OmniBridge

OmniBridge allows the migration and return of assets instantly between all of Omnify's supported networks. Each source asset is locked on the source network and has its own distinct equivalent asset on each destination network. This equivalent asset is minted upon receiving the migrated assets, and is burned when returning it to the source network. This method ensures a 1:1 peg between source and bridged assets. Accessible from bridge.omnify.finance and app.omnify.finance/bridges

OmniBridge banner

Migrating and Returning assets

The process of migrating and returning assets using OmniBridge is very straightforward. Start by downloading the OmniBridge interface from our github repo. You can find a list of all Omnify services' tiers and fees at omnify.finance/fees.

In this example we will be bridging USDC from Avalanche C-Chain to Binance Smart Chain.

Bridging

1

Define OmniBridge variable

2

Quote network fee

Omnify uses LayerZero to send and receive cross-chain messages. LayerZero requires a network fee to process these messages and get them across to the destination networks. We can learn how much LayerZero's DVN's & Executors request to process our bridge transactions by calling quote with our payload from our OmniBridge contract.

Before we call quote we need to know:

  1. the destination chain's LayerZero ID

  2. the payload message we want to send

  3. and create the options that we will forward to LayerZero's DVNs & executors

(1) All networks' Layerzero IDs can be found in our notes file in our Github Repo.

(2) Payload message

The payload message is simply a string that contains the transaction details:

"sourceAssetAddress.sourceChainEid.msgsenderaddress.recipientAddress.amount.assetName.assetSymbol.assetDecimals.isReturningBridgedAsset.foreignEquivalentAddress"

You can dynamically deduce the payload as such:

Check out migrateAssets in our OmniBridge contract source code For a more detailed approach on how to dynamically generate the payload.

(3) Now let's get the gas limit and create the options

Lets explain quote and its structure

We can finally call quote from our code

3

Get Omnify fee

We are one step away from bridging our tokens, we only need to get Omnify's bridge fee, add it to LayerZero's fee and then pass it to migrateAssets .

4

Migrate Assets

We now have all the properties we need to call migrateAssets.

Bridging through OmniBridge is complete, Good Job! 👏

Last updated