Skip to content

Conversation

@Amxx
Copy link
Collaborator

@Amxx Amxx commented Sep 19, 2025

PR Checklist

  • Tests
  • Documentation
  • Changeset entry (run npx changeset add)

@Amxx Amxx added this to the 5.5 milestone Sep 19, 2025
@Amxx Amxx requested a review from a team as a code owner September 19, 2025 08:04
@Amxx Amxx added breaking change Changes that break backwards compatibility of the public API. area: upgradeability labels Sep 19, 2025
@changeset-bot
Copy link

changeset-bot bot commented Sep 19, 2025

⚠️ No Changeset found

Latest commit: e4c56b1

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 19, 2025

Walkthrough

The change adds a NatSpec tag "@Custom:stateless" to the docblocks of ERC721Holder and ERC1155Holder contracts. The CHANGELOG notes a breaking change: these holders are marked stateless and are no longer transpiled, requiring projects that used upgradeable variants to update imports to the equivalents in @openzeppelin/contracts. No contract logic, interfaces, or public signatures were modified. Functions onERC721Received, onERC1155Received, onERC1155BatchReceived, and supportsInterface remain unchanged.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Mark ERC721Holder and ERC1155Holder as stateless" is a concise, single-sentence summary that directly reflects the primary change in the diff (adding the stateless NatSpec tag to both holder contracts) and is clear enough for a reviewer scanning PR history.
Description Check ✅ Passed The PR description is a minimal checklist that references tests, documentation, and a changeset entry and is directly related to the changeset and files changed, so it meets the lenient requirement for being on-topic.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (2)
contracts/token/ERC721/utils/ERC721Holder.sol (1)

14-16: LGTM; consider a brief inline explanation for the tag.

Add one sentence explaining that “stateless” means no storage/initializers and safe use in upgradeable contexts without a dedicated variant.

  /**
   * @dev Implementation of the {IERC721Receiver} interface.
   *
   * Accepts all token transfers.
   * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or
   * {IERC721-setApprovalForAll}.
+
+  * @dev This contract is stateless (no storage / no initializer) and can be used in upgradeable deployments
+  * without a specialized upgradeable variant.
   *
   * @custom:stateless
   */
contracts/token/ERC1155/utils/ERC1155Holder.sol (1)

14-16: LGTM; mirror the brief “stateless” explanation for consistency.

Same one-liner as in ERC721Holder to aid readers scanning the docs.

  /**
   * @dev Simple implementation of `IERC1155Receiver` that will allow a contract to hold ERC-1155 tokens.
   *
   * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
   * stuck.
+
+  * @dev This contract is stateless (no storage / no initializer) and can be used in upgradeable deployments
+  * without a specialized upgradeable variant.
   *
   * @custom:stateless
   */
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2e5d1eb and f6f5844.

📒 Files selected for processing (3)
  • CHANGELOG.md (1 hunks)
  • contracts/token/ERC1155/utils/ERC1155Holder.sol (1 hunks)
  • contracts/token/ERC721/utils/ERC721Holder.sol (1 hunks)
⏰ 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). (6)
  • GitHub Check: slither
  • GitHub Check: tests-foundry
  • GitHub Check: coverage
  • GitHub Check: tests
  • GitHub Check: tests-upgradeable
  • GitHub Check: halmos
🔇 Additional comments (1)
CHANGELOG.md (1)

10-10: Clarify CHANGELOG migration and confirm aliasing

Add the explicit import-migration example to CHANGELOG; repository contains no local ERC721HolderUpgradeable/ERC1155HolderUpgradeable references and docs already import the non-upgradeable holders (docs/modules/ROOT/pages/multisig.adoc:39-40, 83-84, 150-151). Verify whether @openzeppelin/contracts-upgradeable still exposes temporary aliases/stubs and include their deprecation window if present.

- `ERC721Holder` and `ERC1155Holder` are flagged as stateless and are no longer transpiled. Developers that use the upgradeable version of these contracts must update their imports to use the equivalent version available in `@openzeppelin/contracts`.
+ `ERC721Holder` and `ERC1155Holder` are flagged as stateless and are no longer transpiled.
+ Migration: update imports to the non-upgradeable equivalents in `@openzeppelin/contracts`:
+
+ ```diff
+ - import { ERC721HolderUpgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC721/utils/ERC721HolderUpgradeable.sol";
+ + import { ERC721Holder } from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
+
+ - import { ERC1155HolderUpgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC1155/utils/ERC1155HolderUpgradeable.sol";
+ + import { ERC1155Holder } from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
+ ```
+
+ Rationale: these holders are stateless (no storage), so upgradeable variants are unnecessary. If aliases or stubs are provided in `@openzeppelin/contracts-upgradeable`, note their deprecation window here.

ernestognw
ernestognw previously approved these changes Sep 19, 2025
Copy link
Member

@ernestognw ernestognw left a comment

Choose a reason for hiding this comment

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

I'd be in favor of these changes, considering we're changing the transpilation process and there's another rename in 5.5 (SIgnerERC7702 -> SignerEIP7702)

Co-authored-by: Ernesto García <[email protected]>
@Amxx Amxx requested a review from ernestognw September 19, 2025 11:52
arr00
arr00 previously approved these changes Sep 19, 2025
@Amxx Amxx merged commit 798aca1 into OpenZeppelin:master Sep 19, 2025
18 of 19 checks passed
@Amxx Amxx deleted the breaking/stateless branch September 19, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: upgradeability breaking change Changes that break backwards compatibility of the public API. ignore-changeset

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants