Skip to content

Commit 2acd825

Browse files
committed
fix: skip addresses that will overflow
1 parent 19bab5e commit 2acd825

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/horizon/test/staking/delegation/withdraw.t.sol

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ contract HorizonStakingWithdrawDelegationTest is HorizonStakingTest {
179179
useDelegation(delegationAmount)
180180
{
181181
vm.assume(beneficiary != address(0));
182+
// Skip beneficiary if balance will overflow
183+
vm.assume(token.balanceOf(beneficiary) < type(uint256).max - delegationAmount);
182184

183185
// Delegator undelegates to beneficiary
184186
resetPrank(users.delegator);
@@ -192,10 +194,6 @@ contract HorizonStakingWithdrawDelegationTest is HorizonStakingTest {
192194

193195
// Beneficiary withdraws delegated tokens
194196
resetPrank(beneficiary);
195-
// Burn the tokens if the beneficiary has more than the delegation amount so we don't overflow the balance
196-
if (token.balanceOf(beneficiary) > delegationAmount) {
197-
token.burn(delegationAmount);
198-
}
199197
_withdrawDelegated(users.indexer, subgraphDataServiceAddress, address(0), 0, 1);
200198
}
201199

0 commit comments

Comments
 (0)