forked from storyprotocol/protocol-core
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploy Protocol Using Pre-Deployed CREATE3 Deployer (#365)
- Loading branch information
1 parent
286bedc
commit 278571e
Showing
11 changed files
with
84 additions
and
36 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,17 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.26; | ||
|
||
import { CREATE3 } from "@solady/src/utils/CREATE3.sol"; | ||
import { ICreate3Deployer } from "./ICreate3Deployer.sol"; | ||
|
||
contract Create3Deployer is ICreate3Deployer { | ||
/// @inheritdoc ICreate3Deployer | ||
function deployDeterministic(bytes memory creationCode, bytes32 salt) external payable returns (address deployed) { | ||
return CREATE3.deployDeterministic(creationCode, salt); | ||
} | ||
|
||
/// @inheritdoc ICreate3Deployer | ||
function predictDeterministicAddress(bytes32 salt) external view returns (address deployed) { | ||
return CREATE3.predictDeterministicAddress(salt); | ||
} | ||
} |
This file contains 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 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,15 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.26; | ||
|
||
interface ICreate3Deployer { | ||
/// @notice Deploys a contract using CREATE3 | ||
/// @param salt The deployer-specific salt for determining the deployed contract's address | ||
/// @param creationCode The creation code of the contract to deploy | ||
/// @return deployed The address of the deployed contract | ||
function deployDeterministic(bytes memory creationCode, bytes32 salt) external payable returns (address deployed); | ||
|
||
/// @notice Predicts the address of a deployed contract | ||
/// @param salt The deployer-specific salt for determining the deployed contract's address | ||
/// @return deployed The address of the contract that will be deployed | ||
function predictDeterministicAddress(bytes32 salt) external view returns (address deployed); | ||
} |
This file contains 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 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 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 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 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 |
---|---|---|
|
@@ -5109,10 +5109,10 @@ slice-ansi@^4.0.0: | |
astral-regex "^2.0.0" | ||
is-fullwidth-code-point "^3.0.0" | ||
|
||
solady@^0.0.192: | ||
version "0.0.192" | ||
resolved "https://registry.yarnpkg.com/solady/-/solady-0.0.192.tgz#f80ea061903ba1914d2c96c3c69f53d66865f88f" | ||
integrity sha512-96A4dhYkSB/xUyZIuc6l8RMbQ+nqk7GFr0hEci7/64D3G63Ial06puqXA14ZVy/xFe8nzBJbz3Mxssn7SH/1Ag== | ||
solady@^0.0.281: | ||
version "0.0.281" | ||
resolved "https://registry.yarnpkg.com/solady/-/solady-0.0.281.tgz#2538b475ef4db587c4c946cd032412e08acba4ca" | ||
integrity sha512-pO/r0cVb6EXwAISE/cgcn1outhvkEKHEnVCSUTlRdIWDnl013CrUtMx8PbkDYfef2TrJB178TOA0jIBDVyjGBg== | ||
|
||
[email protected]: | ||
version "0.7.3" | ||
|