Closed howlbot-integration[bot] closed 4 months ago
This seems incorrect, as the int
is passed to lnWad
which returns a positive value. Will ask sponsor to confirm.
Agree that this is incorrect. There aren't any negative values produced in getRequiredBond
.
zobront marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2024-07-optimism/blob/main/packages/contracts-bedrock/src/dispute/FaultDisputeGame.sol#L738
Vulnerability details
There are a few underflows that are converted via a typecast afterwards to the expected value. If solidity 0.8.x would be used, then the code would revert.
int256(a-b)
where a and b are uint: For example, ifa=1
andb=2
, then the intermediate result would beuint(-1) == 2**256-1
int256(-x)
where x is a uint. For example,if x=1
, then the intermediate result would beuint(-1) == 2**256-1
From FaultDisputeGame.sol
L738:
Tools Used
Vscode
Recommended Mitigation Steps
Recommend replacing
int256(a-b)
withint256(a)-int256(b)
, and replacingint256(-x)
with-int256(x)
Assessed type
Under/Overflow