ISimulator
The ISimulator interface defines functions for simulating user and solver operations within the Atlas Protocol. It ensures that operations can be tested and validated before actual execution on-chain.
Enums
Result
enum Result {
Unknown,
VerificationSimFail,
PreOpsSimFail,
UserOpSimFail,
SolverSimFail,
AllocateValueSimFail,
PostOpsSimFail,
SimulationPassed
}
Represents the possible outcomes of a simulation.
Functions
simUserOperation
function simUserOperation(UserOperation calldata userOp) external payable returns (bool success, Result simResult, uint256);
Simulates a user operation to determine its success and outcome.
Parameters
Name | Type | Description |
---|---|---|
userOp | UserOperation calldata | The user operation to simulate. |
payable | - | Ether sent with the simulation (if any). |
Return Values
Name | Type | Description |
---|---|---|
success | bool | Indicates if the simulation succeeded. |
simResult | Result | The result of the simulation. |
uint256 | uint256 | Additional data related to the simulation. |
simSolverCall
function simSolverCall(
UserOperation calldata userOp,
SolverOperation calldata solverOp,
DAppOperation calldata verification
) external payable returns (bool success, Result simResult, uint256);
Simulates a single solver operation within the context of a user operation.
Parameters
Name | Type | Description |
---|---|---|
userOp | UserOperation calldata | The user operation context. |
solverOp | SolverOperation calldata | The solver operation to simulate. |
verification | DAppOperation calldata | The verification operation context. |
payable | - | Ether sent with the simulation (if any). |
Return Values
Name | Type | Description |
---|---|---|
success | bool | Indicates if the simulation succeeded. |
simResult | Result | The result of the simulation. |
uint256 | uint256 | Additional data related to the simulation. |
simSolverCalls
function simSolverCalls(
UserOperation calldata userOp,
SolverOperation[] calldata solverOps,
DAppOperation calldata verification
) external payable returns (bool success, Result simResult, uint256);
Simulates multiple solver operations within the context of a user operation.
Parameters
Name | Type | Description |
---|---|---|
userOp | UserOperation calldata | The user operation context. |
solverOps | SolverOperation[] calldata | The array of solver operations to simulate. |
verification | DAppOperation calldata | The verification operation context. |
payable | - | Ether sent with the simulation (if any). |
Return Values
Name | Type | Description |
---|---|---|
success | bool | Indicates if the simulation succeeded. |
simResult | Result | The result of the simulation. |
uint256 | uint256 | Additional data related to the simulation. |