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
556cd486
Unverified
Commit
556cd486
authored
Aug 03, 2023
by
OptimismBot
Committed by
GitHub
Aug 03, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6584 from ethereum-optimism/feat/deploy-script
contracts-bedrock: cleanup deploy script
parents
d9207c6f
50bffd00
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
78 deletions
+68
-78
Deploy.s.sol
packages/contracts-bedrock/scripts/Deploy.s.sol
+68
-78
No files found.
packages/contracts-bedrock/scripts/Deploy.s.sol
View file @
556cd486
...
...
@@ -109,6 +109,14 @@ contract Deploy is Deployer {
vm.stopBroadcast();
}
/// @notice Modifier that will only allow a function to be called on devnet.
modifier onlyDevnet() {
uint256 chainid = block.chainid;
if (chainid == Chains.LocalDevnet || chainid == Chains.GethDevnet) {
_;
}
}
/// @notice Deploy the AddressManager
function deployAddressManager() broadcast() public returns (address) {
AddressManager manager = new AddressManager();
...
...
@@ -250,8 +258,7 @@ contract Deploy is Deployer {
}
/// @notice Deploy the DisputeGameFactoryProxy
function deployDisputeGameFactoryProxy() broadcast() public returns (address) {
if (block.chainid == Chains.LocalDevnet || block.chainid == Chains.GethDevnet) {
function deployDisputeGameFactoryProxy() onlyDevnet broadcast() public returns (address) {
address proxyAdmin = mustGetAddress("ProxyAdmin");
Proxy proxy = new Proxy({
_admin: proxyAdmin
...
...
@@ -265,8 +272,6 @@ contract Deploy is Deployer {
return address(proxy);
}
return address(0);
}
/// @notice Deploy the L1CrossDomainMessenger
function deployL1CrossDomainMessenger() broadcast() public returns (address) {
...
...
@@ -351,40 +356,31 @@ contract Deploy is Deployer {
}
/// @notice Deploy the DisputeGameFactory
function deployDisputeGameFactory() broadcast() public returns (address) {
if (block.chainid == Chains.LocalDevnet || block.chainid == Chains.GethDevnet) {
function deployDisputeGameFactory() onlyDevnet broadcast() public returns (address) {
DisputeGameFactory factory = new DisputeGameFactory();
save("DisputeGameFactory", address(factory));
console.log("DisputeGameFactory deployed at %s", address(factory));
return address(factory);
}
return address(0);
}
/// @notice Deploy the PreimageOracle
function deployPreimageOracle() broadcast() public returns (address) {
if (block.chainid == 900) {
function deployPreimageOracle() onlyDevnet broadcast() public returns (address) {
PreimageOracle preimageOracle = new PreimageOracle();
save("PreimageOracle", address(preimageOracle));
console.log("PreimageOracle deployed at %s", address(preimageOracle));
return address(preimageOracle);
}
return address(0);
}
/// @notice Deploy Mips
function deployMips() broadcast() public returns (address) {
if (block.chainid == 900) {
function deployMips() onlyDevnet broadcast() public returns (address) {
MIPS mips = new MIPS();
save("Mips", address(mips));
console.log("Mips
deployed at %s", address(mips));
console.log("MIPS
deployed at %s", address(mips));
return address(mips);
}
return address(0);
}
/// @notice Deploy the SystemConfig
function deploySystemConfig() broadcast() public returns (address) {
...
...
@@ -470,8 +466,7 @@ contract Deploy is Deployer {
}
/// @notice Initialize the DisputeGameFactory
function initializeDisputeGameFactory() broadcast() public {
if (block.chainid == Chains.LocalDevnet || block.chainid == Chains.GethDevnet) {
function initializeDisputeGameFactory() onlyDevnet broadcast() public {
ProxyAdmin proxyAdmin = ProxyAdmin(mustGetAddress("ProxyAdmin"));
address disputeGameFactoryProxy = mustGetAddress("DisputeGameFactoryProxy");
address disputeGameFactory = mustGetAddress("DisputeGameFactory");
...
...
@@ -488,7 +483,6 @@ contract Deploy is Deployer {
string memory version = DisputeGameFactory(disputeGameFactoryProxy).version();
console.log("DisputeGameFactory version: %s", version);
}
}
/// @notice Initialize the SystemConfig
function initializeSystemConfig() broadcast() public {
...
...
@@ -704,8 +698,7 @@ contract Deploy is Deployer {
}
/// @notice Transfer ownership of the DisputeGameFactory contract to the final system owner
function transferDisputeGameFactoryOwnership() broadcast() public {
if (block.chainid == Chains.LocalDevnet || block.chainid == Chains.GethDevnet) {
function transferDisputeGameFactoryOwnership() onlyDevnet broadcast() public {
DisputeGameFactory disputeGameFactory = DisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
address owner = disputeGameFactory.owner();
address finalSystemOwner = cfg.finalSystemOwner();
...
...
@@ -714,11 +707,9 @@ contract Deploy is Deployer {
console.log("DisputeGameFactory ownership transferred to: %s", finalSystemOwner);
}
}
}
/// @notice Sets the implementation for the `FAULT` game type in the `DisputeGameFactory`
function setFaultGameImplementation() broadcast() public {
if (block.chainid == Chains.LocalDevnet || block.chainid == Chains.GethDevnet) {
function setFaultGameImplementation() onlyDevnet broadcast() public {
DisputeGameFactory factory = DisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
Claim absolutePrestate = Claim.wrap(bytes32(cfg.faultGameAbsolutePrestate()));
IBigStepper faultVm = IBigStepper(new AlphabetVM(absolutePrestate));
...
...
@@ -733,6 +724,5 @@ contract Deploy is Deployer {
console.log("DisputeGameFactory: set `FaultDisputeGame` implementation");
}
}
}
}
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