constructor

Updated : 2024.05.27

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 비율 (25 = 0.25%, 최대 1%)

uint8

_protocolFee

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

address

_rewardToken

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

uint256

_rewardPerSecond

초당 보상토큰 금액

uint256

_startTimestamp

유동성 풀 생성 날짜

uint256

_bonusEndTimestamp

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

Example

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

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

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

More Details

  • Pair Tokens : CVTX-ERDL

  • Reward Token : Earendel ( ERDL )

  • 초당 리워드 : 0.182648401826484 ERDL

  • 초기 풀 입금량 : 25,000 CVTX : 1,000,000 ERDL ( 1 : 4 )

2022.12.22

Last updated