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