Contract 9a2efbee9f3be796a600a8c288eaad2e709dde25e376dcaabf49e59a9643f872

← Back to Index 📥 Download WASM

Meta

rssdkver 20.5.0#9e2c3022b4355b224a7a814e13ba51761eeb14bb
rsver 1.77.2

Instances

  • CBMA4MNTQYDXKGJW5RZEIMCEQYFLGG4TETSVBVQCGK4MDGFCUAOXSKIQ
  • CCLJULBOBZDJN3ZFO3VXXBAIUP5IVYJSNXSGYS2PW5D26ATKJTEEOWHW

Interface

Returns the recipient of the fee.

Returns an error if the Factory is not yet initialized.

fn fee_to(env: soroban_sdk::Env) -> Result

Returns the address allowed to change the fee recipient.

Returns an error if the Factory is not yet initialized.

fn fee_to_setter(env: soroban_sdk::Env) -> Result

Checks if fees are enabled.

Returns an error if the Factory is not yet initialized.

fn fees_enabled(env: soroban_sdk::Env) -> Result

Returns the total number of pairs created through the factory so far.

Returns an error if the Factory is not yet initialized.

fn all_pairs_length(env: soroban_sdk::Env) -> Result

Returns the address of the pair for token_a and token_b, if it has been created.

Returns an error if the Factory is not yet initialized or if the pair does not exist

fn get_pair(
    env: soroban_sdk::Env,
    token_a: soroban_sdk::Address,
    token_b: soroban_sdk::Address,
) -> Result

Returns the address of the nth pair (0-indexed) created through the factory, or address(0) if not enough pairs have been created yet.

Returns an error if the Factory is not yet initialized or if index n does not exist.

fn all_pairs(
    env: soroban_sdk::Env,
    n: u32,
) -> Result

Checks if a pair exists for the given token_a and token_b.

Returns an error if the Factory is not yet initialized.

fn pair_exists(
    env: soroban_sdk::Env,
    token_a: soroban_sdk::Address,
    token_b: soroban_sdk::Address,
) -> Result

Sets the fee_to_setter address and initializes the factory.

Returns an error if the Factory is already initialized.

fn initialize(
    env: soroban_sdk::Env,
    setter: soroban_sdk::Address,
    pair_wasm_hash: soroban_sdk::BytesN<32>,
) -> Result<(), FactoryError>

Sets the fee_to address.

Returns an error if the Factory is not yet initialized or if the caller is not the current fee_to_setter.

fn set_fee_to(
    env: soroban_sdk::Env,
    to: soroban_sdk::Address,
) -> Result<(), FactoryError>

Sets the fee_to_setter address.

Returns an error if the Factory is not yet initialized or if the caller is not the existing fee_to_setter.

fn set_fee_to_setter(
    env: soroban_sdk::Env,
    new_setter: soroban_sdk::Address,
) -> Result<(), FactoryError>

Sets whether fees are enabled or disabled.

Returns an error if the Factory is not yet initialized or if the caller is not the current fee_to_setter.

fn set_fees_enabled(
    env: soroban_sdk::Env,
    is_enabled: bool,
) -> Result<(), FactoryError>

Creates a pair for token_a and token_b if one doesn't exist already.

Returns an error if the pair is not yet initialized, if token_a and token_b have identical addresses, or if the pair already exists between token_a and token_b.

fn create_pair(
    env: soroban_sdk::Env,
    token_a: soroban_sdk::Address,
    token_b: soroban_sdk::Address,
) -> Result

Imports

WebAssembly Text (WAT) ▶