Skip to content

Commit

Permalink
fix: underflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
l-monninger committed Sep 4, 2024
1 parent c0f2c2c commit 74185f5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ contract MovementStaking is MovementStakingStorage, IMovementStaking, BaseStakin
uint256 amount
) internal {
uint256 _stake = epochStakesByDomain[domain][epoch][custodian][attester][delegator];
_stake -= amount; // okay to let this error if it underflows
_stake = _stake > amount ? _stake - amount : 0;
epochStakesByDomain[domain][epoch][custodian][attester][delegator] = _stake;

if (_stake == 0) {
Expand Down

0 comments on commit 74185f5

Please sign in to comment.