fix: use L2_ADMIN (ZkSync Safe) instead of NODL_ADMIN for L2 contract ownership#109
Merged
fix: use L2_ADMIN (ZkSync Safe) instead of NODL_ADMIN for L2 contract ownership#109
Conversation
- Add virtual version() returning '1.0.0' to FleetIdentityUpgradeable - Update V2 mock to override with '2.0.0' - Add test_FleetIdentity_Version and test_FleetIdentity_VersionChangesAfterUpgrade - Fix override specifier in TestUpgradeOnAnvil V2 mock
… ownership NODL_ADMIN (0x55f5...AD8) is the L1 Ethereum Safe multisig and has no code on ZkSync L2, making contracts owned by it effectively locked. Replace with L2_ADMIN which must be set to the ZkSync Safe multisig (0x5e09...6C9) — verified as the NODL token default admin on L2. Affected deployment scripts: - script/DeploySwarmUpgradeableZkSync.s.sol: L2_ADMIN now required (was optional NODL_ADMIN) - ops/deploy_swarm_contracts_zksync.sh: L2_ADMIN required with validation - hardhat-deploy/DeploySwarmUpgradeable.ts: L2_ADMIN required with validation Contracts affected: ServiceProvider, FleetIdentity, SwarmRegistry, BondTreasuryPaymaster (all on ZkSync Era).
LCOV of commit
|
- Add ops/verify_zksync_contracts.py: standalone script that generates standard JSON via forge, rewrites OpenZeppelin's "../" relative imports to resolved project paths, and submits directly to ZkSync verification API. Supports single-contract and batch (--broadcast) modes. - Add bytecode_hash = "none" to foundry.toml (both profiles): omits CBOR metadata hash from bytecode so future deployments achieve full (not partial) verification on ZkSync explorer. - Rewrite verify_source_code() in deploy_swarm_contracts_zksync.sh to call the Python script instead of the broken flatten approach. - Document the verification problem and solution in copilot-instructions.md so AI assistants know the correct approach immediately.
…instructions.md, remove Cursor-specific .agent/rules/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
All L2 swarm contracts (ServiceProvider, FleetIdentity, SwarmRegistry, BondTreasuryPaymaster) were deployed with
NODL_ADMIN(0x55f5...AD8) as owner — which is the L1 Ethereum Safe multisig. This address has no code on ZkSync L2 (it's an EOA there), and since nobody holds its private key, ownership functions (upgrade, configure) are effectively locked.Verified on-chain
0x55f5E48A1d30d67ac13751b523Ca1b3cB5838AD8— Safe multisig on L1 only, EOA on ZkSync0x5e097AC1BCF81E7Ff2657045F72cAa6cF06486C9— Safe multisig on ZkSync L2 only, confirmed as NODL token default adminFix
Introduce
L2_ADMINenvironment variable — the ZkSync Safe multisig address — and use it as the owner for all L2 contract deployments instead ofNODL_ADMIN.Changes
script/DeploySwarmUpgradeableZkSync.s.solNODL_ADMIN→L2_ADMIN(now required, not optional)ops/deploy_swarm_contracts_zksync.shNODL_ADMIN→L2_ADMINwith validationhardhat-deploy/DeploySwarmUpgradeable.tsOWNER→L2_ADMINwith validationNot changed (intentionally)
NODL_ADMINin.env-prod— still needed for L1 contracts (bridge, L1 NODL token)script/DeployL1Nodl.s.sol,script/DeployL1Ens.s.sol— L1 deployments correctly use L1 SafeRedeployment required
The existing mainnet contracts need to be redeployed with the correct owner. The current deployments (2026-04-07) are locked and cannot be upgraded.