BIO
  • Introduction
    • Overview
    • Concepts
      • Decentralized Science
      • Bio Protocol
      • BioDAOs
        • Operations
        • Deal Flow Process
      • BioAgents
      • IP-Tokens
    • Bio Protocol V1
      • Launchpad
        • Curation
        • Funding
          • Auction
          • Bonding Curve
      • Liquidity Engine
      • bio/acc Rewards
      • BioAgents
    • BIO Token
  • Quick Start Guides
    • Join BioDAO Launches
      • Curate
      • Fund
      • Bridge BIO
      • Provide Liquidity
    • Start a BioDAO
    • Run BioAgents
  • Developers
    • DAO Setup
      • EVM Contracts
        • Token Contract
        • Vesting Contracts
        • Airdrop Contracts
      • Solana Programs
    • Launchpad
      • EVM Contracts
      • Solana Programs
    • Utils
      • TokenLists
      • Scripts
    • Audits
  • Resources
    • Media Kit
      • Bio Media
      • Network Media
    • Terms & Conditions
      • Airdrop: Terms & Conditions
      • BIO Genesis: Terms & Conditions
      • Launchpad: Terms & Conditions
  • Audits
Powered by GitBook
On this page
  • Key Features
  • MerkleAirdrop Contract
  1. Developers
  2. DAO Setup
  3. EVM Contracts

Airdrop Contracts

PreviousVesting ContractsNextSolana Programs

Last updated 1 month ago

Key Features

  • ERC20 Token Distribution: Supports airdropping any ERC20 token

  • Merkle Proof Verification: Uses cryptographic proofs to verify claim eligibility

  • Gas Efficient: Only stores one Merkle root instead of all user data

  • Claim Tracking: Prevents double-claiming by maintaining a record of claimed addresses

  • Owner Controls: Allows the owner to update the Merkle root and withdraw unclaimed tokens

MerkleAirdrop Contract

A contract that implements a Merkle tree–based airdrop for ERC20 tokens with controlled claim processing and robust admin management.

Features

  • Merkle Tree Eligibility:

    • Utilizes a stored Merkle root to verify if an address is eligible for the airdrop.

    • The inMerkle() function checks a user's address and claim amount against the Merkle proof.

  • Claiming Process:

    • Users can claim tokens via the claim() function if they are eligible.

    • Prevents double claims by tracking claims in a mapping.

    • Emits a Claimed event on successful claims.

  • Admin Controls:

    • The owner can update the Merkle root using the updateMerkleRoot() function.

    • Allows the owner to withdraw tokens from the contract with the withdraw() function.

Inheritance

  • ReentrancyGuard: Provides protection against reentrancy attacks on critical functions.

  • Ownable: Restricts sensitive functions to the contract owner.

Key Functions

  • claim(uint256 amount, bytes32[] calldata proof): Allows eligible users to claim their tokens if their Merkle proof is valid.

  • inMerkle(address who, uint256 amount, bytes32[] calldata proof): Verifies that the address and claim amount are part of the Merkle tree.

  • hasClaimed(address who): Checks whether an address has already claimed the airdrop.

  • updateMerkleRoot(bytes32 _root): Enables the owner to update the Merkle root to adjust eligibility.

  • withdraw(address recipient, uint256 amount): Allows the owner to withdraw tokens from the contract if needed.

Security Features

  • Reentrancy Protection: Critical functions (like claim()) are secured against reentrant calls.

  • Safe Transfers: Utilizes the SafeERC20 library to ensure secure token transfers.

  • Access Control: Owner-only functions safeguard administrative tasks such as updating the Merkle root and withdrawing tokens.

GitHub - bio-xyz/airdrop-contractsGitHub
Logo