Skip to main content

IExecutionEnvironment

The IExecutionEnvironment interface defines the functions for managing and interacting with the Execution Environment (EE). The EE is a secure smart account that facilitates trustless interactions between users, solvers, and DApps.

Functions

preOpsWrapper

function preOpsWrapper(UserOperation calldata userOp) external returns (bytes memory preOpsData);

Executes custom logic before processing the user operation.

Parameters

NameTypeDescription
userOpUserOperation calldataThe user operation.

Return Value

TypeDescription
bytes memoryThe data returned from the pre-operations call.

userWrapper

function userWrapper(UserOperation calldata userOp) external payable returns (bytes memory userReturnData);

Executes the user operation within the Execution Environment.

Parameters

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

Return Value

TypeDescription
bytes memoryThe data returned from the user operation.

postOpsWrapper

function postOpsWrapper(bool solved, bytes calldata returnData) external;

Executes custom logic after processing all operations.

Parameters

NameTypeDescription
solvedboolIndicates if the operation was solved.
returnDatabytesData returned from the operations.

solverPreTryCatch

function solverPreTryCatch(
uint256 bidAmount,
SolverOperation calldata solverOp,
bytes calldata returnData
) external returns (SolverTracker memory solverTracker);

Executes pre-processing logic for a solver operation with error handling.

Parameters

NameTypeDescription
bidAmountuint256The amount bid by the solver.
solverOpSolverOperation calldataThe solver operation.
returnDatabytesData returned from the previous call.

Return Value

TypeDescription
SolverTracker memoryThe tracker data for the solver operation.

solverPostTryCatch

function solverPostTryCatch(
SolverOperation calldata solverOp,
bytes calldata returnData,
SolverTracker memory solverTracker
) external returns (SolverTracker memory);

Executes post-processing logic for a solver operation with error handling.

Parameters

NameTypeDescription
solverOpSolverOperation calldataThe solver operation.
returnDatabytesData returned from the solver operation.
solverTrackerSolverTracker memoryThe tracker data from pre-processing.

Return Value

TypeDescription
SolverTracker memoryThe updated tracker data for the solver operation.

allocateValue

function allocateValue(
address bidToken,
uint256 bidAmount,
bytes memory returnData
) external returns (bool allocateValueSucceeded);

Allocates value generated from solver operations to specified recipients.

Parameters

NameTypeDescription
bidTokenaddressThe token used for bidding.
bidAmountuint256The amount of tokens bid.
returnDatabytesAdditional data for value allocation.

Return Value

TypeDescription
boolIndicates if the value allocation succeeded (true) or not (false).

getUser

function getUser() external pure returns (address user);

Returns the address of the user associated with the Execution Environment.

Return Value

TypeDescription
addressThe address of the user.

getControl

function getControl() external pure returns (address control);

Returns the address of the DAppControl contract associated with the Execution Environment.

Return Value

TypeDescription
addressThe address of the DAppControl contract.

getConfig

function getConfig() external pure returns (uint32 config);

Returns the configuration settings for the Execution Environment.

Return Value

TypeDescription
uint32The configuration settings.

getEscrow

function getEscrow() external view returns (address escrow);

Returns the address of the escrow contract associated with the Execution Environment.

Return Value

TypeDescription
addressThe address of the escrow contract.

withdrawERC20

function withdrawERC20(address token, uint256 amount) external;

Allows withdrawal of ERC20 tokens from the Execution Environment.

Parameters

NameTypeDescription
tokenaddressThe ERC20 token contract address.
amountuint256The amount of tokens to withdraw.

withdrawEther

function withdrawEther(uint256 amount) external;

Allows withdrawal of Ether from the Execution Environment.

Parameters

NameTypeDescription
amountuint256The amount of Ether to withdraw.