Burn a token. Caller must be the owner.
fn burn(env: soroban_sdk::Env, owner: soroban_sdk::Address, token_id: u32)
Admin mint: mint a single token to any address. Bypasses 1-per-wallet limit (admin can airdrop multiple to same wallet).
fn mint(
env: soroban_sdk::Env,
minter: soroban_sdk::Address,
to: soroban_sdk::Address,
) -> u32
Returns the collection name.
fn name(env: soroban_sdk::Env) -> soroban_sdk::String
Get the current admin address.
fn admin(env: soroban_sdk::Env) -> soroban_sdk::Address
Pause the contract (admin only). Blocks minting.
fn pause(env: soroban_sdk::Env)
Returns true if token_id exists (has been minted and not burned).
fn exists(env: soroban_sdk::Env, token_id: u32) -> bool
Returns the collection symbol.
fn symbol(env: soroban_sdk::Env) -> soroban_sdk::String
Admin batch airdrop: mint 1 token each to multiple addresses. Maximum 50 recipients per call (gas safety).
fn airdrop(
env: soroban_sdk::Env,
minter: soroban_sdk::Address,
recipients: soroban_sdk::Vec,
) -> soroban_sdk::Vec
Approve approved to transfer token_id.
Note: Approvals can be set but transfers will still revert while soulbound.
fn approve(
env: soroban_sdk::Env,
approver: soroban_sdk::Address,
approved: soroban_sdk::Address,
token_id: u32,
live_until_ledger: u32,
)
Returns the number of tokens held by owner.
fn balance(env: soroban_sdk::Env, owner: soroban_sdk::Address) -> u32
Unpause the contract (admin only).
fn unpause(env: soroban_sdk::Env)
Upgrade the contract WASM. Admin only. ⚠️ NEVER REMOVE THIS FUNCTION — doing so bricks the contract permanently.
fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)
Contract version, incremented on each upgrade.
fn version(env: soroban_sdk::Env) -> u32
Returns the owner of token_id. Panics if token does not exist.
fn owner_of(env: soroban_sdk::Env, token_id: u32) -> soroban_sdk::Address
Transfer is permanently disabled — Steve's Stubs are soulbound. This function exists for SEP-50 interface compliance but always panics.
fn transfer(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
to: soroban_sdk::Address,
token_id: u32,
)
Check if an address has the minter role.
fn is_minter(env: soroban_sdk::Env, account: soroban_sdk::Address) -> bool
Returns the token URI for token_id.
fn token_uri(env: soroban_sdk::Env, token_id: u32) -> soroban_sdk::String
Returns all token IDs owned by owner.
fn tokens_of(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
) -> soroban_sdk::Vec
Returns all token IDs in the collection.
fn all_tokens(env: soroban_sdk::Env) -> soroban_sdk::Vec
Admin batch mint: mint count tokens to a single address.
fn batch_mint(
env: soroban_sdk::Env,
minter: soroban_sdk::Address,
to: soroban_sdk::Address,
count: u32,
) -> soroban_sdk::Vec
Check if a wallet has already minted their free stub.
fn has_minted(env: soroban_sdk::Env, account: soroban_sdk::Address) -> bool
Free permissionless mint — anyone can call when active. Enforces: 1-per-wallet limit, auto-soulbound. Returns the new token ID.
fn public_mint(env: soroban_sdk::Env, to: soroban_sdk::Address) -> u32
Returns the approved address for token_id, or None.
fn get_approved(env: soroban_sdk::Env, token_id: u32) -> Option
Grant minter role to an address (admin only).
fn grant_minter(env: soroban_sdk::Env, account: soroban_sdk::Address)
Returns whether the collection is soulbound.
fn is_soulbound(env: soroban_sdk::Env) -> bool
Update the collection base URI (admin only).
fn set_base_uri(env: soroban_sdk::Env, base_uri: soroban_sdk::String)
Returns the next token ID (total minted including burned). Kept for compatibility with frontend indexer.
fn total_minted(env: soroban_sdk::Env) -> u32
Returns total number of minted (non-burned) tokens.
fn total_supply(env: soroban_sdk::Env) -> u32
Deploy and initialize Steve's Stubs.
base_uri - Base URI for metadata (ICP canister URL)name - Collection name ("Steve's Stubs")symbol - Collection symbol ("STUB")admin - Admin addressfn __constructor(
env: soroban_sdk::Env,
base_uri: soroban_sdk::String,
name: soroban_sdk::String,
symbol: soroban_sdk::String,
admin: soroban_sdk::Address,
)
Revoke minter role from an address (admin only).
fn revoke_minter(env: soroban_sdk::Env, account: soroban_sdk::Address)
Set a custom URI for a specific token (admin only).
fn set_token_uri(env: soroban_sdk::Env, token_id: u32, uri: soroban_sdk::String)
Transfer via approval — also soulbound-blocked.
fn transfer_from(
env: soroban_sdk::Env,
spender: soroban_sdk::Address,
from: soroban_sdk::Address,
to: soroban_sdk::Address,
token_id: u32,
)
Transfer admin to a new address (admin only).
fn transfer_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)
Approve/revoke operator for all of owner's tokens.
fn approve_for_all(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
operator: soroban_sdk::Address,
live_until_ledger: u32,
)
Enable or disable public minting. Admin only.
fn set_public_mint(env: soroban_sdk::Env, active: bool)
One-time metadata initialization after upgrading from a different contract. Writes Metadata directly without reading (avoids MetadataNotSet panic). Safe to call multiple times — each call overwrites previous metadata.
fn post_upgrade_init(
env: soroban_sdk::Env,
name: soroban_sdk::String,
symbol: soroban_sdk::String,
base_uri: soroban_sdk::String,
)
Returns whether operator is approved to manage all of owner's tokens.
fn is_approved_for_all(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
operator: soroban_sdk::Address,
) -> bool
Check if public minting is currently active.
fn is_public_mint_active(env: soroban_sdk::Env) -> bool
Toggle collection-wide soulbound status (admin only). Emergency escape hatch — normally should stay true.
fn set_collection_soulbound(env: soroban_sdk::Env, soulbound: bool)