Skip to main content

MockUniswapV2PairLiquidity

Functions

constructor

function constructor(
address _token0,
address _token1
) public

Parameters

NameTypeDescription
_token0address
_token1address

getReserves

function getReserves() external returns (uint112, uint112, uint32)

mint

function mint(
address to
) public returns (uint256)

Parameters

NameTypeDescription
toaddress

mintAmount

function mintAmount(
address to,
uint256 _liquidity
) public

Parameters

NameTypeDescription
toaddress
_liquidityuint256

set

function set(
uint112 newReserve0,
uint112 newReserve1,
uint256 newLiquidity
) external

Parameters

NameTypeDescription
newReserve0uint112
newReserve1uint112
newLiquidityuint256

setReserves

function setReserves(
uint112 newReserve0,
uint112 newReserve1
) external

Parameters

NameTypeDescription
newReserve0uint112
newReserve1uint112

faucet

function faucet(
address account,
uint256 amount
) external returns (bool)

Parameters

NameTypeDescription
accountaddress
amountuint256

burnEth

function burnEth(
address to,
struct Decimal.D256 ratio
) public returns (uint256 amountEth, uint256 amount1)

Parameters

NameTypeDescription
toaddress
ratiostruct Decimal.D256

withdrawFei

function withdrawFei(
address to,
uint256 amount
) public

Parameters

NameTypeDescription
toaddress
amountuint256

burnToken

function burnToken(
address to,
struct Decimal.D256 ratio
) public returns (uint256 amount0, uint256 amount1)

Parameters

NameTypeDescription
toaddress
ratiostruct Decimal.D256

swap

function swap(
uint256 amount0Out,
uint256 amount1Out,
address to,
bytes
) external

Parameters

NameTypeDescription
amount0Outuint256
amount1Outuint256
toaddress
``bytes

sync

function sync() external

totalSupply

function totalSupply() public returns (uint256)

See {IERC20-totalSupply}.

balanceOf

function balanceOf(
address account
) public returns (uint256)

See {IERC20-balanceOf}.

Parameters

NameTypeDescription
accountaddress

transfer

function transfer(
address recipient,
uint256 amount
) public returns (bool)

See {IERC20-transfer}.

Requirements:

  • recipient cannot be the zero address.
  • the caller must have a balance of at least amount.

Parameters

NameTypeDescription
recipientaddress
amountuint256

allowance

function allowance(
address owner,
address spender
) public returns (uint256)

See {IERC20-allowance}.

Parameters

NameTypeDescription
owneraddress
spenderaddress

approve

function approve(
address spender,
uint256 amount
) public returns (bool)

See {IERC20-approve}.

Requirements:

  • spender cannot be the zero address.

Parameters

NameTypeDescription
spenderaddress
amountuint256

transferFrom

function transferFrom(
address sender,
address recipient,
uint256 amount
) public returns (bool)

See {IERC20-transferFrom}.

Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20};

Requirements:

  • sender and recipient cannot be the zero address.
  • sender must have a balance of at least amount.
  • the caller must have allowance for sender's tokens of at least amount.

Parameters

NameTypeDescription
senderaddress
recipientaddress
amountuint256

increaseAllowance

function increaseAllowance(
address spender,
uint256 addedValue
) public returns (bool)

Atomically increases the allowance granted to spender by the caller.

This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}.

Emits an {Approval} event indicating the updated allowance.

Requirements:

  • spender cannot be the zero address.

Parameters

NameTypeDescription
spenderaddress
addedValueuint256

decreaseAllowance

function decreaseAllowance(
address spender,
uint256 subtractedValue
) public returns (bool)

Atomically decreases the allowance granted to spender by the caller.

This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}.

Emits an {Approval} event indicating the updated allowance.

Requirements:

  • spender cannot be the zero address.
  • spender must have allowance for the caller of at least subtractedValue.

Parameters

NameTypeDescription
spenderaddress
subtractedValueuint256

_transfer

function _transfer(
address sender,
address recipient,
uint256 amount
) internal

Moves tokens amount from sender to recipient.

This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc.

Emits a {Transfer} event.

Requirements:

  • sender cannot be the zero address.
  • recipient cannot be the zero address.
  • sender must have a balance of at least amount.

Parameters

NameTypeDescription
senderaddress
recipientaddress
amountuint256

_mint

function _mint(
address account,
uint256 amount
) internal

Creates amount tokens and assigns them to account, increasing the total supply.

Emits a {Transfer} event with from set to the zero address.

Requirements

  • to cannot be the zero address.

Parameters

NameTypeDescription
accountaddress
amountuint256

_burn

function _burn(
address account,
uint256 amount
) internal

Destroys amount tokens from account, reducing the total supply.

Emits a {Transfer} event with to set to the zero address.

Requirements

  • account cannot be the zero address.
  • account must have at least amount tokens.

Parameters

NameTypeDescription
accountaddress
amountuint256

_approve

function _approve(
address owner,
address spender,
uint256 amount
) internal

Sets amount as the allowance of spender over the owners tokens.

This is internal function is equivalent to approve, and can be used to e.g. set automatic allowances for certain subsystems, etc.

Emits an {Approval} event.

Requirements:

  • owner cannot be the zero address.
  • spender cannot be the zero address.

Parameters

NameTypeDescription
owneraddress
spenderaddress
amountuint256

_burnFrom

function _burnFrom(
address account,
uint256 amount
) internal

Destroys amount tokens from account.amount is then deducted from the caller's allowance.

See {_burn} and {_approve}.

Parameters

NameTypeDescription
accountaddress
amountuint256