getShareOfPool

function getShareOfPool(
    address _token, 
    uint _amountDesired,  
    bool _owned
)external view returns (uint poolRatio)

μŠ€ν…Œμ΄ν‚Ή μ§€λΆ„μœ¨ ꡬ할 λ•Œ μ‚¬μš©

Parameters

TypeValueDescription

address

_token

μŠ€ν…Œμ΄ν‚Ή 토큰 μ£Όμ†Œ

uint

_amountDesired

μŠ€ν…Œμ΄ν‚Ή 토큰 개수

bool

_owned

μ†Œμœ μ€‘μΈ μ§€λΆ„μœ¨ 확인 μ—¬λΆ€ true : μ†Œμœ μ€‘μΈ μœ λ™μ„± ν’€ μ§€λΆ„μœ¨ false : 값에 μ˜ν•œ μœ λ™μ„± ν’€ 지뢄

Return Values

TypeValueDescription

uint

poolRatio

지뢄 % 1만자리(λ°±λΆ„μœ¨, μ†Œμˆ˜μ 2κΉŒμ§€ ν‘œν˜„)

Example

// μ§€λΆ„μœ¨ μ–»κΈ°(값에 μ˜ν•œ)
await stakingRouterContract.getShareOfPool(
    mockToken0Contract.address,
    ethers.utils.parseEther("0.1"),
    false
)

// κ²°κ³Ό (0.99%의 영ν–₯도)
BigNumber { value: "99" }

// μ§€λΆ„μœ¨ μ–»κΈ°(μ†Œμœ μ€‘μΈ)
await stakingRouterContract.getShareOfPool(
    mockToken0Contract.address,
    0,
    true
)

// κ²°κ³Ό (100%의 영ν–₯도)
BigNumber { value: "10000" }

2022.12.23

Last updated