Contract aab6f670caa14f0e428bb592487e3bdfb10cc906967bb3139111409715d46b80

← Back to Index 📥 Download WASM

Meta

rssdkver 21.4.0#d6f5639f643d76e758beecbb0ca391f8cd304c24
rsver 1.79.0

Instances

  • CB7NKQGNOY2CHE4UXHULVEWXN64WKP3H4EUOCXEV3YD2M7SBFO2MLECV
  • CCN2XWUKHWMWCBNZXZRV4WADAVBHX2EMMHEGVAH2NV2DMZ3IH3K7FITL
  • CDIYQMQGHX7GSTF2I46K7SDNM5XXDH4PVVKXD37EXP7WNOT4D3SRYPNV

Interface

Initializes the Debt token contract.

Arguments

  • name - The name of the token.
  • symbol - The symbol of the token.
  • pool - The address of the pool contract.
  • underlying_asset - The address of the underlying asset associated with the token.

Panics

Panics if the specified decimal value exceeds the maximum value of u8. Panics if the contract has already been initialized. Panics if name or symbol is empty

fn initialize(
    env: soroban_sdk::Env,
    name: soroban_sdk::String,
    symbol: soroban_sdk::String,
    pool: soroban_sdk::Address,
    underlying_asset: soroban_sdk::Address,
)

Upgrades the deployed contract wasm preserving the contract id.

Arguments

  • new_wasm_hash - The new version of the WASM hash.

Panics

Panics if the caller is not the pool associated with this token.

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

Returns the current version of the contract.

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

Returns the balance of tokens for a specified id.

Arguments

  • id - The address of the account.

Returns

The balance of tokens for the specified id.

fn balance(env: soroban_sdk::Env, id: soroban_sdk::Address) -> i128

Arguments

  • id - The address of the account.

Returns

The spendable balance of tokens for the specified id.

Currently the same as balance(id)

fn spendable_balance(env: soroban_sdk::Env, id: soroban_sdk::Address) -> i128

Checks whether a specified id is authorized.

Arguments

  • id - The address to check for authorization.

Returns

Returns true if the id is authorized, otherwise returns false

fn authorized(env: soroban_sdk::Env, id: soroban_sdk::Address) -> bool

Burns a specified amount of tokens from the from account.

Arguments

  • from - The address of the token holder to burn tokens from.
  • amount - The amount of tokens to burn.

Panics

Panics if the amount is negative. Panics if the caller is not the pool associated with this token. Panics if overflow happens

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

Sets the authorization status for a specified id.

Arguments

  • id - The address to set the authorization status for.
  • authorize - A boolean value indicating whether to authorize (true) or deauthorize (false) the id.

Panics

Panics if the caller is not the pool associated with this token.

fn set_authorized(env: soroban_sdk::Env, id: soroban_sdk::Address, authorize: bool)

Mints a specified amount of tokens for a given id.

Arguments

  • id - The address of the user to mint tokens for.
  • amount - The amount of tokens to mint.

Panics

Panics if the amount is negative. Panics if the caller is not the pool associated with this token.

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

Clawbacks a specified amount of tokens from the from account.

Arguments

  • from - The address of the token holder to clawback tokens from.
  • amount - The amount of tokens to clawback.

Panics

Panics if the amount is negative. Panics if the caller is not the pool associated with this token. Panics if overflow happens

fn clawback(env: soroban_sdk::Env, from: soroban_sdk::Address, amount: i128)

Returns the number of decimal places used by the token.

Returns

The number o

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

Returns the name of the token.

Returns

The name of the token as a soroban_sdk::Bytes value.

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

Returns the symbol of the token.

Returns

The symbol of the token as a soroban_sdk::Bytes value.

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

Returns the total supply of tokens.

Returns

The total supply of tokens.

fn total_supply(env: soroban_sdk::Env) -> i128

Imports

WebAssembly Text (WAT) ▶