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