Contract 65e6fa754cc1edbbe365c69d8b86be71666329a8283b5305ac34efafdbfd28cd

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.8#f46e9e0610213bbb72285566f9dd960ff96d03d8
rsver 1.87.0

Instances

  • CAAIXJXO5TXGJUMKCFAYGQRJDHWP2CSOXER3JRJ637XBTIBXV74JAROT
  • CB4AFNUGNKQ23HLM3S5IXPHOKECP3PKLI76JRIZNS5TMPIN44PSXKGWD
  • CBREDUXMVT6F2TAJNWEWGTXESJQFXQLVF6UFBAUKWY5XKAO54WSFCSGI
  • CBVRWU7TNIUSMMT3SML2IY3W6KZIFTWB3OKND7COHI6YQ27WWF23DRJQ
  • CC6TRVRZRRXL3J4LS3ECUTAYV7KALOIXPNRURPG27VNY5PJS24LFVFOM
  • CC7OWECVZFUAP5RXARYJT3YBT2KGA2PF4FG25ZRFQYRXTOTM7NAVKU3F
  • CCQG4EULGZXL7UPD66UNRCYPYBK3DHB7I6FZ3JO7MIZY5BJY3UT5JBY6
  • CDLNEUAP7NA7LYISK3Q5KBVU5E7HU4A36KNDERJMMBYN3HK43EPUHBEK
  • CDVQHPPVDFYQMXTFFMPWPDZKTQAHDSX5WMULJRV5US56JNV33VXVZECF

Interface

Initializes the contract with the root hash of the Merkle tree, the token address, the funding amount, and the funding source address.

Arguments:

  • 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.

Arguments:

  • e - The Soroban environment.
fn is_ended(env: soroban_sdk::Env) -> bool

Returns whether an index has been claimed.

Arguments:

  • 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.

Arguments:

  • 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.

Arguments:

  • e - The Soroban environment.
fn recover_unclaimed(env: soroban_sdk::Env)

Imports

WebAssembly Text (WAT) ▶