Contract 1b64d61d10f6e20ca0de8087141165895c7914e83afc064b58767843ba60159b

← Back to Index 📥 Download WASM

Meta

cliver 23.4.0#
rssdkver 22.0.8#f46e9e0610213bbb72285566f9dd960ff96d03d8
rsver 1.91.1

Instances

  • CDX7RNL3TJQT4S3GFZJLOTXMDJXIGSJWT2FAUVLV4XDVA5JY63IOCA7W

Interface

Pause Contract Operations

Description:

Emergency function to pause all order creation and settlements.

Authorization:

  • admin: Must authorize the pause

Events:

  • ("Paused",) when contract is paused

Note:

  • Prevents new order creation
  • Existing orders can still be settled/refunded
fn pause(env: soroban_sdk::Env) -> Result<(), ContractError>

Unpause Contract Operations

Description:

Resumes normal contract operations after a pause.

Authorization:

  • admin: Must authorize the unpause

Events:

  • ("Unpaused",) when contract is unpaused
fn unpause(env: soroban_sdk::Env) -> Result<(), ContractError>

Check if Contract is Paused

Returns:

  • true if contract operations are paused
  • false if contract is operational
fn is_paused(env: soroban_sdk::Env) -> bool

Initialize Settings Contract

Description:

Sets up initial protocol configuration with admin, treasury, and relayer addresses.

Default Configuration:

  • Protocol fee: 1% (1000 basis points)
  • Max BPS: 100,000 (100%)
  • Paused: false

Authorization:

  • admin: Must authorize initialization

Parameters:

  • treasury: Address to receive protocol fees
  • relayer_address: Authorized address for settlement operations
fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    treasury: soroban_sdk::Address,
    relayer_address: soroban_sdk::Address,
)

Check if Token is Supported

Description:

Currently hardcoded to only support USDC. Can be extended for multi-token support.

Returns:

  • true if token is supported for orders
  • false if token is not supported
fn is_token_supported(env: soroban_sdk::Env, token: soroban_sdk::Address) -> bool

Upgrade Settings Manager WASM

Description:

Updates the settings manager contract's WASM code.

Authorization:

  • admin: Must authorize the upgrade

Note:

  • Maintains all existing settings and state
  • Only admin can perform upgrades
fn upgrade_lp_manager(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)

Get Relayer Address

Returns:

  • Current relayer address authorized for settlements
fn get_relayer_address(env: soroban_sdk::Env) -> soroban_sdk::Address

Get Treasury Address

Returns:

  • Current treasury address for fee collection
fn get_treasury_address(env: soroban_sdk::Env) -> soroban_sdk::Address

Update Protocol Addresses

Description:

Updates treasury or relayer addresses with proper validation.

Authorization:

  • admin: Must authorize the change

Parameters:

  • what: Type of address to update (Treasury or Aggregator/Relayer)
  • value: New address value
fn update_protocol_address(
    env: soroban_sdk::Env,
    what: ProtocolAddressType,
    value: soroban_sdk::Address,
) -> Result<(), ContractError>

Imports

WebAssembly Text (WAT) ▶