collect

function collect(
    address _tokenA,
    address _tokenB,
    uint _deadline
) public ensure(_deadline) returns(uint256 collect0, uint256 collect1)

์Šคํ…Œ์ดํ‚น ์ดํ›„ LP Swap ์ˆ˜์ˆ˜๋ฃŒ๋งŒ ๋ฐ›์„ ๋•Œ ์‚ฌ์šฉ

Parameters

TypeValueDescription

address

_tokenA

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

address

_tokenB

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

uint

_deadline

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

Return Values

TypeValueDescription

uint256

collect0

์ˆ˜๋ นํ•œ tokenA swap ์ˆ˜์ˆ˜๋ฃŒ

uint256

collect1

์ˆ˜๋ นํ•œ tokenB swap ์ˆ˜์ˆ˜๋ฃŒ

Example

await routerContract.collect(
    mockToken0Contract.address,
    mockToken1Contract.address,
    MaxUint256
) 

// ๊ฒฐ๊ณผ
[ BigNumber { value: "2999999999999999" }, BigNumber { value: "0" } ]

2022.12.22

Last updated