investPairETH

function investPairETH(
    address _token,
    uint _amountTokenDesired,
    uint _amountTokenMin,
    uint _amountETHMin,
    uint _deadline
)external payable ensure(_deadline)

토큰+코인 Staking ν•  λ•Œ μ‚¬μš©(LP+Staking)

Parameters

TypeValueDescription

address

_token

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

uint256

_amountDesired

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

uint256

_amountMin

μŠ€ν…Œμ΄ν‚Ή ν•  토큰 μ΅œμ†Œ 개수 (Slippage κ°’ 이용)

uint256

_amountETHMin

μŠ€ν…Œμ΄ν‚Ή ν•  Coin μ΅œμ†Œ 개수 (Slippage κ°’ 이용)

uint

_deadline

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

Example

const overrides = {
  gasLimit: 9999999,
  value : ethers.utils.parseEther("50.0")
}

// 토큰 κ±°λž˜μ— λŒ€ν•œ ν—ˆμš©
await mockToken0Contract.approve(routerContract.address, MaxUint256)

// Staking(LP+Staking)
await routerContract.investPairETH(
    mockToken0Contract.address,
    ethers.utils.parseEther("20.0"),
    0,
    0,
    MaxUint256,
    overrides
)

2022.12.22

Last updated