Commit 9367c429 authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

contracts-bedrock: modularize deployer script (#9061)

* contracts-bedrock: modularize deployer script

Move logic for interacting with artifacts outside
of the deployer contract into its own contract.

This allows for other contracts to easily inherit the
contract so that any contract can read in contract
addresses.

* ctb: handle devnet

* contracts-bedrock: fixup

* lint: fix
parent 35a5aad6
This diff is collapsed.
...@@ -45,6 +45,7 @@ import "src/libraries/DisputeTypes.sol"; ...@@ -45,6 +45,7 @@ import "src/libraries/DisputeTypes.sol";
import { ChainAssertions } from "scripts/ChainAssertions.sol"; import { ChainAssertions } from "scripts/ChainAssertions.sol";
import { Types } from "scripts/Types.sol"; import { Types } from "scripts/Types.sol";
import { LibStateDiff } from "scripts/libraries/LibStateDiff.sol"; import { LibStateDiff } from "scripts/libraries/LibStateDiff.sol";
import { EIP1967Helper } from "test/mocks/EIP1967Helper.sol";
/// @title Deploy /// @title Deploy
/// @notice Script used to deploy a bedrock system. The entire system is deployed within the `run` function. /// @notice Script used to deploy a bedrock system. The entire system is deployed within the `run` function.
...@@ -408,8 +409,7 @@ contract Deploy is Deployer { ...@@ -408,8 +409,7 @@ contract Deploy is Deployer {
address proxyAdmin = mustGetAddress("ProxyAdmin"); address proxyAdmin = mustGetAddress("ProxyAdmin");
L1ChugSplashProxy proxy = new L1ChugSplashProxy(proxyAdmin); L1ChugSplashProxy proxy = new L1ChugSplashProxy(proxyAdmin);
address admin = address(uint160(uint256(vm.load(address(proxy), OWNER_KEY)))); require(EIP1967Helper.getAdmin(address(proxy)) == proxyAdmin);
require(admin == proxyAdmin);
save("L1StandardBridgeProxy", address(proxy)); save("L1StandardBridgeProxy", address(proxy));
console.log("L1StandardBridgeProxy deployed at %s", address(proxy)); console.log("L1StandardBridgeProxy deployed at %s", address(proxy));
...@@ -433,8 +433,7 @@ contract Deploy is Deployer { ...@@ -433,8 +433,7 @@ contract Deploy is Deployer {
address proxyAdmin = mustGetAddress("ProxyAdmin"); address proxyAdmin = mustGetAddress("ProxyAdmin");
Proxy proxy = new Proxy({ _admin: proxyAdmin }); Proxy proxy = new Proxy({ _admin: proxyAdmin });
address admin = address(uint160(uint256(vm.load(address(proxy), OWNER_KEY)))); require(EIP1967Helper.getAdmin(address(proxy)) == proxyAdmin);
require(admin == proxyAdmin);
save(_name, address(proxy)); save(_name, address(proxy));
console.log(" at %s", address(proxy)); console.log(" at %s", address(proxy));
......
...@@ -15,6 +15,7 @@ import { CheckGelatoLow } from "src/periphery/drippie/dripchecks/CheckGelatoLow. ...@@ -15,6 +15,7 @@ import { CheckGelatoLow } from "src/periphery/drippie/dripchecks/CheckGelatoLow.
import { CheckBalanceLow } from "src/periphery/drippie/dripchecks/CheckBalanceLow.sol"; import { CheckBalanceLow } from "src/periphery/drippie/dripchecks/CheckBalanceLow.sol";
import { CheckTrue } from "src/periphery/drippie/dripchecks/CheckTrue.sol"; import { CheckTrue } from "src/periphery/drippie/dripchecks/CheckTrue.sol";
import { AdminFaucetAuthModule } from "src/periphery/faucet/authmodules/AdminFaucetAuthModule.sol"; import { AdminFaucetAuthModule } from "src/periphery/faucet/authmodules/AdminFaucetAuthModule.sol";
import { EIP1967Helper } from "test/mocks/EIP1967Helper.sol";
/// @title DeployPeriphery /// @title DeployPeriphery
/// @notice Script used to deploy periphery contracts. /// @notice Script used to deploy periphery contracts.
...@@ -113,8 +114,7 @@ contract DeployPeriphery is Deployer { ...@@ -113,8 +114,7 @@ contract DeployPeriphery is Deployer {
addr_ = preComputedAddress; addr_ = preComputedAddress;
} else { } else {
Proxy proxy = new Proxy{ salt: salt }({ _admin: proxyAdmin }); Proxy proxy = new Proxy{ salt: salt }({ _admin: proxyAdmin });
address admin = address(uint160(uint256(vm.load(address(proxy), OWNER_KEY)))); require(EIP1967Helper.getAdmin(address(proxy)) == proxyAdmin);
require(admin == proxyAdmin);
save("FaucetProxy", address(proxy)); save("FaucetProxy", address(proxy));
console.log("FaucetProxy deployed at %s", address(proxy)); console.log("FaucetProxy deployed at %s", address(proxy));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment