Initialize the contract
token - The token to distributedeadline - The deadline ledger sequence number of the distributionadmin - The admin of the contractAlreadyInitializedError - If the contract has already been initializedDeadlineError - If the deadline is not withing [30, 90] days of ledgers in the future
assuming 5s a ledgerfn 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
distributions - The distributions to setAlreadyFinalizedError - If the contract has already been finalizedfn set_distribution(
env: soroban_sdk::Env,
distributions: soroban_sdk::Vec<(soroban_sdk::Address, i128)>,
)
(Admin Only) Finalize the distribution
AlreadyFinalizedError - If the contract has already been finalizedfn finalize(env: soroban_sdk::Env)
(Admin Only) Set the admin of the contract
admin - The new admin of the contractfn set_admin(env: soroban_sdk::Env, admin: soroban_sdk::Address)
Claim the distribution
user - The user to claim the distribution forNotFinalizedError - If the contract has not been finalizedAlreadyClaimedError - If the user has already claimed their distributionDeadlineError - If the deadline has passedNoDistributionError - If the user has no distribution to claimfn claim(env: soroban_sdk::Env, user: soroban_sdk::Address) -> i128
Refund the remaining balance to the admin
DeadlineError - If the deadline has not passedfn refund(env: soroban_sdk::Env) -> i128