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