Airdrop

Airdrop ERC20 / ERC721 / ERC1155 tokens via push-based or claimable methods.

thirdweb's Airdrop contract

note: token-owner must approve their tokens to this airdrop contract, by calling approval related function on the token contract.

Airdrop ERC20 / ERC721 / ERC1155 tokens to a list of recipients.

The Airdrop contract is suitable to use when you want to transfer ERC20 / ERC721 / ERC1155 tokens to a list of recipient addresses, and supports push based, claim based (allowlist), and signature based airdrops.

When push and signature based airdrops, you specify:

  • The address of the token contract from which tokens are being transferred.
  • The owner address from where the tokens will be transferred to a list of the recipients.
  • An array of objects containing recipient-address and token-ids/amounts, for e.g.
[
   {
       recipient: "0x123...",
       tokenId: 1 
   },
   {
       recipient: "0xabc...",
       tokenId: 2
   }
]

For claim based airdrops, contract admin can set an allowlist of recipients by calling setMerkleRoot function. Addresses in the allowlist can claim the allowlisted quantity/token-id by calling the claim functions.

The allowlist data should contain the following items in the given order:

  • For ERC721: receiver, tokenId
  • For ERC20: receiver, quantity
  • For ERC1155: receiver, tokenId, quantity

On claiming an airdrop, a recipient specifies:

  • The address to transfer the claimed airdrop to.
  • The total quantity and/or tokenId to claim.
  • The proof of inclusion in the merkle root allowlist, if it exists.

Published by

Publisher avatar
View all contracts

Details

  • Publish Date

    Sep 26, 2024

  • Audit Report

    View Audit Report

  • Licenses

    Apache-2.0, MIT


  • Learn more about Publish