Contract ae68869840391da72e9db3e07a5c3271a645b67101c0ef097ba9604f07823ad0

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.8#f46e9e0610213bbb72285566f9dd960ff96d03d8
rsver 1.88.0

Instances

  • CAKBVGHJIK2HPP5JPT2UOP27O2IMKIUUCFGP3LOOMGCZLE3NP73Z44H6

Interface

Initializes the token admin contract.

Arguments

  • e - Access to Soroban environment.
  • default_admin - The address of the default admin.
  • trustline_manager - The address of the trustline manager.
  • clawback_manager - The address of the clawback manager.
  • supply_control_manager - The address of the supply control manager.
  • pauser - The address of the pauser.
  • supply_controller_configs - The configs of the supply controllers.
  • sac - The address of the SAC contract.
fn __constructor(
    env: soroban_sdk::Env,
    default_admin: soroban_sdk::Address,
    trustline_manager: soroban_sdk::Address,
    clawback_manager: soroban_sdk::Address,
    supply_control_manager: soroban_sdk::Address,
    pauser: soroban_sdk::Address,
    supply_controller_configs: soroban_sdk::Vec,
    sac: soroban_sdk::Address,
)

Upgrades the contract.

Arguments

  • e - Access to Soroban environment.
  • new_wasm_hash - The new wasm hash.

Auth

  • Caller must have the ADMIN role and auth.

Note

  • Upgrade is allowed even when paused for emergency fixes.
fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)

Adds a new supply controller.

Arguments

  • e - Access to Soroban environment.
  • supply_controller_manager - The address of the supply controller manager.
  • new_supply_controller - The address of the new supply controller.
  • limit_capacity - The limit capacity of the new supply controller.
  • refill_per_second - The refill per second of the new supply controller.
  • mint_address_whitelist - The mint address whitelist of the new supply controller.
  • allow_any_mint_to_address - Flag to bypass the mint address whitelist.

Errors

  • [TokenAdminError::AlreadySupplyController] - If the new supply controller already has the SUPPLY_CONTROLLER role.
  • [TokenAdminError::InvalidParameters] - If limit_capacity or refill_per_second is negative.

Auth

  • supply_controller_manager - Must have the SUPPLY_CONTROL_MANAGER role and auth.
fn add_supply_controller(
    env: soroban_sdk::Env,
    supply_controller_manager: soroban_sdk::Address,
    new_supply_controller: soroban_sdk::Address,
    limit_capacity: i128,
    refill_per_second: i128,
    mint_address_whitelist: soroban_sdk::Vec,
    allow_any_mint_to_address: bool,
)

Removes a supply controller.

Arguments

  • e - Access to Soroban environment.
  • supply_controller_manager - The address of the supply controller manager.
  • old_supply_controller - The address of the old supply controller.

Auth

  • supply_controller_manager - Must have the SUPPLY_CONTROL_MANAGER role and auth.
fn remove_supply_controller(
    env: soroban_sdk::Env,
    supply_controller_manager: soroban_sdk::Address,
    old_supply_controller: soroban_sdk::Address,
)

Updates the limit config of a supply controller.

Arguments

  • e - Access to Soroban environment.
  • supply_controller_manager - The address of the supply controller manager.
  • supply_controller - The address of the supply controller.
  • limit_capacity - The limit capacity of the supply controller.
  • refill_per_second - The refill per second of the supply controller.

Errors

  • [TokenAdminError::InvalidParameters] - If limit_capacity or refill_per_second is negative.

Auth

  • supply_controller_manager - Must have the SUPPLY_CONTROL_MANAGER role and auth.
fn update_limit_config(
    env: soroban_sdk::Env,
    supply_controller_manager: soroban_sdk::Address,
    supply_controller: soroban_sdk::Address,
    limit_capacity: i128,
    refill_per_second: i128,
)

Sets the flag to allow any mint to address for a supply controller.

Arguments

  • e - Access to Soroban environment.
  • supply_controller_manager - The address of the supply controller manager.
  • supply_controller - The address of the supply controller.
  • allow_any_mint_to_address - Flag to bypass the mint address whitelist.

Auth

  • supply_controller_manager - Must have the SUPPLY_CONTROL_MANAGER role and auth.
fn set_allow_any_mint_to_address(
    env: soroban_sdk::Env,
    supply_controller_manager: soroban_sdk::Address,
    supply_controller: soroban_sdk::Address,
    allow_any_mint_to_address: bool,
)

Adds a mint address to the whitelist of a supply controller.

Arguments

  • e - Access to Soroban environment.
  • supply_controller_manager - The address of the supply controller manager.
  • supply_controller - The address of the supply controller.
  • mint_address - The address to add to the whitelist.

Auth

  • supply_controller_manager - Must have the SUPPLY_CONTROL_MANAGER role and auth.
fn add_mint_address_to_list(
    env: soroban_sdk::Env,
    supply_controller_manager: soroban_sdk::Address,
    supply_controller: soroban_sdk::Address,
    mint_address: soroban_sdk::Address,
)

Removes a mint address from the whitelist of a supply controller.

Arguments

  • e - Access to Soroban environment.
  • supply_controller_manager - The address of the supply controller manager.
  • supply_controller - The address of the supply controller.
  • mint_address - The address to remove from the whitelist.

Auth

  • supply_controller_manager - Must have the SUPPLY_CONTROL_MANAGER role and auth.
fn remove_mint_address_from_list(
    env: soroban_sdk::Env,
    supply_controller_manager: soroban_sdk::Address,
    supply_controller: soroban_sdk::Address,
    mint_address: soroban_sdk::Address,
)

Gets the config of a supply controller.

Arguments

  • e - Access to Soroban environment.
  • supply_controller - The address of the supply controller.
fn get_supply_controller_config(
    env: soroban_sdk::Env,
    supply_controller: soroban_sdk::Address,
) -> (RateLimitData, soroban_sdk::Vec, bool)

Gets all the supply controller addresses.

Arguments

  • e - Access to Soroban environment.
fn get_all_sc_addresses(
    env: soroban_sdk::Env,
) -> soroban_sdk::Vec

Gets the remaining mint amount for the calling supply controller at a given timestamp.

Returns the remaining token amount that can be minted by the calling supply controller within their rate limit at the specified timestamp.

Arguments

  • e - Access to Soroban environment.
  • supply_controller - The address of the supply controller (must have SUPPLY_CONTROLLER role).
  • timestamp - The timestamp to calculate the remaining amount for.

Returns

The remaining mint capacity considering rate limiting. If rate limiting is disabled (refill_per_second = 0), returns i128::MAX.

Auth

  • supply_controller - Must have the SUPPLY_CONTROLLER role and auth.
fn get_remaining_mint_amount(
    env: soroban_sdk::Env,
    supply_controller: soroban_sdk::Address,
    timestamp: u64,
) -> i128
fn set_admin(
    env: soroban_sdk::Env,
    new_admin: soroban_sdk::Address,
    _operator: soroban_sdk::Address,
)
fn set_authorized(
    env: soroban_sdk::Env,
    id: soroban_sdk::Address,
    authorize: bool,
    operator: soroban_sdk::Address,
)
fn mint(
    env: soroban_sdk::Env,
    to: soroban_sdk::Address,
    amount: i128,
    operator: soroban_sdk::Address,
)
fn clawback(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    amount: i128,
    operator: soroban_sdk::Address,
)
fn grant_role(
    env: soroban_sdk::Env,
    operator: soroban_sdk::Address,
    account: soroban_sdk::Address,
    role: soroban_sdk::Symbol,
)
fn has_role(
    env: soroban_sdk::Env,
    account: soroban_sdk::Address,
    role: soroban_sdk::Symbol,
) -> Option
fn get_role_member_count(env: soroban_sdk::Env, role: soroban_sdk::Symbol) -> u32
fn get_role_member(
    env: soroban_sdk::Env,
    role: soroban_sdk::Symbol,
    index: u32,
) -> soroban_sdk::Address
fn get_role_admin(
    env: soroban_sdk::Env,
    role: soroban_sdk::Symbol,
) -> Option
fn get_admin(env: soroban_sdk::Env) -> Option
fn revoke_role(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    account: soroban_sdk::Address,
    role: soroban_sdk::Symbol,
)
fn renounce_role(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    role: soroban_sdk::Symbol,
)
fn renounce_admin(env: soroban_sdk::Env)
fn transfer_admin_role(
    env: soroban_sdk::Env,
    new_admin: soroban_sdk::Address,
    live_until_ledger: u32,
)
fn accept_admin_transfer(env: soroban_sdk::Env)
fn set_role_admin(
    env: soroban_sdk::Env,
    role: soroban_sdk::Symbol,
    admin_role: soroban_sdk::Symbol,
)
fn pause(env: soroban_sdk::Env, pauser: soroban_sdk::Address)
fn unpause(env: soroban_sdk::Env, pauser: soroban_sdk::Address)
fn paused(env: soroban_sdk::Env) -> bool

Imports

WebAssembly Text (WAT) ▶