Skip to content

Commit

Permalink
Add a safety check on eth matched corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
kanewallmann committed Sep 26, 2024
1 parent 109d13f commit 8d4d5c0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contracts/contract/upgrade/RocketUpgradeOneDotThreeDotOne.sol
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ contract RocketUpgradeOneDotThreeDotOne is RocketBase {
// Cast is safe as current values cannot exceed max value of int256 as not enough ETH exists for that
(,,uint224 currentValue) = rocketNetworkSnapshots.latest(key);
int256 newValue = int256(uint256(currentValue)) + correction.delta;
// Sanity check new value
require(newValue >= 0, "Invalid correction");
rocketNetworkSnapshots.push(key, uint224(uint256(newValue)));
}

Expand Down

0 comments on commit 8d4d5c0

Please sign in to comment.