Initializes the contract with the root hash of the Merkle tree, the token address, the funding amount, and the funding source address.
e - The Soroban environment.root_hash - The root hash of the Merkle tree.token - The address of the token to be distributed.admin - The address of the admin who will manage the airdrop.funder - The address where the recover_unclaimed function deposits the remaining balance.fn __constructor(
env: soroban_sdk::Env,
root_hash: soroban_sdk::BytesN<32>,
token: soroban_sdk::Address,
admin: soroban_sdk::Address,
funder: soroban_sdk::Address,
)
Returns whether the airdrop has ended.
e - The Soroban environment.fn is_ended(env: soroban_sdk::Env) -> bool
Returns whether an index has been claimed.
e - The Soroban environment.index - The index of the claim in the Merkle tree.fn is_claimed(env: soroban_sdk::Env, index: u32) -> bool
Claims the airdrop for a given index, transferring the specified amount of tokens to the receiver.
e - The Soroban environment.index - The index of the claim in the Merkle tree.receiver - The address of the receiver who will receive the tokens.amount - The amount of tokens to be claimed.proof - The Merkle proof that verifies the claim.fn claim(
env: soroban_sdk::Env,
index: u32,
receiver: soroban_sdk::Address,
amount: i128,
proof: soroban_sdk::Vec>,
)
Recovers any unclaimed tokens from the contract back to the funder and disables further claims.
e - The Soroban environment.fn recover_unclaimed(env: soroban_sdk::Env)