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