Solidity API
Atlas
The Execution Abstraction protocol.
constructor
constructor(uint256 escrowDuration, uint256 atlasSurchargeRate, uint256 bundlerSurchargeRate, address verification, address simulator, address initialSurchargeRecipient, address l2GasCalculator, address factoryLib) public
metacall
function metacall(struct UserOperation userOp, struct SolverOperation[] solverOps, struct DAppOperation dAppOp, address gasRefundBeneficiary) external payable returns (bool auctionWon)
metacall is the entrypoint function for the Atlas transactions.
Any ETH sent as msg.value with a metacall should be considered a potential subsidy for the winning solver's gas repayment.
Parameters
Name | Type | Description |
---|---|---|
userOp | struct UserOperation | The UserOperation struct containing the user's transaction data. |
solverOps | struct SolverOperation[] | The SolverOperation array containing the solvers' transaction data. |
dAppOp | struct DAppOperation | The DAppOperation struct containing the DApp's transaction data. |
gasRefundBeneficiary | address | The address to receive the gas refund. |
Return Values
Name | Type | Description |
---|---|---|
auctionWon | bool | A boolean indicating whether there was a successful, winning solver. |
execute
function execute(struct DAppConfig dConfig, struct UserOperation userOp, struct SolverOperation[] solverOps, address executionEnvironment, address bundler, bytes32 userOpHash, bool isSimulation) external payable returns (struct Context ctx)
execute is called above, in a try-catch block in metacall.
Parameters
Name | Type | Description |
---|---|---|
dConfig | struct DAppConfig | Configuration data for the DApp involved, containing execution parameters and settings. |
userOp | struct UserOperation | UserOperation struct of the current metacall tx. |
solverOps | struct SolverOperation[] | SolverOperation array of the current metacall tx. |
executionEnvironment | address | Address of the execution environment contract of the current metacall tx. |
bundler | address | Address of the bundler of the current metacall tx. |
userOpHash | bytes32 | Hash of the userOp struct of the current metacall tx. |
isSimulation | bool |
Return Values
Name | Type | Description |
---|---|---|
ctx | struct Context | Context struct containing relevant context information for the Atlas auction. |
_bidFindingIteration
function _bidFindingIteration(struct Context ctx, struct DAppConfig dConfig, struct UserOperation userOp, struct SolverOperation[] solverOps, bytes returnData) internal returns (uint256)
Called above in execute
if the DAppConfig requires ex post bids. Sorts solverOps by bid amount and
executes them in descending order until a successful winner is found.
Parameters
Name | Type | Description |
---|---|---|
ctx | struct Context | Context struct containing the current state of the escrow lock. |
dConfig | struct DAppConfig | Configuration data for the DApp involved, containing execution parameters and settings. |
userOp | struct UserOperation | UserOperation struct of the current metacall tx. |
solverOps | struct SolverOperation[] | SolverOperation array of the current metacall tx. |
returnData | bytes | Return data from the preOps and userOp calls. |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The winning bid amount or 0 when no solverOps. |
_bidKnownIteration
function _bidKnownIteration(struct Context ctx, struct DAppConfig dConfig, struct UserOperation userOp, struct SolverOperation[] solverOps, bytes returnData) internal returns (uint256)
Called above in execute
as an alternative to _bidFindingIteration
, if solverOps have already been
reliably sorted. Executes solverOps in order until a successful winner is found.
Parameters
Name | Type | Description |
---|---|---|
ctx | struct Context | Context struct containing the current state of the escrow lock. |
dConfig | struct DAppConfig | Configuration data for the DApp involved, containing execution parameters and settings. |
userOp | struct UserOperation | UserOperation struct of the current metacall tx. |
solverOps | struct SolverOperation[] | SolverOperation array of the current metacall tx. |
returnData | bytes | Return data from the preOps and userOp calls. |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The winning bid amount or 0 when no solverOps. |
_handleErrors
function _handleErrors(bytes revertData, uint32 callConfig) internal view
Called at the end of metacall
to bubble up specific error info in a revert.
Parameters
Name | Type | Description |
---|---|---|
revertData | bytes | Revert data from a failure during the execution of the metacall. |
callConfig | uint32 | The CallConfig of the current metacall tx. |
_verifyUserControlExecutionEnv
function _verifyUserControlExecutionEnv(address environment, address user, address control, uint32 callConfig) internal returns (bool)
Returns whether or not the execution environment address matches what's expected from the set of inputs.
Parameters
Name | Type | Description |
---|---|---|
environment | address | ExecutionEnvironment address |
user | address | User address |
control | address | DAppControl contract address |
callConfig | uint32 | CallConfig of the current metacall tx. |
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | A bool indicating whether the execution environment address is the same address that the factory would deploy an Execution Environment to, given the user, control, and callConfig params. |