investPair

function investPair(
    address _tokenA,
    address _tokenB,
    uint256 _amountADesired,
    uint256 _amountBDesired, 
    uint256 _amountAMin, 
    uint256 _amountBMin,
    uint _deadline
)external ensure(_deadline)

ํ† ํฐ+ํ† ํฐ Staking ํ•  ๋•Œ ์‚ฌ์šฉ(LP+Staking)

Parameters

TypeValueDescription

address

_tokenA

์Šคํ…Œ์ดํ‚น ํ•  ํ† ํฐA ์ฃผ์†Œ

address

_tokenB

์Šคํ…Œ์ดํ‚น ํ•  ํ† ํฐB ์ฃผ์†Œ (์ฝ”์ธ์˜ ๊ฒฝ์šฐ WETH์ฃผ์†Œ)

uint256

_amountADesired

์Šคํ…Œ์ดํ‚น ํ•  ํ† ํฐA ๊ฐœ์ˆ˜

uint256

_amountBDesired

์Šคํ…Œ์ดํ‚น ํ•  ํ† ํฐB ๊ฐœ์ˆ˜

uint256

_amountAMin

์Šคํ…Œ์ดํ‚น ํ•  ํ† ํฐA ์ตœ์†Œ ๊ฐœ์ˆ˜ (Slippage ๊ฐ’ ์ด์šฉ)

uint256

_amountBMin

์Šคํ…Œ์ดํ‚น ํ•  ํ† ํฐB ์ตœ์†Œ ๊ฐœ์ˆ˜ (Slippage ๊ฐ’ ์ด์šฉ)

uint

_deadline

ํŠธ๋žœ์žญ์…˜ ์ตœ๋Œ€ ์‹œ๊ฐ„ (ํ˜„์žฌ์‹œ๊ฐ„+์ข…๋ฃŒ์‹œ๊ฐ„, sec๋‹จ)

Example

// ํ† ํฐ ๊ฑฐ๋ž˜์— ๋Œ€ํ•œ ํ—ˆ์šฉ
await mockToken0Contract.approve(routerContract.address, MaxUint256)
await mockToken1Contract.approve(routerContract.address, MaxUint256)

// Staking(LP+Staking)
await routerContract.investPair(
    mockToken0Contract.address,
    mockToken1Contract.address,
    10000,
    5000,
    0,
    0,
    MaxUint256
)

2022.12.22

Last updated