Contract 220cebfb3af68dcbfcd8b007ec738480bd2e9aa35131648cf518e97acca5f8c0

← Back to Index 📥 Download WASM

Meta

cliver 26.0.0#60f7458e7ecffddf2f2d91dc6d0d2db4fab03ecc
rssdkver 23.5.3#d3e1ab2424388b10893b796b0c8e405c5edd03d2
rsver 1.95.0

Instances

  • CBJKL6SRYNUBRFW5CV5TVSRPXHLVLYYJDALHI2RQQDG343S25WAF74JQ
  • CBX3NYCN3YOTRO7NZFUCNAVM36OFKL35VNVUOBSCZSGHXBDLIDPCF7LK
  • CCSHBWKDCNKTOWW46X6ZKJXVDROLEO7XPBZWT4RVBF7CGB7HHNHAHSWK

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.

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

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

Deploy the token with a Predicate Registry binding.

Arguments

  • admin - Token admin who can mint
  • registry - Address of the deployed PredicateRegistry contract
  • 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: soroban_sdk::Address,
    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.

fn register_policy(env: soroban_sdk::Env)

Imports

WebAssembly Text (WAT) ▶