Contract 3c531bc7dc6db9f421104a002d0314771c29f67f178e34407617318fd1cdde77

← Back to Index 📥 Download WASM

Meta

rssdkver 23.5.2#347f71141ddf69ef1873527c94ac98e79215f125
rsver 1.90.0

Instances

  • CBO23QRXJJJ3O4BZ5ZGGZ6VXB7275RFIRQ24GYNFGOI6BTIRCVUAEHHC

Interface

Constructs the token.

Arguments

  • owner - The initial owner (can set minter, transfer ownership)
  • name - Token name
  • symbol - Token symbol
  • decimals - Number of decimals
fn __constructor(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    name: soroban_sdk::String,
    symbol: soroban_sdk::String,
    decimals: u32,
)

Sets or clears the minter address. Only the owner can call this. Pass None to revoke minting capability.

fn set_minter(env: soroban_sdk::Env, minter: Option)

Mints amount tokens to to. The operator must be the minter. The signature includes operator for OFT compatibility.

fn mint(
    env: soroban_sdk::Env,
    to: soroban_sdk::Address,
    amount: i128,
    operator: soroban_sdk::Address,
)

Returns the current minter address, if set.

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

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

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

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)
fn transfer(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    to: soroban_sdk::MuxedAddress,
    amount: i128,
)
fn transfer_from(
    env: soroban_sdk::Env,
    spender: soroban_sdk::Address,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
)
fn approve(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    spender: soroban_sdk::Address,
    amount: i128,
    live_until_ledger: u32,
)
fn total_supply(env: soroban_sdk::Env) -> i128
fn balance(env: soroban_sdk::Env, account: soroban_sdk::Address) -> i128
fn allowance(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    spender: soroban_sdk::Address,
) -> i128
fn decimals(env: soroban_sdk::Env) -> u32
fn name(env: soroban_sdk::Env) -> soroban_sdk::String
fn symbol(env: soroban_sdk::Env) -> soroban_sdk::String
fn burn(env: soroban_sdk::Env, from: soroban_sdk::Address, amount: i128)
fn burn_from(
    env: soroban_sdk::Env,
    spender: soroban_sdk::Address,
    from: soroban_sdk::Address,
    amount: i128,
)

Imports

WebAssembly Text (WAT) ▶