Skip to content

refactor(contracts): remove OPCMv1 from all Solidity code#19795

Draft
smartcontracts wants to merge 7 commits intodevelopfrom
chore/remove-opcmv1-solidity
Draft

refactor(contracts): remove OPCMv1 from all Solidity code#19795
smartcontracts wants to merge 7 commits intodevelopfrom
chore/remove-opcmv1-solidity

Conversation

@smartcontracts
Copy link
Copy Markdown
Contributor

Summary

Remove OPContractsManager v1 from all Solidity code, making OPContractsManagerV2 the sole OPCM.

  • Delete v1 contract: OPContractsManager.sol (2203 lines, 7 inner contracts) and gut IOPContractsManager.sol interface
  • Remove v1 gating: DevFeatures.OPCM_V2 flag, Constants.OPCM_V2_MIN_VERSION, Config.devFeatureOpcmV2()
  • Delete v1-only files: AddGameType.s.sol, opcm-upgrade-checks/ directory, 3 test files, 12 snapshot files
  • Update deploy scripts: All 10 deploy scripts now unconditionally use V2 types (no more v1/v2 branching)
  • Update test infrastructure: ~17 test/setup files cleaned of v1 branches, assertions, and imports

V2 contracts in src/L1/opcm/ are completely untouched — they have zero V1 dependencies.

56 files changed, +212 / -13,404 lines (net deletion of ~13,200 lines)

This is PR 1 of the OPCMv1 removal series. Breaks out the Solidity-side changes from #19385. Go code (op-deployer) and CI matrix changes follow in subsequent PRs.

Test plan

  • mise exec -- just build-dev passes (zero compilation errors)
  • mise exec -- just pr passes (17/17 checks: lint, semgrep, snapshots, semver-diff, interfaces, size-check, etc.)
  • Zero remaining imports of IOPContractsManager or OPContractsManager (non-V2)
  • Zero remaining references to DevFeatures.OPCM_V2 or Constants.OPCM_V2_MIN_VERSION
  • Zero remaining isOPCMv2 / isOPCMV2 variables
  • V2 contracts in src/L1/opcm/ verified untouched
  • CI passes (pending)
  • mise exec -- just test-dev passes (not yet run — long-running)

🤖 Generated with Claude Code

Delete OPContractsManager v1 contract, interface, tests, snapshots,
and all v1/v2 branching logic. OPContractsManagerV2 is now the sole
OPCM — all deploy scripts and test infrastructure use V2 exclusively.

Key changes:
- Delete OPContractsManager.sol (2203 lines, 7 inner contracts)
- Gut IOPContractsManager.sol interface to empty
- Remove DevFeatures.OPCM_V2 flag and Constants.OPCM_V2_MIN_VERSION
- Remove AddGameType.s.sol (v1-only script)
- Remove opcm-upgrade-checks (v1-only CI check)
- Update all deploy scripts to unconditionally use V2 types
- Update all test files to remove v1 branches and assertions
- Delete 12 v1 snapshot files (ABI + storage layout)

V2 contracts in src/L1/opcm/ are untouched (zero V1 dependencies).

This is PR 1 of the OPCMv1 removal series. Go code and CI matrix
changes follow in subsequent PRs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@smartcontracts smartcontracts marked this pull request as ready for review March 27, 2026 17:10
@smartcontracts smartcontracts requested review from a team and digorithm March 27, 2026 17:10
@smartcontracts smartcontracts marked this pull request as draft March 27, 2026 17:11
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.7%. Comparing base (8f8adda) to head (ad56dcc).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #19795     +/-   ##
==========================================
+ Coverage     75.5%    75.7%   +0.2%     
==========================================
  Files          194      138     -56     
  Lines        11275     6749   -4526     
==========================================
- Hits          8515     5113   -3402     
+ Misses        2616     1636    -980     
+ Partials       144        0    -144     
Flag Coverage Δ
cannon-go-tests-64 ?
contracts-bedrock-tests 75.7% <ø> (-4.9%) ⬇️

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

Files with missing lines Coverage Δ
...ages/contracts-bedrock/src/libraries/Constants.sol 100.0% <ø> (ø)
...es/contracts-bedrock/src/libraries/DevFeatures.sol 100.0% <ø> (ø)

... and 59 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 and others added 6 commits March 27, 2026 13:36
Add back v1 OPCM fields as address/bytes32 placeholders in Solidity
script structs to maintain ABI compatibility with Go op-deployer.

- DeployImplementations.Output: 6 deprecated address fields (always zero)
- ReadSuperchainDeployment.Input: opcmAddress field (ignored)
- ReadSuperchainDeployment.Output: 5 ProtocolVersions fields (always zero)

These fields are never populated — they exist solely so Go's ABI
encoding matches the Solidity struct layout. They will be removed
atomically with the Go struct fields in a follow-up PR.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update Go op-deployer to unconditionally use OPCMv2 instead of
branching on the OPCM_V2 dev feature flag, matching the Solidity
contract deletion.

- opchain.go: unconditionally use OpcmV2Impl instead of defaulting
  to v1 OpcmImpl
- init.go: update ReadSuperchainDeployment call for new struct layout
- artifacts.go: point Opcm mapping to V2 artifact, remove 5 deleted
  v1 sub-contract artifact mappings
- Tests updated to match new behavior

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

Since v1 OPContractsManager is deleted, dio.Opcm is always zero.
Populate OpcmImpl with dio.OpcmV2 so downstream consumers
(op-devstack, e2e tests) get a valid OPCM address.

The OpcmImpl field will be renamed/removed in the follow-up Go PR.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The v1 OPCM Go bindings are stale (v1 contract deleted), so
superroot.go can no longer use OPContractsManagerMetaData to ABI-encode
migrate calls. Remove the v1 path entirely and use an inline v2
migrator ABI for the migrate call.

- Remove isOPCMV2 version check (always v2 now)
- Remove v1 MigrateInput path with UsePermissionlessGame/GameParameters
- Add OPContractsManagerMigratorABI() helper with inline v2 ABI JSON
- Remove unused deployer import and versionFn var

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- apply_test: OpcmImpl now equals OpcmV2Impl (not zero)
- implementations_test: check OpcmV2 instead of Opcm (deprecated zero field)
- migrate_test: remove opcm-v1 test case from table-driven test
- migrate_test (CLI): skip TestCLIMigrateV1 (v1 contract deleted)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Dead code left behind when v1 migration path was removed.
Caught by go-lint CI check.

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.

1 participant