Jovial Teal Butterfly
High
In getRedeemAmount
function the redeemRate at one instance is calculated as -
https://github.com/sherlock-audit/2024-12-plaza-finance/blob/14a962c52a8f4731bbe4655a2f6d0d85e144c7c2/plaza-evm/src/Pool.sol#L514
redeemRate = ((tvl - (bondSupply * BOND_TARGET_PRICE)) / assetSupply) * PRECISION;
It's clearly divison before multiplication. which is classic case of precision error.
- If numerator is less than denominator, then the result will be always zero.
- and if redeemRate 0, due to above calculation the redeemAMount is also 0. due to following calculation.
return ((depositAmount * redeemRate).fromBaseUnit(oracleDecimals) / ethPrice) / PRECISION;
Divison before multiplication
Incorrect calculation of redeemRate
and redeemAmount
, hence user will not able to get correct amount of wstETH, that's intended.
Using this instead -
redeemRate = ((tvl - (bondSupply * BOND_TARGET_PRICE)) * PRECISION) / assetSupply;