DropAllowanceERC20

Airdrop ERC1155 NFTsThe Token Allowance Drop is an extended version of the Token Drop contract that allows users to set the token they want to sell. to a list of recipients.

The DropAllowanceERC20 contract is an extended version of the standard DropERC20 contract, allowing users to set the ERC-20 token they want to sell. This contract works with any ERC-20 token that uses 18 decimals and enables a presale or public sale flow where the token owner gives the contract an allowance, and buyers can claim tokens under predefined conditions.

Key Features

  • Custom Token Support – Unlike fixed-token drops, this version allows you to specify which ERC-20 token you want to sell at deployment.

  • Allowance-Based Sale – The contract does not hold your tokens directly. Instead, the token owner must grant allowance to the contract so it can transfer tokens to buyers upon claim.

  • Standard ERC-20 Compliance – Works with any ERC-20 token that has 18 decimals.

  • Thirdweb Integration – Fully compatible with Thirdweb SDK, allowing you to set claim conditions, price, and distribution parameters from the dashboard or via code.

  • Ownership Flexibility – You can define a Token Owner different from the deployer, enabling multi-party setups.

Use Cases

  • Token presales where you don’t want to transfer custody of tokens before the sale.

  • Community reward campaigns using existing ERC-20 tokens.

  • Controlled distributions where the seller can revoke allowance at any time.

  • Private or public drops using custom claim conditions.

Deploying this contract

How It Works

  1. Deployment When deploying the contract, you will provide:

    • Token Address – The ERC-20 token contract address to be sold.

    • Token Owner – The wallet address that currently holds the tokens.

    • Sale Recipient – The wallet address that will receive the payment from token sales.

  2. Granting Allowance Before any claims can occur, the Token Owner must call the approve() function on the token contract, granting allowance to the DropAllowanceERC20 contract for the amount they want to sell.

  3. Setting Claim Conditions Through the dashboard or SDK, you can set:

    • Price per token

    • Sale start. End date will finish when supply is totally claimed or another phase is created.

    • Wallet purchase limits

    • Any other claim restrictions

  4. Token Claiming When a user claims tokens, the contract transfers the tokens directly from the Token Owner’s wallet to the buyer, deducting from the granted allowance.

Deployment Parameters

Field
Description

Name

The display name for your drop (used for dashboard display).

Symbol

Token symbol for reference purposes.

Description

Rich-text or markdown description of your token drop.

Image

Optional logo/image to represent your token sale.

Token Address

ERC-20 token contract address you want to sell. Must have 18 decimals.

Token Owner

Address from which the tokens will be transferred during claims. Must approve this contract to spend the tokens.

Sale Recipient

Address that will receive payment from token sales.

Example Flow

  1. Deploy DropAllowanceERC20 with your token address, token owner address, and sale recipient address.

  2. Token Owner runs approve(contractAddress, amount) on the ERC-20 token contract.

  3. Set your claim conditions via the dashboard or programmatically.

  4. Buyers claim tokens according to your rules.

  5. The contract automatically transfers tokens from the token owner to buyers until allowance runs out or conditions expire.

Claim Conditions

The Token Allowance Drop supports the same claim condition settings as the regular Token Drop:

  • Start time

  • Maximum quantity per transaction

  • Claim phases

  • Whitelist settings

  • Payment token configuration (native token or ERC20)

You can set and manage claim conditions via the dashboard after deployment.

Notes & Best Practices

  1. Ensure your ERC-20 token uses 18 decimals—other configurations are not supported.

  2. The Token Owner must maintain enough token balance and allowance for claims to succeed.

  3. Allowance can be increased or decreased at any time to control sale supply.

  4. Use a secure wallet for the Token Owner address—anyone with its private key can change allowances or transfer tokens directly.

Last updated