Contract 94313c946697c20f336f380782f7a7083a475c7cd18078c54c8d8108dbed6985

← Back to Index 📥 Download WASM

Meta

cliver 25.2.0#28484880988199233a7e8e87c97cb12dac323cb3
rssdkver 23.5.3#d3e1ab2424388b10893b796b0c8e405c5edd03d2
rsver 1.94.0

Instances

  • CCSNFZ5RA2EHTSMK2A5ZDXRCAQBYBVFAPJFNWP5BJECLIL4J5UBLLUQG

Interface

Destroys amount of tokens from from. Updates the total supply accordingly.

Arguments

  • e - Access to the Soroban environment.
  • from - The account whose tokens are destroyed.
  • amount - The amount of tokens to burn.

Errors

  • [crate::fungible::FungibleTokenError::InsufficientBalance] - When attempting to burn more tokens than from current balance.
  • [crate::fungible::FungibleTokenError::LessThanZero] - When amount < 0.

Events

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

Returns the name for this token.

Arguments

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

Returns the symbol for this token.

Arguments

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

Sets the amount of tokens a spender is allowed to spend on behalf of an owner. Overrides any existing allowance set between spender and owner.

Arguments

  • e - Access to Soroban environment.
  • owner - The address holding the tokens.
  • spender - The address authorized to spend the tokens.
  • amount - The amount of tokens made available to spender.
  • live_until_ledger - The ledger number at which the allowance expires.

Errors

  • [FungibleTokenError::InvalidLiveUntilLedger] - Occurs when attempting to set live_until_ledger that is less than the current ledger number and greater than 0.
  • [FungibleTokenError::LessThanZero] - Occurs when amount < 0.

Events

  • topics - ["approve", from: Address, spender: Address]
  • data - [amount: i128, live_until_ledger: u32]
fn approve(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    spender: soroban_sdk::Address,
    amount: i128,
    live_until_ledger: u32,
)

Returns the amount of tokens held 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) -> i128
fn upgrade(
    env: soroban_sdk::Env,
    new_wasm_hash: soroban_sdk::BytesN<32>,
    operator: soroban_sdk::Address,
)

Returns the number of decimals used to represent amounts of this token.

Arguments

  • e - Access to Soroban environment.
fn decimals(env: soroban_sdk::Env) -> u32

Transfers amount of tokens from from to to.

Arguments

  • e - Access to Soroban environment.
  • from - The address holding the tokens.
  • to - The address receiving the transferred tokens.
  • amount - The amount of tokens to be transferred.

Errors

  • [FungibleTokenError::InsufficientBalance] - When attempting to transfer more tokens than from current balance.
  • [FungibleTokenError::LessThanZero] - When amount < 0.

Events

  • topics - ["transfer", from: Address, to: Address]
  • data - [to_muxed_id: Option<u64>, amount: i128]
fn transfer(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    to: soroban_sdk::MuxedAddress,
    amount: i128,
)

Returns the amount of tokens a spender is allowed to spend on behalf of an owner.

Arguments

  • e - Access to Soroban environment.
  • owner - The address holding the tokens.
  • spender - The address authorized to spend the tokens.
fn allowance(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    spender: soroban_sdk::Address,
) -> i128

Destroys amount of tokens from from. Updates the total supply accordingly.

Arguments

  • e - Access to the Soroban environment.
  • spender - The address authorized to burn the tokens.
  • from - The account whose tokens are destroyed.
  • amount - The amount of tokens to burn.

Errors

  • [crate::fungible::FungibleTokenError::InsufficientBalance] - When attempting to burn more tokens than from current balance.
  • [crate::fungible::FungibleTokenError::InsufficientAllowance] - When attempting to burn more tokens than from allowance.
  • [crate::fungible::FungibleTokenError::LessThanZero] - When amount < 0.

Events

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

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
fn mint_batch(
    env: soroban_sdk::Env,
    recipients: soroban_sdk::Vec,
    amount: i128,
)
fn mint_tokens(env: soroban_sdk::Env, to: soroban_sdk::Address, amount: i128)

Returns the total amount of tokens in circulation.

Arguments

  • e - Access to the Soroban environment.
fn total_supply(env: soroban_sdk::Env) -> i128
fn __constructor(
    env: soroban_sdk::Env,
    name: soroban_sdk::String,
    symbol: soroban_sdk::String,
    initial_owner: soroban_sdk::Address,
)

Transfers amount of tokens from from to to using the allowance mechanism. amount is then deducted from spender allowance.

Arguments

  • e - Access to Soroban environment.
  • spender - The address authorizing the transfer, and having its allowance consumed during the transfer.
  • from - The address holding the tokens which will be transferred.
  • to - The address receiving the transferred tokens.
  • amount - The amount of tokens to be transferred.

Errors

  • [FungibleTokenError::InsufficientBalance] - When attempting to transfer more tokens than from current balance.
  • [FungibleTokenError::LessThanZero] - When amount < 0.
  • [FungibleTokenError::InsufficientAllowance] - When attempting to transfer more tokens than spender current allowance.

Events

  • topics - ["transfer", from: Address, to: Address]
  • data - [amount: i128]
fn transfer_from(
    env: soroban_sdk::Env,
    spender: soroban_sdk::Address,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
)
fn schema_version(env: soroban_sdk::Env) -> u32

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)

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

Imports

WebAssembly Text (WAT) ▶