StabilityPool::getExchangeRate commented out the intended logic.
Likehood: H
Severity: M
The getExchangeRate function in contracts/core/pools/StabilityPool/StabilityPool.sol
currently returns a hardcoded value of 1e18, which does not align with the documented behavior:
Gets the current exchange rate between rToken and deToken.
the intended logic, which correctly calculates the exchange rate based on the balances of rToken and deToken, is commented out.
If rToken and deToken have different decimal precisions, the hardcoded return value (1e18) will cause the function to return an incorrect exchange rate. This incorrect rate affects external dependencies, including:
library/RPCLibrary/pools/getStabilityPoolInfo.js
library/RPCLibrary/pools/liquidityPool/getLiquidityPoolInfo.js
These modules may retrieve and rely on an incorrect exchange rate, potentially leading to miscalculations in pricing, liquidity management, or token conversions.
N/A
Uncomment the intended logic to properly compute the exchange rate dynamically:
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.