You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the value of _batchIndex - _finalizedBatchIndex is larger than type(uint32).max, then the expression above will be evaluated incorrectly, instead of reverting the transaction at hand on overflow (as it should).
You can either add this as a preliminary requirement, prior to the code above:
In case you've missed it (since this issue is typically easy to miss), in the aforementioned contract function, you are performing an unsafe cast:
If the value of
_batchIndex - _finalizedBatchIndex
is larger thantype(uint32).max
, then the expression above will be evaluated incorrectly, instead of reverting the transaction at hand on overflow (as it should).You can either add this as a preliminary requirement, prior to the code above:
Or you can replace that cast with a call to OpenZeppelin's de-facto standard library function
SafeCast.toUint32
:The text was updated successfully, but these errors were encountered: