constructor

constructor(
    address _factory,
    address _router,
    address _tokenA, 
    address _tokenB, 
    uint8 _swapFee, 
    uint8 _protocolFee,
    address _rewardToken,
    uint256 _rewardPerSecond,
    uint256 _startTimestamp,
    uint256 _bonusEndTimestamp
)

유동성풀(Liquidity Pool) Pair Contract Contructor

Parameters

TypeValueDescription

address

_factory

pairFactory Contract 주소

address

_router

pairRouter Contract 주소

address

_tokenA

생성 할 페어 토큰A 주소

address

_tokenB

생성 할 페어 토큰B 주소

uint8

_swapFee

초기 swapFee 비율 (30 = 0.3%, 최대 1%)

uint8

_protocolFee

초기 protocolFee 비율 (5 = 0.05%, 최대 1%)

address

_rewardToken

스테이킹 시 보상 줄 토큰 주소

uint256

_rewardPerSecond

초당 보상토큰 금액

uint256

_startTimestamp

유동성 풀 생성 날짜

uint256

_bonusEndTimestamp

보상 완료 날짜(최대로 잡기)

Example

const swapFee = 30;
const protocolFee = 5;
const rewardPerSecond = ethers.utils.parseEther("0.01");
const startTimestamp = parseInt(new Date().getTime() / 1000)
const bonusEndTimestamp = startTimestamp + 86400*30;

pairContract = await (await ethers.getContractFactory("MantiswapPair")).deploy(
    MantiswapFactoryContract.address,
    routerContract.address,
    mockToken0Contract.address, 
    mockToken1Contract.address, 
    swapFee, 
    protocolFee,
    mockRewardTokenContract.address,
    rewardPerSecond,
    startTimestamp,
    bonusEndTimestamp
);

parseInt(new Date().getTime() / 1000)+ 86400*30 = 30일

2022.12.22

Last updated