Skip to main content

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​

NameTypeDescription
userOpstruct UserOperationThe UserOperation struct.

Return Values​

NameTypeDescription
[0]bytesdata 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​

NameTypeDescription
solverOpstruct SolverOperationThe SolverOperation to be executed after this hook has been called.
returnDatabytesData 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​

NameTypeDescription
solverOpstruct SolverOperationThe SolverOperation struct that was executed just before this hook was called.
returnDatabytesData 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​

NameTypeDescription
solvedbool
bidTokenaddressThe address of the token used for the winning SolverOperation's bid.
bidAmountuint256The winning bid amount.
databytesData 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​

NameTypeDescription
userOpstruct UserOperationThe UserOperation struct.

Return Values​

NameTypeDescription
dConfigstruct DAppConfigThe DAppConfig struct of this DAppControl contract.

getCallConfig​

function getCallConfig() external view returns (struct CallConfig)

Returns the CallConfig struct of this DAppControl contract.

Return Values​

NameTypeDescription
[0]struct CallConfigThe 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​

NameTypeDescription
[0]addressThe 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​

NameTypeDescription
newGovernanceaddressThe 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.