Airdrop Claiming Guidelines
In this article we're going to study imaginary claim solution, try to identify it's performance problems and solve them. This article focuses on contract interactions and their impact on overall performance. Code, security aspects, and other nuances left aside.
Claim Machine
How pretty much any claim solution works? Let's think about it.
User send some kind of proof, that he is eligible for the claim
solution checks it and sends jettons back.
In current case proof
means merkle proof but it could very well be signed data or whatever else authorization method one could come up with.
Sending jettons, - so there would be a jetton wallet and minter.
And we got to make sure that these sneaky users can't claim twice - double spend protection contract.
Oh, and we probably want to make some money, do we?
So at least one claim wallet.
Let's sum it up:
Distributor
Takes the proof from the user, checks it, releases the jettons.
State init: (merkle_root, admin, fee_wallet_address)
.
Double spend
Receives message, bounces if already used, otherwise passes message further
Jetton
Jetton wallet where the tokens will be sent from by the distributor. Jetton minter is out of the scope of this article.
Fee wallet
Any kind of wallet contract