If a _fCashAmount value that is greater than uint88 is passed into the _mint function, downcasting it to uint88 will silently overflow.
Recommended Mitigation Steps
// Use a safe downcast function e.g. wfCashLogic::_safeUint88
function _safeUint88(uint256 x) internal pure returns (uint88) {hil
require(x <= uint256(type(uint88).max));
return uint88(x);
}
Judge has assessed an item in Issue #104 as Medium risk. The relevant finding follows:
L01: Silent overflow of
_fCashAmount
Line References
https://github.com/code-423n4/2022-06-notional-coop/blob/6f8c325f604e2576e2fe257b6b57892ca181509a/index-coop-notional-trade-module/contracts/protocol/modules/v1/NotionalTradeModule.sol#L526
Description
If a
_fCashAmount
value that is greater than uint88 is passed into the_mint
function, downcasting it to uint88 will silently overflow.Recommended Mitigation Steps