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.
admin - Token admin who can mintregistry - Address of the deployed PredicateRegistry contractpolicy_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)