Initializes the token admin contract.
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.
e - Access to Soroban environment.new_wasm_hash - The new wasm hash.fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)
Adds a new supply controller.
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.TokenAdminError::AlreadySupplyController] - If the new supply controller already has the SUPPLY_CONTROLLER role.TokenAdminError::InvalidParameters] - If limit_capacity or refill_per_second is negative.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.
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.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.
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.TokenAdminError::InvalidParameters] - If limit_capacity or refill_per_second is negative.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.
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.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.
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.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.
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.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.
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.
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.
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.The remaining mint capacity considering rate limiting. If rate limiting is disabled (refill_per_second = 0), returns i128::MAX.
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