Solidity API
IRelayBridge
Interface for the RelayBridge contract Defines the bridge function for cross-chain asset transfersbridge
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | Amount of asset units to bridge (ERC20 tokens or native currency) |
recipient | address | Address on the pool chain to receive the bridged asset |
poolAsset | address | Address of the asset on the pool chain to bridge to |
poolGas | uint256 | Gas limit for the pool chain transaction |
extraData | bytes | Extra data passed to the bridge proxy |
Return Values
Name | Type | Description |
---|---|---|
nonce | uint256 | Unique identifier for this bridge transaction |
RelayBridge
RelayBridge contract enabling cross-chain bridging via Hyperlane Bridges assets from an origin chain to a configured pool chainBridgeTransaction
Internal struct capturing parameters for a bridge transactionBridgingFailed
Parameters
Name | Type | Description |
---|---|---|
nonce | uint256 | The nonce of the failed transaction |
InsufficientValue
Parameters
Name | Type | Description |
---|---|---|
received | uint256 | The amount of native currency received |
expected | uint256 | The amount of native currency expected |
FailedFeeRefund
Parameters
Name | Type | Description |
---|---|---|
value | uint256 | The amount of native currency that failed to refund |
transferNonce
ASSET
BRIDGE_PROXY
HYPERLANE_MAILBOX
BridgeInitiated
Parameters
Name | Type | Description |
---|---|---|
nonce | uint256 | Nonce of the transaction |
sender | address | Address on the origin chain that initiated the bridge |
recipient | address | Address on the pool chain to receive assets |
ASSET | address | Asset address on the origin chain (address(0) for native currency) |
poolAsset | address | Asset address on the pool chain (address(0) for native currency) |
amount | uint256 | Amount of asset units bridged |
BRIDGE_PROXY | contract BridgeProxy | BridgeProxy used |
BridgeExecuted
Parameters
Name | Type | Description |
---|---|---|
nonce | uint256 | Nonce of the executed transaction |
BridgeCancelled
Parameters
Name | Type | Description |
---|---|---|
nonce | uint256 | Nonce of the cancelled transaction |
constructor
Parameters
Name | Type | Description |
---|---|---|
asset | address | Asset address on the origin chain to bridge (0 for native currency) |
bridgeProxy | contract BridgeProxy | BridgeProxy contract for origin-chain transfers |
hyperlaneMailbox | address | Hyperlane Mailbox address for messaging |
getFee
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | Amount of asset units to bridge |
recipient | address | Address on the pool chain that will receive the bridged asset |
poolGas | uint256 | Gas limit for the pool chain transaction |
Return Values
Name | Type | Description |
---|---|---|
fee | uint256 | Required fee in native currency for dispatch |
bridge
- Validates sufficient payment for fees (and asset amount if native)
- Transfers the asset from sender to this contract (if ERC20)
- Executes bridge logic via delegatecall to BRIDGE_PROXY
- Dispatches cross-chain message via Hyperlane
- Refunds any excess native currency to sender_
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | Amount of asset units to bridge (ERC20 tokens or native currency) |
recipient | address | Address on the pool chain to receive the bridged asset |
poolAsset | address | Address of the asset on the pool chain to bridge to |
poolGas | uint256 | Gas limit for the pool chain transaction |
extraData | bytes | Extra data passed to the bridge proxy |
Return Values
Name | Type | Description |
---|---|---|
nonce | uint256 | Unique identifier for this bridge transaction |