Contract 500291974b3a223677e260b060d96d4e2e3a97d43117096dd0fa5ae8fe5474eb

← Back to Index 📥 Download WASM

Meta

rssdkver 20.5.0#9e2c3022b4355b224a7a814e13ba51761eeb14bb
rsver 1.74.1

Instances

  • CALXP6SSECNUGNB2UHENQ7NVRC23NT5FLXOP7PTVZOJRK4XD2SARJBXW
  • CCBEUM4M4PY32DFVO7SJNR43FELS4PX3KYASIWBV7UHE6SSAZI7SRLGX

Interface

Initialize the contract

Arguments

  • token - The token to distribute
  • deadline - The deadline ledger sequence number of the distribution
  • admin - The admin of the contract

Panics

  • AlreadyInitializedError - If the contract has already been initialized
  • DeadlineError - If the deadline is not withing [30, 90] days of ledgers in the future assuming 5s a ledger
fn initialize(
    env: soroban_sdk::Env,
    token: soroban_sdk::Address,
    deadline: u32,
    admin: soroban_sdk::Address,
)

Fetch it a user has claimed their distribution

fn get_claimed(env: soroban_sdk::Env, user: soroban_sdk::Address) -> bool

Fetch the deadline ledger sequence for the distribution

fn get_deadline(env: soroban_sdk::Env) -> u32

Fetch the admin of the contract

fn get_admin(env: soroban_sdk::Env) -> soroban_sdk::Address

Fetch the token being distributed

fn get_token(env: soroban_sdk::Env) -> soroban_sdk::Address

(Admin Only) Set the distribution for users

Arguments

  • distributions - The distributions to set

Panics

  • AlreadyFinalizedError - If the contract has already been finalized
fn set_distribution(
    env: soroban_sdk::Env,
    distributions: soroban_sdk::Vec<(soroban_sdk::Address, i128)>,
)

(Admin Only) Finalize the distribution

Panics

  • AlreadyFinalizedError - If the contract has already been finalized
fn finalize(env: soroban_sdk::Env)

(Admin Only) Set the admin of the contract

Arguments

  • admin - The new admin of the contract
fn set_admin(env: soroban_sdk::Env, admin: soroban_sdk::Address)

Claim the distribution

Arguments

  • user - The user to claim the distribution for

Panics

  • NotFinalizedError - If the contract has not been finalized
  • AlreadyClaimedError - If the user has already claimed their distribution
  • DeadlineError - If the deadline has passed
  • NoDistributionError - If the user has no distribution to claim
fn claim(env: soroban_sdk::Env, user: soroban_sdk::Address) -> i128

Refund the remaining balance to the admin

Panics

  • DeadlineError - If the deadline has not passed
fn refund(env: soroban_sdk::Env) -> i128

Imports

WebAssembly Text (WAT) ▶