Name: __constructor
This function will set the owner and signer of the contract and set the metadata for the token.
e - The environmentowner - The owner of the contractname - The name of the tokensymbol - The symbol of the tokenuri - The URI of the tokenmax_supply - The maximum supply of tokensfn __constructor(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
name: soroban_sdk::String,
symbol: soroban_sdk::String,
uri: soroban_sdk::String,
max_supply: i32,
)
Name: update_uri
This function will update the URI of the token metadata. It requires the owner of the contract to authorize the change.
e - The environmenturi - The new URI for the token metadatafn update_uri(env: soroban_sdk::Env, uri: soroban_sdk::String)
Name: get_total_minted
This function will return the total number of tokens minted.
e - The environmentfn get_total_minted(env: soroban_sdk::Env) -> i32
Name: get_max_supply
This function will return the maximum supply of tokens.
fn get_max_supply(env: soroban_sdk::Env) -> i32
Name: mint
This function will mint a new token to the given address. The token ID will be sequential starting from 0 and incrementing by 1 for each minted token.
e - The environmentto - The address to mint the token tofn mint(
env: soroban_sdk::Env,
to: soroban_sdk::Address,
) -> Result
fn balance(env: soroban_sdk::Env, account: soroban_sdk::Address) -> u32
fn owner_of(env: soroban_sdk::Env, token_id: u32) -> soroban_sdk::Address
fn transfer(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
to: soroban_sdk::Address,
token_id: u32,
)
fn transfer_from(
env: soroban_sdk::Env,
spender: soroban_sdk::Address,
from: soroban_sdk::Address,
to: soroban_sdk::Address,
token_id: u32,
)
fn approve(
env: soroban_sdk::Env,
approver: soroban_sdk::Address,
approved: soroban_sdk::Address,
token_id: u32,
live_until_ledger: u32,
)
fn approve_for_all(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
operator: soroban_sdk::Address,
live_until_ledger: u32,
)
fn get_approved(env: soroban_sdk::Env, token_id: u32) -> Option
fn is_approved_for_all(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
operator: soroban_sdk::Address,
) -> bool
fn token_uri(env: soroban_sdk::Env, token_id: u32) -> soroban_sdk::String
fn name(env: soroban_sdk::Env) -> soroban_sdk::String
fn symbol(env: soroban_sdk::Env) -> soroban_sdk::String