Contracts
Stylus Airdrop Contract
If you need to send tokens to thousands of wallets at once, you can leverage the Stylus Airdrop contracts.
Learn how to deploy Stylus Airdrop contracts through dashboard or CLI for inexpensive, WASM-powered distribution on Arbitrum chain.
- Ink, not gas: Stylus executes WASM thousands of times faster than the EVM, so sending 10 000 NFTs costs a fraction of normal gas.
- Rust Tooling: Cargo tests, Clippy lints, and the full crates ecosystem for your drop logic.
- Interoperability: Rust contracts call Solidity (and vice-versa) with zero wrappers.
- Battle-tested Logic: Template ports the same claim, snapshot & signature pattern used by thirdweb’s Solidity pre-built contracts.
Deploying a Stylus Airdrop contract is easy through the thirdweb dashboard and ideal when you don't want to modify any code on the contract.
Navigate to the Stylus Contracts section on Explore and select any Airdrop contract for your project.
Select Arbitrum Sepolia or any other Stylus-supported network, then select Deploy.
You can either upload a CSV file with the recipient addresses and amounts and select
Run Airdrop
Or set a claim condition for recipients to claim their tokens on their own.
If you want to modify the contract code or deploy a custom Airdrop contract, you can use the thirdweb CLI.
In your CLI, run the following command to create a new directory with an airdrop template contract.
In the
src/lib.rs
file you can modify the contract logic such as adding fees, gating logic, analytics events, and more.To build your project, run the following command:
You can publish and deploy your project to Arbitrum. Publishing stores your contract metadata in thirdweb’s on-chain registry so anyone (including you) can deploy that exact version later with a few clicks.
To publish your contract, ensure you have your thirdweb secret key from your created project, then run the following command:
If you'd prefer to just deploy a single instance of the contract without publishing, run the following command to deploy:
Once the transaction confirms, the CLI will redirect you to the contract management dashboard where you can mint, transfer, view events, or pull ready-made SDK snippets.
Using the thirdweb SDKs, you can interact with your Stylus Airdrop contract to mint tokens, transfer ownership, and more.
The following includes three common patterns using thirdweb TypeScript SDK:
When to use: you already have every recipient’s address and want to send everything in a single transaction.
(Swap for airdropERC20 or airdropERC1155 helpers as needed.)
When to use: you know the recipients but want them to claim the tokens at their convenience (gas paid by the claimer).
- Generate snapshot off-chain
merkleRoot is a single 32-byte value representing the whole list.
- Store root on-chain (_setMerkleRoot(root) in the template).
- Recipient claims:
When to use: you don’t know the full list ahead of time (e.g., quest rewards). An authorised backend signs a payload per user; the user submits it on-chain.
- Generate signed payload server-side:
- Recipient executes: