Solidity API
DAppControl
DAppControl is the base contract which should be inherited by any Atlas dApps. Storage variables (except immutable) will be defaulted if accessed by delegatecalls. If an extension DAppControl uses storage variables, those should not be accessed by delegatecalls.
CALL_CONFIG
uint32 CALL_CONFIG
CONTROL
address CONTROL
ATLAS_VERIFICATION
address ATLAS_VERIFICATION
governance
address governance
pendingGovernance
address pendingGovernance
constructor
constructor(address atlas, address initialGovernance, struct CallConfig callConfig) internal
validControl
modifier validControl()
onlyPhase
modifier onlyPhase(enum ExecutionPhase phase)
mustBeCalled
modifier mustBeCalled()
preOpsCall
function preOpsCall(struct UserOperation userOp) external payable returns (bytes)
The preOpsCall hook which may be called before the UserOperation is executed.
Parameters
Name | Type | Description |
---|---|---|
userOp | struct UserOperation | The UserOperation struct. |
Return Values
Name | Type | Description |
---|---|---|
[0] | bytes | data Data to be passed to the next call phase. |
preSolverCall
function preSolverCall(struct SolverOperation solverOp, bytes returnData) external payable
The preSolverCall hook which may be called before the SolverOperation is executed.
Should revert if any DApp-specific checks fail to indicate non-fulfillment.
Parameters
Name | Type | Description |
---|---|---|
solverOp | struct SolverOperation | The SolverOperation to be executed after this hook has been called. |
returnData | bytes | Data returned from the previous call phase. |
postSolverCall
function postSolverCall(struct SolverOperation solverOp, bytes returnData) external payable
The postSolverCall hook which may be called after the SolverOperation has been executed.
Should revert if any DApp-specific checks fail to indicate non-fulfillment.
Parameters
Name | Type | Description |
---|---|---|
solverOp | struct SolverOperation | The SolverOperation struct that was executed just before this hook was called. |
returnData | bytes | Data returned from the previous call phase. |
allocateValueCall
function allocateValueCall(bool solved, address bidToken, uint256 bidAmount, bytes data) external
The allocateValueCall hook which is called after a successful SolverOperation.
Parameters
Name | Type | Description |
---|---|---|
solved | bool | |
bidToken | address | The address of the token used for the winning SolverOperation's bid. |
bidAmount | uint256 | The winning bid amount. |
data | bytes | Data returned from the previous call phase. |
userDelegated
function userDelegated() external view returns (bool delegated)
requireSequentialUserNonces
function requireSequentialUserNonces() external view returns (bool isSequential)
requireSequentialDAppNonces
function requireSequentialDAppNonces() external view returns (bool isSequential)
getDAppConfig
function getDAppConfig(struct UserOperation userOp) external view returns (struct DAppConfig dConfig)
Returns the DAppConfig struct of this DAppControl contract.
Parameters
Name | Type | Description |
---|---|---|
userOp | struct UserOperation | The UserOperation struct. |
Return Values
Name | Type | Description |
---|---|---|
dConfig | struct DAppConfig | The DAppConfig struct of this DAppControl contract. |
getCallConfig
function getCallConfig() external view returns (struct CallConfig)
Returns the CallConfig struct of this DAppControl contract.
Return Values
Name | Type | Description |
---|---|---|
[0] | struct CallConfig | The CallConfig struct of this DAppControl contract. |
_getCallConfig
function _getCallConfig() internal view returns (struct CallConfig)
getDAppSignatory
function getDAppSignatory() external view returns (address)
Returns the current governance address of this DAppControl contract.
Return Values
Name | Type | Description |
---|---|---|
[0] | address | The address of the current governance account of this DAppControl contract. |
_validateCallConfig
function _validateCallConfig(uint32 callConfig) internal view
transferGovernance
function transferGovernance(address newGovernance) external
Starts the transfer of governance to a new address. Only callable by the current governance address.
Parameters
Name | Type | Description |
---|---|---|
newGovernance | address | The address of the new governance. |
acceptGovernance
function acceptGovernance() external
Accepts the transfer of governance to a new address. Only callable by the new governance address.