Solidity API
RelayPool
ERC4626 vault that enables cross-chain asset bridging and yield generation Receives bridged assets via Hyperlane, provides instant liquidity, and deposits idle funds into yield poolsOriginSettings
Configuration for an authorized origin chain and bridgeParameters
| Name | Type | Description |
|---|
OriginParam
Parameters for adding a new originParameters
| Name | Type | Description |
|---|
UnauthorizedCaller
Parameters
| Name | Type | Description |
|---|---|---|
| sender | address | The address that attempted the unauthorized call |
UnauthorizedSwap
Parameters
| Name | Type | Description |
|---|---|---|
| token | address | The token address that was attempted to be swapped |
UnauthorizedOrigin
Parameters
| Name | Type | Description |
|---|---|---|
| chainId | uint32 | The chain ID of the unauthorized origin |
| bridge | address | The bridge address of the unauthorized origin |
MessageAlreadyProcessed
Parameters
| Name | Type | Description |
|---|---|---|
| chainId | uint32 | The chain ID of the message origin |
| bridge | address | The bridge address of the message origin |
| nonce | uint256 | The nonce of the already processed message |
TooMuchDebtFromOrigin
Parameters
| Name | Type | Description |
|---|---|---|
| chainId | uint32 | The chain ID of the origin |
| bridge | address | The bridge address of the origin |
| maxDebt | uint256 | The maximum allowed debt for this origin |
| nonce | uint256 | The nonce of the rejected transaction |
| recipient | address | The intended recipient of the funds |
| amount | uint256 | The amount that would exceed the debt limit |
FailedTransfer
Parameters
| Name | Type | Description |
|---|---|---|
| recipient | address | The intended recipient of the transfer |
| amount | uint256 | The amount that failed to transfer |
InsufficientFunds
Parameters
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The amount available |
| balance | uint256 | The balance required |
NotAWethPool
MessageTooRecent
Parameters
| Name | Type | Description |
|---|---|---|
| chainId | uint32 | The chain ID of the message origin |
| bridge | address | The bridge address of the message origin |
| nonce | uint256 | The nonce of the message |
| timestamp | uint256 | The timestamp of the message |
| coolDown | uint32 | The required cooldown period |
SharePriceTooLow
Parameters
| Name | Type | Description |
|---|---|---|
| actualPrice | uint256 | The actual share price |
| minPrice | uint256 | The minimum acceptable share price |
SharePriceTooHigh
Parameters
| Name | Type | Description |
|---|---|---|
| actualPrice | uint256 | The actual share price |
| maxPrice | uint256 | The maximum acceptable share price |
HYPERLANE_MAILBOX
WETH
FRACTIONAL_BPS_DENOMINATOR
outstandingDebt
authorizedOrigins
messages
yieldPool
tokenSwapAddress
pendingBridgeFees
totalAssetsToStream
lastAssetsCollectedAt
endOfStream
streamingPeriod
LoanEmitted
Parameters
| Name | Type | Description |
|---|---|---|
| nonce | uint256 | The unique identifier of the transaction |
| recipient | address | The address receiving the funds |
| asset | contract ERC20 | The asset being transferred |
| amount | uint256 | The total amount including fees |
| origin | struct RelayPool.OriginSettings | The origin settings for this bridge |
| fees | uint256 | The fee amount collected |
BridgeCompleted
Parameters
| Name | Type | Description |
|---|---|---|
| chainId | uint32 | The chain ID of the bridge origin |
| bridge | address | The bridge address on the origin chain |
| amount | uint256 | The total amount claimed |
| fees | uint256 | The fee amount collected |
OutstandingDebtChanged
Parameters
| Name | Type | Description |
|---|---|---|
| oldDebt | uint256 | Previous total outstanding debt |
| newDebt | uint256 | New total outstanding debt |
| origin | struct RelayPool.OriginSettings | The origin settings involved |
| oldOriginDebt | uint256 | Previous outstanding debt for the origin |
| newOriginDebt | uint256 | New outstanding debt for the origin |
AssetsDepositedIntoYieldPool
Parameters
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The amount deposited |
| yieldPool | address | The yield pool address |
AssetsWithdrawnFromYieldPool
Parameters
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The amount withdrawn |
| yieldPool | address | The yield pool address |
TokenSwapChanged
Parameters
| Name | Type | Description |
|---|---|---|
| prevAddress | address | The previous swap contract address |
| newAddress | address | The new swap contract address |
YieldPoolChanged
Parameters
| Name | Type | Description |
|---|---|---|
| oldPool | address | The previous yield pool address |
| newPool | address | The new yield pool address |
StreamingPeriodChanged
Parameters
| Name | Type | Description |
|---|---|---|
| oldPeriod | uint256 | The previous streaming period |
| newPeriod | uint256 | The new streaming period |
OriginAdded
Parameters
| Name | Type | Description |
|---|---|---|
| origin | struct RelayPool.OriginParam | The origin parameters |
OriginDisabled
Parameters
| Name | Type | Description |
|---|---|---|
| chainId | uint32 | The chain ID of the disabled origin |
| bridge | address | The bridge address of the disabled origin |
| maxDebt | uint256 | The previous maximum debt limit |
| outstandingDebt | uint256 | The outstanding debt at time of disabling |
| proxyBridge | address | The proxy bridge address |
constructor
Parameters
| Name | Type | Description |
|---|---|---|
| hyperlaneMailbox | address | The Hyperlane mailbox contract address |
| asset | contract ERC20 | The underlying asset for this vault |
| name | string | The name of the vault token |
| symbol | string | The symbol of the vault token |
| baseYieldPool | address | The initial yield pool for depositing assets |
| weth | address | The WETH contract address (for native currency pools) |
| curator | address | The address that will own the pool after deployment |
updateStreamingPeriod
Parameters
| Name | Type | Description |
|---|---|---|
| newPeriod | uint256 | The new streaming period in seconds |
updateYieldPool
Parameters
| Name | Type | Description |
|---|---|---|
| newPool | address | The address of the new yield pool |
| minSharePriceFromOldPool | uint256 | The minimum acceptable share price when withdrawing from the old pool |
| maxSharePricePriceFromNewPool | uint256 | The maximum acceptable share price when depositing into the new pool |
addOrigin
Parameters
| Name | Type | Description |
|---|---|---|
| origin | struct RelayPool.OriginParam | The origin parameters including chain ID, addresses, and limits |
disableOrigin
Parameters
| Name | Type | Description |
|---|---|---|
| chainId | uint32 | The chain ID of the origin to disable |
| bridge | address | The bridge address of the origin to disable |
increaseOutstandingDebt
Parameters
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The amount to increase debt by |
| origin | struct RelayPool.OriginSettings | The origin settings to update |
decreaseOutstandingDebt
Parameters
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The amount to decrease debt by |
| origin | struct RelayPool.OriginSettings | The origin settings to update |
maxDeposit
Parameters
| Name | Type | Description |
|---|---|---|
| address |
Return Values
| Name | Type | Description |
|---|---|---|
| maxAssets | uint256 | The maximum amount of assets that can be deposited |
maxWithdraw
Parameters
| Name | Type | Description |
|---|---|---|
| owner | address | The address to check withdrawal capacity for |
Return Values
| Name | Type | Description |
|---|---|---|
| maxAssets | uint256 | The maximum amount of assets that can be withdrawn |
maxMint
Parameters
| Name | Type | Description |
|---|---|---|
| receiver | address | The address that would receive the shares |
Return Values
| Name | Type | Description |
|---|---|---|
| maxShares | uint256 | The maximum amount of shares that can be minted |
maxRedeem
Parameters
| Name | Type | Description |
|---|---|---|
| owner | address | The address to check redemption capacity for |
Return Values
| Name | Type | Description |
|---|---|---|
| maxShares | uint256 | The maximum amount of shares that can be redeemed |
totalAssets
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The total assets under management |
depositAssetsInYieldPool
Parameters
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The amount of assets to deposit |
withdrawAssetsFromYieldPool
Parameters
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The amount of assets to withdraw |
| recipient | address | The address to receive the withdrawn assets |
handle
Parameters
| Name | Type | Description |
|---|---|---|
| chainId | uint32 | The origin chain ID |
| bridgeAddress | bytes32 | The origin bridge address (as bytes32) |
| data | bytes | The encoded message data |
remainsToStream
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The amount of assets remaining to be streamed |
updateStreamedAssets
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The new total assets to stream |
addToStreamingAssets
Parameters
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The amount of assets to add to streaming |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The new total assets to stream |
claim
Parameters
| Name | Type | Description |
|---|---|---|
| chainId | uint32 | The origin chain ID |
| bridge | address | The origin bridge address |
Return Values
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The amount of assets claimed |
sendFunds
Parameters
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The amount to send |
| recipient | address | The address to receive the funds |
setTokenSwap
Parameters
| Name | Type | Description |
|---|---|---|
| newTokenSwapAddress | address | The new token swap contract address |
swapAndDeposit
Parameters
| Name | Type | Description |
|---|---|---|
| token | address | The token to swap from |
| amount | uint256 | The amount of tokens to swap |
| uniswapWethPoolFeeToken | uint24 | The fee tier for token-WETH pool |
| uniswapWethPoolFeeAsset | uint24 | The fee tier for WETH-asset pool |
| deadline | uint48 | The deadline for the swap |
| amountOutMinimum | uint256 | The minimum amount of assets to receive |
collectNonDepositedAssets
beforeWithdraw
Parameters
| Name | Type | Description |
|---|---|---|
| assets | uint256 | The amount of assets to withdraw |
| uint256 |
afterDeposit
Parameters
| Name | Type | Description |
|---|---|---|
| assets | uint256 | The amount of assets deposited |
| uint256 |
processFailedHandler
Parameters
| Name | Type | Description |
|---|---|---|
| chainId | uint32 | The origin chain ID |
| bridge | address | The origin bridge address |
| data | bytes | The encoded message data |