Contract 9229544366366dc1df1b4a500901ea1a0b678d80897e31ce3eb4a4c4593fca6e

← Back to Index 📥 Download WASM

Meta

rssdkver 23.5.1#59fcef437260ed4da42d1efb357137a5c166c02e
rsver 1.93.0

Instances

  • CAVK536DH2G3PQG65AJU6TOTRFB6QWTXBV5ADLJ42RTK3JGWHC7H54K3

Interface

Destroys the token with token_id from from.

Arguments

  • e - Access to the Soroban environment.
  • from - The account whose token is destroyed.
  • token_id - The identifier of the token to burn.

Errors

  • [crate::non_fungible::NonFungibleTokenError::NonExistentToken] - When attempting to burn a token that does not exist.
  • [crate::non_fungible::NonFungibleTokenError::IncorrectOwner] - If the current owner (before calling this function) is not from.

Events

  • topics - ["burn", from: Address]
  • data - [token_id: u32]
fn burn(env: soroban_sdk::Env, from: soroban_sdk::Address, token_id: u32)

Owner-only mint (for airdrops, team, etc.)

fn mint(env: soroban_sdk::Env, to: soroban_sdk::Address) -> u32

Returns the token collection name.

Arguments

  • e - Access to the Soroban environment.
fn name(env: soroban_sdk::Env) -> soroban_sdk::String

Claim an NFT from the pool. Public claims: anyone can call. Reserved claims: only the reserved address.

fn claim(env: soroban_sdk::Env, id: u32, to: soroban_sdk::Address)

Pause the contract (stops all minting)

fn pause(env: soroban_sdk::Env)

Check if contract is paused

fn paused(env: soroban_sdk::Env) -> bool

Reveal the collection (show real metadata)

fn reveal(env: soroban_sdk::Env)

Returns the token collection symbol.

Arguments

  • e - Access to the Soroban environment.
fn symbol(env: soroban_sdk::Env) -> soroban_sdk::String

Gives permission to approved to transfer the token with token_id to another account. The approval is cleared when the token is transferred.

Only a single account can be approved at a time for a token_id. To remove an approval, the approver can approve their own address, effectively removing the previous approved address. Alternatively, setting the live_until_ledger to 0 will also revoke the approval.

Arguments

  • e - Access to Soroban environment.
  • approver - The address of the approver (should be owner or operator).
  • approved - The address receiving the approval.
  • token_id - Token ID as a number.
  • live_until_ledger - The ledger number at which the allowance expires. If live_until_ledger is 0, the approval is revoked.

Errors

  • [NonFungibleTokenError::NonExistentToken] - If the token does not exist.
  • [NonFungibleTokenError::InvalidApprover] - If the owner address is not the actual owner of the token.
  • [NonFungibleTokenError::InvalidLiveUntilLedger] - If the ledge
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 owned by account.

Arguments

  • e - Access to the Soroban environment.
  • account - The address for which the balance is being queried.
fn balance(env: soroban_sdk::Env, account: soroban_sdk::Address) -> u32

Unpause the contract

fn unpause(env: soroban_sdk::Env)

Upgrade the contract to a new WASM binary. Only the contract owner can call this. The new_wasm_hash must be a previously uploaded WASM hash.

fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)

Return the contract version for verification

fn version(env: soroban_sdk::Env) -> u32

Get base URI from storage

fn base_uri(env: soroban_sdk::Env) -> soroban_sdk::String

Return the decimals for the token (0 for NFTs)

fn decimals(env: soroban_sdk::Env) -> u32

Returns the owner of the token with token_id.

Arguments

  • e - Access to the Soroban environment.
  • token_id - Token ID as a number.

Errors

  • [NonFungibleTokenError::NonExistentToken] - If the token does not exist.
fn owner_of(env: soroban_sdk::Env, token_id: u32) -> soroban_sdk::Address

Transfers the token with token_id from from to to.

WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving the Non-Fungible or else the NFT may be permanently lost.

Arguments

  • e - Access to the Soroban environment.
  • from - Account of the sender.
  • to - Account of the recipient.
  • token_id - Token ID as a number.

Errors

  • [NonFungibleTokenError::IncorrectOwner] - If the current owner (before calling this function) is not from.
  • [NonFungibleTokenError::NonExistentToken] - If the token does not exist.

Events

  • topics - ["transfer", from: Address, to: Address]
  • data - [token_id: u32]
fn transfer(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    token_id: u32,
)

Destroys the token with token_id from from, by using spenders approval.

Arguments

  • e - Access to the Soroban environment.
  • spender - The account that is allowed to burn the token on behalf of the owner.
  • from - The account whose token is destroyed.
  • token_id - The identifier of the token to burn.

Errors

  • [crate::non_fungible::NonFungibleTokenError::NonExistentToken] - When attempting to burn a token that does not exist.
  • [crate::non_fungible::NonFungibleTokenError::IncorrectOwner] - If the current owner (before calling this function) is not from.
  • [crate::non_fungible::NonFungibleTokenError::InsufficientApproval] - If the spender does not have a valid approval.

Events

  • topics - ["burn", from: Address]
  • data - [token_id: u32]
fn burn_from(
    env: soroban_sdk::Env,
    spender: soroban_sdk::Address,
    from: soroban_sdk::Address,
    token_id: u32,
)

Returns Some(Address) if ownership is set, or None if ownership has been renounced.

Arguments

  • e - Access to the Soroban environment.
fn get_owner(env: soroban_sdk::Env) -> Option

Returns the Uniform Resource Identifier (URI) for the token with token_id.

Arguments

  • e - Access to the Soroban environment.
  • token_id - Token ID as a number.

Notes

If the token does not exist, this function is expected to panic.

fn token_uri(env: soroban_sdk::Env, token_id: u32) -> soroban_sdk::String

Get max supply

fn max_supply(env: soroban_sdk::Env) -> u32

Owner-only batch mint

fn mint_batch(env: soroban_sdk::Env, to: soroban_sdk::Address, count: u32) -> u32

Check if collection is revealed

fn is_revealed(env: soroban_sdk::Env) -> bool

Get the current Merkle root

fn merkle_root(env: soroban_sdk::Env) -> Option>

Public mint (when public sale is active)

fn public_mint(env: soroban_sdk::Env, to: soroban_sdk::Address) -> u32

Returns the account approved for the token with token_id.

Arguments

  • e - Access to the Soroban environment.
  • token_id - Token ID as a number.

Errors

  • [NonFungibleTokenError::NonExistentToken] - If the token does not exist.
fn get_approved(env: soroban_sdk::Env, token_id: u32) -> Option

Owner-only mint with specific ID

fn mint_with_id(env: soroban_sdk::Env, to: soroban_sdk::Address, id: u32)

Revoke a claim — return NFT from contract back to owner.

fn revoke_claim(env: soroban_sdk::Env, id: u32)

Get royalty info for a token sale

fn royalty_info(
    env: soroban_sdk::Env,
    token_id: u32,
    sale_price: i128,
) -> (soroban_sdk::Address, i128)

Update base URI (for all tokens)

fn set_base_uri(env: soroban_sdk::Env, uri: soroban_sdk::String)

Get current supply

fn total_minted(env: soroban_sdk::Env) -> u32

Initialize the NFT collection

fn __constructor(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    base_uri: soroban_sdk::String,
    royalty_recipient: soroban_sdk::Address,
)

Get per-token URI (returns token-specific if set, else base URI)

fn get_token_uri(env: soroban_sdk::Env, token_id: u32) -> soroban_sdk::String

Set claimable (legacy approve-based — prefer deposit_to_pool for new claims)

fn set_claimable(
    env: soroban_sdk::Env,
    id: u32,
    claimant: Option,
)

Set per-token URI (overrides base URI for a specific token)

fn set_token_uri(env: soroban_sdk::Env, token_id: u32, uri: soroban_sdk::String)

Transfers the token with token_id from from to to by using spenders approval.

Unlike transfer(), which is used when the token owner initiates the transfer, transfer_from() allows an approved third party (spender) to transfer the token on behalf of the owner. This function verifies that spender has the necessary approval.

WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving the Non-Fungible or else the NFT may be permanently lost.

Arguments

  • e - Access to the Soroban environment.
  • spender - The address authorizing the transfer.
  • from - Account of the sender.
  • to - Account of the recipient.
  • token_id - Token ID as a number.

Errors

  • [NonFungibleTokenError::IncorrectOwner] - If the current owner (before calling this function) is not from.
  • [NonFungibleTokenError::InsufficientApproval] - If the spender does not have a valid approval.
  • [NonFungibleTokenError::NonExistentToken] - If the token does not exist.

Events

fn transfer_from(
    env: soroban_sdk::Env,
    spender: soroban_sdk::Address,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    token_id: u32,
)

Batch transfer

fn batch_transfer(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    ids: soroban_sdk::Vec,
)

Whitelist mint (must be whitelisted via Merkle proof)

fn whitelist_mint(
    env: soroban_sdk::Env,
    to: soroban_sdk::Address,
    proof: soroban_sdk::Vec>,
) -> u32

Approve or remove operator as an operator for the owner.

Operators can call transfer_from() for any token held by owner, and call approve() on behalf of owner.

Arguments

  • e - Access to Soroban environment.
  • owner - The address holding the tokens.
  • operator - Account to add to the set of authorized operators.
  • live_until_ledger - The ledger number at which the allowance expires. If live_until_ledger is 0, the approval is revoked.

Errors

  • [NonFungibleTokenError::InvalidLiveUntilLedger] - If the ledger number is less than the current ledger number.

Events

  • topics - ["approve_for_all", from: Address]
  • data - [operator: Address, live_until_ledger: u32]
fn approve_for_all(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    operator: soroban_sdk::Address,
    live_until_ledger: u32,
)

Deposit a single NFT into the claim pool. Transfers NFT from caller → contract, stores the claim type.

fn deposit_to_pool(env: soroban_sdk::Env, id: u32, claim_type: ClaimPool)

Owner-only: Repair corrupted counters after broken v5 deployment. Sets TotalMinted and advances the OZ sequential counter.

fn repair_counters(env: soroban_sdk::Env, total_minted: u32, next_sequential_id: u32)

Set the Merkle root for whitelist verification

fn set_merkle_root(env: soroban_sdk::Env, root: soroban_sdk::BytesN<32>)

Accepts a pending ownership transfer.

Arguments

  • e - Access to the Soroban environment.

Errors

  • [crate::role_transfer::RoleTransferError::NoPendingTransfer] - If there is no pending transfer to accept.

Events

  • topics - ["ownership_transfer_completed"]
  • data - [new_owner: Address]
fn accept_ownership(env: soroban_sdk::Env)

Get the claim status of a token (view function). Returns None if not in pool, Some(ClaimPool) if claimable.

fn get_claim_status(env: soroban_sdk::Env, id: u32) -> Option

Check if whitelist is active

fn whitelist_active(env: soroban_sdk::Env) -> bool

Get token metadata URI (returns placeholder if not revealed)

fn get_token_metadata(env: soroban_sdk::Env, token_id: u32) -> soroban_sdk::String

Check if public mint is active

fn public_mint_active(env: soroban_sdk::Env) -> bool

Renounces ownership of the contract.

Permanently removes the owner, disabling all functions gated by #[only_owner].

Arguments

  • e - Access to the Soroban environment.

Errors

  • [OwnableError::TransferInProgress] - If there is a pending ownership transfer.
  • [OwnableError::OwnerNotSet] - If the owner is not set.

Notes

  • Authorization for the current owner is required.
fn renounce_ownership(env: soroban_sdk::Env)

Initiates a 2-step ownership transfer to a new address.

Requires authorization from the current owner. The new owner must later call accept_ownership() to complete the transfer.

Arguments

  • e - Access to the Soroban environment.
  • new_owner - The proposed new owner.
  • live_until_ledger - Ledger number until which the new owner can accept. A value of 0 cancels any pending transfer.

Errors

  • [OwnableError::OwnerNotSet] - If the owner is not set.
  • [crate::role_transfer::RoleTransferError::NoPendingTransfer] - If trying to cancel a transfer that doesn't exist.
  • [crate::role_transfer::RoleTransferError::InvalidLiveUntilLedger] - If the specified ledger is in the past.
  • [crate::role_transfer::RoleTransferError::InvalidPendingAccount] - If the specified pending account is not the same as the provided new address.

Notes

  • Authorization for the current owner is required.
fn transfer_ownership(
    env: soroban_sdk::Env,
    new_owner: soroban_sdk::Address,
    live_until_ledger: u32,
)

Batch set claimable (legacy)

fn batch_set_claimable(
    env: soroban_sdk::Env,
    ids: soroban_sdk::Vec,
    claimant: Option,
)

Returns whether the operator is allowed to manage all the assets of owner.

Arguments

  • e - Access to the Soroban environment.
  • owner - Account of the token's owner.
  • operator - Account to be checked.
fn is_approved_for_all(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    operator: soroban_sdk::Address,
) -> bool

Check if a token is publicly claimable (convenience view).

fn is_public_claimable(env: soroban_sdk::Env, id: u32) -> bool

Enable/disable whitelist minting

fn set_whitelist_active(env: soroban_sdk::Env, active: bool)

Batch deposit NFTs into the claim pool (same claim type for all).

fn batch_deposit_to_pool(
    env: soroban_sdk::Env,
    ids: soroban_sdk::Vec,
    claim_type: ClaimPool,
)

Update royalty recipient

fn set_royalty_recipient(env: soroban_sdk::Env, recipient: soroban_sdk::Address)

Enable/disable public minting

fn set_public_mint_active(env: soroban_sdk::Env, active: bool)

Batch set claimable with per-token claimants (legacy)

fn batch_set_claimable_multi(
    env: soroban_sdk::Env,
    ids: soroban_sdk::Vec,
    claimants: soroban_sdk::Vec,
)

Imports

WebAssembly Text (WAT) ▶