Contract 555210f70b30010aec58c08382a95ecf2c584db1e793ea2e9f43bf9fc028faa3

← Back to Index 📥 Download WASM

Meta

cliver 27.1.0#8e402ea28202950b272fbabc34caad4d2f64fe87
rssdk_spec_shaking 2
rssdkver 26.1.1#8ac18efb681a1c0b4b85a38c5a380300344e3f39
rsver 1.98.1
source_commit 26b0f4577a17dfa365e463577f312a5ede34adc3

Instances

  • CDDEOTFOD5O2GOVMANJUIKLLQ5UDJCU3XFBXGTUWQYOUV5HF4OV6AU7U

Interface

fn get_rate(env: soroban_sdk::Env) -> i128
fn set_rate(env: soroban_sdk::Env, rate: i128)
fn withdraw(
    env: soroban_sdk::Env,
    token: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
)

Returns Some(Address) if ownership is set, or None if ownership has been renounced.

Arguments

  • e - Access to the Soroban environment.
fn get_owner(env: soroban_sdk::Env) -> Option

Initializes the treasury with an owner and a fee rate.

Arguments

  • e - Access to the Soroban environment.
  • owner - The address that may change the rate and withdraw fees.
  • rate - The protocol fee rate as a SCALAR_18 fraction, in [0, SCALAR_18 / 2].

Errors

  • [TreasuryError::InvalidRate] - If rate is outside [0, SCALAR_18 / 2].
fn __constructor(env: soroban_sdk::Env, owner: soroban_sdk::Address, rate: i128)

Accepts a pending ownership transfer.

Arguments

  • e - Access to the Soroban environment.

Errors

  • [crate::role_transfer::RoleTransferError::NoPendingTransfer] - If there is no pending transfer to accept.

Events

  • topics - ["ownership_transfer_completed"]
  • data - [new_owner: Address]
fn accept_ownership(env: soroban_sdk::Env)

Renounces ownership of the contract.

Permanently removes the owner, disabling all functions gated by #[only_owner].

Arguments

  • e - Access to the Soroban environment.

Errors

  • [OwnableError::TransferInProgress] - If there is a pending ownership transfer.
  • [OwnableError::OwnerNotSet] - If the owner is not set.

Notes

  • Authorization for the current owner is required.
fn renounce_ownership(env: soroban_sdk::Env)

Initiates a 2-step ownership transfer to a new address.

Requires authorization from the current owner. The new owner must later call accept_ownership() to complete the transfer.

Arguments

  • e - Access to the Soroban environment.
  • new_owner - The proposed new owner.
  • live_until_ledger - Ledger number until which the new owner can accept. A value of 0 cancels any pending transfer.

Errors

  • [OwnableError::OwnerNotSet] - If the owner is not set.
  • [crate::role_transfer::RoleTransferError::NoPendingTransfer] - If trying to cancel a transfer that doesn't exist.
  • [crate::role_transfer::RoleTransferError::InvalidLiveUntilLedger] - If the specified ledger is in the past.
  • [crate::role_transfer::RoleTransferError::InvalidPendingAccount] - If the specified pending account is not the same as the provided new address.

Notes

  • Authorization for the current owner is required.
fn transfer_ownership(
    env: soroban_sdk::Env,
    new_owner: soroban_sdk::Address,
    live_until_ledger: u32,
)

Imports

WebAssembly Text (WAT) ▶