Contract 3a6d44112220f9ff6ccaa301f67f5c1fddb0f224401de4f29b4fca1e046e56b5

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.11#34f7f53ae31e0fd02aab436a9872e79fa671ca02
rsver 1.96.1

Instances

  • CCQB2LMR3JB6BMUKLDUNU3MBL74KO54Z76SG5KRI6OZWWHWH5BXRIT6L

Interface

Unsubscribe. Claim accrued rewards before cancelling or they are forfeited.

fn cancel(env: soroban_sdk::Env, subscriber: soroban_sdk::Address)
fn claimable(env: soroban_sdk::Env, subscriber: soroban_sdk::Address) -> i128

Pay the default/Basic monthly fee and start the subscription (legacy).

fn subscribe(env: soroban_sdk::Env, subscriber: soroban_sdk::Address)

Returns (basic, pro, elite) fees in Zi stroops.

fn tier_fees(env: soroban_sdk::Env) -> (i128, i128, i128)

Deploy once. epoch_ledgers is the key testability knob:

  • Pass 12 for ~60-second "months" on testnet.
  • Pass 518_400 for real 30-day months on mainnet.

monthly_fee_zi is the legacy default fee (also used as Basic if tier fees are not customized later).

fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    zi_token: soroban_sdk::Address,
    epoch_ledgers: u32,
    monthly_fee_zi: i128,
)
fn monthly_fee(env: soroban_sdk::Env) -> i128

Claim all pending rewards (50 % of fee_in_zi × epochs elapsed since last claim). Rewards are sent to payout_address if set, otherwise back to subscriber.

fn claim_reward(env: soroban_sdk::Env, subscriber: soroban_sdk::Address) -> i128

Load Zi tokens into the contract so it can pay rewards.

fn fund_reserve(env: soroban_sdk::Env, from: soroban_sdk::Address, amount: i128)
fn epoch_ledgers(env: soroban_sdk::Env) -> u32

Set tiered on-chain fees (Zi stroops). Cashback per full epoch = fee/2. Reference sizing at $1/Zi ≈ USD monthly plan fees: Basic 15 Zi, Pro 29 Zi, Elite 99 Zi.

fn set_tier_fees(env: soroban_sdk::Env, basic: i128, pro: i128, elite: i128)

Subscribe at a membership tier fee (0=Basic, 1=Pro, 2=Elite).

fn subscribe_tier(env: soroban_sdk::Env, subscriber: soroban_sdk::Address, tier: u32)
fn set_monthly_fee(env: soroban_sdk::Env, monthly_fee_zi: i128)
fn get_subscription(
    env: soroban_sdk::Env,
    subscriber: soroban_sdk::Address,
) -> Option

Switch between test mode (e.g. 12) and production mode (518_400).

fn set_epoch_ledgers(env: soroban_sdk::Env, epoch_ledgers: u32)

Admin push-payout: claim accrued rewards for a subscriber without their signature. Enables monthly automated distribution jobs.

fn admin_claim_reward(env: soroban_sdk::Env, subscriber: soroban_sdk::Address) -> i128

Update (or clear) the payout address for reward claims. Pass None to revert to the subscriber's own address.

fn set_payout_address(
    env: soroban_sdk::Env,
    subscriber: soroban_sdk::Address,
    payout: Option,
)

Subscribe with an explicit fee in Zi stroops (must match a configured tier fee or the legacy monthly fee — prevents arbitrary underpayment).

fn subscribe_with_fee(
    env: soroban_sdk::Env,
    subscriber: soroban_sdk::Address,
    fee: i128,
)

Imports

WebAssembly Text (WAT) ▶