-
Notifications
You must be signed in to change notification settings - Fork 2
add storage gap #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add storage gap #59
Conversation
WalkthroughThe changes update comments and storage patterns in three Solidity contracts: Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
also reordered some state vars
8705b9f to
46d6575
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
src/Hyperfund.sol (1)
12-12: Clarify use of “immutable” in comment
The comment refers to “immutable values,” yet these aren’t declared with Solidity’simmutablekeyword. Consider rewording to “values set at initialization” or marking themimmutableif set in the constructor.src/Hyperstaker.sol (2)
23-24: Refine initialization comment
“Immutable values that are set on initialization” might be misread as using Solidity’simmutablefeature. Consider clarifying to “values initialized once by the proxy” to avoid confusion.🧰 Tools
🪛 GitHub Actions: CI
[error] 23-37: Prettier formatting check failed due to whitespace differences. Run 'forge fmt' to fix code style issues.
1-207: Fix formatting withforge fmt
CI indicates Prettier formatting mismatches around lines 23–37. Please runforge fmt(or your code formatter) to align whitespace and pass the formatting checks.🧰 Tools
🪛 GitHub Actions: CI
[error] 23-37: Prettier formatting check failed due to whitespace differences. Run 'forge fmt' to fix code style issues.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/Hyperfund.sol(2 hunks)src/HyperfundFactory.sol(2 hunks)src/Hyperstaker.sol(2 hunks)
🧰 Additional context used
🪛 GitHub Actions: CI
src/Hyperstaker.sol
[error] 23-37: Prettier formatting check failed due to whitespace differences. Run 'forge fmt' to fix code style issues.
🔇 Additional comments (6)
src/HyperfundFactory.sol (2)
15-17: Update mapping comment for clarity
The revised comment accurately conveys thathyperfundsandhyperstakersmap a hypercert ID to a boolean flag indicating deployment status—improving readability and reducing ambiguity.
135-141: Verify storage gap size
You’ve addeduint256[26] private __gap;to reserve 26 slots. Please confirm that 26 plus the existing contract state variables aligns with your goal of 30 reserved slots as per OpenZeppelin’s upgradeable pattern.src/Hyperfund.sol (1)
217-223: Confirm addition of storage gap
Theuint256[23] private __gap;follows the OZ upgradeable‐contract pattern. Please verify that reserving 23 slots here, combined with your declared state variables, indeed yields 30 available slots for future growth.src/Hyperstaker.sol (3)
28-29: Validate named-mapping syntax
You’ve switched tomapping(uint256 hypercertId => Stake stake). Ensure this named-key/value mapping syntax is supported by Solidity v0.8.28—otherwise revert tomapping(uint256 => Stake).
31-31: Approve relocation of TYPE_MASK constant
Moving theTYPE_MASKconstant above the role declarations improves logical grouping and has no storage impact, since constants don’t occupy slots.
199-205: Verify storage gap alignment
The newuint256[24] private __gap;reserves 24 slots. Please double-check that when combined with your declared state variables, it maintains the intended 30-slot buffer for future upgrades.
also reordered some state vars
Summary by CodeRabbit
Documentation
Refactor
Chores
No changes to user-facing functionality.