Airdrop contract development with Merkle distributor

Mass token distribution breaks under peak load: some addresses do not receive a payout, and the team spends weeks reconciling lists manually. We develop an airdrop smart contract with batch distribution and take the project turnkey — from the distribution scheme to recipient verification. Distribution to tens of thousands of addresses runs without failures, and payout costs stop growing.

Blockchain Development Services

Frequently Asked Questions

Latest works

  • Development of a web application for FEEDME
    Development of a web application for FEEDME
    1375
  • Development of an online store for the company FURNORO
    Development of an online store for the company FURNORO
    1349
  • B2B Advance company logo design
    B2B Advance company logo design
    794
  • Development of a web application for Enviok
    Development of a web application for Enviok
    1087
  • AIDER company logo development
    AIDER company logo development
    1032
  • CRM development for Chasseurs
    CRM development for Chasseurs
    1129

Why an airdrop smart contract breaks on mass payouts

A mass token distribution is not a single transaction but tens of thousands of calls to the airdrop smart contract, and the sender pays for every extra call.

When distribution is built “head-on” — with a loop over the entire recipient list inside a single call on Ethereum — the contract hits the block limit: some addresses go through, some revert, and the state remains incomplete.

Then the human factor comes into play. Errors in the recipient list — duplicates, missing addresses, amounts with the wrong precision — surface only after publication, when fixing them requires a separate distributor and another reconciliation.

Manual transactions turn mass token payouts into a multi-hour operation: a broken nonce order, signatures stuck in the mempool, payouts that cannot be reproduced from the log.

A separate class of failures is unrevoked minting rights. If an emitting contract retains an active key, whoever gains access to it mints additional tokens after the distribution and zeroes out the calculated share of every participant. What breaks here is not the transfer mechanics but the economics of the entire campaign.

All three failures are about distribution architecture, not the operator’s attentiveness. We break down how this is closed at the level of the contract, the recipient list, and permission separation.

What changes after switching to batch payouts

After switching to batch payouts, an airdrop stops being a series of transfers and becomes a single root published in the smart contract. Each participant independently calls the contract and presents proof — a Merkle tree branch leading to their leaf.

The contract verifies the branch against the root and only then transfers the tokens: distribution time no longer depends on list length because payouts run in parallel and do not block each other.

The double-payout class is closed at the level of the verification itself.

A leaf is assembled from the address and amount, and the fact of receipt is recorded by a separate state flag; a repeated call with the same branch does not pass, even if the participant selects the wrong network or sends the transaction twice.

Manual reconciliations in “who has already received” spreadsheets go away — the share of manual operations drops to preparing the list and publishing the root.

Transaction execution costs stop growing linearly with the number of recipients. The project pays for one root publication, and participants cover the rest; when conditions change, only the contract state changes, not the entire address list.

Separately, before launch, we lock down the claim deadlines, the fate of unclaimed amounts, and the right to pause. These parameters determine how the distribution ends — as a predictable tree-based distribution or as a backlog of support requests.

Token distribution options: comparison of approaches

The distribution scheme is chosen not by appearance but by three things: what load falls on the network, how many transactions must be signed, and how easy it is to fix or revoke a round.

We additionally check each option for compatibility with an already issued token, with recipients’ wallet contracts, and with exchange addresses to which the token moves further.

Option When it fits Limitations
Batch distribution via a Merkle tree The recipient list is large, amounts are known in advance The tree root plus proofs for each address are stored; changing any amount requires recalculating the root
Line-by-line transfers in a loop The list is within dozens of addresses Network load grows linearly, a batch stops fitting into a block, and a revert cancels the entire transaction
A single distribution contract Scheduled issuance, with lockup periods and repeat rounds Funds sit in the contract; pause logic and emergency withdrawal are needed
Distribution in parts, in epochs The issuance needs to be stretched over time More transactions and accounting; the recipient sees several accruals
Direct minting of new tokens A token without a fixed issuance cap, full control is needed Changes the declared tokenomics and fares poorly in an audit before listing

Line-by-line transfers and direct minting look simplest exactly until the first large list: a loop over an array of addresses quickly hits the block limit, and minting tokens “on the fly” diverges from what is recorded in the tokenomics.

A single distribution contract solves the scheduling issue but takes funds under its own logic, so it is separately tested for pause, role revocation, and residual withdrawal scenarios — otherwise the distribution turns into an uncontrolled storage.

Stages of implementing a distribution contract

The work order is structured so that by the time the contract is published on the mainnet, no figure raises questions. We start with an audit of the distribution scheme — the source of recipient data, accrual rules, limits, and protection against repeat claims. Each stage ends with an artifact that can be verified independently.

  1. Distribution scheme audit. We reconcile the source of recipient data with the accrual rules, record discrepancies and edge cases. The output is agreed logic and a list of risks that would break the distribution.

  2. Design of the list and structure. From the export, we assemble a Merkle hash tree: remove duplicates and zero addresses, and check amount rounding. Each recipient receives an inclusion proof, and the tree root is fixed in the contract.

  3. Contract configuration. We set the distribution window, the claim fee, the ability to pause, and permission separation. We separately verify that the same amount cannot be claimed twice.

  4. Verification of distribution correctness. We reconcile the calculated amounts with the source data down to the last unit: a rounding error at this step is more costly than any code error.

  5. Testnet. We deploy the contract, run the full recipient list, and check edge cases — a repeat claim, someone else’s proof, a closed window. We observe behavior under mass requests.

  6. Migration to mainnet. We publish the contract with the same parameters that passed verification, enter the tree root, and transfer admin rights to the client.

  7. Handover of the contract to the client. We provide the source code, addresses, distribution instructions, and the procedure for disputed situations.

What is handed over to the client: configurations, schemes, policies

The package is handed over not “verbally”: each artifact has a recorded owner and update procedure. The client can run the next token distribution with their own team or hand support to another contractor without reverse engineering.

  • Source code of the contract and data-preparation scripts — with checksums and instructions for reproducible builds from a clean environment.
  • Distribution configuration: the list of addresses and amounts, the Merkle tree root, the token claim window, and per-address limits.
  • Distribution schemes: where the balance snapshot comes from, how category weights are calculated, and how the absence of duplicates and “dead” addresses is verified.
  • Key access policies: separation of admin and operator roles, multisignature requirements, and the procedure for rotating and storing keys outside the repository.
  • Payout policy: handling of unclaimed tokens after the window closes, actions for disputed addresses and erroneous recipients.
  • Contract documentation: purpose of functions and events, error codes, invariants checked by tests.
  • Repeat distribution launch policy: step-by-step procedure — new snapshot, tree rebuild, root update, testnet run, publication.

Each item is tied to a role: what the client does independently, where our team is needed, and where an on-call support engineer is sufficient.

Case study: distribution to tens of thousands of addresses without failures

The project launched a token distribution to 38,000 addresses after changing its rewards model. The first round was done manually: lists were consolidated in a spreadsheet, transactions were sent in batches of 200 addresses, and balances were reconciled between batches.

This took about two days of engineer time, and roughly every fourteenth address either received a payout twice or did not receive one at all — the discrepancy surfaced only through support requests.

We moved the logic into a distributor on a Merkle tree: the list of participants and amounts is hashed into a tree, only the root goes into the contract, and the participant calls the claim themselves and presents an inclusion proof.

A repeat call, someone else’s address, and a changed amount are cut off by verification, not by policy.

Round preparation shrank from two days to three hours: the engineer assembles the list, computes the tree, and publishes the root with a single call.

The share of erroneous accruals went from 7% to zero — double payouts and omissions became impossible by construction, not by operator attentiveness.

Support requests on the topic of “the payout did not arrive” dropped by an order of magnitude: claim status is visible in the contract, not in a chat.

The template withstood four more distribution rounds: only the list changed, the code remained the same.

The participant covers the transaction fee themselves, so the distribution does not depend on the balance in a single wallet, and the class of failures where “some addresses were left without a payout” disappeared completely.

How does a batch airdrop differ from line-by-line payouts?

Both schemes produce the same result — tokens in participants’ wallets — but behave differently under load. The difference is visible along two axes: how many transactions go to the network and how easy it is to prove distribution correctness.

In a Merkle Distributor, the list is collapsed into a single tree root published in the contract.

The recipient calls the contract themselves and presents proof of their branch — the network processes as many transactions as people came to claim, not as many addresses as are in the list. Verifiability is maximal: the tree is rebuilt from the published file and checked against the root.

Line-by-line payouts are a loop of sends: a separate transaction and storage write for each address.

On a list of thousands of addresses, issuance stretches out: early recipients see the balance immediately, later ones after hours, and all that time the contract remains a single point of failure. On the other hand, the participant does not need to do anything themselves.

Option When it fits Limitations
Batch airdrop by tree root Lists from hundreds of addresses, public verifiability is needed The root is immutable; changes require a new round
Line-by-line payouts from the contract A short list; recipients do not do anything themselves As many transactions as addresses
Batch round plus additional issuance The main list and disputed addresses separately Two accounting contours; reconciliation is more complex

Edits after launch are the main divergence. The root is immutable, so an error in an address or amount is closed by a second round with a new root.

In the line-by-line scheme, the list is edited before the first payout, but a transaction that has already gone out cannot be canceled — the fix is issued as a separate transfer.

Technical concerns before launching a token distribution

Before publishing the tree root, the team has a dozen questions that are not visible in a demo: a typo in an address, a repeat round, confirmation of the right to a payout, and key access. We work through them before launch — they surface most often during acceptance.

What to do about a typo in a recipient address?

Some typos are filtered out by checksum validation, but not all — the list goes through normalization, deduplication, and reconciliation with the source export. Then we lock it with a hash: edits after root publication are made through a new round.

How will a repeat round work, and will there be a double payout?

A leaf has a payout flag, and a repeat call is canceled at the contract level. A new round gets its own root, old leaves do not enter it, and the remainder is transferred by a separate operation.

How does a recipient verify their right to a payout?

The proof is calculated from the pair “address and amount” and checked against the published root. We run the check locally before launch: if a participant from the sample does not pass, the distribution does not start.

Who retains access to the keys?

The admin key can withdraw the pool remainder, so it is not stored by one person. Management is through a multisignature with several holders and execution delay: a suspicious operation is visible and can be canceled.

Let’s discuss the task: we will review your distribution scheme

To come back with an estimate and a plan rather than generalities, we need a minimum of inputs. We collect them in one list — if some data is not yet locked down, we mark it as an open question and bring it out as a separate stage.

  • network and token standard: where the contract is deployed, whether transfers with side calls are supported, and who holds minting rights;
  • balance snapshot: the block and moment by which participants are calculated, and the rules for filtering out bots and duplicate addresses;
  • recipient list: size range, amount distribution, whether a waiting period and gradual unlocking are needed;
  • roles and access: who holds the admin multisignature, whether a timelock and revocation of rights after distribution are needed;
  • claim mechanics: one round or several, whether the pool can be topped up and the accrual tree changed between rounds;
  • load: how many calls to the contract will arrive in the first hours and who absorbs the peak;
  • acceptance: who on the client side confirms the correctness of accruals.

Next, we assemble a work plan: design of the accrual rules and tree, development and verification, a test distribution on a limited set of addresses, an audit, then launch.

The distribution proceeds in stages — first a small pool, then the main one, so that the peak of requests does not overload the network and there is room for rollback.

Handover for support is a separate stage, not a formality: we provide configurations, the rights and multisignature scheme, the procedure for updating the tree for a new round, instructions for topping up the pool, and an incident response policy.

Describe the task — we will come back with an estimate and a launch plan where each item corresponds to a stage and an owner.