userInfo

function userInfo( 
    address _tokenA, 
    address _tokenB,
    address _to
) external view returns(
    uint256 liquidity, 
    uint256 reward, 
    uint256 cumulativeReward, 
    uint256 feeCollect0,
    uint256 feeCollect1
)

ํŽ˜์–ด ์Šคํ…Œ์ดํ‚น ๊ธˆ์•ก ๋ฐ ์ˆ˜๋ น ๋ฐ›์„ ์ˆ˜ ์žˆ๋Š” ๋ฆฌ์›Œ๋“œ ์–ป์„ ๋•Œ ์‚ฌ์šฉ

Parameters

TypeValueDescription

address

_tokenA

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

address

_tokenB

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

address

_to

ํ™•์ธ ํ•  ์‚ฌ์šฉ์ž ์ฃผ์†Œ

Return Values

TypeValueDescription

uint256

liquidity

์˜ˆ์น˜ ๋œ LP ๊ฐ’

uint256

reward

๋ฆฌ์›Œ๋“œ ์ˆ˜๋ น ๊ฐ€๋Šฅ ๊ฐœ์ˆ˜

uint256

cumulativeReward

๋ˆ„์  ๋ฆฌ์›Œ๋“œ ๋ณด์ƒ

uint256

feeCollect0

swap ์ˆ˜์ˆ˜๋ฃŒ

uint256

feeCollect1

swap ์ˆ˜์ˆ˜๋ฃŒ

Example

// ์œ ์ €์ •๋ณด (์˜ˆ์น˜๊ธˆ+๋ฆฌ์›Œ๋“œ ์ˆ˜๋ น์•ก)
await routerContract.userInfo(
    mockToken0Contract.address,
    mockToken1Contract.address,
    accounts[1].address
) 
    
// ๊ฒฐ๊ณผ
[ BigNumber { value: "3535" }, BigNumber { value: "9999" }, BigNumber { value: "0" },
BigNumber { value: "0" }, BigNumber { value: "2999999999999999" } ]

// ์œ ์ €์ •๋ณด (์˜ˆ์น˜๊ธˆ+๋ฆฌ์›Œ๋“œ ์ˆ˜๋ น์•ก)
await routerContract.connect(accounts[1]).userInfo(
    mockToken0Contract.address,
    WMATICContract.address,
    accounts[1].address
) 
    
// ๊ฒฐ๊ณผ
[ BigNumber { value: "7071" }, BigNumber { value: "9999" }, BigNumber { value: "0" },
BigNumber { value: "0" }, BigNumber { value: "2999999999999999" } ]

2022.12.22

Last updated