Proposal Details
Proposal #224
Proposal title
Upload a free to use smart-contract to distribute native tokens to NFT owners of an NFT collection.
Submit time
Deposit end time
Voting start time
Voting end time
Tally result
Proposal #224 description
Description
This proposal is to upload a smart-contract that distribute a fixed amount of native tokens to every NFT owner of a given NFT collection. The contract can be used for any number of distribution and is therefore re-useable. It can also be used to make airdrops to NFT holders of an NFT collection.
Example of use
You want to make an airdrop of 100 $STARS to every NFT holder of a collection of 1,000 NFTs. You just need to instantiate the contract by linking an NFT collection, decide on the airdrop distribution parameters and send the total amount to distribute (100k $STARS in that case) and it is done. The owners can now claim their airdrop.
How does it work?
You first need to instantiate the contract (for free) and link an NFT collection to the contract. The contract will take care of fetching the number of NFTs in the given collection for the distribution purposes. When instantiating the contract, you also decide on who is the admin of the contract and which wallet will make the distributions.
After the contract is instantiated, you can add a distribution to it by deciding on the following parameters: assets_per_nft which is how much of a given asset each NFT is allocated. So if you want to distribute 1 $ATOM and 100 $STARS to every NFT holder you would specify both of them. Then you decide on the distribution_end_time which is when the distribution comes to an end (afterward the holders of an NFT cannot claim their portion). You also have to decide if the unclaimed assets are given back to the distributor or added to the next distribution. In other words, if only 50% of the NFTs claimed, the remaining 50% will be distributed to every during the next distribution. If you set unclaimed_to_distributor to false this is what will happen. Otherwise, when the distribution ends, the one who sent the assets will receive the unclaimed amounts by calling an ExecuteMsg named ReturnUnclaimed after the distribution has ended. You can also decide on the minimum_nfts_to_claim which means one would need at least X NFTs in a given wallet to claim its portion. Note: the contract keeps track of NFTs that claims their portion to avoid NFT transfers to claim.
Additional Details
It is possible to claim for up to 500 NFTs at a time using the BulkClaim ExecuteMsg or use the ClaimFive approach to claim up to 5 specific NFTs at a time. They are both slightly different as the bulk one uses the Tokens approach whereas the other uses OwnerOf to check if the sender is the owner. The admin can also halt a distribution if something happens. It is possible to query the current distribution information and also query if the portion has been claimed for a given token id.
Conclusion
We believe this contract can be used by different NFT projects that would like to distribute tokens to their holders. It definitely facilitate the process of doing such and also to make claimable airdrops.
Code details
The code is available here: https://github.com/racoon-supply-rac/cw-nft-reward-distribution.
You can compile the code by calling make optimized-build which will produce the following checksum: 2ea56f474a4c5d1b8ec425ca1a3681d085c4a05b92ea85dcb2c154cc1a16e4f7 cw_nft_reward_distribution.wasm.
You can also verify this information on-chain by calling the following:
You can also verify locally by doing the following on the compiled wasm file:
Who we are
Racoon Supply is a project that first launched in January 2021 on Juno with the $RAC token and then launched its NFT collection on Secret in March 2021. The Racoon NFT collection is now on Stargaze and we intend to build more and more on Stargaze. We also made some contribution to the code base of the Stargaze marketplace and worked with many different project within the Cosmos Ecosystem. If you want more details you can have a look at our Twitter: https://twitter.com/RacoonSupply.