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