How to Set Up
At the time of token deployment, the deployer needs to supply the following:- How much supply to allocate to the airdrop (max 90%)
- How long to lock up the airdrop (minimum 1 day)
- How long to vest the airdrop (can be zero)
- The merkle root specifying the recipients and their token amounts (can be zero and set later)
Merkle Root Format
The airdrop expects leaves to be in ABI-encoded format:(address recipient, uint256 amount). The OpenZeppelin MerkleProof library is used to verify the proof against the merkle root, with a JavaScript package available here.
Important: This extension does not verify on-chain that the merkle root’s leaves add up to the total supply of the token. It is the responsibility of the deployer to ensure that the merkle root is valid. If a recipient is granted tokens in multiple leaves, the amount of tokens they are able to claim will be the maximum of the granted amounts.
Admin Capabilities
Admins are able to perform two main actions:- Recover unclaimed tokens two weeks after an airdrop’s lockup + vesting time period has passed. If an airdrop has a 7-day lockup and a 7-day vest, the admin can recover tokens 28 days post-launch (7-day lockup + 7-day vest + 14-day protected user claim window = 28 days).
- Change the merkle root for their token. Admins are able to do this:
- Anytime if the root was initially set to zero and is still zero
- 1 day after the lockup period has ended and no users have claimed their tokens
Admin-Facing Functions
Only a token’s admin can call the following functions:How to Claim
To claim tokens, the recipient must have a leaf in the merkle root. Anyone is able to trigger theclaim() function to transfer funds from the airdrop to the recipient’s address.
Claiming can begin after a token’s lockup period has ended, and the amount available to claim is a function of time over an optional vesting period. For example, if a deployer wants to lock the airdropped tokens for 30 days and have all tokens available 60 days post-unlock, they would set the lockupDuration to 30 days and the vestingDuration to 30 days. At 45 days post-deployment, half of the airdropped token supply would be accessible.