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

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

  • OFTs

    • FRAX: 0x80eede496655fb9047dd39d9f418d5483ed600df

    • sFRAX: 0x5bff88ca1442c2496f7e475e9e7786383bc070c0

    • sfrxETH: 0x3ec3849c33291a9ef4c5db86de593eb4a37fde45

    • FXS: 0x64445f0aecc51e94ad52d8ac56b7190e764e561a

    • frxETH: 0x43eDD7f3831b08FE70B7555ddD373C8bF65a9050

    • FPI : 0xEed9DE5E41b53D1C8fAB8AAB4b0e446F828c1483 7

Source Code

Last updated