Contract aba393eed4352f48b8189f98a91cdaba7f9146884c67f84d7a646d6b19cfd228

← Back to Index 📥 Download WASM

Meta

rssdkver 21.7.7#5da789c50b18a4c2be53394138212fed56f0dfc4
rsver 1.79.0

Interface

Initializes the contract with name, symbol, decimal, and roles. Called after deployment, only can be called once.

Arguments

  • name - the token name
  • symbol - the token symbol
  • decimal - the token decimals
  • admin - address of the admin
  • supply_controller - address of the supply controller
  • pauser - address of the pauser
  • asset_protector - address of the asset protector
  • rebase_admin - address of the rebase admin
  • rebaser - address of the rebaser
fn initialize(
    env: soroban_sdk::Env,
    name: soroban_sdk::String,
    symbol: soroban_sdk::String,
    decimal: u32,
    admin: soroban_sdk::Address,
    supply_controller: soroban_sdk::Address,
    pauser: soroban_sdk::Address,
    asset_protector: soroban_sdk::Address,
    rebase_admin: soroban_sdk::Address,
    rebaser: soroban_sdk::Address,
)

Returns the total rebase shares in the contract.

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

Returns the total fixed shares in the contract.

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

Returns the multiplier effective before the increase time.

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

Returns the multiplier effective after the increase time.

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

Returns the time at which the multiplier changes from before_incr_mult to after_incr_mult.

fn get_mult_incr_time(env: soroban_sdk::Env) -> u64

Returns the rebasing period to increment mult_incr_time.

fn get_rebase_period(env: soroban_sdk::Env) -> u64

Returns the max rate increase between before_incr_mult -> after_incr_mult.

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

Returns the active rebase multiplier.

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

Returns the total supply of the token.

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

Returns the rebase shares of the address.

Arguments

  • addr - address to get the shares for
fn get_rebase_shares(env: soroban_sdk::Env, addr: soroban_sdk::Address) -> i128

Returns the fixed shares of the address.

Arguments

  • addr - address to get the shares for
fn get_fixed_shares(env: soroban_sdk::Env, addr: soroban_sdk::Address) -> i128

Returns true if the address is blocked. A blocked address cannot submit approvals or transfers (from & to). A blocked address will not receive rebase payouts.

Arguments

  • addr - address to check
fn is_addr_blocked(env: soroban_sdk::Env, addr: soroban_sdk::Address) -> bool

Returns true if the address is blocked from receiving the token. An address blocked from receiving will still receive rebase payouts.

Arguments

  • addr - address to check
fn is_addr_blocked_from_receiving(
    env: soroban_sdk::Env,
    addr: soroban_sdk::Address,
) -> bool

Increases the total supply by minting the specified number of tokens. Converts to underlying rebase shares and checks if results in overflow for total supply. Restricted to SUPPLY_CONTROLLER role.

Arguments

  • minter - address of the minter
  • to - address to mint the tokens to
  • amount - amount of tokens to mint
fn mint(
    env: soroban_sdk::Env,
    minter: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
)

Sets the rebase period. Restricted to REBASE_ADMIN role.

Arguments

  • rebase_admin - address of the rebase admin
  • rebase_period - rebase period to set
fn set_rebase_period(
    env: soroban_sdk::Env,
    rebase_admin: soroban_sdk::Address,
    rebase_period: u64,
)

Sets the max rebase rate. Restricted to REBASE_ADMIN role.

Arguments

  • rebase_admin - address of the rebase admin
  • max_rebase_rate - max rebase rate to set
fn set_max_rebase_rate(
    env: soroban_sdk::Env,
    rebase_admin: soroban_sdk::Address,
    max_rebase_rate: i128,
)

Sets the next rebase multiplier and increase time. Restricted to REBASE_ADMIN role. Used in the following scenarios:

  1. corrective actions when a pending increase is set, i.e. mult_incr_time is in future. a. The before_incr_mult should be active in this case and should not change.
  2. explicitly setting the next multiplier & increase time. a. The after_incr_mult should be active in this case and roll to before_incr_mult.

Arguments

  • rebase_admin - address of the rebase admin
  • next_multiplier - next multiplier to set
  • mult_incr_time - increase time to set
  • expected_total_supply - expected total supply after the multiplier change
fn set_next_multiplier(
    env: soroban_sdk::Env,
    rebase_admin: soroban_sdk::Address,
    next_multiplier: i128,
    mult_incr_time: u64,
    expected_total_supply: i128,
)

Increases the next multiplier and sets the increase time. Restricted to REBASE role.

Arguments

  • rebaser - address of the rebaser
  • rebase_rate - rate of increase for the multiplier
  • expected_total_supply - expected total supply after the multiplier change
fn increase_rebase_multiplier(
    env: soroban_sdk::Env,
    rebaser: soroban_sdk::Address,
    rebase_rate: i128,
    expected_total_supply: i128,
)

Restricted to ASSET_PROTECTION role. This function intentionally does not include the require_no_pending_multiplier() check since blocking addresses is a critical operation and should not be delayed. As a result, the overall payout amount would be less than originally expected for a pending multiplier since the blocked addresses would not receive the payout.

Arguments

  • asset_protector - address of the asset protector
  • addrs - addresses to block
fn block_addrs(
    env: soroban_sdk::Env,
    asset_protector: soroban_sdk::Address,
    addrs: soroban_sdk::Vec,
)

Blocks multiple addresses at once from receiving funds. Restricted to ASSET_PROTECTION role.

Arguments

  • asset_protector - address of the asset protector
  • addrs - addresses to block
fn block_addrs_from_receiving(
    env: soroban_sdk::Env,
    asset_protector: soroban_sdk::Address,
    addrs: soroban_sdk::Vec,
)

Batch unblock addresses. Restricted to ASSET_PROTECTION role.

Arguments

  • asset_protector - address of the asset protector
  • addrs - addresses to unblock
fn unblock_addrs(
    env: soroban_sdk::Env,
    asset_protector: soroban_sdk::Address,
    addrs: soroban_sdk::Vec,
)

Batch unblock addresses, to enable receiving the token. Restricted to ASSET_PROTECTION role.

Arguments

  • asset_protector - address of the asset protector
  • addrs - addresses to unblock
fn unblock_addrs_from_receiving(
    env: soroban_sdk::Env,
    asset_protector: soroban_sdk::Address,
    addrs: soroban_sdk::Vec,
)

Wipes the balance of a blocked address, and burns the tokens. Restricted to ASSET_PROTECTION role.

Arguments

  • asset_protector - address of the asset protector
  • addrs - blocked address to wipe.
fn wipe_blocked_addr(
    env: soroban_sdk::Env,
    asset_protector: soroban_sdk::Address,
    addr: soroban_sdk::Address,
)

Upgrade the contract with the new wasm hash. Restricted to the admin.

Arguments

  • new_wasm_hash - new wasm hash to upgrade to
fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)
fn allowance(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    spender: soroban_sdk::Address,
) -> i128
fn approve(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    spender: soroban_sdk::Address,
    amount: i128,
    expiration_ledger: u32,
)
fn balance(env: soroban_sdk::Env, addr: soroban_sdk::Address) -> i128
fn transfer(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
)
fn transfer_from(
    env: soroban_sdk::Env,
    spender: soroban_sdk::Address,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
)
fn burn(env: soroban_sdk::Env, from: soroban_sdk::Address, amount: i128)
fn burn_from(
    env: soroban_sdk::Env,
    supply_controller: soroban_sdk::Address,
    from: soroban_sdk::Address,
    amount: 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 is_initialized(env: soroban_sdk::Env) -> bool
fn admin(env: soroban_sdk::Env) -> soroban_sdk::Address
fn pending_admin(env: soroban_sdk::Env) -> soroban_sdk::Address
fn grant_role(
    env: soroban_sdk::Env,
    role: soroban_sdk::Symbol,
    account: soroban_sdk::Address,
)
fn revoke_role(
    env: soroban_sdk::Env,
    role: soroban_sdk::Symbol,
    account: soroban_sdk::Address,
)
fn has_role(
    env: soroban_sdk::Env,
    role: soroban_sdk::Symbol,
    account: soroban_sdk::Address,
) -> bool
fn start_admin_transfer(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)
fn accept_admin_transfer(env: soroban_sdk::Env)
fn pause(env: soroban_sdk::Env, pauser: soroban_sdk::Address)
fn unpause(env: soroban_sdk::Env, pauser: soroban_sdk::Address)
fn is_paused(env: soroban_sdk::Env) -> bool

Imports

WebAssembly Text (WAT) ▶