Merged
Conversation
…m/OffchainLabs/nitro-contracts into deterministic-factory-deployments
gzeoneth
requested changes
Jul 1, 2025
Member
gzeoneth
left a comment
There was a problem hiding this comment.
looks good, I think we can simplify more
gzeoneth
reviewed
Jul 1, 2025
Contributor
Author
|
Fixing CI |
* disable CBOR * chore: remove entries for removed files * refactor: commonSetting * feat: foundry override * fix: test * chore: default profile * format: yarn format * ci: comapre bytecodes * fix: slither db --------- Co-authored-by: gzeon <im@gzeon.dev>
There was a problem hiding this comment.
Pull Request Overview
This PR refactors contract deployment to use CREATE2 for deterministic addresses, updates deployment utilities and scripts accordingly, and streamlines factory contracts by removing mutable template setters.
- Introduces a
create2helper and adds auseCreate2flag todeployContract/deployAllContracts, switching core deployments to CREATE2. - Updates local, upgrade, and end-to-end deployment scripts for CREATE2 factory deployment and passes
factoryOwnertodeployAllContracts. - Removes
Ownableinheritance and update/template setter functions fromBridgeCreator, and consolidates template initialization inValidatorWalletCreatorandRollupCreatorconstructors.
Reviewed Changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| scripts/deploymentUtils.ts | Added create2 helper, useCreate2 param, and wired CREATE2 flag |
| scripts/local-deployment/deployCreatorAndCreateRollup.ts | Bootstraps CREATE2 factory, updates deployAllContracts call signature |
| src/rollup/ValidatorWalletCreator.sol | Removed Ownable, made template immutable, removed setter |
| src/rollup/RollupCreator.sol | Extended constructor, set up templates & ownership on deploy |
| src/rollup/BridgeCreator.sol | Dropped Ownable, removed dynamic setters for templates |
| test/signatures/BridgeCreator | Removed outdated signature entries for removed template setters |
| test/foundry/RollupCreator.t.sol | Updated tests to use creatorOwner instead of deployer |
| test/foundry/BridgeCreator.t.sol | Cleaned up tests for removed update functions |
| test/e2e/orbitChain.ts | Changed _uint256ToAddress to accept BigNumber and updated logic |
| package.json | Enabled FOUNDRY_PROFILE=test for coverage and bytecode testing scripts |
| hardhat.config.ts | Consolidated compiler settings into commonSetting |
| foundry.toml | Aligned profiles and optimizer settings with hardhat config |
| .github/workflows/contract-tests.yml | Added bytecode comparison step and updated Geth test node ref |
| .env-sample | Documented FACTORY_OWNER and CREATE2_FACTORY vars |
Comments suppressed due to low confidence (4)
test/e2e/orbitChain.ts:1116
- [nitpick] The local variable
addressshadows a common identifier and may be confusing. Consider renaming it toaddroraddrStrfor clarity.
const address =
src/rollup/BridgeCreator.sol:21
- By removing
Ownableand theupdateTemplatesfunctions, you lose the ability to update bridge templates after deployment. If runtime template changes are required, consider reintroducing controlled setters or document that templates are immutable.
contract BridgeCreator {
src/rollup/RollupCreator.sol:94
- [nitpick]
setTemplateswas external before; marking itpublicmay increase gas costs and expose unnecessary internal use. Consider reverting it toexternalto follow standard access patterns.
) public onlyOwner {
test/e2e/orbitChain.ts:1114
- You changed
_uint256ToAddressto acceptBigNumberbut existing calls may still pass strings. Verify and update all callers to passBigNumberinstances to avoid runtime type errors.
function _uint256ToAddress(uint256: BigNumber) {
godzillaba
commented
Jul 16, 2025
gzeoneth
approved these changes
Sep 9, 2025
Member
gzeoneth
left a comment
There was a problem hiding this comment.
LGTM, latest review items are resolved
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.
Implement CREATE2 deployment, also making BridgeCreator and ValidatorWalletCreator immutable.