Skip to content

Latest commit

 

History

History
260 lines (231 loc) · 7.48 KB

FakeUniswapPair.md

File metadata and controls

260 lines (231 loc) · 7.48 KB

FakeUniswapPair.sol

View Source: contracts/fakes/FakeUniswapPair.sol

↗ Extends: IUniswapV2PairLike, ERC20

FakeUniswapPair

Contract Members

Constants & Variables

address public token0;
address public token1;

Functions

function (address _token0, address _token1) public nonpayable ERC20 

Arguments

Name Type Description
_token0 address
_token1 address
Source Code
constructor(address _token0, address _token1) ERC20("PAIR", "PAIR") {
    token0 = _token0;
    token1 = _token1;

    super._mint(msg.sender, 100000 ether);
  }

totalSupply

function totalSupply() public view
returns(uint256)

Arguments

Name Type Description
Source Code
function totalSupply() public view override(ERC20, IUniswapV2PairLike) returns (uint256) {
    return super.totalSupply();
  }

getReserves

function getReserves() external view
returns(reserve0 uint112, reserve1 uint112, blockTimestampLast uint32)

Arguments

Name Type Description
Source Code
function getReserves()
    external
    view
    override
    returns (
      uint112 reserve0,
      uint112 reserve1,
      uint32 blockTimestampLast
    )
  {
    reserve0 = 100000 ether;
    reserve1 = 50000 ether;
    blockTimestampLast = uint32(block.timestamp - 1 hours); // solhint-disable-line
  }

Contracts