Contract e5d35f59152d84d1c05235b4db23b9a82d574b82e8d7c98a215e156c9f7d5fdf

← Back to Index 📥 Download WASM

Meta

cliver 28.0.0#300aaf69ab100536678bdb641428b06f06b318ea
rssdkver 23.5.3#d3e1ab2424388b10893b796b0c8e405c5edd03d2
rsver 1.95.0

Instances

  • CAI3SPN3H3MZ2RPNDAQI7JQAAFJUUTSTRVTWU2SUCPTAPXB3ASFM5BW5

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")

The network is not configured here: the registry derives it from the ledger when it builds the attestation digest.

fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    registry: soroban_sdk::Address,
    policy_id: soroban_sdk::String,
)

Register this contract's policy with the Predicate Registry.

The constructor already does this, so a freshly deployed token needs no follow-up call. Kept so the entry can be re-registered if the registry's mapping is ever cleared. The admin must authorize.

fn register_policy(env: soroban_sdk::Env)

Imports

WebAssembly Text (WAT) ▶