Distribute tokens to a list of addresses. The creator uploads recipients and amounts in batches, finalizes the airdrop, and recipients claim their allocations.
Token distribution events
Community rewards and incentives
Retroactive airdrops for early users
Creator initializes with token ID and total amount
Creator adds recipients in batches (up to 100 per batch)
Creator finalizes the airdrop
Recipients claim their individual allocations
Creator can reclaim any unclaimed tokens after finalization
Parameter Type Description token_idTokenIdToken to distribute total_amountu128Total tokens allocated for the airdrop
Method Parameters Description initializetoken_id, total_amountSet up the airdrop. Only callable once. add_recipientsrecipients: Vec<Allocation>Add a batch of recipients (max 100 per call). Creator only. finalize-- Lock in the recipient list. No more additions after this. claim-- Recipient claims their allocated tokens. Requires finalization. reclaim_remaining-- Creator reclaims unclaimed tokens after finalization.
Method Parameters Returns Description get_config-- AirdropConfigAirdrop configuration and progress get_allocationaddress: Addressu128Allocation amount for a specific address is_claimedaddress: AddressboolWhether an address has claimed their tokens
pub struct AirdropConfig {
pub creator : Address ,
pub token_id : TokenId ,
pub total_amount : u128 ,
pub claimed_amount : u128 ,
pub recipient_count : u64 ,
pub finalized : bool ,
pub created_at : u64 ,
}
pub struct Allocation {
pub address : Address ,
pub amount : u128 ,
}
# Deploy
norn wallet deploy-loom --name my-airdrop
# Upload bytecode
norn wallet upload-bytecode --loom-id < LOOM_I D > \
--bytecode airdrop.wasm
# Execute (borsh-encoded input)
norn wallet execute-loom --loom-id < LOOM_I D > --input < HE X >
# Query config
norn wallet query-loom --loom-id < LOOM_I D >