deployPool

Updated : 2024.05.10

function deployPool(
    address _router,
    address _stakedToken,
    address _rewardToken,
    uint256 _rewardPerSecond,
    uint256 _startTimestamp,
    uint256 _bonusEndTimestamp
) external onlyOwner returns(MantiswapStakingPool pool)

μ‹±κΈ€μŠ€ν…Œμ΄ν‚Ή μ»¨νŠΈλž™νŠΈ 생성

Parameters

TypeValueDescription

address

_router

stakingRouter Contract μ£Όμ†Œ

address

_stakeToken

μŠ€ν…Œμ΄ν‚Ή 토큰 μ£Όμ†Œ

address

_rewardToken

μŠ€ν…Œμ΄ν‚Ή μ‹œ 보상 쀄 토큰 μ£Όμ†Œ

uint256

_rewardPerSecond

μ΄ˆλ‹Ή 보상토큰 κΈˆμ•‘

uint256

_startTimestamp

μœ λ™μ„± ν’€ 생성 λ‚ μ§œ

uint256

_bonusEndTimestamp

보상 μ™„λ£Œ λ‚ μ§œ(μ΅œλŒ€λ‘œ 작기)

Example

// single staking pool 생성

// START_TIMESTAMP : 1695715200, // μ‹œμž‘μ‹œκ°„ (9μ›” 26일 17:00 - 1695715200)
// BONUES_PERIOD_SECONDS : 86400*30, // ν’€ μœ νš¨μ‹œκ°„ (초)
const rewardPerSecond = 
    CONFIG.TOTAL_REWARD_FOR_DURATION.div(CONFIG.BONUES_PERIOD_SECONDS);
const poolRewardEndTime = CONFIG.START_TIMESTAMP + CONFIG.BONUES_PERIOD_SECONDS;


await factoryContract.deployPool(
    routerContract.address,
    tokenContract.address, 
    tokenContract.address,
    rewardPerSecond,
    CONFIG.START_TIMESTAMP,
    poolRewardEndTime,
)

2024.05.10

Last updated