NFT Bridge

Habtor NFT Bridges

Habtor NFT bridges support native L1 NFT as well as native L2 NFT. Users can transfer their NFTs between L1 and L2.

Native L1 NFT: the original NFT contract was deployed on L1Native L2 NFT: the original NFT contract was deployed on L2

NFT Bridging on Habtor Network in a nutshell - Native L1 & L2 NFTs are supported to be bridged between L1<>L2 - In order to move an L1 NFT to L2, the L1 creator needs to deploy a corresponding contract on L2 - In order to move an L2 NFT to L1, the L2 creator needs to deploy a corresponding contract on L1 - Moving NFTs from L1 to L2 is near instant and burns the NFT on L1 - Moving NFTs from L2 to L1 takes 7 days due to the optimistic rollup challenge period

Native L1 NFT

Requirements

In order for a native L1 NFT to be moved to the Habtor Network, the L1 NFT creator needs to deploy L2StandardERC721 smart contract on the Habtor Network.1const Factory__L2StandardERC721 = new ethers.ContractFactory(2L2StandardERC721.abi,3L2StandardERC721.bytecode,4L2Wallet5)6const L2StandardERC721 = await Factory__L2StandardERC721.deploy(7L2_NFT_BRIDGE_ADDRESS, // L2 NFT Bridge Address8L1_NFT_CONTRACT_ADDRESS, // Your L1 NFT Address9NFT_NAME,10NFT_SYMBOL11)12await L2StandardERC721.deployTransaction.wait()Copied!

NOTE:Once you get the L2StandardERC721 address, please contact us. We will register your NFT contracts in L1 and L2 NFT bridges, so there is only one corresponding L2 NFT contract.

How to bridge and exit NFTs

Deposit NFT to Habtor NetworkThe users have to transfer their NFT to L1 NFT Bridge, so they should approve the transaction first.1const approveTx = await L1NFT.approve(L1_NFT_BRIDGE_ADDRESS, TOKEN_ID)2await approveTx.wait()Copied!Users call the depositNFT or depositNFTTo function to deposit NFT to L2. The NFT arrives on L2 after eight L1 blocks.1const tx = await L1NFTBrige.depositNFT(2L1_NFT_CONTRACT_ADDRESS,3TOKEN_ID,49999999, // L2 gas5ethers.utils.formatBytes32String(new Date().getTime().toString())6)7await tx.wait()Copied!

Exit NFT from Habtor Network

The L2 NFT Bridge has to burn the L2 NFT, so they should approve the transaction first.1const approveTx = await L2NFT.approve(L2_NFT_BRIDGE_ADDRESS, TOKEN_ID)2await approveTx.wait()Copied!Users call the withdraw or withdrawTo function to exit NFT from L2. The NFT arrives on L1 after the seven days.1const tx = await L2NFTBrige.withdraw(2L2_NFT_CONTRACT_ADDRESS,3TOKEN_ID,49999999, // L2 gas5ethers.utils.formatBytes32String(new Date().getTime().toString())6)7await tx.wait()Copied!

Native L2 NFT

The L2 NFT creator should deploy L1StandardERC721 on the Habtor Network.1const Factory__L2StandardERC721 = new ethers.ContractFactory(2L1StandardERC721.abi,3L1StandardERC721.bytecode,4L1Wallet5)6const L1StandardERC721 = await Factory__L1StandardERC721.deploy(7L1_NFT_BRIDGE_ADDRESS, // L1 NFT Bridge Address8L2_NFT_CONTRACT_ADDRESS, // Your L2 NFT Address9NFT_NAME,10NFT_SYMBOL11)12await L2StandardERC721.deployTransaction.wait()Copied!

NOTE:Once you get the L1StandardERC721 address, please contact us. We will register your NFT contracts in L1 and L2 NFT bridges, so there is only one corresponding L1 NFT contract.

How to bridge and exit NFTs

Exit NFT from Habtor Network

Users have to transfer their NFTs to the L2 NFT Bridge, so they should approve the transaction first.1const approveTx = await L2NFT.approve(L2_NFT_BRIDGE_ADDRESS, TOKEN_ID)2await approveTx.wait()Copied!Users call the withdraw or withdrawTo function to exit NFT from L2. The NFT arrives on L1 after the seven day exit window.1const tx = await L2NFTBrige.withdraw(2L2_NFT_CONTRACT_ADDRESS,3TOKEN_ID,49999999, // L2 gas5ethers.utils.formatBytes32String(new Date().getTime().toString())6)7await tx.wait()Copied!

Deposit NFT to Habtor Network

The L1 NFT Bridge has to burn the L1 NFT, so they should approve the transaction first.1const approveTx = await L1NFT.approve(L1_NFT_BRIDGE_ADDRESS, TOKEN_ID)2await approveTx.wait()Copied!Users call the depositNFT or depositNFTTo function to deposit NFT to L2. The NFT arrives on L2 after eight L1 blocks.1const tx = await L1NFTBrige.depositNFT(2L1_NFT_CONTRACT_ADDRESS,3TOKEN_ID,49999999, // L2 gas5ethers.utils.formatBytes32String(new Date().getTime().toString())6)7await tx.wait()Copied!

Mainnet

Contract NameContract Address​​

Testnet

Contract NameContract AddressProxy__L1NFTBridge0x01F5d5D6de3a8c7A157B22FD331A1F177b7bE043Proxy__L2NFTBridge0x5E368E9dce71B624D7DdB155f360E7A4969eB7aA

Last updated