Skip to content

Conversation

godzillaba
Copy link
Contributor

@godzillaba godzillaba commented Jun 24, 2025

Implement CREATE2 deployment, also making BridgeCreator and ValidatorWalletCreator immutable.

@cla-bot cla-bot bot added the s label Jun 24, 2025
@godzillaba godzillaba changed the base branch from main to develop June 24, 2025 18:29
@godzillaba godzillaba marked this pull request as ready for review June 30, 2025 15:12
@godzillaba godzillaba requested a review from gzeoneth June 30, 2025 15:13
@godzillaba godzillaba changed the title wip: use create2 for factory deployment use create2 for factory deployment Jun 30, 2025
Copy link
Member

@gzeoneth gzeoneth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, I think we can simplify more

@godzillaba godzillaba requested a review from gzeoneth July 1, 2025 13:50
@godzillaba godzillaba marked this pull request as draft July 1, 2025 19:37
@godzillaba
Copy link
Contributor Author

Fixing CI

godzillaba and others added 3 commits July 3, 2025 23:39
* 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 <[email protected]>
@gzeoneth gzeoneth requested a review from Copilot July 7, 2025 19:13
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 create2 helper and adds a useCreate2 flag to deployContract/deployAllContracts, switching core deployments to CREATE2.
  • Updates local, upgrade, and end-to-end deployment scripts for CREATE2 factory deployment and passes factoryOwner to deployAllContracts.
  • Removes Ownable inheritance and update/template setter functions from BridgeCreator, and consolidates template initialization in ValidatorWalletCreator and RollupCreator constructors.

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 address shadows a common identifier and may be confusing. Consider renaming it to addr or addrStr for clarity.
  const address =

src/rollup/BridgeCreator.sol:21

  • By removing Ownable and the updateTemplates functions, 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] setTemplates was external before; marking it public may increase gas costs and expose unnecessary internal use. Consider reverting it to external to follow standard access patterns.
    ) public onlyOwner {

test/e2e/orbitChain.ts:1114

  • You changed _uint256ToAddress to accept BigNumber but existing calls may still pass strings. Verify and update all callers to pass BigNumber instances to avoid runtime type errors.
function _uint256ToAddress(uint256: BigNumber) {

@gzeoneth gzeoneth marked this pull request as ready for review September 9, 2025 19:26
Copy link
Member

@gzeoneth gzeoneth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, latest review items are resolved

@gzeoneth gzeoneth merged commit 0edf861 into develop Sep 9, 2025
13 checks passed
@gzeoneth gzeoneth deleted the deterministic-factory-deployments branch September 9, 2025 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants