Contract b43902b7d979c7874535ed2294400597591a5186d7595b82d40a68e933ddd212

← Back to Index 📥 Download WASM

Meta

cliver 26.0.0#60f7458e7ecffddf2f2d91dc6d0d2db4fab03ecc
rssdkver 23.5.3#d3e1ab2424388b10893b796b0c8e405c5edd03d2
rsver 1.95.0

Instances

  • CA6XMZES5QS6AMHT6ZAJDGJ3NWPQW2V5NADD7TGBMJLHOKZNPTVJXM7Z
  • CAYXGYBS2EZROB6MEA6EO7BOP4JDD7R6W3HW3VIFPDYODRUXI4EMXER7
  • CC3VU7OY2R5TY33ETDJBZFH7422OIGIXWAFAI52YS62W76TSY3A2FUZJ

Interface

Mint tokens to an address. Admin only, no attestation required.

fn mint(env: soroban_sdk::Env, to: soroban_sdk::Address, amount: i128)

Query token balance.

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

Query the registry address, or None if no registry has been set yet.

fn registry(env: soroban_sdk::Env) -> Option

Transfer tokens. Requires a valid Predicate attestation.

This is the key function: before moving tokens, it calls the Predicate Registry via predicate_client::authorize_transaction() to verify that the transfer is compliant with the configured policy.

fn transfer(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
    attestation: Attestation,
) -> Result<(), TokenError>

Query the policy ID.

fn policy_id(env: soroban_sdk::Env) -> soroban_sdk::String

Attach (or replace) the Predicate Registry this token uses. Admin only. Enables register_policy and compliant transfers on a token that was deployed without a registry.

fn set_registry(env: soroban_sdk::Env, registry: soroban_sdk::Address)

Deploy the token with a Predicate Registry binding.

Arguments

  • admin - Token admin who can mint
  • registry - Address of the deployed PredicateRegistry contract, or None to deploy without one (e.g. on a network with no registry yet). Attach later with [set_registry]. Until a registry is set, register_policy and transfer fail.
  • policy_id - Policy identifier (e.g. "x-a1b2c3d4e5f6g7h8")
  • network - Stellar network passphrase (e.g. "Test SDF Network ; September 2015")
fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    registry: Option,
    policy_id: soroban_sdk::String,
    network: soroban_sdk::String,
)

Register this contract's policy with the Predicate Registry. Call this once after deployment. The admin must authorize. Fails with RegistryNotConfigured if no registry has been set.

fn register_policy(env: soroban_sdk::Env) -> Result<(), TokenError>

Imports

WebAssembly Text (WAT) ▶