Module: AwakenSwapContract_Helper.cs
Function: long[] AddLiquidity(string tokenA, string tokenB, long amountADesired, long amountBDesired, long amountAMin, long amountBMin)
Adds liquidity to a token pair.
Inputs
tokenAValidation: Must be a valid token symbol.
Impact: Used to add liquidity.
tokenBValidation: Must be a valid token symbol.
Impact: Used to add liquidity.
amountADesiredValidation: Must be greater than zero.
Impact: Specifies desired amount of tokenA.
amountBDesiredValidation: Must be greater than zero.
Impact: Specifies desired amount of tokenB.
amountAMinValidation: Must be greater than or equal to zero.
Impact: Ensures minimum amount of tokenA.
amountBMinValidation: Must be greater than or equal to zero.
Impact: Ensures minimum amount of tokenB.
Branches and code coverage (including function calls)
Intended branches
Negative behavior
Function call analysis
This function interacts with external state (token balances, reserves).
Function: long[] RemoveLiquidity(string tokenA, string tokenB, long liquidityRemoveAmount, long amountAMin, long amountBMin, Address to)
Removes liquidity from a token pair.
Inputs
tokenAValidation: Must be a valid token symbol.
Impact: Used to remove liquidity.
tokenBValidation: Must be a valid token symbol.
Impact: Used to remove liquidity.
liquidityRemoveAmountValidation: Must be greater than zero.
Impact: Specifies amount of liquidity to remove.
amountAMinValidation: Must be greater than or equal to zero.
Impact: Ensures minimum amount of tokenA to be received.
amountBMinValidation: Must be greater than or equal to zero.
Impact: Ensures minimum amount of tokenB to be received.
toValidation: Must be a valid address.
Impact: Specifies recipient address.
Branches and code coverage (including function calls)
Intended branches
Negative behavior
Function call analysis
This function interacts with external state (token balances, reserves).
Function: long MintLPToken(string tokenA, string tokenB, long amountA, long amountB, Address account, string channel)
Mints liquidity pool tokens based on provided token amounts.
Inputs
tokenAValidation: Must be a valid token symbol.
Impact: Used in minting LP tokens.
tokenBValidation: Must be a valid token symbol.
Impact: Used in minting LP tokens.
amountAValidation: Must be greater than zero.
Impact: Specifies the amount of tokenA.
amountBValidation: Must be greater than zero.
Impact: Specifies the amount of tokenB.
accountValidation: Must be a valid address.
Impact: Recipient of the minted LP tokens.
channelValidation: None.
Impact: Specifies the channel for the tokens.
Branches and code coverage (including function calls)
Intended branches
Negative behavior
Function call analysis
This function interacts with external state (token balances, reserves).
Function: long[] PerformBurn(Address to, string tokenA, string tokenB, long liquidityRemoveAmount)
Burns liquidity pool tokens and returns the underlying tokens.
Inputs
toValidation: Must be a valid address.
Impact: Recipient of the underlying tokens.
tokenAValidation: Must be a valid token symbol.
Impact: Token to be returned.
tokenBValidation: Must be a valid token symbol.
Impact: Token to be returned.
liquidityRemoveAmountValidation: Must be greater than zero.
Impact: Specifies the amount of liquidity to burn.
Branches and code coverage (including function calls)
Intended branches
Negative behavior
Function call analysis
This function interacts with external state (token balances, reserves).
Function: void Swap(RepeatedField<long> amounts, RepeatedField<string> path, Address lastTo, string channel)
Performs a token swap along a specified path.
Inputs
amountsValidation: Must correspond to the path.
Impact: Specifies the amounts for the swap.
pathValidation: Must be a valid path of token symbols.
Impact: Specifies the path for the swap.
lastToValidation: Must be a valid address.
Impact: Final recipient of the swap output.
channelValidation: None.
Impact: Specifies the channel for the swap.
Branches and code coverage (including function calls)
Intended branches
Negative behavior
Function call analysis
This function interacts with external state (token balances, reserves).
Function: void SwapSupportingFeeOnTransferTokens(RepeatedField<string> path, Address lastTo, string channel)
Performs a token swap supporting tokens with transfer fees.
Inputs
pathValidation: Must be a valid path of token symbols.
Impact: Specifies the path for the swap.
lastToValidation: Must be a valid address.
Impact: Final recipient of the swap output.
channelValidation: None.
Impact: Specifies the channel for the swap.
Branches and code coverage (including function calls)
Intended branches
Negative behavior
Function call analysis
This function interacts with external state (token balances, reserves).
Function: void TransferIn(Address pair, Address from, string symbol, long amount)
Transfers tokens into the contract from a specified address.
Inputs
pairValidation: Must be a valid address.
Impact: Recipient of the transferred tokens.
fromValidation: Must be a valid address.
Impact: Source of the transferred tokens.
symbolValidation: Must be a valid token symbol.
Impact: Specifies the token to transfer.
amountValidation: Must be greater than zero.
Impact: Specifies the amount of tokens to transfer.
Branches and code coverage (including function calls)
Intended branches
Negative behavior
Function call analysis
This function interacts with external state (token balances).
Function: void TransferOut(Address pair, Address to, string symbol, long amount)
Transfers tokens out of the contract to a specified address.
Inputs
pairValidation: Must be a valid address.
Impact: Source of the transferred tokens.
toValidation: Must be a valid address.
Impact: Recipient of the transferred tokens.
symbolValidation: Must be a valid token symbol.
Impact: Specifies the token to transfer.
amountValidation: Must be greater than zero.
Impact: Specifies the amount of tokens to transfer.
Branches and code coverage (including function calls)
Intended branches
Negative behavior
Function call analysis
This function interacts with external state (token balances).