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