Skip to content

Remove orphan account mocks not referenced by any guide#242

Merged
ernestognw merged 2 commits into
masterfrom
chore/remove-orphan-account-mocks
May 8, 2026
Merged

Remove orphan account mocks not referenced by any guide#242
ernestognw merged 2 commits into
masterfrom
chore/remove-orphan-account-mocks

Conversation

@ernestognw
Copy link
Copy Markdown
Member

@ernestognw ernestognw commented May 8, 2026

Summary

Two example mocks under contracts/mocks/docs/account/ are not referenced by any .adoc guide in this repo:

  • contracts/mocks/docs/account/MyAccountEIP7702.sol
  • contracts/mocks/docs/account/MyFactoryAccount.sol

They are referenced only by solidity guides (accounts.adoc, eoa-delegation.adoc) in openzeppelin-contracts.

Why this matters

scripts/prepare-docs.sh copies every contracts/mocks/docs/**/*.sol into the docs site's shared examples/ directory. Because the version of these files in this repo diverges from solidity's (different signatures, missing checks), every community-contracts docs regen clobbers solidity's canonical version and breaks the contracts/5.x guides.

Concrete example surfaced by docs PR #154: community's MyFactoryAccount.sol changes predictAddress(callData)predictAddress(salt, callData), but the contracts/5.x/accounts.mdx prose was written for the 1-arg form.

Deleting them here keeps the canonical version in solidity and stops the regen pipeline from clobbering unrelated examples.

Test plan

  • Re-run the docs regen for community-contracts and confirm examples/account/MyAccountEIP7702.sol and MyFactoryAccount.sol are no longer touched

Summary by CodeRabbit

  • Chores
    • Removed example smart contract implementations from the codebase.

`MyAccountEIP7702.sol` and `MyFactoryAccount.sol` under
`contracts/mocks/docs/account/` are not referenced by any `.adoc` guide
in this repo. They are referenced only by solidity guides
(`accounts.adoc`, `eoa-delegation.adoc` in openzeppelin-contracts).

Because `prepare-docs.sh` copies every `contracts/mocks/docs/**/*.sol`
into the docs site's shared `examples/` directory, having a divergent
copy here overwrites solidity's version on every community-contracts
docs regen, breaking those solidity guides.

Removing them here keeps the canonical version in
openzeppelin-contracts and prevents the regen pipeline from clobbering
unrelated examples.
@ernestognw ernestognw requested a review from a team as a code owner May 8, 2026 15:02
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3c3a6f1c-0868-4600-a590-af076ab5de7b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Two mock contract files are removed from contracts/mocks/docs/account/: MyAccountEIP7702.sol (an EIP7702-based account with multi-inheritance) and MyFactoryAccount.sol (a factory for deterministic clone deployment and initialization).

Changes

Mock Contract Removals

Layer / File(s) Summary
EIP7702 Account Mock
contracts/mocks/docs/account/MyAccountEIP7702.sol
Entire contract removed, including inheritance chain from Account, SignerEIP7702, ERC7821, ERC721Holder, and ERC1155Holder, and the _erc7821AuthorizedExecutor override.
Factory Account Mock
contracts/mocks/docs/account/MyFactoryAccount.sol
Entire contract removed, including constructor, immutable _impl state, predictAddress() public view function, cloneAndInitialize() public function, _cloneAndInitialize() internal flow, and _saltedCallData() helper.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Two mock contracts take their leave,
Away from docs they now perceive,
The factory and EIP's refrain,
Cleaner code, a lighter chain,
Contracts gone, examples plain.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly summarizes the main change: removing two orphan account mock contracts that are not referenced by guides in this repository.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/remove-orphan-account-mocks

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

ernestognw added a commit to OpenZeppelin/docs that referenced this pull request May 8, 2026
`MyAccountEIP7702.sol` and `MyFactoryAccount.sol` are referenced only by
solidity guides (accounts.adoc, eoa-delegation.adoc), but
`prepare-docs.sh` blindly copies every `contracts/mocks/docs/**/*.sol`
into the shared `examples/` dir, so community's divergent copies were
clobbering solidity's. The community-side fix is OpenZeppelin/openzeppelin-community-contracts#242.
Removing MyFactoryAccount.sol dropped Clones (and transitively Create2)
from the compilation graph, which broke tests that rely on the
hardhat-exposed $Create2 artifact.
@ernestognw ernestognw merged commit 1c39bcd into master May 8, 2026
15 checks passed
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.

1 participant