docs: remove legacy constructor visibility from upgradeable diff example
[context] upgradeable.adoc showed a pre-change diff line with public on a constructor. [fix] Dropped public to align with Solidity ≥0.7 syntax and repo-wide ^0.8 usage.
⚠️ No Changeset found
Latest commit: bc72b41f85689311aefddf8201172ac24d83f047
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Walkthrough
The documentation example for upgradeable contracts in docs/modules/ROOT/pages/upgradeable.adoc has been updated. An initialize() function has been added to the contract code example to demonstrate proper initialization patterns. The constructor's initialization logic has been relocated to this new initialize() function. The constructor signature remains unchanged but no longer contains initialization code. Minor formatting adjustments were made to ensure consistency in the documentation file.
Pre-merge checks and finishing touches
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title accurately describes the main change: removing public visibility from a constructor in an upgradeable documentation example. |
| Description check | ✅ Passed | The description clearly explains the context and fix, relating directly to the changeset modifications in upgradeable.adoc. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✨ Finishing touches
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
📜 Recent review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 6308fdc5e8e0d5e8a94dc9d5d4c79f6331334c81 and e194f5f2d22c6a790bbcfbed5568705661ab2de2.
📒 Files selected for processing (1)
docs/modules/ROOT/pages/upgradeable.adoc(2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-29T13:17:07.068Z
Learnt from: Amxx
Repo: OpenZeppelin/openzeppelin-contracts PR: 5904
File: contracts/crosschain/ERC7786Recipient.sol:22-31
Timestamp: 2025-08-29T13:17:07.068Z
Learning: In OpenZeppelin contracts, virtual functions that implement interfaces should use `public` visibility instead of `external`, even for calldata-heavy functions. This is because external functions cannot be called with `super` in derived contracts, which would limit extensibility. OpenZeppelin has strong guidelines to keep all public-facing virtual functions as `public` to maintain inheritance flexibility.
Applied to files:
docs/modules/ROOT/pages/upgradeable.adoc
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: slither
- GitHub Check: tests
- GitHub Check: Redirect rules - solidity-contracts
- GitHub Check: coverage
- GitHub Check: tests-foundry
- GitHub Check: tests-upgradeable
- GitHub Check: halmos
- GitHub Check: Header rules - solidity-contracts
- GitHub Check: Pages changed - solidity-contracts
🔇 Additional comments (1)
docs/modules/ROOT/pages/upgradeable.adoc (1)
35-40: Documentation update correctly demonstrates the upgradeable contract pattern.The diff example accurately shows the transition from constructor-based initialization to the proper upgradeable pattern:
- Constructor replaced by public
initialize()function (proper visibility per OpenZeppelin guidelines for virtual/public functions)- Initialization logic relocated to
initialize()with theinitializermodifier- Correct call to parent initializer (
__ERC721_init)The example aligns with Solidity 0.8+ conventions and is consistent with the deployment example at lines 44–60 that demonstrates
upgrades.deployProxy(MyCollectible)triggering the initialize call.
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.
Comment @coderabbitai help to get the list of available commands and usage tips.