Contract c1230340470b197373b9bd41c5709bc2d30452a2a06d20c5973d51434c9424dd

← Back to Index 📥 Download WASM

Meta

cliver 25.2.0#28484880988199233a7e8e87c97cb12dac323cb3
home_domain mgusd.bridge.xyz
rssdk_spec_shaking 2
rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.94.0
source_repo github:m0-foundation/mgusd-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::blockedtrue 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)

Blocks a user, preventing them from sending or receiving SAC tokens. Block operator only.

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 the latest stored index (from last update).

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

Returns the total_supply (principal + cumulative claimed yield).

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

Unblocks a user, restoring their ability to send and receive SAC tokens. Unblock operator only.

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.
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,
) -> Result<(), MinterGatewayError>

Returns the current accrued yield available to claim.

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

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

Blocks multiple users in a single transaction. 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)

Unblocks multiple users in a single transaction. 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) ▶