VIS-2 / taobank-04-24

0 stars 0 forks source link

If-statement never reached in `StabilityPool::_updateP()` #41

Open DanailYordanov opened 4 months ago

DanailYordanov commented 4 months ago

Context

StabilityPool::_updateP()

Description

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
      );
  }