The _updateP function is always called with its loss parameter being true, which means that else block is never reached.
if (loss) {
newProductFactor = uint256(
DECIMAL_PRECISION - _stableCoinChangePerUnitStaked
);
@> } else { // @audit this case is never hit
newProductFactor = uint256(
DECIMAL_PRECISION + _stableCoinChangePerUnitStaked
);
}
Context
StabilityPool::_updateP()
Description
The
_updateP
function is always called with itsloss
parameter beingtrue
, which means thatelse
block is never reached.