-
Notifications
You must be signed in to change notification settings - Fork 3.9k
feat: Add Conditional L2 Deployer #18864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
maurelian
merged 15 commits into
ethereum-optimism:develop
from
defi-wonderland:sc-feat/l2cm-conditional-deployer
Feb 13, 2026
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
edbc4ea
feat: add ConditionalDeployer (#687)
0xiamflux 4f849e0
Merge branch 'develop' into sc-feat/l2cm-conditional-deployer
0xniha 36ed1f0
Merge pull request #804 from defi-wonderland/chore/l2cm-conditional-d…
0xiamflux 8c1fa94
feat: refactor l2cm conditional deployer predeploy and add L2CM dev f…
0xniha c3dfb71
fix: conditional deployer tests and match style guide
0xniha d7d35fb
fix: comments and add msg.value to ConditionalDeployer
0xniha 85764a4
Merge branch 'develop' of github.com:defi-wonderland/optimism into sy…
0xOneTony 290addb
Merge pull request #841 from defi-wonderland/sync/l2cm-cd
0xOneTony fe7f6b3
fix: add code length check after deploy
0xniha a361569
refactor: remove useL2CM bool initialization
0xniha 4c034ae
fix: make deploy non payable and add tests
0xniha 014acf1
refactor: add returned address check in deploy
0xniha d6321df
fix: use encodePacked for return address test
0xniha 5fd13a7
fix: unify getters in a single test contract
0xniha b223a44
fix: variables naming and mutability
0xniha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
31 changes: 31 additions & 0 deletions
31
packages/contracts-bedrock/interfaces/L2/IConditionalDeployer.sol
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.0; | ||
|
|
||
| import { ISemver } from "interfaces/universal/ISemver.sol"; | ||
|
|
||
| /// @title IConditionalDeployer | ||
| /// @notice Interface for the ConditionalDeployer contract. | ||
| interface IConditionalDeployer is ISemver { | ||
| /// @notice Emitted when an implementation is deployed. | ||
| /// @param implementation The address of the deployed implementation. | ||
| /// @param salt The salt used for deployment. | ||
| event ImplementationDeployed(address indexed implementation, bytes32 salt); | ||
|
|
||
| /// @notice Emitted when deployment is skipped because implementation already exists. | ||
| /// @param implementation The address of the existing implementation. | ||
| event ImplementationExists(address indexed implementation); | ||
|
|
||
| /// @notice Error thrown when deployment fails. | ||
| /// @param data The data returned from the deployment call. | ||
| error ConditionalDeployer_DeploymentFailed(bytes data); | ||
|
|
||
| /// @notice Deploys an implementation using CREATE2 if it doesn't already exist. | ||
| /// @param _salt The salt to use for CREATE2 deployment. | ||
| /// @param _code The initialization code for the contract. | ||
| /// @return implementation_ The address of the deployed or existing implementation. | ||
| function deploy(bytes32 _salt, bytes memory _code) external returns (address implementation_); | ||
|
|
||
| /// @notice Address of the Arachnid's DeterministicDeploymentProxy. | ||
| /// @return deterministicDeploymentProxy_ The address of the Arachnid's DeterministicDeploymentProxy. | ||
| function deterministicDeploymentProxy() external pure returns (address deterministicDeploymentProxy_); | ||
| } |
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
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
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
95 changes: 95 additions & 0 deletions
95
packages/contracts-bedrock/snapshots/abi/ConditionalDeployer.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| [ | ||
| { | ||
| "inputs": [ | ||
| { | ||
| "internalType": "bytes32", | ||
| "name": "_salt", | ||
| "type": "bytes32" | ||
| }, | ||
| { | ||
| "internalType": "bytes", | ||
| "name": "_code", | ||
| "type": "bytes" | ||
| } | ||
| ], | ||
| "name": "deploy", | ||
| "outputs": [ | ||
| { | ||
| "internalType": "address", | ||
| "name": "implementation_", | ||
| "type": "address" | ||
| } | ||
| ], | ||
| "stateMutability": "nonpayable", | ||
| "type": "function" | ||
| }, | ||
| { | ||
| "inputs": [], | ||
| "name": "deterministicDeploymentProxy", | ||
| "outputs": [ | ||
| { | ||
| "internalType": "address", | ||
| "name": "deterministicDeploymentProxy_", | ||
| "type": "address" | ||
| } | ||
| ], | ||
| "stateMutability": "pure", | ||
| "type": "function" | ||
| }, | ||
| { | ||
| "inputs": [], | ||
| "name": "version", | ||
| "outputs": [ | ||
| { | ||
| "internalType": "string", | ||
| "name": "", | ||
| "type": "string" | ||
| } | ||
| ], | ||
| "stateMutability": "view", | ||
| "type": "function" | ||
| }, | ||
| { | ||
| "anonymous": false, | ||
| "inputs": [ | ||
| { | ||
| "indexed": true, | ||
| "internalType": "address", | ||
| "name": "implementation", | ||
| "type": "address" | ||
| }, | ||
| { | ||
| "indexed": false, | ||
| "internalType": "bytes32", | ||
| "name": "salt", | ||
| "type": "bytes32" | ||
| } | ||
| ], | ||
| "name": "ImplementationDeployed", | ||
| "type": "event" | ||
| }, | ||
| { | ||
| "anonymous": false, | ||
| "inputs": [ | ||
| { | ||
| "indexed": true, | ||
| "internalType": "address", | ||
| "name": "implementation", | ||
| "type": "address" | ||
| } | ||
| ], | ||
| "name": "ImplementationExists", | ||
| "type": "event" | ||
| }, | ||
| { | ||
| "inputs": [ | ||
| { | ||
| "internalType": "bytes", | ||
| "name": "data", | ||
| "type": "bytes" | ||
| } | ||
| ], | ||
| "name": "ConditionalDeployer_DeploymentFailed", | ||
| "type": "error" | ||
| } | ||
| ] |
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
1 change: 1 addition & 0 deletions
1
packages/contracts-bedrock/snapshots/storageLayout/ConditionalDeployer.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| [] |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.