Skip to content

feat: add ConditionalDeployer#687

Merged
0xiamflux merged 1 commit intosc-feat/l2cm-conditional-deployerfrom
feat/l2cm-conditional-deployer
Nov 14, 2025
Merged

feat: add ConditionalDeployer#687
0xiamflux merged 1 commit intosc-feat/l2cm-conditional-deployerfrom
feat/l2cm-conditional-deployer

Conversation

@0xiamflux
Copy link
Copy Markdown

@0xiamflux 0xiamflux commented Nov 14, 2025

Note

Adds a ConditionalDeployer that conditionally deploys implementations via CREATE2 using a preinstall, with authorization and comprehensive tests.

  • Contracts:
    • Add packages/contracts-bedrock/src/L2/ConditionalDeployer.sol:
      • Uses ICreate2Deployer preinstall to computeAddress and deploy via CREATE2.
      • Skips deployment if code already exists; emits ImplementationDeployed/ImplementationExists.
      • Restricts calls with onlyAuthorized (depositor account or address(0)).
    • Add packages/contracts-bedrock/interfaces/preinstalls/ICreate2Deployer.sol with deploy, deployERC1820Implementer, computeAddress, computeAddressWithDeployer, and receive().
  • Tests:
    • Add packages/contracts-bedrock/test/L2/ConditionalDeployer.t.sol:
      • Fuzz tests for successful deploy, zero-address caller, idempotent re-deploy (emits ImplementationExists), and unauthorized caller revert.

Written by Cursor Bugbot for commit 263fee2. This will update automatically on new commits. Configure here.

@0xiamflux 0xiamflux requested a review from 0xOneTony November 14, 2025 20:02
@0xiamflux 0xiamflux self-assigned this Nov 14, 2025
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on November 16

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.

Comment thread packages/contracts-bedrock/src/L2/ConditionalDeployer.sol
@0xiamflux 0xiamflux merged commit edbc4ea into sc-feat/l2cm-conditional-deployer Nov 14, 2025
1 check passed
0xOneTony added a commit that referenced this pull request Feb 13, 2026
* feat: add ConditionalDeployer (#687)

* feat: refactor l2cm conditional deployer predeploy and add L2CM dev flag  (#836)

* refactor: replace create2 deployer for arachnid

* feat: add ConditionalDeployer as predeploy and add L2CM dev flag

* fix: add pre-pr fix

* fix: remove unnecessary auth in conditional deployer

* feat: add custom error for deployment revert

* test: add l2cm e2e apply test case

* fix: conditional deployer tests and match style guide

* fix: remove fork test

* feat: add common test to cond deployer test

* fix: follow constant style guide

* fix: comments and add msg.value to ConditionalDeployer

* fix: conditional deployer comment in apply test

* fix: arachnid reference comment

* fix: add msg.value to conditional deployer

* fix: deterministic deployment proxy comment

* fix: add code length check after deploy

* fix: add code length check after deploy

* fix: pre pr fix

* refactor: remove useL2CM bool initialization

* fix: make deploy non payable and add tests

* fix: make deploy non payable

* test: add missing getters test

* fix: add missing natspec

* feat: add todo issue for devfeatures cyclic import

* chore: pre pr run

* refactor: add returned address check in deploy

* fix: use encodePacked for return address test

* fix: unify getters in a single test contract

* fix: variables naming and mutability

* fix: remove underscore from local variable

* fix: remove address payable from deterministicDeploymentProxy

* refactor: rename dummy storage variable in test and add internal getExpectedImplementation helper

---------

Co-authored-by: niha <205694301+0xniha@users.noreply.github.com>
Co-authored-by: OneTony <onetony@defi.sucks>
Co-authored-by: 0xOneTony <112496816+0xOneTony@users.noreply.github.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.

2 participants