fn total_supply(env: soroban_sdk::Env) -> i128
fn allowance(
env: soroban_sdk::Env,
address: soroban_sdk::Address,
spender: soroban_sdk::Address,
) -> i128
fn approve(
env: soroban_sdk::Env,
address: soroban_sdk::Address,
spender: soroban_sdk::Address,
amount: i128,
expiration_ledger: u32,
)
fn balance(env: soroban_sdk::Env, address: soroban_sdk::Address) -> i128
fn transfer(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
to: soroban_sdk::Address,
amount: i128,
)
fn transfer_from(
env: soroban_sdk::Env,
spender: soroban_sdk::Address,
from: soroban_sdk::Address,
to: soroban_sdk::Address,
amount: i128,
)
fn burn(env: soroban_sdk::Env, address: soroban_sdk::Address, amount: i128)
fn burn_from(
env: soroban_sdk::Env,
spender: soroban_sdk::Address,
from: soroban_sdk::Address,
amount: i128,
)
fn decimals(env: soroban_sdk::Env) -> u32
fn name(env: soroban_sdk::Env) -> soroban_sdk::String
fn symbol(env: soroban_sdk::Env) -> soroban_sdk::String
Initializes a new RaumFi pair by setting token addresses, factory, and initial reserves.
e - The runtime environment.factory - The address of the RaumFi factory contract.token_0 - The address of the first token in the pair.token_1 - The address of the second token in the pair.fn initialize(
env: soroban_sdk::Env,
factory: soroban_sdk::Address,
token_0: soroban_sdk::Address,
token_1: soroban_sdk::Address,
) -> Result<(), PairError>
Returns the address of the first token in the RaumFi pair.
fn token_0(env: soroban_sdk::Env) -> soroban_sdk::Address
Returns the address of the second token in the RaumFi pair.
fn token_1(env: soroban_sdk::Env) -> soroban_sdk::Address
Returns the address of the RaumFi factory contract.
fn factory(env: soroban_sdk::Env) -> soroban_sdk::Address
Deposits tokens into the RaumFi pair and mints LP tokens in return.
e - The runtime environment.to - The address where the minted LP tokens will be sent.The amount of minted LP tokens. Possible errors:
PairError::NotInitialized: The RaumFi pair has not been initialized.PairError::DepositInsufficientAmountToken0: Insufficient amount of token 0 sent.PairError::DepositInsufficientAmountToken1: Insufficient amount of token 1 sent.PairError::DepositInsufficientFirstLiquidity: Insufficient first liquidity minted.PairError::DepositInsufficientLiquidityMinted: Insufficient liquidity minted.PairError::UpdateOverflow: Overflow occurred during update.fn deposit(env: soroban_sdk::Env, to: soroban_sdk::Address) -> Result
Executes a token swap within the RaumFi pair.
e - The runtime environment.amount_0_out - The desired amount of the first token to receive.amount_1_out - The desired amount of the second token to receive.to - The address where the swapped tokens will be sent.
Returns an error if the swap cannot be executed. Possible errors include:PairError::NotInitializedPairError::SwapInsufficientOutputAmountPairError::SwapNegativesOutNotSupportedPairError::SwapInsufficientLiquidityPairError::SwapInvalidToPairError::SwapInsufficientInputAmountPairError::SwapNegativesInNotSupportedPairError::SwapConstantNotMet: If the K constant condition is not met after the swap.fn swap(
env: soroban_sdk::Env,
amount_0_out: i128,
amount_1_out: i128,
to: soroban_sdk::Address,
) -> Result<(), PairError>
Withdraws liquidity from the RaumFi pair, burning LP tokens and returning the corresponding tokens to the user.
e - The runtime environment.to - The address where the withdrawn tokens will be sent.A tuple containing the amounts of token 0 and token 1 withdrawn from the pair.
fn withdraw(
env: soroban_sdk::Env,
to: soroban_sdk::Address,
) -> Result<(i128, i128), PairError>
Skims excess tokens from reserves and sends them to the specified address.
e - The runtime environment.to - The address where the excess tokens will be sent.fn skim(env: soroban_sdk::Env, to: soroban_sdk::Address)
Forces reserves to match current balances.
e - The runtime environment.fn sync(env: soroban_sdk::Env)
Returns the current reserves and the last block timestamp.
e - The runtime environment.A tuple containing the reserves of token 0 and token 1.
fn get_reserves(env: soroban_sdk::Env) -> (i128, i128)
Returns the value of the last product of reserves (K) stored in the contract.
e - The runtime environment.The value of the last product of reserves (K).
fn k_multiplier(env: soroban_sdk::Env) -> i128