Skip to main content

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 tokens

AddressCannotBeZero

Revert if the address is zero

InvalidSignature

Revert if the signature is invalid

CallRequestExpired

Revert if the call request is expired

CallRequestAlreadyUsed

Revert if the call request has already been used

CallFailed

Revert if a call fails

Parameters

RelayNativeDeposit

Emit event when a native deposit is made

Parameters

RelayErc20Deposit

Emit event when an erc20 deposit is made

Parameters

RelayCallExecuted

Emit event when a call is executed

Parameters

_CALL_TYPEHASH

The EIP-712 typehash for the Call struct Used in structured data hashing for signature verification

_CALL_REQUEST_TYPEHASH

The EIP-712 typehash for the CallRequest struct Used in structured data hashing for signature verification

callRequests

Set of executed call requests Maps the hash of a call request to whether it has been executed

allocator

The allocator address Must be set to a secure and trusted entity

constructor

Initializes the contract with an owner and allocator

Parameters

setAllocator

Set the allocator address Only callable by the contract owner

Parameters

depositNative

Deposit native tokens and emit a RelayNativeDeposit event Emits a RelayNativeDeposit event with the deposit details

Parameters

depositErc20

Deposit erc20 tokens and emit an RelayErc20Deposit event Transfers tokens from msg.sender to this contract and emits a RelayErc20Deposit event

Parameters

depositErc20

Deposit erc20 tokens and emit an RelayErc20Deposit event Uses the full allowance granted to this contract and calls depositErc20

Parameters

execute

Execute a CallRequest signed by the allocator Verifies the signature, expiration, and uniqueness before execution

Parameters

Return Values

_executeCalls

Internal function to execute a list of calls Handles multiple calls and properly manages failures based on allowFailure flag

Parameters

Return Values

_hashCallRequest

Helper function to hash a CallRequest and return the EIP-712 digest Implements EIP-712 structured data hashing for the complex CallRequest type

Parameters

Return Values

_domainNameAndVersion

Returns the domain name and version of the contract to be used in the domain separator Implements required function from EIP712 base contract

Return Values

Call

A structure representing a single call to be executed

Parameters

CallRequest

A request containing multiple calls to be executed after signature verification

Parameters

CallResult

The result of an executed call

Parameters