Inspiration
Discovering CCIP and with NFT background, we thought it would be fun to send NFT to other chains where there could be lower gas fees or possible NFT gamification resources
What it does
Allows the owner of an ERC721 contract to deploy a bridge to another chain using CCIP. Currently recognising two types of 721
- baseURI based (used in PFP collections)
- Individual URI per tokenID (as in art NFTs)
Allows the owner to designate a bridge to another chain so that users may transfer their tokens.
How we built it
NFT Bridge is what we call a "poor man's diamond" in that half the contract is proxied and uses a fixed location storage slot.
Uses CCIP to send messages to secondary chain to create proxied NFT contracts (with same owner and configuration as primary NFT contract) and mint tokens on that proxied contract after taking the NFT into custody on source chain.
If an NFT is returned to source chain it is burned from the secondary chain and released on the primary chain.
Three functions, two for bridge definition, one for transfer
- createBaseURIToken
- createIndividualURIBasedToken
- transferMyToken
The first two collect necessary data and pass it across the bridge to the destination chain where a proxy is deployed to one of the two golden contracts (one baseURI and one IndividualURI) Setup parameters are stored on each side to ensure that creation only need happen once.
Challenges we ran into
Harder debugging cross chain code - but etherscan allows access to debug traces.
Accomplishments that we're proud of
It works! (currently set up for arbitrum_goerli to sepolia)
What we learned
You can't expect all structure ABIs to look the same ! (messed up the simplicity of ccipReceive)
What's next for Cross Chain NFT Bridge
eliminate the need to watch the status at ccip.chain.link check the baseURI version with reveal shifts
UI can be found at https://github.com/iserifith/Chainlink2023Web
Log in or sign up for Devpost to join the conversation.