Skip to content

contracts: implement onlyDelegateCall and add tests for audit fixes#19272

Merged
smartcontracts merged 3 commits intodevelopfrom
fix/audit-feb2026-code
Mar 5, 2026
Merged

contracts: implement onlyDelegateCall and add tests for audit fixes#19272
smartcontracts merged 3 commits intodevelopfrom
fix/audit-feb2026-code

Conversation

@smartcontracts
Copy link
Copy Markdown
Contributor

Add onlyDelegateCall enforcement to upgradeSuperchain, upgrade, and migrate functions (#17). Include msg.sender in deploy salt to prevent cross-caller CREATE2 collisions (#17). Add duplicate instruction key detection in upgrade validation (#9). Validate startingRespectedGameType against enabled game configs (#10). Add code-existence check in loadBytes (#18). Add tests covering all audit fix behaviors.

@smartcontracts smartcontracts requested a review from a team as a code owner February 22, 2026 20:25
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.2%. Comparing base (88d42e5) to head (f68cd8e).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #19272     +/-   ##
==========================================
+ Coverage     75.5%    80.2%   +4.7%     
==========================================
  Files          193      138     -55     
  Lines        11227     7220   -4007     
==========================================
- Hits          8478     5793   -2685     
+ Misses        2603     1427   -1176     
+ Partials       146        0    -146     
Flag Coverage Δ
cannon-go-tests-64 ?
contracts-bedrock-tests 80.2% <100.0%> (+<0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...bedrock/src/L1/opcm/OPContractsManagerMigrator.sol 95.9% <ø> (ø)
...ts-bedrock/src/L1/opcm/OPContractsManagerUtils.sol 95.0% <100.0%> (+<0.1%) ⬆️
...racts-bedrock/src/L1/opcm/OPContractsManagerV2.sol 97.6% <100.0%> (+0.3%) ⬆️

... and 56 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@smartcontracts smartcontracts force-pushed the fix/audit-feb2026-code branch 2 times, most recently from 3fe65b0 to 7dad511 Compare February 22, 2026 21:46
@0xiamflux
Copy link
Copy Markdown
Contributor

LGTM

@smartcontracts smartcontracts force-pushed the fix/audit-feb2026-code branch from e44cac8 to ccaf46b Compare March 3, 2026 22:25
@stevennevins
Copy link
Copy Markdown
Contributor

We might want to update the links in the PR description to not link to PR's or update to link to the audit report/findings

smartcontracts and others added 3 commits March 5, 2026 15:25
Add onlyDelegateCall enforcement to upgradeSuperchain, upgrade, and
migrate functions (#17). Include msg.sender in deploy salt to prevent
cross-caller CREATE2 collisions (#17). Add duplicate instruction key
detection in upgrade validation (#9). Validate startingRespectedGameType
against enabled game configs (#10). Add code-existence check in
loadBytes (#18). Add setUp guard to VerifyOPCM.runSingle (#4). Remove
unused _findChar function (#5). Pass real AddressManager in migrator
proxy deploy args (#11). Add tests covering all audit fix behaviors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Semver-diff requires a patch version bump when bytecode changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@smartcontracts smartcontracts force-pushed the fix/audit-feb2026-code branch from 3c75ec2 to f68cd8e Compare March 5, 2026 15:25
@smartcontracts smartcontracts added this pull request to the merge queue Mar 5, 2026
Merged via the queue into develop with commit 56ee47e Mar 5, 2026
231 checks passed
@smartcontracts smartcontracts deleted the fix/audit-feb2026-code branch March 5, 2026 16:30
wwared pushed a commit that referenced this pull request Mar 9, 2026
…19272)

* contracts: implement audit code fixes and add tests

Add onlyDelegateCall enforcement to upgradeSuperchain, upgrade, and
migrate functions (#17). Include msg.sender in deploy salt to prevent
cross-caller CREATE2 collisions (#17). Add duplicate instruction key
detection in upgrade validation (#9). Validate startingRespectedGameType
against enabled game configs (#10). Add code-existence check in
loadBytes (#18). Add setUp guard to VerifyOPCM.runSingle (#4). Remove
unused _findChar function (#5). Pass real AddressManager in migrator
proxy deploy args (#11). Add tests covering all audit fix behaviors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* contracts: regenerate semver-lock.json for OPContractsManagerV2

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* contracts: bump OPContractsManagerV2 version to 7.0.10

Semver-diff requires a patch version bump when bytecode changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

5 participants