Skip to content

Staking audit fixes v2#1003

Merged
0x4007 merged 4 commits intoubiquity:developmentfrom
ryzhak:fix/audit-nevi
Sep 17, 2025
Merged

Staking audit fixes v2#1003
0x4007 merged 4 commits intoubiquity:developmentfrom
ryzhak:fix/audit-nevi

Conversation

@ryzhak
Copy link
Contributor

@ryzhak ryzhak commented Sep 12, 2025

This PR applies these proposed fixes for issues found in #1002.

@ryzhak ryzhak marked this pull request as ready for review September 12, 2025 08:48
@ryzhak ryzhak requested a review from rndquu as a code owner September 12, 2025 08:48
@ryzhak
Copy link
Contributor Author

ryzhak commented Sep 12, 2025

@0x4007 FYI

@nevillehuang Could you review the fixes?

This was referenced Sep 15, 2025
@ryzhak
Copy link
Contributor Author

ryzhak commented Sep 16, 2025

@0x4007 I think this one can be merged

@0x4007 0x4007 requested review from Copilot and whilefoo September 16, 2025 15:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements audit fixes for the staking system to address security and functionality issues identified in an audit. The changes focus on improving input validation, maintaining consistency in reward calculations, and adding proper safety checks.

  • Adds validation to prevent staking in disabled pools (allocation points = 0)
  • Ensures pool state consistency by calling massUpdateStakingPools() before parameter changes
  • Strengthens validation for staking start block updates

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
LibStaking.sol Adds pool validation, state consistency updates, and enhanced start block validation
StakingFacet.t.sol Updates test cases with corrected reward calculations and adds validation tests

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@0x4007 0x4007 merged commit 4c13028 into ubiquity:development Sep 17, 2025
16 of 17 checks passed
@ryzhak ryzhak deleted the fix/audit-nevi branch September 17, 2025 14:55
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.

4 participants