investSingle

Updated : 2024.05.10

function investSingle(
    address _token,
    uint256 _amountDesired,
    uint256 _period,
    uint _deadline
)external ensure(_deadline)

토큰 Staking ν•  λ•Œ μ‚¬μš©

Parameters

TypeValueDescription

address

_token

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

uint256

_amountDesired

μŠ€ν…Œμ΄ν‚Ή ν•  토큰 개수

uint256

_period

μŠ€ν…Œμ΄ν‚Ή ν•  κΈ°κ°„(sec)

uint

_deadline

νŠΈλžœμž­μ…˜ μ΅œλŒ€ μ‹œκ°„ (ν˜„μž¬μ‹œκ°„+μ’…λ£Œμ‹œκ°„, sec단)

Example

// 토큰 ν—ˆμš©
await mockToken0Contract.approve(stakingRouterContract.address, MaxUint256)

await stakingRouterContract.investSingle(
     mockToken0Contract.address,
     ethers.utils.parseEther("100.0"),
     0,
     MaxUint256
)

2022.12.23

Last updated