Contract ebad9a30db7f22f11743c9857b86ba1784600f71fb4dae5236f5139d3e465e59

← Back to Index 📥 Download WASM

Meta

binver 0.0.1
rssdkver 22.0.8#f46e9e0610213bbb72285566f9dd960ff96d03d8
rsver 1.89.0

Instances

  • CAVZK26ERVGKGXLQGEOKPAQGIZS2YKN4BSXOYDMUY365EV66ZNSFEDBS

Interface

fn upgrade(
    env: soroban_sdk::Env,
    new_wasm_hash: soroban_sdk::BytesN<32>,
    operator: soroban_sdk::Address,
)
fn __constructor(env: soroban_sdk::Env, owner: soroban_sdk::Address)

Add a token to the redemption contract. All token contract addresses must be added to the redemption contract.

Arguments

  • token_contract_address - The address of the token contract to add.

Errors

The caller must be the owner.

fn add_token(env: soroban_sdk::Env, token_contract_address: soroban_sdk::Address)

Remove a token from the redemption contract.

Arguments

  • token_contract_address - The address of the token contract to remove.

Errors

The caller must be the owner.

fn remove_token(env: soroban_sdk::Env, token_contract_address: soroban_sdk::Address)

Set the permission manager (central role management authority).

Arguments

  • permission_manager - The address of the permission manager.

Errors

The caller must be the owner.

fn set_permission_manager(
    env: soroban_sdk::Env,
    permission_manager: soroban_sdk::Address,
)

On redeem. It is called by a registered token contract just after the tokens are transferred to the redemption contract. The redemption is recorded as pending.

Arguments

  • token - The address of the token contract.
  • from - The address of the account that redeemed the tokens.
  • amount - The amount of tokens redeemed.
  • salt - The salt used to generate the redemption hash.

Errors

It must be called by a registered token contract. The redemption hash must be in the Null status. The redemption hash is used to prevent duplicate redemptions. All redemptions are unique.

fn on_redeem(
    env: soroban_sdk::Env,
    token: soroban_sdk::Address,
    from: soroban_sdk::Address,
    amount: i128,
    salt: soroban_sdk::String,
)

Execute redemptions. It is called by a redemption executor. It will burn the tokens from the redemption contract.

Arguments

  • caller - The address of the redemption executor.
  • operations - The operations to execute.

Errors

The caller must have the REDEMPTION_EXECUTOR_ROLE. The operations must not be empty. All tokens must be registered. All redemptions must be in the Pending status.

fn execute_redemptions(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    operations: soroban_sdk::Vec,
)

Cancel a redemption. It is called by a redemption executor. It will transfer the tokens back to the from address.

Arguments

  • caller - The address of the redemption executor.
  • token - The address of the token contract.
  • from - The address of the account that redeemed the tokens.
  • amount - The amount of tokens redeemed.
  • salt - The salt used to generate the redemption hash.

Errors

The caller must have the REDEMPTION_EXECUTOR_ROLE. The token must be registered. The redemption must be in the Pending status.

fn cancel_redemption(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    token: soroban_sdk::Address,
    from: soroban_sdk::Address,
    amount: i128,
    salt: soroban_sdk::String,
)
fn get_owner(env: soroban_sdk::Env) -> Option
fn transfer_ownership(
    env: soroban_sdk::Env,
    new_owner: soroban_sdk::Address,
    live_until_ledger: u32,
)
fn accept_ownership(env: soroban_sdk::Env)
fn renounce_ownership(env: soroban_sdk::Env)

Imports

WebAssembly Text (WAT) ▶