LayerZero Integration on Frame Testnet

CrossChain ONFT

Try mint an NFT on Sepolia and bridge to Frame Tesnet.

Step by step :

Mint NFT

  • Confirm transaction on Metamask

  • From there, click on "View Transaction" to find the id of the NFT you just minted. We'll need this ID for the next step.

Find Token ID
  • Next, we'll go through the actual bridging process. Go back to the Sepolia contract page and find the crossChain function.

  • The first field is the gas paid to cover the bridging costs, the second field is the LayerZero chain id for Frame, and the third field is your NFT id.

CrossChain to Frame Tesnet
  • Click on Write and confirm your transaction on metamask

  • After submitting this txn, you'll find that your NFT no longer exists on Sepolia.

  • Instead, go to the corresponding Frame NFT page here: https://explorer.testnet.frame.xyz/address/0xa558CF3E0Ca1B9aAA696A48677d359277FeE4c34?tab=contract&contractTab=read

  • In the ownerOf function, input your token id. Click submit, and you should see your address.

    Input Token ID
  • You can repeat the process in reverse by minting on Frame and bridging to Sepolia (you can bridge your original NFT back to Sepolia).

  • Here's what the crossChain inputs should look like (use 1000000000000000 for the last field - it means 0.001 ETH).

CrossChain to Sepolia

The source code for the cross chain NFT contracts can be found here: https://github.com/frame-network/lz-example/blob/main/contracts/CrossChainNFT.sol. The important functions to pay attention to are crossChain and _nonblockingLzReceive. These handle the minting and burning of tokens when they're bridged.

The NonblockingLzApp contract handles most of the LayerZero communication. If you want to build your own ONFT contract, you can inherit from this contract. Your ONFT contract just needs to call the corresponding functions to trigger the cross-chain messaging. This is a demo app showcasing LayerZero integration on Frame.

Thats all.

Thats all.

Loading...
highlight
Collect this post to permanently own it.
Fandriyan logo
Subscribe to Fandriyan and never miss a post.
#frame#nft