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
Name | Type | Description |
---|
userOp | UserOperation calldata | The user operation. |
Return Value
Type | Description |
---|
bytes memory | The 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
Name | Type | Description |
---|
userOp | UserOperation calldata | The user operation. |
payable | - | Ether sent with the call (if any). |
Return Value
Type | Description |
---|
bytes memory | The data returned from the user operation. |
postOpsWrapper
function postOpsWrapper(bool solved, bytes calldata returnData) external;
Executes custom logic after processing all operations.
Parameters
Name | Type | Description |
---|
solved | bool | Indicates if the operation was solved. |
returnData | bytes | Data 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
Name | Type | Description |
---|
bidAmount | uint256 | The amount bid by the solver. |
solverOp | SolverOperation calldata | The solver operation. |
returnData | bytes | Data returned from the previous call. |
Return Value
Type | Description |
---|
SolverTracker memory | The 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
Name | Type | Description |
---|
solverOp | SolverOperation calldata | The solver operation. |
returnData | bytes | Data returned from the solver operation. |
solverTracker | SolverTracker memory | The tracker data from pre-processing. |
Return Value
Type | Description |
---|
SolverTracker memory | The 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
Name | Type | Description |
---|
bidToken | address | The token used for bidding. |
bidAmount | uint256 | The amount of tokens bid. |
returnData | bytes | Additional data for value allocation. |
Return Value
Type | Description |
---|
bool | Indicates 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
Type | Description |
---|
address | The 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
Type | Description |
---|
address | The address of the DAppControl contract. |
getConfig
function getConfig() external pure returns (uint32 config);
Returns the configuration settings for the Execution Environment.
Return Value
Type | Description |
---|
uint32 | The configuration settings. |
getEscrow
function getEscrow() external view returns (address escrow);
Returns the address of the escrow contract associated with the Execution Environment.
Return Value
Type | Description |
---|
address | The address of the escrow contract. |
withdrawERC20
function withdrawERC20(address token, uint256 amount) external;
Allows withdrawal of ERC20 tokens from the Execution Environment.
Parameters
Name | Type | Description |
---|
token | address | The ERC20 token contract address. |
amount | uint256 | The amount of tokens to withdraw. |
withdrawEther
function withdrawEther(uint256 amount) external;
Allows withdrawal of Ether from the Execution Environment.
Parameters
Name | Type | Description |
---|
amount | uint256 | The amount of Ether to withdraw. |