Skip to main content

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

NameTypeDescription
userOpUserOperation calldataThe user operation to simulate.
payable-Ether sent with the simulation (if any).

Return Values

NameTypeDescription
successboolIndicates if the simulation succeeded.
simResultResultThe result of the simulation.
uint256uint256Additional 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

NameTypeDescription
userOpUserOperation calldataThe user operation context.
solverOpSolverOperation calldataThe solver operation to simulate.
verificationDAppOperation calldataThe verification operation context.
payable-Ether sent with the simulation (if any).

Return Values

NameTypeDescription
successboolIndicates if the simulation succeeded.
simResultResultThe result of the simulation.
uint256uint256Additional 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

NameTypeDescription
userOpUserOperation calldataThe user operation context.
solverOpsSolverOperation[] calldataThe array of solver operations to simulate.
verificationDAppOperation calldataThe verification operation context.
payable-Ether sent with the simulation (if any).

Return Values

NameTypeDescription
successboolIndicates if the simulation succeeded.
simResultResultThe result of the simulation.
uint256uint256Additional data related to the simulation.