Skip to content

docs: state each effective-salt derivation once - #247

Open
thedavidmeister wants to merge 2 commits into
mainfrom
2026-09-21-issue-141-effective-salt-formula-dedup
Open

thedavidmeister wants to merge 2 commits into
mainfrom
2026-09-21-issue-141-effective-salt-formula-dedup

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

Closes #141

The two keccak256(abi.encode(...)) effective-salt derivations were written out
as literal formulas three times in this one file: the header code block (both
derivations), the cloneDeterministicOpenSalt MUST (open-salt), and the
disjointness argument (both). All three agreed, and nothing connected them —
test/src/lib/LibICloneableFactoryV4.t.sol binds
LibICloneableFactoryV4.effectiveSalt / effectiveOpenSalt to the formula, so
the library cannot drift from the spec, but no test may read NatSpec text, so
each copy was maintained by hand.

The hazard is a third party computing a clone address offchain from a
restatement a later edit updated everywhere but there, and pinning an address
the factory will never deploy to. Deduplication is the only available structural
fix, since the duplication is what makes the drift possible.

The header code block is now the single statement of both derivations. The MUST
and the disjointness argument name it instead of repeating it; neither loses a
normative clause.

ICloneableFactoryV3.sol's fourth copy is in src/interface/deprecated/**,
which is frozen, and stays.

Comment-only. No source, ABI or bytecode change.

QA

  • Discriminating tests: n/a — comment-only change; tests never assert NatSpec
    text. The code side is already pinned by testEffectiveSaltMatchesFormula and
    testEffectiveOpenSaltMatchesFormula in
    test/src/lib/LibICloneableFactoryV4.t.sol, which recompute each formula
    inline against the library.
  • Mutations applied: n/a — no executable src line changes, so there is nothing
    to mutate.
  • Oracle: src/lib/LibICloneableFactoryV4.sol effectiveSalt /
    effectiveOpenSalt — the surviving header block matches them word for word.
  • Category check: the category is "a second hand-maintained copy of a fact
    nothing enforces". Grepped the repo for abi.encode(ICLONEABLE_FACTORY_V4: the
    remaining hits are the header block, the library's two implementations, and the
    frozen ICloneableFactoryV3 restatement. README.md describes the shape
    (96-byte preimage, leading domain tag) without writing the formula out.

🤖 Generated with Claude Code

claude and others added 2 commits September 21, 2026 11:20
The two `keccak256(abi.encode(...))` formulas were written out three times in
this file by hand, with nothing connecting the copies. The header code block
is the statement; the `cloneDeterministicOpenSalt` MUST and the disjointness
argument name it instead of repeating it.

Closes #141

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this Sep 21, 2026
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 41 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: e0cfcc07-a716-4dd2-a4be-e384efe4ce1b

📥 Commits

Reviewing files that changed from the base of the PR and between 710dff5 and 2317230.

📒 Files selected for processing (1)
  • src/interface/ICloneableFactoryV4.sol

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants