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