Example: Cross-Chain Airdrop
Allow owners of an ERC721 on Ethereum to claim something on another chain.
We've built a simple example contract that allows users that own an ERC721 on mainnet to receive an airdrop such as a new NFT or other tokens on another chain (ex. Polygon). The contract reads ERC721.ownerOf(uint256)
from mainnet to ensure that the wallet is the correct owner.
Since the _giveAirdrop
function is abstract, you can add any logic you want for airdrop claimers. This base contract could be used to migrate an NFT to a new chain, give tokens to claimers, or otherwise provide additional utility to ERC721 tokens on mainnet.
Here's an example that gives 1 ETH to airdrop claimers.
The full source code for the contracts used in this below can be found at the Github NFTAirdrop.sol example.
Last updated