Relay
SupportGet in TouchTry Relay
Relay PlatformAPI ReferenceRelayKitRelay ProtocolChangelog

Getting Started

What is Relay?How Relay Works

Solutions

Payment Service ProvidersWallets & Wallet ProvidersMultichain AppsChainsCommerce & Payments

Use Cases

Bridging & OnboardingSwapsCall Execution

Features

App FeesFee SponsorshipDeposit AddressesGas Top-UpGasless ExecutionFast FillGasless SwapsPrice StabilizationRouting Integration Models

Security

Transaction ScreeningUnsupported ExchangesBug Bounty ProgramMEV protectionCommunity SupportContract Audits

Resources

Supported ChainsIntegrating using AISupportBrand Assets

API Reference

API OverviewQuickstartApps, API keys, and Rate LimitsAccess TokensUnderstanding Step ExecutionWallet DetectionCost & Fee StructureRefundsInput ValidationTrade TypesSurplus & ShortageHandling Quote ErrorsHandling Rate LimitsHandling Execution ErrorsContract CompatibilityBridging Integration GuideCall Execution Integration GuideTransaction IndexingBase Builder CodesSmart Accounts in RelayTestnet SupportSolana SupportBitcoin SupportHyperliquid SupportLighter SupportDeep LinkingWebsocketsWebhooksMigrating to Requests v3Migrating to Currencies v2Migrating to Token Price v2Supported ChainsContract AddressesSupported Tokens & RoutesTroubleshootingGet QuoteSubmit PermitGet StatusGet RequestsGet Published RequestsGet ChainsGet Chains LiquidityGet CurrenciesGet Currency ClassificationsGet Token PriceTransactions IndexTransactions SingleDeposit Address ReindexGet App Fee BalancesGet Balance EventsClaim App FeesGet UsageFast FillGet Swap SourcesCreate Access TokenExecute Gasless TxsAttest DepositGet Recovery BalancesRequest WithdrawalGet Withdrawal StatusGet Requests (v2)Get PriceGet ConfigGet Execution StatusGet Currencies (v1)Get Token Price (v1)Get Quote

RelayKit

OverviewInstallationcreateClientgetQuoteexecutegetAppFeesclaimAppFeesfastFillexecuteGaslessBatchAdaptersTypescript API TypingsChain UtilsInstallationuseQuoteuseRelayChainsuseRequestsuseTokenListuseTokenPriceuseExecutionStatusInstallationRelayKitProviderSwapWidgetThemingTroubleshooting

Protocol

Relay ProtocolHow It WorksThe Relay ChainDepositoryDeposit AddressesOracleHubAllocatorSecurity CouncilSecurity & AuditsFor AppsProgrammatic WithdrawalsWithdrawing with a SafeOperate a Third-Party Relay OracleAddressesEVM Depository ReferenceSVM Depository ReferenceOverviewArchitectureSecurityRelay Vaults BackendBridgingInteracting with Relay VaultsWithdrawing from Relay VaultsRelayPoolFactoryRelayPoolRelayPoolNativeGatewayRelayBridgeFactoryRelayBridge

Changelog

Changelog
## Documentation Index Fetch the complete documentation index at: https://docs.relay.link/llms.txt Use this file to discover all available pages before exploring further.
## Agent Instructions To quote bridges and swaps, look up chains and tokens, or track Relay transactions from an agent, use the Relay MCP server: npx -y @relayprotocol/relay-mcp. It is read-only and does not sign or broadcast transactions. Setup: https://docs.relay.link/resources/developing-with-ai.md For Relay Protocol's trust model, security architecture, and audits, see https://docs.relay.link/references/protocol/security.md. For address screening, see https://docs.relay.link/security/transaction-screening.md.

EVM Depository Reference

Solidity API reference for the EVM Relay Depository contract

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

error AddressCannotBeZero()

Revert if the address is zero

InvalidSignature

error InvalidSignature()

Revert if the signature is invalid

CallRequestExpired

error CallRequestExpired()

Revert if the call request is expired

CallRequestAlreadyUsed

error CallRequestAlreadyUsed()

Revert if the call request has already been used

CallFailed

error CallFailed(bytes returnData)

Revert if a call fails

Parameters

NameTypeDescription
returnDatabytesThe data returned from the failed call

RelayNativeDeposit

event RelayNativeDeposit(address from, uint256 amount, bytes32 id)

Emit event when a native deposit is made

Parameters

NameTypeDescription
fromaddressThe address that made the deposit
amountuint256The amount of native currency deposited
idbytes32The unique identifier associated with the deposit

RelayErc20Deposit

event RelayErc20Deposit(address from, address token, uint256 amount, bytes32 id)

Emit event when an erc20 deposit is made

Parameters

NameTypeDescription
fromaddressThe address that made the deposit
tokenaddressThe address of the ERC20 token
amountuint256The amount of tokens deposited
idbytes32The unique identifier associated with the deposit

RelayCallExecuted

event RelayCallExecuted(bytes32 id, struct Call call)

Emit event when a call is executed

Parameters

NameTypeDescription
idbytes32The identifier of the call request
callstruct CallThe call details that were executed

\_CALL\_TYPEHASH

bytes32 _CALL_TYPEHASH

The EIP-712 typehash for the Call struct

*Used in structured data hashing for signature verification*

\_CALL\_REQUEST\_TYPEHASH

bytes32 _CALL_REQUEST_TYPEHASH

The EIP-712 typehash for the CallRequest struct

*Used in structured data hashing for signature verification*

callRequests

mapping(bytes32 => bool) callRequests

Set of executed call requests

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

allocator

address allocator

The allocator address

*Must be set to a secure and trusted entity*

constructor

constructor(address _owner, address _allocator) public

Initializes the contract with an owner and allocator

Parameters

NameTypeDescription
\_owneraddressThe address that will own the contract
\_allocatoraddressThe address authorized to sign withdrawal requests

setAllocator

function setAllocator(address _allocator) external

Set the allocator address

*Only callable by the contract owner*

Parameters

NameTypeDescription
\_allocatoraddressThe new allocator address

depositNative

function depositNative(address depositor, bytes32 id) external payable

Deposit native tokens and emit a RelayNativeDeposit event

*Emits a RelayNativeDeposit event with the deposit details*

Parameters

NameTypeDescription
depositoraddressThe address of the depositor - set to address(0) to credit msg.sender
idbytes32The identifier associated with the deposit

depositErc20

function depositErc20(address depositor, address token, uint256 amount, bytes32 id) public

Deposit erc20 tokens and emit an RelayErc20Deposit event

*Transfers tokens from msg.sender to this contract and emits a RelayErc20Deposit event*

Parameters

NameTypeDescription
depositoraddressThe address of the depositor - set to address(0) to credit msg.sender
tokenaddressThe erc20 token to deposit
amountuint256The amount to deposit
idbytes32The identifier associated with the deposit

depositErc20

function depositErc20(address depositor, address token, bytes32 id) external

Deposit erc20 tokens and emit an RelayErc20Deposit event

*Uses the full allowance granted to this contract and calls depositErc20*

Parameters

NameTypeDescription
depositoraddressThe address of the depositor - set to address(0) to credit msg.sender
tokenaddressThe erc20 token to deposit
idbytes32The identifier associated with the deposit

execute

function execute(struct CallRequest request, bytes signature) external returns (struct CallResult[] results)

Execute a CallRequest signed by the allocator

*Verifies the signature, expiration, and uniqueness before execution*

Parameters

NameTypeDescription
requeststruct CallRequestThe CallRequest to execute
signaturebytesThe signature from the allocator

Return Values

NameTypeDescription
resultsstruct CallResult\[]The results of the calls

\_executeCalls

function _executeCalls(bytes32 id, struct Call[] calls) internal returns (struct CallResult[] returnData)

Internal function to execute a list of calls

*Handles multiple calls and properly manages failures based on allowFailure flag*

Parameters

NameTypeDescription
idbytes32The identifier of the call request
callsstruct Call\[]The array of calls to execute

Return Values

NameTypeDescription
returnDatastruct CallResult\[]The results of each executed call

\_hashCallRequest

function _hashCallRequest(struct CallRequest request) internal view returns (bytes32 structHash, bytes32 eip712Hash)

Helper function to hash a CallRequest and return the EIP-712 digest

*Implements EIP-712 structured data hashing for the complex CallRequest type*

Parameters

NameTypeDescription
requeststruct CallRequestThe CallRequest to hash

Return Values

NameTypeDescription
structHashbytes32The struct hash
eip712Hashbytes32The EIP712 hash

\_domainNameAndVersion

function _domainNameAndVersion() internal pure returns (string name, string version)

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

NameTypeDescription
namestringThe domain name
versionstringThe version

Call

A structure representing a single call to be executed

Parameters

NameTypeDescription
struct Call {
  address to;
  bytes data;
  uint256 value;
  bool allowFailure;
}

CallRequest

A request containing multiple calls to be executed after signature verification

Parameters

NameTypeDescription
struct CallRequest {
  struct Call[] calls;
  uint256 nonce;
  uint256 expiration;
}

CallResult

The result of an executed call

Parameters

NameTypeDescription
struct CallResult {
  bool success;
  bytes returnData;
}

This documentation is built and hosted on Mintlify, a developer documentation platform.

PreviousAddressesNextSVM Depository Reference
Relay© 2026 Uneven Labs, Inc. All rights reserved.XGitHubSupport