but here, it is checking that it should be nextTotalSupply < supplyCap. that means tokenA can be minted to 9999 only. it will lead to miscalculations and unintended behaviour to the protocol.
Recommendation
change it to require(nextTotalSupply <= supplyCap, "market supply cap reached”);
Affected Contracts
Comptroller.sol CToken.sol
Severity
Medium
Description
https://github.com/LodestarFinance/lodestar-protocol/blob/cfca1ae275d023a02198798bbcb24b2a1f646776/contracts/ComptrollerStorage.sol#L155-L161
supplyCaps[cToken] is introduced to cap the mint supply of token. if it is set 10000 for tokenA then it can be minted 10000.
https://github.com/LodestarFinance/lodestar-protocol/blob/cfca1ae275d023a02198798bbcb24b2a1f646776/contracts/Comptroller.sol#L272
but here, it is checking that it should be
nextTotalSupply < supplyCap
. that means tokenA can be minted to 9999 only. it will lead to miscalculations and unintended behaviour to the protocol.Recommendation
change it to
require(nextTotalSupply <= supplyCap, "market supply cap reached”);