In this guide, we will learn how to successfully bridge funds from an origin to a vault.
outstandingDebt
and
totalAssets
values.
outstandingDebt
is sufficient to handle your
deposit. This is the maximum amount of funds that can be bridged from that
origin at any given time. You can query this value on the Backend API. You can
use the vault’s authorizedOrigins
field to check the origins available for a
specific vault (it also returns the bridgeFee
and cooldown
that are
useful).
getFee
method on the bridge contract in order to get
the fee that will be charged for the deposit itself. These are the fees
collected by Hyperlane to send the message to the vault. You will need to
specify the amount
, recipient
and poolGas
parameters (a default of 300,000
gas should be sufficient for most cases). Once you have the fee, you will need
to call the bridge
method on the origin contract, passing the amount
,
recipient
, poolGas
and an extra data
parameters. You MUST also pass a
value
matching the result of the getFee
call from above. The data
parameter is optional and can be used to pass extra information to the
underlying bridge proxy (see BridgeProxy) and could
be 0x0
in most cases.
The recipient
address will receive the funds on the vault chain as soon as the
message has been processed by Hyperlane (and the cool down period has been
respected). The recipient
address can be the same as the one you used to
deposit, or a different one. This is useful if you want to bridge funds to a
different address than the one you used to deposit.
messageId
parameter of the DispatchId
event emitted by Mailbox
contract on
the origin chain. Here
is an example
for this transaction
on the Zora chain.