# Airdrop

# Why Airdrop?

Airdrop helps newly launched NRC-20 tokens to reach a large number of users and increase number of holders in short period of time, by engaging existing holders of another popular NRC-20 token such as NEAT.

To distribute airdrop to your target users, you should first register the airdrop, usually when the NRC-20 token is deployed, and ask users to claim airdrops via the airdrop contract later.

# Register Airdrop

Register airdrop from one token to another target token's holders. Try it out at Deploy page of NRC-20 Launchpad (opens new window)

# Requirements

The below requirements define an valid and effective airdrop.

  1. The target token must be 100% minted, such as NEAT.
  2. The target token must have at least 1,000,000 valid mint events and 1,000 holders. The condition makes sure the target token is a valid airdrop target with a large number of holders.
  3. The airdrop token must be already deployed first before registering airdrop.
  4. The current supply of airdrop token (the amount of token that is already minted) should not exceed 10% of its max supply, and the airdrop token must have no more than 500 holders. This ensures the minting participants are aware of the airdrop plan before its too late.
  5. The total amount of airdrop should be greater than 0 and not exceeds 50% of the airdrop token's max supply.
  6. Only the deployer of the token can register its airdrop.

# Examples

Deploy MILK token with 21,000,000 max supply (with 8 decimals) first.

{
    "p": "nrc-20",              // required
    "op": "deploy",             // required
    "tick": "milk",             // required
    "max": "2100000000000000",  // required
    "lim": "100000000",         // optional, no limit if not provided
    "dec": 8                    // optional, 0 if not provided
}

Register that 10% of MILK, i.e. 2,100,000 in total, will be airdropped to NEAT NRC-20 holders.

{
    "p": "nrc-20",              // required
    "op": "register_airdrop",   // required
    "tick": "milk",             // required
    "to": "neat",               // required
    "amt": "210000000000000",   // required
}

# Distribute Airdrop

The airdrop distribution is done via a public airdrop contract at airdrop.nrc-20.near, which allows creating airdrops, and claiming airdrops by users.

The airdrop distribution data will be calculated according to holders data from indexer, and inscribed to inscription.near by the distributor account distributor.nrc-20.near, with the distribute_airdrop operation. The inscribed airdrop distribution data can be queried from indexer.

# Example Operation

In this example, we'll distribute 2,100,000 MILK airdrops with ID 1 to 20,000 NEAT holders. The distribute_airdrop operation can be found below. As the number of airdrops is usually large, the distribution data will be split into chunks and inscribed by multiple distribute_airdrop operations. The inscribed airdrop amount, index and merkle proof can be used for calling claim function on airdrop.nrc-20.near contract.

  • id: a unique ID of the airdrop, same as the ID of the airdrop created on airdrop.nrc-20.near
  • root: the merkle root of the airdrop
  • num: the total number of receivers
  • end: the deadline timestamp of claiming airdrop. 0 meas no deadline. 1706745600000 represents UTC time 2024-02-01T00:00:00Z.
  • idx: the index of the airdrop data chunk, with the format of chunk_id/total_chunk. chunk_id starts from 1. If there're three chunks, the index for each chunk will be 1/3, 2/3 and 3/3.
  • data: an array of airdrop records. Each record contains the receiver account ID, token amount, index of the record, and the merkle proof.
{
    "p": "nrc-20",              // required
    "op": "distribute_airdrop", // required
    "tick": "milk",             // required
    "to": "neat",               // required
    "amt": "210000000000000",   // required
    "id": "1",                  // required
    "root": "b53...9f7",        // required
    "num": 20000,               // required
    "end": 1706745600000,       // optional, 0 (no deadline) if not provided
    "idx": "1/2",               // required
    "data": [                   // required
        {
            "to:": "alice.near",
            "amt": "1000000000000",
            "idx": 0,
            "prf": [
                "2f8...b0c",
                "468...226",
                "049...489",
            ]
        },
        {
            "to:": "bob.near",
            "amt": "1250000000000",
            "idx": 1,
            "prf": [
                "1c5...c1e",
                "57b...8b9",
                "790...920",
            ]
        },
        // ...
    ],
}

# Example Workflow

Assume the airdropped NRC-20 token is MILK, and the airdrop target NRC-20 token is NEAT.

  1. In the register_airdrop operation, the total airdrop amount of MILK (2,100,000 in above example) will be minted to the public airdrop contract airdrop.nrc-20.near.
  2. The airdrop amount of MILK for each user will be calculated according to NEAT holders' balances at one given timestamp (usually at the timestamp when MILK is deployed). The merkle root of airdrop amounts will be added to the airdrop contract airdrop.nrc-20.near by NEAT DAO. The distribution data will be inscribed with distribute_airdrop operation, and queryable from indexer.
  3. Airdrop receivers can claim airdrops with claim function in the airdrop contract, which will transfer MILK from the airdrop contract to receiver's account by transfer inscription.