Contract 2bbe21a917929b1cb97b120d8d59732fc85083b671672b6a679967e747fd97ad

← Back to Index 📥 Download WASM

Meta

cliver 28.1.0#c0f4d0da891bbf214c08b8c5035ae6db80e9a3bd
rssdk_spec_shaking 2
rssdkver 28.0.0#48d506712f964094d14176e2f0b02afcd1054567
rsver 1.98.1

Instances

  • CBRTTVZYSW2EXHEWSUDE7CEZDLW7TG7VETNFB5VC2NEQYRTJK6ECCQAP
  • CCNUWC2YXMSIW33J2OPYGUJGMHS23CPAF3VXYHFFTYC6E4UPLSPGXN6C

Interface

Returns the port's balance of token_address.

Arguments

  • token_address - Token contract address to query.

Returns

Balance held by this port.

fn balance(env: soroban_sdk::Env, token_address: soroban_sdk::Address) -> i128

Replaces the Wasm of this port with new_wasm_hash.

Only the admin (the factory that deployed this port) can call this: when invoked from the factory, its require_auth is satisfied automatically as the invoking contract. The new Wasm must be already uploaded to the ledger. The network emits the executable_update system event automatically. The constructor is NOT re-run after an upgrade, so storage migrations require a separate migrate step.

Arguments

  • new_wasm_hash - Wasm hash of the new port implementation.

Panics

Panics if the invocation is not authorized by the admin, or if new_wasm_hash is not present in the ledger.

fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)

Returns the admin address of the port.

Returns

Admin address (the factory) authorized to upgrade the port.

fn get_admin(env: soroban_sdk::Env) -> soroban_sdk::Address

Sweeps amount of a SEP-41 token from the port to to.

token_address must expose the SEP-41 token interface. Emits SweptSep41.

Arguments

  • token_address - SEP-41 token contract address to sweep.
  • to - Recipient of the swept funds.
  • amount - Amount to sweep.

Panics

Panics if the invocation is not authorized by the current off-ramp, or if the token transfer fails (insufficient balance, negative amount, token_address is not a token, ...).

fn sweep_sep41(
    env: soroban_sdk::Env,
    token_address: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
)

Sweeps native XLM from the port to to.

Emits SweptNative.

Arguments

  • to - Recipient of the swept funds.
  • amount - Amount to sweep.

Panics

Panics if the invocation is not authorized by the current off-ramp, or if the token transfer fails (insufficient balance, negative amount, ...).

fn sweep_native(env: soroban_sdk::Env, to: soroban_sdk::Address, amount: i128)

Initializes the port.

Arguments

  • admin - Admin address (the deploying factory), i.e. the only upgrade path of the port.
  • off_ramp - Off-ramp address authorized to sweep funds and rotate the off-ramp.
  • xlm - XLM token (SAC) contract address held by the port.
fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    off_ramp: soroban_sdk::Address,
    xlm: soroban_sdk::Address,
)

Returns the current off-ramp address.

Returns

Off-ramp address authorized to sweep funds and rotate the off-ramp.

fn get_off_ramp_address(env: soroban_sdk::Env) -> soroban_sdk::Address

Replaces the off-ramp address.

Emits OffRampChanged.

Arguments

  • off_ramp - New off-ramp address.

Panics

Panics if the invocation is not authorized by the current off-ramp.

fn change_off_ramp_address(env: soroban_sdk::Env, off_ramp: soroban_sdk::Address)

Imports

WebAssembly Text (WAT) ▶