Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
febfc9a5
Commit
febfc9a5
authored
Oct 03, 2023
by
Tarun Khasnavis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
linter fix
parent
07ff7a16
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
DeployPeriphery.s.sol
packages/contracts-bedrock/scripts/DeployPeriphery.s.sol
+16
-4
No files found.
packages/contracts-bedrock/scripts/DeployPeriphery.s.sol
View file @
febfc9a5
...
@@ -413,14 +413,20 @@ contract DeployPeriphery is Deployer {
...
@@ -413,14 +413,20 @@ contract DeployPeriphery is Deployer {
string memory moduleName = "OnChainAuthModule";
string memory moduleName = "OnChainAuthModule";
string memory version = "1";
string memory version = "1";
bytes32 salt = keccak256(bytes("OnChainAuthModule"));
bytes32 salt = keccak256(bytes("OnChainAuthModule"));
bytes32 initCodeHash = keccak256(abi.encodePacked(type(AdminFaucetAuthModule).creationCode, abi.encode(cfg.faucetOnchainAuthModuleAdmin(), moduleName, version)));
bytes32 initCodeHash = keccak256(
abi.encodePacked(
type(AdminFaucetAuthModule).creationCode,
abi.encode(cfg.faucetOnchainAuthModuleAdmin(), moduleName, version)
)
);
address preComputedAddress = computeCreate2Address(salt, initCodeHash);
address preComputedAddress = computeCreate2Address(salt, initCodeHash);
if (preComputedAddress.code.length > 0) {
if (preComputedAddress.code.length > 0) {
console.log("OnChainAuthModule already deployed at %s", preComputedAddress);
console.log("OnChainAuthModule already deployed at %s", preComputedAddress);
save("OnChainAuthModule", preComputedAddress);
save("OnChainAuthModule", preComputedAddress);
addr_ = preComputedAddress;
addr_ = preComputedAddress;
} else {
} else {
AdminFaucetAuthModule onChainAuthModule = new AdminFaucetAuthModule{ salt: salt }(cfg.faucetOnchainAuthModuleAdmin(), moduleName, version);
AdminFaucetAuthModule onChainAuthModule =
new AdminFaucetAuthModule{ salt: salt }(cfg.faucetOnchainAuthModuleAdmin(), moduleName, version);
require(onChainAuthModule.ADMIN() == cfg.faucetOnchainAuthModuleAdmin());
require(onChainAuthModule.ADMIN() == cfg.faucetOnchainAuthModuleAdmin());
save("OnChainAuthModule", address(onChainAuthModule));
save("OnChainAuthModule", address(onChainAuthModule));
...
@@ -435,7 +441,12 @@ contract DeployPeriphery is Deployer {
...
@@ -435,7 +441,12 @@ contract DeployPeriphery is Deployer {
string memory moduleName = "OffChainAuthModule";
string memory moduleName = "OffChainAuthModule";
string memory version = "1";
string memory version = "1";
bytes32 salt = keccak256(bytes("OffChainAuthModule"));
bytes32 salt = keccak256(bytes("OffChainAuthModule"));
bytes32 initCodeHash = keccak256(abi.encodePacked(type(AdminFaucetAuthModule).creationCode, abi.encode(cfg.faucetOffchainAuthModuleAdmin(), moduleName, version)));
bytes32 initCodeHash = keccak256(
abi.encodePacked(
type(AdminFaucetAuthModule).creationCode,
abi.encode(cfg.faucetOffchainAuthModuleAdmin(), moduleName, version)
)
);
address preComputedAddress = computeCreate2Address(salt, initCodeHash);
address preComputedAddress = computeCreate2Address(salt, initCodeHash);
if (preComputedAddress.code.length > 0) {
if (preComputedAddress.code.length > 0) {
console.logBytes32(initCodeHash);
console.logBytes32(initCodeHash);
...
@@ -443,7 +454,8 @@ contract DeployPeriphery is Deployer {
...
@@ -443,7 +454,8 @@ contract DeployPeriphery is Deployer {
save("OffChainAuthModule", preComputedAddress);
save("OffChainAuthModule", preComputedAddress);
addr_ = preComputedAddress;
addr_ = preComputedAddress;
} else {
} else {
AdminFaucetAuthModule offChainAuthModule = new AdminFaucetAuthModule{ salt: salt }(cfg.faucetOffchainAuthModuleAdmin(), moduleName, version);
AdminFaucetAuthModule offChainAuthModule =
new AdminFaucetAuthModule{ salt: salt }(cfg.faucetOffchainAuthModuleAdmin(), moduleName, version);
require(offChainAuthModule.ADMIN() == cfg.faucetOffchainAuthModuleAdmin());
require(offChainAuthModule.ADMIN() == cfg.faucetOffchainAuthModuleAdmin());
save("OffChainAuthModule", address(offChainAuthModule));
save("OffChainAuthModule", address(offChainAuthModule));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment