Skip to content

Commit 8d4d5c0

Browse files
committed
Add a safety check on eth matched corrections
1 parent 109d13f commit 8d4d5c0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

contracts/contract/upgrade/RocketUpgradeOneDotThreeDotOne.sol

+2
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ contract RocketUpgradeOneDotThreeDotOne is RocketBase {
149149
// Cast is safe as current values cannot exceed max value of int256 as not enough ETH exists for that
150150
(,,uint224 currentValue) = rocketNetworkSnapshots.latest(key);
151151
int256 newValue = int256(uint256(currentValue)) + correction.delta;
152+
// Sanity check new value
153+
require(newValue >= 0, "Invalid correction");
152154
rocketNetworkSnapshots.push(key, uint224(uint256(newValue)));
153155
}
154156

0 commit comments

Comments
 (0)