Solidity API
EVM Relay Depository
Provides secure deposit functionality and execution of allocator-signed requests for EVM chains EVM implementation using EIP-712 for structured data signing, supporting native ETH and ERC20 tokensAddressCannotBeZero
InvalidSignature
CallRequestExpired
CallRequestAlreadyUsed
CallFailed
Parameters
Name | Type | Description |
---|---|---|
returnData | bytes | The data returned from the failed call |
RelayNativeDeposit
Parameters
Name | Type | Description |
---|---|---|
from | address | The address that made the deposit |
amount | uint256 | The amount of native currency deposited |
id | bytes32 | The unique identifier associated with the deposit |
RelayErc20Deposit
Parameters
Name | Type | Description |
---|---|---|
from | address | The address that made the deposit |
token | address | The address of the ERC20 token |
amount | uint256 | The amount of tokens deposited |
id | bytes32 | The unique identifier associated with the deposit |
RelayCallExecuted
Parameters
Name | Type | Description |
---|---|---|
id | bytes32 | The identifier of the call request |
call | struct Call | The call details that were executed |
_CALL_TYPEHASH
_CALL_REQUEST_TYPEHASH
callRequests
allocator
constructor
Parameters
Name | Type | Description |
---|---|---|
_owner | address | The address that will own the contract |
_allocator | address | The address authorized to sign withdrawal requests |
setAllocator
Parameters
Name | Type | Description |
---|---|---|
_allocator | address | The new allocator address |
depositNative
RelayNativeDeposit
event
Emits a RelayNativeDeposit event with the deposit details
Parameters
Name | Type | Description |
---|---|---|
depositor | address | The address of the depositor - set to address(0) to credit msg.sender |
id | bytes32 | The identifier associated with the deposit |
depositErc20
RelayErc20Deposit
event
Transfers tokens from msg.sender to this contract and emits a RelayErc20Deposit event
Parameters
Name | Type | Description |
---|---|---|
depositor | address | The address of the depositor - set to address(0) to credit msg.sender |
token | address | The erc20 token to deposit |
amount | uint256 | The amount to deposit |
id | bytes32 | The identifier associated with the deposit |
depositErc20
RelayErc20Deposit
event
Uses the full allowance granted to this contract and calls depositErc20
Parameters
Name | Type | Description |
---|---|---|
depositor | address | The address of the depositor - set to address(0) to credit msg.sender |
token | address | The erc20 token to deposit |
id | bytes32 | The identifier associated with the deposit |
execute
CallRequest
signed by the allocator
Verifies the signature, expiration, and uniqueness before execution
Parameters
Name | Type | Description |
---|---|---|
request | struct CallRequest | The CallRequest to execute |
signature | bytes | The signature from the allocator |
Return Values
Name | Type | Description |
---|---|---|
results | struct CallResult[] | The results of the calls |
_executeCalls
Parameters
Name | Type | Description |
---|---|---|
id | bytes32 | The identifier of the call request |
calls | struct Call[] | The array of calls to execute |
Return Values
Name | Type | Description |
---|---|---|
returnData | struct CallResult[] | The results of each executed call |
_hashCallRequest
CallRequest
and return the EIP-712 digest
Implements EIP-712 structured data hashing for the complex CallRequest type
Parameters
Name | Type | Description |
---|---|---|
request | struct CallRequest | The CallRequest to hash |
Return Values
Name | Type | Description |
---|---|---|
structHash | bytes32 | The struct hash |
eip712Hash | bytes32 | The EIP712 hash |
_domainNameAndVersion
Return Values
Name | Type | Description |
---|---|---|
name | string | The domain name |
version | string | The version |
Call
A structure representing a single call to be executedParameters
Name | Type | Description |
---|
CallRequest
A request containing multiple calls to be executed after signature verificationParameters
Name | Type | Description |
---|
CallResult
The result of an executed callParameters
Name | Type | Description |
---|