Contracts Reference
RelayPool
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
| Name | Type | Description |
|---|
struct OriginSettings {
uint32 chainId;
address bridge;
address curator;
uint256 maxDebt;
uint256 outstandingDebt;
address proxyBridge;
uint32 bridgeFee;
uint32 coolDown;
}
| Name | Type | Description |
|---|
struct OriginParam {
address curator;
uint32 chainId;
address bridge;
address proxyBridge;
uint256 maxDebt;
uint32 bridgeFee;
uint32 coolDown;
}
error UnauthorizedCaller(address sender)
| Name | Type | Description |
|---|---|---|
| sender | address | The address that attempted the unauthorized call |
error UnauthorizedSwap(address token)
| Name | Type | Description |
|---|---|---|
| token | address | The token address that was attempted to be swapped |
error UnauthorizedOrigin(uint32 chainId, address bridge)
| Name | Type | Description |
|---|---|---|
| chainId | uint32 | The chain ID of the unauthorized origin |
| bridge | address | The bridge address of the unauthorized origin |
error MessageAlreadyProcessed(uint32 chainId, address bridge, uint256 nonce)
| 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 |
error TooMuchDebtFromOrigin(uint32 chainId, address bridge, uint256 maxDebt, uint256 nonce, address recipient, uint256 amount)
| 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 |
error FailedTransfer(address recipient, uint256 amount)
| Name | Type | Description |
|---|---|---|
| recipient | address | The intended recipient of the transfer |
| amount | uint256 | The amount that failed to transfer |
error InsufficientFunds(uint256 amount, uint256 balance)
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The amount available |
| balance | uint256 | The balance required |
error NotAWethPool()
error MessageTooRecent(uint32 chainId, address bridge, uint256 nonce, uint256 timestamp, uint32 coolDown)
| 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 |
error SharePriceTooLow(uint256 actualPrice, uint256 minPrice)
| Name | Type | Description |
|---|---|---|
| actualPrice | uint256 | The actual share price |
| minPrice | uint256 | The minimum acceptable share price |
error SharePriceTooHigh(uint256 actualPrice, uint256 maxPrice)
| Name | Type | Description |
|---|---|---|
| actualPrice | uint256 | The actual share price |
| maxPrice | uint256 | The maximum acceptable share price |
address HYPERLANE_MAILBOX
address WETH
uint256 FRACTIONAL_BPS_DENOMINATOR
uint256 outstandingDebt
mapping(uint32 => mapping(address => struct RelayPool.OriginSettings)) authorizedOrigins
mapping(uint32 => mapping(address => mapping(uint256 => bytes))) messages
address yieldPool
address tokenSwapAddress
uint256 pendingBridgeFees
uint256 totalAssetsToStream
uint256 lastAssetsCollectedAt
uint256 endOfStream
uint256 streamingPeriod
event LoanEmitted(uint256 nonce, address recipient, contract ERC20 asset, uint256 amount, struct RelayPool.OriginSettings origin, uint256 fees)
| 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 |
event BridgeCompleted(uint32 chainId, address bridge, uint256 amount, uint256 fees)
| 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 |
event OutstandingDebtChanged(uint256 oldDebt, uint256 newDebt, struct RelayPool.OriginSettings origin, uint256 oldOriginDebt, uint256 newOriginDebt)
| 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 |
event AssetsDepositedIntoYieldPool(uint256 amount, address yieldPool)
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The amount deposited |
| yieldPool | address | The yield pool address |
event AssetsWithdrawnFromYieldPool(uint256 amount, address yieldPool)
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The amount withdrawn |
| yieldPool | address | The yield pool address |
event TokenSwapChanged(address prevAddress, address newAddress)
| Name | Type | Description |
|---|---|---|
| prevAddress | address | The previous swap contract address |
| newAddress | address | The new swap contract address |
event YieldPoolChanged(address oldPool, address newPool)
| Name | Type | Description |
|---|---|---|
| oldPool | address | The previous yield pool address |
| newPool | address | The new yield pool address |
event StreamingPeriodChanged(uint256 oldPeriod, uint256 newPeriod)
| Name | Type | Description |
|---|---|---|
| oldPeriod | uint256 | The previous streaming period |
| newPeriod | uint256 | The new streaming period |
event OriginAdded(struct RelayPool.OriginParam origin)
| Name | Type | Description |
|---|---|---|
| origin | struct RelayPool.OriginParam | The origin parameters |
event OriginDisabled(uint32 chainId, address bridge, uint256 maxDebt, uint256 outstandingDebt, address proxyBridge)
| 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(address hyperlaneMailbox, contract ERC20 asset, string name, string symbol, address baseYieldPool, address weth, address curator) public
| 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 |
function updateStreamingPeriod(uint256 newPeriod) public
| Name | Type | Description |
|---|---|---|
| newPeriod | uint256 | The new streaming period in seconds |
function updateYieldPool(address newPool, uint256 minSharePriceFromOldPool, uint256 maxSharePricePriceFromNewPool) public
| 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 |
function addOrigin(struct RelayPool.OriginParam origin) public
| Name | Type | Description |
|---|---|---|
| origin | struct RelayPool.OriginParam | The origin parameters including chain ID, addresses, and limits |
function disableOrigin(uint32 chainId, address bridge) public
| Name | Type | Description |
|---|---|---|
| chainId | uint32 | The chain ID of the origin to disable |
| bridge | address | The bridge address of the origin to disable |
function increaseOutstandingDebt(uint256 amount, struct RelayPool.OriginSettings origin) internal
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The amount to increase debt by |
| origin | struct RelayPool.OriginSettings | The origin settings to update |
function decreaseOutstandingDebt(uint256 amount, struct RelayPool.OriginSettings origin) internal
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The amount to decrease debt by |
| origin | struct RelayPool.OriginSettings | The origin settings to update |
function maxDeposit(address) public view returns (uint256 maxAssets)
| Name | Type | Description |
|---|---|---|
| address |
| Name | Type | Description |
|---|---|---|
| maxAssets | uint256 | The maximum amount of assets that can be deposited |
function maxWithdraw(address owner) public view returns (uint256 maxAssets)
| Name | Type | Description |
|---|---|---|
| owner | address | The address to check withdrawal capacity for |
| Name | Type | Description |
|---|---|---|
| maxAssets | uint256 | The maximum amount of assets that can be withdrawn |
function maxMint(address receiver) public view returns (uint256 maxShares)
| Name | Type | Description |
|---|---|---|
| receiver | address | The address that would receive the shares |
| Name | Type | Description |
|---|---|---|
| maxShares | uint256 | The maximum amount of shares that can be minted |
function maxRedeem(address owner) public view returns (uint256 maxShares)
| Name | Type | Description |
|---|---|---|
| owner | address | The address to check redemption capacity for |
| Name | Type | Description |
|---|---|---|
| maxShares | uint256 | The maximum amount of shares that can be redeemed |
function totalAssets() public view returns (uint256)
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The total assets under management |
function depositAssetsInYieldPool(uint256 amount) internal
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The amount of assets to deposit |
function withdrawAssetsFromYieldPool(uint256 amount, address recipient) internal
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The amount of assets to withdraw |
| recipient | address | The address to receive the withdrawn assets |
function handle(uint32 chainId, bytes32 bridgeAddress, bytes data) external payable
| Name | Type | Description |
|---|---|---|
| chainId | uint32 | The origin chain ID |
| bridgeAddress | bytes32 | The origin bridge address (as bytes32) |
| data | bytes | The encoded message data |
function remainsToStream() internal view returns (uint256)
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The amount of assets remaining to be streamed |
function updateStreamedAssets() public returns (uint256)
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The new total assets to stream |
function addToStreamingAssets(uint256 amount) internal returns (uint256)
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The amount of assets to add to streaming |
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The new total assets to stream |
function claim(uint32 chainId, address bridge) public returns (uint256 amount)
| Name | Type | Description |
|---|---|---|
| chainId | uint32 | The origin chain ID |
| bridge | address | The origin bridge address |
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The amount of assets claimed |
function sendFunds(uint256 amount, address recipient) internal
| Name | Type | Description |
|---|---|---|
| amount | uint256 | The amount to send |
| recipient | address | The address to receive the funds |
function setTokenSwap(address newTokenSwapAddress) external
| Name | Type | Description |
|---|---|---|
| newTokenSwapAddress | address | The new token swap contract address |
function swapAndDeposit(address token, uint256 amount, uint24 uniswapWethPoolFeeToken, uint24 uniswapWethPoolFeeAsset, uint48 deadline, uint256 amountOutMinimum) public
| 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 |
function collectNonDepositedAssets() public
function beforeWithdraw(uint256 assets, uint256) internal
| Name | Type | Description |
|---|---|---|
| assets | uint256 | The amount of assets to withdraw |
| uint256 |
function afterDeposit(uint256 assets, uint256) internal
| Name | Type | Description |
|---|---|---|
| assets | uint256 | The amount of assets deposited |
| uint256 |
function processFailedHandler(uint32 chainId, address bridge, bytes data) public
| Name | Type | Description |
|---|---|---|
| chainId | uint32 | The origin chain ID |
| bridge | address | The origin bridge address |
| data | bytes | The encoded message data |
receive() external payable
Was this page helpful?