Contract 9aabb3fc3e8a3ff57d391cc6a24d3e2d53f46f14a4a15f50c6b4e71f544651b6

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.8#f46e9e0610213bbb72285566f9dd960ff96d03d8
rsver 1.85.0

Instances

  • CCRCHYPBWAQLYM3HH4R374IE4523L7XY525555TWWEZFY5UD4CFEXOSB
  • CDM3TEYLAPCLCKCYIX3OXV267LNYWSMQMTNPV6OTWMZKSPHLZP5ZPEED
  • CDXZLJKWLPBNVYUUOLJ7UYDJINU7ETPLFX6ZSBSKJMVL5OQWKPNZ5TBD

Interface

Name: __constructor

Description

This function will set the owner and signer of the contract and set the metadata for the token.

Arguments

  • e - The environment
  • owner - The owner of the contract
  • name - The name of the token
  • symbol - The symbol of the token
  • uri - The URI of the token
  • max_supply - The maximum supply of tokens
fn __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

Description

This function will update the URI of the token metadata. It requires the owner of the contract to authorize the change.

Arguments

  • e - The environment
  • uri - The new URI for the token metadata
fn update_uri(env: soroban_sdk::Env, uri: soroban_sdk::String)

Name: get_total_minted

Description

This function will return the total number of tokens minted.

Arguments

  • e - The environment
fn get_total_minted(env: soroban_sdk::Env) -> i32

Name: get_max_supply

Description

This function will return the maximum supply of tokens.

Arguments

fn get_max_supply(env: soroban_sdk::Env) -> i32

Name: mint

Description

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.

Arguments

  • e - The environment
  • to - The address to mint the token to
fn 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

Imports

WebAssembly Text (WAT) ▶