AtlasVerification
AtlasVerification handles the verification of DAppConfigs, UserOperations, SolverOperations, and
DAppOperations within a metacall to ensure that calldata sourced from various parties is safe and valid.
constructor
constructor(address atlas) public
validateCalls
function validateCalls(struct DAppConfig dConfig, struct UserOperation userOp, struct SolverOperation[] solverOps, struct DAppOperation dAppOp, uint256 msgValue, address msgSender, bool isSimulation) external returns (enum ValidCallsResult)
The validateCalls function verifies the validity of the metacall calldata components.
Parameters
Name | Type | Description |
---|
dConfig | struct DAppConfig | Configuration data for the DApp involved, containing execution parameters and settings. |
userOp | struct UserOperation | The UserOperation struct of the metacall. |
solverOps | struct SolverOperation[] | An array of SolverOperation structs. |
dAppOp | struct DAppOperation | The DAppOperation struct of the metacall. |
msgValue | uint256 | The ETH value sent with the metacall transaction. |
msgSender | address | The forwarded msg.sender of the original metacall transaction in the Atlas contract. |
isSimulation | bool | A boolean indicating if the call is a simulation. |
Return Values
Name | Type | Description |
---|
[0] | enum ValidCallsResult | The result of the ValidCalls check, in enum ValidCallsResult form. |
verifySolverOp
function verifySolverOp(struct SolverOperation solverOp, bytes32 userOpHash, uint256 userMaxFeePerGas, address bundler, bool allowsTrustedOpHash) external view returns (uint256 result)
The verifySolverOp function verifies the validity of a SolverOperation.
Parameters
Name | Type | Description |
---|
solverOp | struct SolverOperation | The SolverOperation struct to verify. |
userOpHash | bytes32 | The hash of the associated UserOperation struct. |
userMaxFeePerGas | uint256 | The maximum fee per gas the user is willing to pay. |
bundler | address | The address of the bundler. |
allowsTrustedOpHash | bool | |
Return Values
Name | Type | Description |
---|
result | uint256 | The result of the SolverOperation verification, containing SolverOutcome info in a bitmap. |
verifyCallConfig
function verifyCallConfig(uint32 callConfig) external pure returns (enum ValidCallsResult)
External function to call the internal _verifyCallConfig function
Parameters
Name | Type | Description |
---|
callConfig | uint32 | The call configuration struct to verify. |
Return Values
Name | Type | Description |
---|
[0] | enum ValidCallsResult | The result of the ValidCalls check, in enum ValidCallsResult form. |
_verifyCallConfig
function _verifyCallConfig(uint32 callConfig) internal pure returns (enum ValidCallsResult)
The _verifyCallConfig internal function verifies the validity of the call configuration.
Parameters
Name | Type | Description |
---|
callConfig | uint32 | The call configuration to verify. |
Return Values
Name | Type | Description |
---|
[0] | enum ValidCallsResult | The result of the ValidCalls check, in enum ValidCallsResult form. |
_verifyAuctioneer
function _verifyAuctioneer(struct DAppConfig dConfig, struct UserOperation userOp, struct SolverOperation[] solverOps, struct DAppOperation dAppOp, address msgSender) internal pure returns (enum ValidCallsResult validCallsResult, bool allowUnapprovedDAppSignatories)
The _verifyAuctioneer internal function is called by _validCalls to verify that the auctioneer of the
metacall is valid according to the rules set in the DAppConfig.
Parameters
Name | Type | Description |
---|
dConfig | struct DAppConfig | Configuration data for the DApp involved, containing execution parameters and settings. |
userOp | struct UserOperation | The UserOperation struct of the metacall. |
solverOps | struct SolverOperation[] | An array of SolverOperation structs. |
dAppOp | struct DAppOperation | The DAppOperation struct of the metacall. |
msgSender | address | The bundler (msg.sender) of the metacall transaction in the Atlas contract. |
Return Values
Name | Type | Description |
---|
validCallsResult | enum ValidCallsResult | The result of the ValidCalls check, in enum ValidCallsResult form. |
allowUnapprovedDAppSignatories | bool | A boolean indicating if the signatory approval check should be bypassed. |
getSolverPayload
function getSolverPayload(struct SolverOperation solverOp) external view returns (bytes32 payload)
The getSolverPayload function returns the hash of a SolverOperation struct for use in signatures.
Parameters
Name | Type | Description |
---|
solverOp | struct SolverOperation | The SolverOperation struct to hash. |
_verifySolverSignature
function _verifySolverSignature(struct SolverOperation solverOp) internal view returns (bool)
The internal _verifySolverSignature function verifies the signature of a SolverOperation.
Parameters
Name | Type | Description |
---|
solverOp | struct SolverOperation | The SolverOperation struct to verify. |
Return Values
Name | Type | Description |
---|
[0] | bool | A boolean indicating if the signature is valid. |
_getSolverOpHash
function _getSolverOpHash(struct SolverOperation solverOp) internal pure returns (bytes32 solverOpHash)
The _getSolverOpHash internal function returns the hash of a SolverOperation struct.
Parameters
Name | Type | Description |
---|
solverOp | struct SolverOperation | The SolverOperation struct to hash. |
Return Values
Name | Type | Description |
---|
solverOpHash | bytes32 | The hash of the SolverOperation struct. |
_verifyDApp
function _verifyDApp(struct DAppConfig dConfig, struct DAppOperation dAppOp, address msgSender, bool allowUnapprovedDAppSignatories, bool isSimulation) internal returns (enum ValidCallsResult)
Verifies that the dapp's data matches the data submitted by the user and solvers. NOTE: The dapp's front
end is the last party in the supply chain to submit data. If any other party (user, solver, FastLane, or a
collusion between all of them) attempts to alter it, this check will fail.
Parameters
Name | Type | Description |
---|
dConfig | struct DAppConfig | The DAppConfig containing configuration details. |
dAppOp | struct DAppOperation | The DAppOperation struct of the metacall. |
msgSender | address | The forwarded msg.sender of the original metacall transaction in the Atlas contract. |
allowUnapprovedDAppSignatories | bool | Boolean indicating whether to bypass signatory approval. |
isSimulation | bool | Boolean indicating whether the execution is a simulation. |
Return Values
Name | Type | Description |
---|
[0] | enum ValidCallsResult | The result of the ValidCalls check, in enum ValidCallsResult form. |
_getDAppOpHash
function _getDAppOpHash(struct DAppOperation dAppOp) internal pure returns (bytes32 dappOpHash)
Generates the hash of a DAppOperation struct.
Parameters
Name | Type | Description |
---|
dAppOp | struct DAppOperation | The DAppOperation struct to hash. |
Return Values
Name | Type | Description |
---|
dappOpHash | bytes32 | The hash of the DAppOperation struct. |
_verifyDAppSignature
function _verifyDAppSignature(struct DAppOperation dAppOp) internal view returns (bool)
Verifies the signature of a DAppOperation struct.
Parameters
Name | Type | Description |
---|
dAppOp | struct DAppOperation | The DAppOperation struct to verify. |
Return Values
Name | Type | Description |
---|
[0] | bool | A boolean indicating if the signature is valid. |
getDAppOperationPayload
function getDAppOperationPayload(struct DAppOperation dAppOp) public view returns (bytes32 payload)
Generates the hash of a DAppOperation struct.
Parameters
Name | Type | Description |
---|
dAppOp | struct DAppOperation | The DAppOperation struct to hash. |
Return Values
Name | Type | Description |
---|
payload | bytes32 | The hash of the DAppOperation struct. |
getDomainSeparator
function getDomainSeparator() external view returns (bytes32 domainSeparator)
Returns the domain separator for the EIP712 signature scheme.
Return Values
Name | Type | Description |
---|
domainSeparator | bytes32 | The domain separator for the EIP712 signature scheme. |
_verifyUser
function _verifyUser(struct DAppConfig dConfig, struct UserOperation userOp, bytes32 userOpHash, address msgSender, bool isSimulation) internal returns (enum ValidCallsResult)
Verifies the validity of a UserOperation struct.
Parameters
Name | Type | Description |
---|
dConfig | struct DAppConfig | Configuration data for the DApp involved, containing execution parameters and settings. |
userOp | struct UserOperation | The UserOperation struct to verify. |
userOpHash | bytes32 | |
msgSender | address | The forwarded msg.sender of the original metacall transaction in the Atlas contract. |
isSimulation | bool | A boolean indicating if the call is a simulation. |
Return Values
Name | Type | Description |
---|
[0] | enum ValidCallsResult | The result of the UserOperation verification, in enum ValidCallsResult form. |
getUserOperationPayload
function getUserOperationPayload(struct UserOperation userOp) public view returns (bytes32 payload)
Generates the payload hash of a UserOperation struct used in signatures.
Parameters
Name | Type | Description |
---|
userOp | struct UserOperation | The UserOperation struct to generate the payload for. |
Return Values
Name | Type | Description |
---|
payload | bytes32 | The hash of the UserOperation struct for use in signatures. |
getUserOperationHash
function getUserOperationHash(struct UserOperation userOp) public view returns (bytes32 userOpHash)
Generates the hash of a UserOperation struct used for inter-operation references.
Parameters
Name | Type | Description |
---|
userOp | struct UserOperation | The UserOperation struct to generate the hash for. |
Return Values
Name | Type | Description |
---|
userOpHash | bytes32 | The hash of the UserOperation struct for in inter-operation references. |
_getUserOperationHash
function _getUserOperationHash(struct UserOperation userOp, bool trusted) internal view returns (bytes32 userOpHash)