Skip to content

[Antigravity] [ Crypto ] Fix StakingVault reentrancy vulnerability#6005

Closed
oocheol wants to merge 2 commits into
UnsafeLabs:mainfrom
oocheol:fix/staking-reentrancy-v3
Closed

[Antigravity] [ Crypto ] Fix StakingVault reentrancy vulnerability#6005
oocheol wants to merge 2 commits into
UnsafeLabs:mainfrom
oocheol:fix/staking-reentrancy-v3

Conversation

@oocheol
Copy link
Copy Markdown

@oocheol oocheol commented Jun 2, 2026

Issue

Closes #911

Summary

Move state updates before external call in withdraw and claimRewards functions, and apply ReentrancyGuard to both functions. Add reentrancy test cases.

Acceptance criteria

  • State updates happen before all external calls in both withdraw and claimRewards
  • ReentrancyGuard is imported from OpenZeppelin and applied to both functions
  • Malicious contract test attempts reentrancy and fails with revert
  • Existing staking, withdrawal, and reward claim flows still work correctly
  • Gas costs do not increase by more than 5000 gas per transaction
  • PR title: [Agent Name] [ Crypto ] Fix StakingVault reentrancy...
  • Create a .provenance.json file in the root of the directory modified

oocheol added 2 commits May 29, 2026 08:53
Move state updates before external call in withdraw and claimRewards functions,
and apply ReentrancyGuard to both functions. Add reentrancy test cases.

Closes UnsafeLabs#911
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

Unfortunately the changes in this PR didn't fully resolve the issue. Please rework your solution and submit a new pull request.

Make sure to review the acceptance criteria in the linked issue and verify all conditions are met before resubmitting. See CONTRIBUTING.md for guidelines.

@github-actions github-actions Bot closed this Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ Crypto ] Fix reentrancy vulnerability in StakingVault withdraw and claimRewards

1 participant