Router v2
SOY Finance is based on Uniswap v2. Read the Uniswap v2 documentation. For more in-depth information on the core contract logic, read the Uniswap v2 Core whitepaper.
Contract info
Contract name: SoyFinanceRouter
View SoyFinanceRouter.sol on GitHub.
View the SoyFinance Router v2 contract on:
Callisto Network 0xeB5B468fAacC6bBdc14c4aacF0eec38ABCCC13e7.
BitTorrent chain (BTTC) 0x8cb2e43e5aeb329de592f7e49b6c454649b61929.
Binance Smart Chain (BSC) 0x8c5Bba04B2f5CCCe0f8F951D2DE9616BE190070D.
Ethereum Classic (ETC) 0x8c5Bba04B2f5CCCe0f8F951D2DE9616BE190070D.
Read functions
WCLO
function WCLO() external pure returns (address);
Returns the canonical address for Callisto: WCLO token (WCLO being a vestige from Callisto network origins).
factory
function factory() external pure returns (address);
Returns the canonical address for SoyFinanceFactory.
For explanations of the following, view the Uniswap v2 Internal Functions documentation.
getAmountOut
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut);
getAmountIn
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn);
getAmountsOut
function getAmountsOut(uint amountIn, address[] memory path) internal view returns (uint[] memory amounts);
getAmountsIn
function getAmountsIn(uint amountOut, address[] memory path) internal view returns (uint[] memory amounts);
quote
function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB);
Write functions
addLiquidity
Adds liquidity to a BEP20⇄BEP20 pool.
Name | Type | |
---|---|---|
tokenA |
| The contract address of one token from your liquidity pair. |
tokenB |
| The contract address of the other token from your liquidity pair. |
amountADesired |
| The amount of tokenA you'd like to provide as liquidity. |
amountBDesired |
| The amount of tokenA you'd like to provide as liquidity. |
amountAMin |
| The minimum amount of tokenA to provide (slippage impact). |
amountBMin |
| The minimum amount of tokenB to provide (slippage impact). |
to |
| Address of LP Token recipient. |
deadline |
| Unix timestamp deadline by which the transaction must confirm. |
addLiquidityCLO
Adds liquidity to a BEP20⇄WCLO pool.
Name | Type | |
---|---|---|
addLiquidityCLO |
| The payable amount in CLO. |
token |
| The contract address of the token to add liquidity. |
amountTokenDesired |
| The amount of the token you'd like to provide as liquidity. |
amountTokenMin |
| The minimum amount of the token to provide (slippage impact). |
amountCLOMin |
| The minimum amount of CLO to provide (slippage impact). |
to |
| Address of LP Token recipient. |
deadline |
| Unix timestamp deadline by which the transaction must confirm. |
removeLiquidity
Removes liquidity from a BEP20⇄BEP20 pool.
Name | Type | |
---|---|---|
tokenA |
| The contract address of one token from your liquidity pair. |
tokenB |
| The contract address of the other token from your liquidity pair. |
liquidity |
| The amount of LP Tokens to remove. |
amountAMin |
| The minimum amount of tokenA to remove (slippage impact). |
amountBMin |
| The minimum amount of tokenB to remove (slippage impact). |
to |
| Address of LP Token recipient. |
deadline |
| Unix timestamp deadline by which the transaction must confirm. |
removeLiquidityCLO
Removes liquidity from a BEP20⇄WCLO pool.
Name | Type | |
---|---|---|
token |
| The contract address of the token to remove liquidity. |
liquidity |
| The amount of LP Tokens to remove. |
amountTokenMin |
| The minimum amount of the token to remove (slippage impact). |
amountCLOMin |
| The minimum amount of CLO to remove (slippage impact). |
to |
| Address of LP Token recipient. |
deadline |
| Unix timestamp deadline by which the transaction must confirm. |
removeLiquidityCLOSupportingFeeOnTransferTokens
Removes liquidity from a BEP20⇄WCLO for tokens that take a fee on transfer.
Name | Type | |
---|---|---|
token |
| The contract address of the token to remove liquidity. |
liquidity |
| The amount of LP Tokens to remove. |
amountTokenMin |
| The minimum amount of the token to remove (slippage impact). |
amountCLOMin |
| The minimum amount of CLO to remove (slippage impact). |
to |
| Address of LP Token recipient. |
deadline |
| Unix timestamp deadline by which the transaction must confirm. |
removeLiquidityCLOWithPermit
Removes liquidity from a BEP20⇄WCLO and receives CLO, without pre-approval, via permit.
Name | Type | |
---|---|---|
token |
| The contract address of the token to remove liquidity. |
liquidity |
| The amount of LP Tokens to remove. |
amountTokenMin |
| The minimum amount of the token to remove (slippage impact). |
amountCLOMin |
| The minimum amount of CLO to remove (slippage impact). |
to |
| Address of LP Token recipient. |
deadline |
| Unix timestamp deadline by which the transaction must confirm. |
approveMax |
| Whether or not the approval amount in the signature is for liquidity or |
v |
| The v component of the permit signature. |
r |
| The r component of the permit signature. |
s |
| The s component of the permit signature. |
removeLiquidityCLOWithPermitSupportingFeeOnTransferTokens
Removes liquidity from a BEP20⇄WCLO and receives CLO via permit for tokens that take a fee on transfer.
Name | Type | |
---|---|---|
token |
| The contract address of the token to remove liquidity. |
liquidity |
| The amount of LP Tokens to remove. |
amountTokenMin |
| The minimum amount of the token to remove (slippage impact). |
amountCLOMin |
| The minimum amount of CLO to remove (slippage impact). |
to |
| Address of LP Token recipient. |
deadline |
| Unix timestamp deadline by which the transaction must confirm. |
approveMax |
| Whether or not the approval amount in the signature is for liquidity or |
v |
| The v component of the permit signature. |
r |
| The r component of the permit signature. |
s |
| The s component of the permit signature. |
removeLiquidityWithPermit
Removes liquidity from a BEP20⇄BEP20, without pre-approval, via permit.
Name | Type | |
---|---|---|
tokenA |
| The contract address of one token from your liquidity pair. |
tokenB |
| The contract address of the other token from your liquidity pair. |
liquidity |
| The amount of LP Tokens to remove. |
amountTokenMin |
| The minimum amount of the token to remove (slippage impact). |
amountCLOMin |
| The minimum amount of CLO to remove (slippage impact). |
to |
| Address of LP Token recipient. |
deadline |
| Unix timestamp deadline by which the transaction must confirm. |
approveMax |
| Whether or not the approval amount in the signature is for liquidity or |
v |
| The v component of the permit signature. |
r |
| The r component of the permit signature. |
s |
| The s component of the permit signature. |
swapCLOForExactTokens
Receive an exact amount of output tokens for as little CLO as possible.
Name | Type | |
---|---|---|
swapCLOForExactTokens |
| Payable CLO amount. |
amountOut |
| The amount tokens to receive. |
path (address[]) |
| An array of token addresses. |
to |
| Address of recipient. |
deadline |
| Unix timestamp deadline by which the transaction must confirm. |
swapExactCLOForTokens
Receive as many output tokens as possible for an exact amount of CLO.
Name | Type | |
---|---|---|
swapExactCLOForTokens |
| Payable CLO amount. |
amountOutMin |
| The minimum amount tokens to receive. |
path (address[]) |
| An array of token addresses. |
to |
| Address of recipient. |
deadline |
| Unix timestamp deadline by which the transaction must confirm. |
swapExactCLOForTokensSupportingFeeOnTransferTokens
Receive as many output tokens as possible for an exact amount of CLO. Supports tokens that take a fee on transfer.
Name | Type | |
---|---|---|
swapExactCLOForTokensSupportingFeeOnTransferTokens |
| Payable CLO amount. |
amountOutMin |
| The minimum amount tokens to receive. |
path (address[]) |
| An array of token addresses. |
to |
| Address of recipient. |
deadline |
| Unix timestamp deadline by which the transaction must confirm. |
swapExactTokensForCLO
Receive as much CLO as possible for an exact amount of input tokens.
Name | Type | |
---|---|---|
amountIn |
| Payable amount of input tokens. |
amountOutMin |
| The minimum amount tokens to receive. |
path (address[]) |
| An array of token addresses. |
to |
| Address of recipient. |
deadline |
| Unix timestamp deadline by which the transaction must confirm. |
swapExactTokensForCLOSupportingFeeOnTransferTokens
Receive as much CLO as possible for an exact amount of tokens. Supports tokens that take a fee on transfer.
Name | Type | |
---|---|---|
amountIn |
| Payable amount of input tokens. |
amountOutMin |
| The minimum amount tokens to receive. |
path (address[]) |
| An array of token addresses. |
to |
| Address of recipient. |
deadline |
| Unix timestamp deadline by which the transaction must confirm. |
swapExactTokensForTokens
Receive as many output tokens as possible for an exact amount of input tokens.
Name | Type | |
---|---|---|
amountIn |
| Payable amount of input tokens. |
amountOutMin |
| The minimum amount tokens to receive. |
path (address[]) |
| An array of token addresses. |
to |
| Address of recipient. |
deadline |
| Unix timestamp deadline by which the transaction must confirm. |
swapExactTokensForTokensSupportingFeeOnTransferTokens
Receive as many output tokens as possible for an exact amount of input tokens. Supports tokens that take a fee on transfer.
Name | Type | |
---|---|---|
amountIn |
| Payable amount of input tokens. |
amountOutMin |
| The minimum amount tokens to receive. |
path (address[]) |
| An array of token addresses. |
to |
| Address of recipient. |
deadline |
| Unix timestamp deadline by which the transaction must confirm. |
swapTokensForExactCLO
Receive an exact amount of CLO for as few input tokens as possible.
Name | Type | |
---|---|---|
amountOut |
| Payable amount of input tokens. |
amountInMax |
| The minimum amount tokens to input. |
path (address[]) |
| An array of token addresses. |
to |
| Address of recipient. |
deadline |
| Unix timestamp deadline by which the transaction must confirm. |
swapTokensForExactTokens
Receive an exact amount of output tokens for as few input tokens as possible.
Name | Type | |
---|---|---|
amountOut |
| Payable amount of input tokens. |
amountInMax |
| The minimum amount tokens to input. |
path (address[]) |
| An array of token addresses. |
to |
| Address of recipient. |
deadline |
| Unix timestamp deadline by which the transaction must confirm. |
Interface
Last updated