LayerZero x Stargate

Bridge tokens in minutes through the LayerZero x Stargate partnership.

Motivation

  • Alternative and scalable multichain bridging solution.

Benefits

  • Bridging complete within minutes.

  • Flexible choice in source or destination chain.

Risks

  • Trust delegated to LayerZero / Stargate.

    • LayerZero Endpoint

    • LayerZero, Horizen DVN

    • Stargate UI

OFTs

Frax assets are represented as OFTs (as defined by LayerZero) on chains other than Fraxtal, Ethereum, and Arbitrum. An OFT operates the exact same as an ERC20 with the additional function of bridge-ability through the LayerZero protocol.

Available Frax OFTs

  • FRAX

  • sFRAX

  • frxETH

  • sfrxETH

  • FXS

  • FPI

Legacy vs. Upgradeable OFTs

In the initial deployment with LayerZero, the LayerZero team deployed Frax assets across several chains as fixed contracts. After the initial deployment, the Frax team has assumed additional deployment responsibilities and currently deploys OFTs as upgradeable, transparent proxies (contracts audited, repo link).

Legacy and Upgradeable OFTs maintain the same address per asset across chains, respectively.

All OFTs with bridging permissions are managed by a 3/6 msig on each respective chain.

Process

  • Bridge through the Stargate UI (link)

  • Bridge directly with LayerZero

npm install @fraxfinance/layerzero-v2-upgradeable
import { OptionsBuilder } from "@fraxfinance/layerzero-v2-upgradeable/oapp/contracts/oapp/libs/OptionsBuilder.sol";
import { SendParam, MessagingFee, IOFT } from "@fraxfinance/layerzero-v2-upgradeable/oapp/contracts/oft/interfaces/IOFT.sol";

uint256 amount = 1e18;
// Upgradeable FRAX - Bridging FROM Mode
address oft = 0x80eede496655fb9047dd39d9f418d5483ed600df; 
// Ethereum - choose destination EID from https://github.com/FraxFinance/frax-oft-upgradeable/blob/master/scripts/L0Config.json
uint32 dstEid = 30101;

bytes memory options = OptionsBuilder.newOptions();
SendParam memory sendParam = SendParam({
        dstEid: dstEid,
        to: bytes32(uint256(uint160(msg.sender))),
        amountLD: amount,
        minAmountLD: amount,
        extraOptions: options,
        composeMsg: '',
        oftCmd: ''
});
MessagingFee memory fee = IOFT(_oft).quoteSend(sendParam, false);
IOFT(_oft).send{value: fee.nativeFee}(
    sendParam,
    fee,
    payable(msg.sender)
);

Contracts & Addresses

Admin

Legacy OFTs

  • Chain: Ethereum, Metis, Blast, Base

  • Admin: Chain-respective msig

  • OFTs

    • FRAX: 0x909DBdE1eBE906Af95660033e478D59EFe831fED

    • sFRAX: 0xe4796cCB6bB5DE2290C417Ac337F2b66CA2E770E

    • sfrxETH: 0x1f55a02A049033E3419a8E2975cF3F572F4e6E9A

    • FXS: 0x23432452B720C80553458496D4D9d7C5003280d0

    • frxETH : 0xF010a7c8877043681D59AD125EbF575633505942

    • FPI: 0xE41228a455700cAF09E551805A8aB37caa39D08c

Upgradeable OFTs

  • Chain: Mode, Sei, Fraxtal, X-Layer

  • Admin: ProxyAdmin (owned by chain-respective msig)

  • OFTs

    • FRAX: 0x80eede496655fb9047dd39d9f418d5483ed600df

    • sFRAX: 0x5bff88ca1442c2496f7e475e9e7786383bc070c0

    • sfrxETH: 0x3ec3849c33291a9ef4c5db86de593eb4a37fde45

    • FXS: 0x64445f0aecc51e94ad52d8ac56b7190e764e561a

    • frxETH: 0x43eDD7f3831b08FE70B7555ddD373C8bF65a9050

    • FPI : 0xEed9DE5E41b53D1C8fAB8AAB4b0e446F828c1483

Source Code

Security Considerations

Layer Zero OFT Frax Assets are not a liability of the Frax Protocol. They do not appear on the balance sheet on facts.frax.finance. They are not redeemable for protocol owned assets. They are only redeemable for the Frax Asset in the Layer Zero “lockbox” contract that is part of the Layer Zero Protocol. Layer Zero OFT Frax Assets are settled by Layer Zero Decentralized Verification Networks (DVNs) that are not operated by the Frax Protocol, Frax Core Developers, or any associated entity of Frax. Therefore, the risk of OFT Frax Assets are borne by their holders. This is similar to holding “USDC tokens” on a network that its issuer, Circle, does not support minting/redeeming on. Such “USDC tokens” do not appear on Circle’s balance sheet as a liability nor are they redeemable from its issuer. They are only redeemable for the underlying USDC token in the bridge (ie ‘lockbox’) contract.

In the future, the Frax Protocol can work with Layer Zero to upgrade certain OFT Frax Assets on select networks to allow the Frax Protocol to have direct oversight in the settlement process similar to the Frax Ferry system. After this, the OFT Frax Assets for those select networks will be reported on the associated balance sheet of those Frax Assets. When this occurs, the Frax Protocol will consider such tokens at that time as its liability that are backed directly by the assets it holds on its respective balance sheets. At this time, no Frax OFT tokens are native liabilities of the protocol.

Last updated