Skip to main content

MockRouter

Functions

constructor

function constructor(
address pair
) public

Parameters

NameTypeDescription
pairaddress

addLiquidityETH

function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountToken0Min,
uint256 ,
address to,
uint256
) external returns (uint256 amountToken, uint256 amountETH, uint256 liquidity)

Parameters

NameTypeDescription
tokenaddress
amountTokenDesireduint256
amountToken0Minuint256
``uint256
toaddress
``uint256

checkAmountMin

function checkAmountMin(
uint256 amount
) public

Parameters

NameTypeDescription
amountuint256

setAmountMin

function setAmountMin(
uint256 amount
) public

Parameters

NameTypeDescription
amountuint256

addLiquidity

function addLiquidity(
address token0,
address token1,
uint256 amountToken0Desired,
uint256 amountToken1Desired,
uint256 amountToken0Min,
uint256 ,
address to,
uint256
) external returns (uint256, uint256, uint256 liquidity)

Parameters

NameTypeDescription
token0address
token1address
amountToken0Desireduint256
amountToken1Desireduint256
amountToken0Minuint256
``uint256
toaddress
``uint256

setWETH

function setWETH(
address weth
) public

Parameters

NameTypeDescription
wethaddress

removeLiquidity

function removeLiquidity(
address ,
address ,
uint256 liquidity,
uint256 amountToken0Min,
uint256 ,
address to,
uint256
) external returns (uint256 amountFei, uint256 amountToken)

Parameters

NameTypeDescription
``address
``address
liquidityuint256
amountToken0Minuint256
``uint256
toaddress
``uint256

transferLiquidity

function transferLiquidity(
uint256 liquidity
) internal

Parameters

NameTypeDescription
liquidityuint256

ratioOwned

function ratioOwned(
address to
) public returns (struct Decimal.D256)

Parameters

NameTypeDescription
toaddress