feat(l2cm): add a generation script using NUT library, add sample L2CM#663
Merged
0xiamflux merged 3 commits intopoc/l2cu-tx-gen-scriptsfrom Nov 10, 2025
Merged
feat(l2cm): add a generation script using NUT library, add sample L2CM#6630xiamflux merged 3 commits intopoc/l2cu-tx-gen-scriptsfrom
0xiamflux merged 3 commits intopoc/l2cu-tx-gen-scriptsfrom
Conversation
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
0xOneTony
reviewed
Oct 30, 2025
packages/contracts-bedrock/scripts/deploy/TransactionGeneration.s.sol
Outdated
Show resolved
Hide resolved
0xOneTony
reviewed
Oct 30, 2025
packages/contracts-bedrock/scripts/deploy/TransactionGeneration.s.sol
Outdated
Show resolved
Hide resolved
0xOneTony
reviewed
Oct 30, 2025
maurelian
reviewed
Oct 31, 2025
maurelian
reviewed
Oct 31, 2025
maurelian
reviewed
Oct 31, 2025
maurelian
reviewed
Oct 31, 2025
packages/contracts-bedrock/scripts/deploy/TransactionGeneration.s.sol
Outdated
Show resolved
Hide resolved
maurelian
reviewed
Nov 3, 2025
* feat: add deterministic upgrades to TransactionGeneration script & ProxyUpgrade struct to L2CM * fix: predeploy deployments with constructor * feat: add separate interface file for create2 preinstall * docs: add natspec * refactor: add single getChangedPredeploys * feat: add L2ImplementationsDeployer * refactor: add addFeeVault helper * refactor: remove l2impldeployer from script * fix: replace performDelegateCall signature with selector * refactor: move proxy upgrades logic to L2CM * refactor: use only upgradeTo * fix: revert console log
0xniha
approved these changes
Nov 10, 2025
0xiamflux
added a commit
that referenced
this pull request
Nov 14, 2025
) * feat: add NUT lib * refactor: makes txn artifact lib to produce array instead of using keys * refactor: rename "artifactPath" to "forgeArtifactPath" * test: add test that checks the file is generated correctly * refactor: rename UpgradeTxn to NetworkUpgradeTxn * feat: add readArtifact to lib & fix writeArtifact test * feat(l2cm): add a generation script using NUT library, add sample L2CM (#663) * feat: add a generation script using NUT library, add sample L2CM * chore: rename script to match doc terms * feat(l2cm): add deterministic upgrades (#665) * feat: add deterministic upgrades to TransactionGeneration script & ProxyUpgrade struct to L2CM * fix: predeploy deployments with constructor * feat: add separate interface file for create2 preinstall * docs: add natspec * refactor: add single getChangedPredeploys * feat: add L2ImplementationsDeployer * refactor: add addFeeVault helper * refactor: remove l2impldeployer from script * fix: replace performDelegateCall signature with selector * refactor: move proxy upgrades logic to L2CM * refactor: use only upgradeTo * fix: revert console log --------- Co-authored-by: niha <205694301+0xniha@users.noreply.github.com> * feat: l2cm poc fixes (#674) * test: add idempotent upgrade test & hard fork name input param * fix: remove newDeploymentTx helper from NUT lib * fix: skip proxyadmin accordingly * fix: move tx gen script test to /scripts * fix: remove l1block check * refactor: l2cm execute without args * test: add implementation checks * refactor: remove returndata from l2cm functions * fix: remove extra comment on predeployhelper * docs: add natspec for XForkContractsManager * fix: remove xforkcm constructor checks * test: add expect upgrade event emission --------- Co-authored-by: Flux <175354924+0xiamflux@users.noreply.github.com>
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.
Adds a script and contracts to generate Network Upgrade Transactions (NUTs) for L2 contract upgrades during xFork hardforks.
If you want to run the tests introduced in this PR you need to provide both
FORK_RPC_URLandFORK_BLOCK_NUMBERenv variables:Closes OPT-1272
Note
Introduces a NUT generation script and L2 upgrade framework (manager, implementations deployer, ProxyAdmin delegatecall), adds CREATE2 deployer interface, bumps
L1Blockto v1.8.0, and adds tests.src/L2/L2ContractsManager.sol: Base manager with before/after hooks and_performUpgradesfor proxy upgrades.src/L2/XForkContractsManager.sol: Minimal implementation of the manager for xFork.src/L2/L2ImplementationsDeployer.sol: Authorized intermediary that computes and deploys predeploy implementations viaCREATE2(emits events; skips if exists).src/universal/ProxyAdmin.sol: AddsperformDelegateCallto delegatecallL2ContractsManager.execute(auth check).interfaces/preinstalls/ICreate2Deployer.sol: Interface for computing and deploying viaCREATE2.scripts/deploy/TransactionGeneration.s.sol: Generates NUTs—deploys implementations viaL2ImplementationsDeployer, deploys L2CM viaCreate2Deployer, then executes viaProxyAdmin.performDelegateCall; writes artifact.scripts/deploy/PredeployHelper.sol: Collects supported predeploys, handles constructor-arg cases, builds init code, computes implementationCREATE2addresses.src/L2/L1Block.sol: Bump semver to1.8.0.test/L2/TransactionGeneration.t.sol: Validates generated transactions, execution flow, and upgrade outcome (L1Blockversion()==1.8.0).Written by Cursor Bugbot for commit f8d6c07. This will update automatically on new commits. Configure here.