Contract afbdd28741b14906948bdb6d95c90393c63b51b7e5b9e09a64196316992c5f5c

← Back to Index 📥 Download WASM

Meta

cliver 25.2.0#28484880988199233a7e8e87c97cb12dac323cb3
home_domain m0.org
rssdk_spec_shaking 2
rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.94.0
source_repo github:m0-foundation/stellar-minter-gateway

Instances

  • CD7LJGITEYTOAVKH3PPAVOBWXLMMFGK3NN5W4QAXFJLNSNS4R46TW562

Interface

Burns SAC tokens from an account and updates accumulators. Minter only.

fn burn(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    from: soroban_sdk::Address,
    amount: i128,
) -> Result<(), MinterGatewayError>

Mints SAC tokens directly to the recipient and updates accumulators. Minter only.

fn mint(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
) -> Result<(), MinterGatewayError>

Returns the admin address.

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

Pauses the contract. Blocks mint, burn, claim_yield, set_interest_rate; compliance ops (block_user, unblock_user, force_transfer, reconcile_burn) stay live. Pauser only.

fn pause(env: soroban_sdk::Env, caller: soroban_sdk::Address)

Returns the minter address.

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

Returns true if the contract is currently paused.

fn paused(env: soroban_sdk::Env) -> bool

Returns the SAC token balance for the given address. Delegates to the underlying SAC — balances live on the SAC, not here.

fn balance(env: soroban_sdk::Env, id: soroban_sdk::Address) -> i128

Returns whether the given account is blocked. Matches stellar_tokens::fungible::blocklist::FungibleBlockList::blocked — true means the account is blocked (SAC-unauthorized). Untouched accounts return true because the SAC issuer uses AUTH_REQUIRED.

The SAC's authorized host function traps (not returns false) when the account has no classic trustline for the asset — so a naive !authorized(account) would make blocked() unusable for onboarding pre-flight checks. We catch that trap via try_authorized and treat any non-success outcome as "blocked": without a trustline there is no authorization state, so denying is the safe and truthful answer.

fn blocked(env: soroban_sdk::Env, account: soroban_sdk::Address) -> bool

Unpauses the contract, resuming all blocked operations. Pauser only.

fn unpause(env: soroban_sdk::Env, caller: soroban_sdk::Address)

Upgrades the contract WASM to a new version. Admin only. The new WASM must already be uploaded to the ledger. Storage is preserved — a separate migrate() call may be needed if the new version changes the storage schema.

fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)

Returns whether addr has pause permission.

fn is_pauser(env: soroban_sdk::Env, addr: soroban_sdk::Address) -> bool

Returns the SAC token address this contract administers.

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

Transfers admin role to a new address. Current admin only.

fn set_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)

Grants pause permission to addr. Admin only. Idempotent: silent no-op (no event) if the address is already a pauser.

fn add_pauser(env: soroban_sdk::Env, addr: soroban_sdk::Address)

Places user on the compliance block list and revokes their SAC authorization. Block operator only. Idempotent: silent no-op (no event) if the user is already on the block list.

fn block_user(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    operator: soroban_sdk::Address,
) -> Result<(), MinterGatewayError>

Sets a new minter address. Admin only.

fn set_minter(env: soroban_sdk::Env, new_minter: soroban_sdk::Address)

Claims accrued yield by minting new SAC tokens to the yield recipient. Yield recipient manager only. Returns the amount of yield claimed.

Note: Claimed yield is NOT added to principal — it does not earn more yield. Tokens are always minted to the yield recipient, regardless of who calls.

fn claim_yield(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
) -> Result

Returns whether account has ever been explicitly activated by an onboarder.

fn is_onboarded(env: soroban_sdk::Env, account: soroban_sdk::Address) -> bool

Returns whether addr has onboard permission.

fn is_onboarder(env: soroban_sdk::Env, addr: soroban_sdk::Address) -> bool

Returns the latest stored index (from last update).

fn latest_index(env: soroban_sdk::Env) -> i128

Activates user by granting SAC authorization and recording them in the Onboarded set. Returns UserBlockedError if the user is on the compliance block list, even if already onboarded.

For already-onboarded users this re-asserts SAC authorization without re-emitting user_onboarded: deleting and recreating a trustline resets SAC auth to unauthorized, and this is the sanctioned path to restore it (the SAC's own set_authorized event records the re-authorization). Onboarder only.

fn onboard_user(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    operator: soroban_sdk::Address,
) -> Result<(), MinterGatewayError>

Returns the total_supply (principal + cumulative claimed yield).

fn total_supply(env: soroban_sdk::Env) -> i128

Removes user from the compliance block list. Restores SAC authorization only if the user has previously been onboarded. Unblock operator only. Idempotent: silent no-op (no event) if the user is not on the block list.

fn unblock_user(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    operator: soroban_sdk::Address,
) -> Result<(), MinterGatewayError>

Initializes the SAC admin yield token contract.

Arguments

  • sac_token - Address of the SAC token contract this contract administers
  • admin - Top-level authority address
  • minter - Address that can mint/burn tokens and set rate
  • yield_recipient_manager - Address that can set the yield recipient
  • yield_recipient - Address that receives claimed yield (passive — claim_yield is gated by yield_recipient_manager)
  • forced_transfer_manager - Address that can authorize accounts and transfer tokens
  • block_operator - Initial address with block permission; added to the block-operator set. More addresses can be granted via add_block_operator.
  • unblock_operator - Initial address with unblock permission; added to the unblock-operator set. More addresses can be granted via add_unblock_operator. May equal block_operator.
  • pauser - Initial address with pause permission; added to the pauser set. More addresses can be granted via add_pauser.
  • onboarder - Initial address with onboard pe
fn __constructor(
    env: soroban_sdk::Env,
    sac_token: soroban_sdk::Address,
    admin: soroban_sdk::Address,
    minter: soroban_sdk::Address,
    yield_recipient_manager: soroban_sdk::Address,
    yield_recipient: soroban_sdk::Address,
    forced_transfer_manager: soroban_sdk::Address,
    block_operator: soroban_sdk::Address,
    unblock_operator: soroban_sdk::Address,
    pauser: soroban_sdk::Address,
    onboarder: soroban_sdk::Address,
) -> Result<(), MinterGatewayError>

Returns the current accrued yield available to claim.

fn accrued_yield(env: soroban_sdk::Env) -> i128

Grants onboard permission to addr. Admin only. Idempotent: silent no-op (no event) if the address is already an onboarder.

fn add_onboarder(env: soroban_sdk::Env, addr: soroban_sdk::Address)

Returns the current index (real-time, includes pending growth).

fn current_index(env: soroban_sdk::Env) -> i128

Returns the current interest rate in basis points.

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

Revokes pause permission from addr. Admin only. Idempotent: silent no-op (no event) if the address does not have pause permission.

fn remove_pauser(env: soroban_sdk::Env, addr: soroban_sdk::Address)

Forces a transfer of SAC tokens between accounts (clawback + mint). Forced transfer manager only. Does not require source authorization. Accumulators are not touched — supply is unchanged.

Not pause-gated: a compliance primitive must stay executable during a pause, alongside block_user / unblock_user.

fn force_transfer(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
) -> Result<(), MinterGatewayError>

Reconciles accumulators after tokens are destroyed by sending to the SAC issuer. Decreases both accumulators to reflect the reduced supply. Admin only — this is a reconciliation action, not normal operations.

fn reconcile_burn(
    env: soroban_sdk::Env,
    amount: i128,
) -> Result<(), MinterGatewayError>

Returns the total_principal (yield-earning base). This is the sum of mints minus burns, excluding claimed yield.

fn total_principal(env: soroban_sdk::Env) -> i128

Returns the yield recipient address.

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

Returns whether account is on the contract-level compliance block list.

fn is_on_block_list(env: soroban_sdk::Env, account: soroban_sdk::Address) -> bool

Revokes onboard permission from addr. Admin only. Idempotent: silent no-op (no event) if the address does not have onboard permission.

fn remove_onboarder(env: soroban_sdk::Env, addr: soroban_sdk::Address)

Places multiple users on the compliance block list and revokes SAC authorization. Already-blocked users are silently skipped (no event). Block operator only. Max 40 users per call.

fn batch_block_users(
    env: soroban_sdk::Env,
    users: soroban_sdk::Vec,
    operator: soroban_sdk::Address,
) -> Result<(), MinterGatewayError>

Returns whether addr has block permission.

fn is_block_operator(env: soroban_sdk::Env, addr: soroban_sdk::Address) -> bool

Sets the interest rate in basis points (max 10000 = 100%). Minter only. No-op if the new rate equals the current rate.

fn set_interest_rate(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    rate_bps: u32,
) -> Result<(), MinterGatewayError>

Grants block permission to addr. Admin only. Idempotent: silent no-op (no event) if the address is already a block operator.

fn add_block_operator(env: soroban_sdk::Env, addr: soroban_sdk::Address)

Transfers SAC admin role to another address. Admin only. After this call the contract loses the ability to mint, burn, clawback and authorize accounts on the SAC.

fn transfer_sac_admin(env: soroban_sdk::Env, new_sac_admin: soroban_sdk::Address)

Activates multiple users by granting SAC authorization. Users on the compliance block list are skipped and returned, even if already onboarded. Users without a trustline are silently skipped (the SAC's authorized trap is caught via try_authorized, so one such member no longer aborts the whole batch) — they are NOT marked onboarded and must be resubmitted once the trustline exists. Like onboard_user, this re-asserts SAC authorization for already-onboarded users whose trustline auth was reset (e.g. trustline deleted and recreated), without re-emitting user_onboarded. Onboarder only. Max 40 users per call.

fn batch_onboard_users(
    env: soroban_sdk::Env,
    users: soroban_sdk::Vec,
    operator: soroban_sdk::Address,
) -> Result, MinterGatewayError>

Removes multiple users from the compliance block list and restores SAC authorization. Users not on the block list are silently skipped (no event). Unblock operator only. Max 40 users per call.

fn batch_unblock_users(
    env: soroban_sdk::Env,
    users: soroban_sdk::Vec,
    operator: soroban_sdk::Address,
) -> Result<(), MinterGatewayError>

Returns whether addr has unblock permission.

fn is_unblock_operator(env: soroban_sdk::Env, addr: soroban_sdk::Address) -> bool

Sets a new yield recipient address. Yield recipient manager.

fn set_yield_recipient(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    new_yield_recipient: soroban_sdk::Address,
) -> Result<(), MinterGatewayError>

Grants unblock permission to addr. Admin only. Idempotent: silent no-op (no event) if the address is already an unblock operator.

fn add_unblock_operator(env: soroban_sdk::Env, addr: soroban_sdk::Address)

Revokes block permission from addr. Admin only. Idempotent: silent no-op (no event) if the address does not have block permission.

fn remove_block_operator(env: soroban_sdk::Env, addr: soroban_sdk::Address)

Returns the forced transfer manager address.

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

Revokes unblock permission from addr. Admin only. Idempotent: silent no-op (no event) if the address does not have unblock permission.

fn remove_unblock_operator(env: soroban_sdk::Env, addr: soroban_sdk::Address)

Returns the yield recipient manager address.

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

Sets a new forced transfer manager address. Admin only.

fn set_forced_transfer_manager(
    env: soroban_sdk::Env,
    new_forced_transfer_manager: soroban_sdk::Address,
)

Sets a new yield recipient manager address. Admin only.

fn set_yield_recipient_manager(
    env: soroban_sdk::Env,
    new_yield_recipient_manager: soroban_sdk::Address,
)

Imports

WebAssembly Text (WAT) ▶