Contract a6c1acc6e367e46535733ce8a7320c718616ed42f762cf2f1a0aa77ac6e056f6

← Back to Index 📥 Download WASM

Meta

rssdkver 23.5.3#d3e1ab2424388b10893b796b0c8e405c5edd03d2
rsver 1.93.0

Instances

  • CAE2G5Z77UP7GYPYGFOWFGW7C7J6I4YP2AFGSADRKQY62SYUFLPNFTXL

Interface

fn pause(env: soroban_sdk::Env)
fn paused(env: soroban_sdk::Env) -> bool
fn unpause(env: soroban_sdk::Env)
fn upgrade(
    env: soroban_sdk::Env,
    new_wasm_hash: soroban_sdk::BytesN<32>,
    operator: soroban_sdk::Address,
)
fn denylist(env: soroban_sdk::Env, account: soroban_sdk::Address)
fn get_admin(env: soroban_sdk::Env) -> Option
fn get_owner(env: soroban_sdk::Env) -> Option
fn get_pauser(env: soroban_sdk::Env) -> Option
fn get_min_fee(env: soroban_sdk::Env, burn_token: soroban_sdk::Address) -> i128
fn get_rescuer(env: soroban_sdk::Env) -> Option
fn set_min_fee(env: soroban_sdk::Env, burn_token: soroban_sdk::Address, min_fee: i128)
fn un_denylist(env: soroban_sdk::Env, account: soroban_sdk::Address)
fn accept_admin(env: soroban_sdk::Env)
fn rescue_sep41(
    env: soroban_sdk::Env,
    token_contract: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
)

Initializes the TokenMessengerMinterV2 contract.

Arguments

  • env - Access to the Soroban environment.
  • params - Initialization parameters including:
  • owner: The contract owner address.
  • pauser: The address authorized to pause/unpause the contract.
  • rescuer: The address authorized to rescue tokens.
  • token_controller: The address authorized to manage token configurations.
  • admin: The contract admin address.
  • fee_recipient: The address that receives fees.
  • min_fee_controller: The address that controls min fee configuration.
  • denylister: The address authorized to manage the denylist.
  • message_transmitter: The local MessageTransmitter contract address.
  • message_body_version: The version for burn message bodies.
  • remote_domains: List of remote domain identifiers.
  • remote_token_messengers: Corresponding remote token messenger addresses.

Errors

  • Panics if remote_domains and remote_token_messengers have different lengths.
  • [RemoteTokenMessengerError::ZeroAddress
fn __constructor(
    env: soroban_sdk::Env,
    params: TokenMessengerMinterV2ContractInitParams,
)
fn is_denylisted(env: soroban_sdk::Env, account: soroban_sdk::Address) -> bool
fn update_pauser(env: soroban_sdk::Env, new_pauser: soroban_sdk::Address)
fn get_denylister(env: soroban_sdk::Env) -> Option
fn transfer_admin(
    env: soroban_sdk::Env,
    new_admin: soroban_sdk::Address,
    expires_in_ledgers: u32,
)
fn update_rescuer(env: soroban_sdk::Env, new_rescuer: soroban_sdk::Address)
fn get_local_token(
    env: soroban_sdk::Env,
    remote_domain: u32,
    remote_token: soroban_sdk::BytesN<32>,
) -> Option
fn link_token_pair(
    env: soroban_sdk::Env,
    local_token: soroban_sdk::Address,
    remote_domain: u32,
    remote_token: soroban_sdk::BytesN<32>,
)
fn accept_ownership(env: soroban_sdk::Env)

Deposits and burns tokens from sender to be minted on destination domain.

Arguments

  • e - Access to the Soroban environment.
  • caller - The address of the caller depositing tokens.
  • amount - Amount of tokens to burn (must be non-zero).
  • destination_domain - Destination domain to receive message on.
  • mint_recipient - Address of mint recipient on destination domain (as bytes32).
  • burn_token - Token to burn amount of, on local domain.
  • destination_caller - Authorized caller on the destination domain (as bytes32). If zero, any address can broadcast the message.
  • max_fee - Maximum fee to pay on the destination domain, in units of burn_token.
  • min_finality_threshold - The minimum finality at which the burn message will be attested.

Errors

  • HostError: Error(Contract, #1000) – Contract is paused (EnforcedPaused).
  • HostError: Error(Auth, InvalidAction)caller authorization fails.
  • [DenylistError::AccountDenylisted] – If caller is on the denylist.
  • [`TokenMesseng
fn deposit_for_burn(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    amount: i128,
    destination_domain: u32,
    mint_recipient: soroban_sdk::BytesN<32>,
    burn_token: soroban_sdk::Address,
    destination_caller: soroban_sdk::BytesN<32>,
    max_fee: i128,
    min_finality_threshold: u32,
)
fn get_fee_recipient(env: soroban_sdk::Env) -> Option
fn get_pending_admin(env: soroban_sdk::Env) -> Option
fn get_pending_owner(env: soroban_sdk::Env) -> Option
fn set_fee_recipient(env: soroban_sdk::Env, new_fee_recipient: soroban_sdk::Address)
fn unlink_token_pair(
    env: soroban_sdk::Env,
    local_token: soroban_sdk::Address,
    remote_domain: u32,
    remote_token: soroban_sdk::BytesN<32>,
)
fn update_denylister(env: soroban_sdk::Env, denylister: soroban_sdk::Address)
fn get_min_fee_amount(
    env: soroban_sdk::Env,
    burn_token: soroban_sdk::Address,
    amount: i128,
) -> i128
fn transfer_ownership(
    env: soroban_sdk::Env,
    new_owner: soroban_sdk::Address,
    expires_in_ledgers: u32,
)
fn get_token_controller(env: soroban_sdk::Env) -> Option
fn set_token_controller(
    env: soroban_sdk::Env,
    new_token_controller: soroban_sdk::Address,
)
fn get_min_fee_controller(env: soroban_sdk::Env) -> Option
fn get_swap_minter_config(
    env: soroban_sdk::Env,
    local_token: soroban_sdk::Address,
) -> Option
fn set_min_fee_controller(
    env: soroban_sdk::Env,
    new_min_fee_controller: soroban_sdk::Address,
)
fn set_swap_minter_config(
    env: soroban_sdk::Env,
    local_token: soroban_sdk::Address,
    swap_minter: soroban_sdk::Address,
    allow_asset: soroban_sdk::Address,
)

Returns the message body version used for burn messages.

Arguments

  • e - Access to the Soroban environment.

Returns

The message body version.

Errors

  • [TokenMessengerMinterError::MessageBodyVersionNotSet] – If not set.
fn get_message_body_version(env: soroban_sdk::Env) -> u32
fn get_token_decimal_config(
    env: soroban_sdk::Env,
    local_token: soroban_sdk::Address,
) -> Option
fn set_token_decimal_config(
    env: soroban_sdk::Env,
    local_token: soroban_sdk::Address,
    local_decimals: u32,
    canonical_decimals: u32,
)
fn remove_swap_minter_config(env: soroban_sdk::Env, local_token: soroban_sdk::Address)
fn add_remote_token_messenger(
    env: soroban_sdk::Env,
    domain: u32,
    token_messenger: soroban_sdk::BytesN<32>,
)

Deposits and burns tokens from sender to be minted on destination domain, with optional hook data for execution on the destination chain.

Arguments

  • e - Access to the Soroban environment.
  • caller - The address of the caller depositing tokens.
  • amount - Amount of tokens to burn (must be non-zero).
  • destination_domain - Destination domain to receive message on.
  • mint_recipient - Address of mint recipient on destination domain (as bytes32).
  • burn_token - Token to burn amount of, on local domain.
  • destination_caller - Authorized caller on the destination domain (as bytes32). If zero, any address can broadcast the message.
  • max_fee - Maximum fee to pay on the destination domain, in units of burn_token.
  • min_finality_threshold - The minimum finality at which the burn message will be attested.
  • hook_data - Hook data to append to burn message for interpretation on destination domain.

Errors

  • HostError: Error(Contract, #1000) – Contract is paused (EnforcedPaused).
  • `Host
fn deposit_for_burn_with_hook(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    amount: i128,
    destination_domain: u32,
    mint_recipient: soroban_sdk::BytesN<32>,
    burn_token: soroban_sdk::Address,
    destination_caller: soroban_sdk::BytesN<32>,
    max_fee: i128,
    min_finality_threshold: u32,
    hook_data: soroban_sdk::Bytes,
)
fn get_remote_token_messenger(
    env: soroban_sdk::Env,
    domain: u32,
) -> Option>

Returns the address of the local MessageTransmitter contract.

Arguments

  • e - Access to the Soroban environment.

Returns

The address of the local MessageTransmitter contract.

Errors

  • [TokenMessengerMinterError::LocalMessageTransmitterNotSet] – If not set.
fn get_local_message_transmitter(env: soroban_sdk::Env) -> soroban_sdk::Address

Handles an incoming finalized message received by the local MessageTransmitter, and takes the appropriate action. For a burn message, mints the associated token to the requested recipient on the local domain.

Arguments

  • e - Access to the Soroban environment.
  • source_domain - The domain where the message originated from.
  • sender - The sender of the message (remote TokenMessenger).
  • finality_threshold_executed - The level of finality at which the message was attested to.
  • message_body - The message body bytes (burn message).

Returns

true if successful.

Errors

  • HostError: Error(Contract, #1000) – Contract is paused (EnforcedPaused).
  • HostError: Error(Auth, InvalidAction) – Authorization from the local MessageTransmitter fails.
  • [RemoteTokenMessengerError::RemoteTokenMessengerNotRegistered] – Sender is not a registered remote token messenger.
  • [TokenMessengerMinterError::InvalidBurnMessageFormat] – Burn message format is invalid.
  • [`TokenMessengerMinterError::In
fn handle_recv_finalized_message(
    env: soroban_sdk::Env,
    source_domain: u32,
    sender: soroban_sdk::BytesN<32>,
    finality_threshold_executed: u32,
    message_body: soroban_sdk::Bytes,
) -> bool
fn remove_remote_token_messenger(env: soroban_sdk::Env, domain: u32)
fn get_max_burn_amount_per_message(
    env: soroban_sdk::Env,
    local_token: soroban_sdk::Address,
) -> Option

Handles an incoming unfinalized message received by the local MessageTransmitter, and takes the appropriate action. For a burn message, mints the associated token to the requested recipient on the local domain, less fees. Fees are separately minted to the currently set fee_recipient address.

Arguments

  • e - Access to the Soroban environment.
  • source_domain - The domain where the message originated from.
  • sender - The sender of the message (remote TokenMessenger).
  • finality_threshold_executed - The level of finality at which the message was attested to.
  • message_body - The message body bytes (burn message).

Returns

true if successful.

Errors

  • HostError: Error(Contract, #1000) – Contract is paused (EnforcedPaused).
  • HostError: Error(Auth, InvalidAction) – Authorization from the local MessageTransmitter fails.
  • [RemoteTokenMessengerError::RemoteTokenMessengerNotRegistered] – Sender is not a registered remote token messenger.
  • [`TokenMessengerMinterError::Unsupporte
fn handle_recv_unfinalized_message(
    env: soroban_sdk::Env,
    source_domain: u32,
    sender: soroban_sdk::BytesN<32>,
    finality_threshold_executed: u32,
    message_body: soroban_sdk::Bytes,
) -> bool
fn set_max_burn_amount_per_message(
    env: soroban_sdk::Env,
    local_token: soroban_sdk::Address,
    burn_limit_per_message: i128,
)

Imports

WebAssembly Text (WAT) ▶