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