Any Well can be whitelisted according to docs:
https://docs.bean.money/almanac/farm/sun#minting-whitelist
LibWell.getWellTwaUsdLiquidityFromReserves()
uses uncached prices when is called from SeasonGettersFacet.sol
. In this case it returns result with precision of nonBeanToken instead of expected 1e18. It becomes problem when token is non-18 decimals.
LibUsdOracle returns price with 1e6 precision, so this line just returns how much USD is in nonBeanToken reserve. Note that result has precision of token decimals:
Function is used in LibEvaluate.calcLPToSupplyRatio()
to calculate nonBeanToken USD liquidity in all Wells. So for different tokens result has different precision, but they are all summed up:
SeasonGettersFacet.sol will return incorrect values in case Well with non-18 decimals is whitelisted.
Manual Review
getWellTwaUsdLiquidityFromReserves()
must return result with 1e18 precision, so add up to 18 in case token decimals is less.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.