Commit 32fc813d authored by Maurelian's avatar Maurelian

contract-bedrock: Add logs at start of deploy functions

This changes makes debugging the deploy scripts easier, by indicating
the action which is about to happen, rather than the one which last
succeeded.
parent d82e51e7
......@@ -277,6 +277,7 @@ contract Deploy is Deployer {
/// @notice Deploy the Safe
function deploySafe() public broadcast returns (address addr_) {
console.log("Deploying Safe...");
(SafeProxyFactory safeProxyFactory, Safe safeSingleton) = _getSafeFactory();
address[] memory signers = new address[](1);
......@@ -294,6 +295,7 @@ contract Deploy is Deployer {
/// @notice Deploy the AddressManager
function deployAddressManager() public broadcast returns (address addr_) {
console.log("Deploying AddressManager...");
AddressManager manager = new AddressManager();
require(manager.owner() == msg.sender);
......@@ -304,6 +306,7 @@ contract Deploy is Deployer {
/// @notice Deploy the ProxyAdmin
function deployProxyAdmin() public broadcast returns (address addr_) {
console.log("Deploying ProxyAdmin...");
ProxyAdmin admin = new ProxyAdmin({
_owner: msg.sender
});
......@@ -323,6 +326,7 @@ contract Deploy is Deployer {
/// @notice Deploy the StorageSetter contract, used for upgrades.
function deployStorageSetter() public broadcast returns (address addr_) {
console.log("Deploying StorageSetter");
StorageSetter setter = new StorageSetter{ salt: _implSalt() }();
console.log("StorageSetter deployed at: %s", address(setter));
string memory version = setter.version();
......@@ -336,6 +340,7 @@ contract Deploy is Deployer {
/// @notice Deploy the L1StandardBridgeProxy using a ChugSplashProxy
function deployL1StandardBridgeProxy() public broadcast returns (address addr_) {
console.log("Deploying proxy for L1StandardBridge");
address proxyAdmin = mustGetAddress("ProxyAdmin");
L1ChugSplashProxy proxy = new L1ChugSplashProxy(proxyAdmin);
......@@ -349,6 +354,7 @@ contract Deploy is Deployer {
/// @notice Deploy the L1CrossDomainMessengerProxy using a ResolvedDelegateProxy
function deployL1CrossDomainMessengerProxy() public broadcast returns (address addr_) {
console.log("Deploying proxy for L1CrossDomainMessenger");
AddressManager addressManager = AddressManager(mustGetAddress("AddressManager"));
string memory contractName = "OVM_L1CrossDomainMessenger";
ResolvedDelegateProxy proxy = new ResolvedDelegateProxy(addressManager, contractName);
......@@ -367,7 +373,7 @@ contract Deploy is Deployer {
}
function deployERC1967Proxy(string memory _name) public broadcast returns (address addr_) {
console.log(string.concat("Deploying ", _name));
console.log(string.concat("Deploying ERC1967 proxy for", _name));
address proxyAdmin = mustGetAddress("ProxyAdmin");
Proxy proxy = new Proxy({
_admin: proxyAdmin
......@@ -387,6 +393,7 @@ contract Deploy is Deployer {
/// @notice Deploy the L1CrossDomainMessenger
function deployL1CrossDomainMessenger() public broadcast returns (address addr_) {
console.log("Deploying L1CrossDomainMessenger implementation");
address portal = mustGetAddress("OptimismPortalProxy");
L1CrossDomainMessenger messenger = new L1CrossDomainMessenger{ salt: _implSalt() }({
_portal: OptimismPortal(payable(portal))
......@@ -409,6 +416,7 @@ contract Deploy is Deployer {
/// @notice Deploy the OptimismPortal
function deployOptimismPortal() public broadcast returns (address addr_) {
console.log("Deploying OptimismPortal implementation");
address guardian = cfg.portalGuardian();
if (guardian.code.length == 0) {
console.log("Portal guardian has no code: %s", guardian);
......@@ -441,6 +449,7 @@ contract Deploy is Deployer {
/// @notice Deploy the L2OutputOracle
function deployL2OutputOracle() public broadcast returns (address addr_) {
console.log("Deploying L2OutputOracle implementation");
L2OutputOracle oracle = new L2OutputOracle{ salt: _implSalt() }({
_submissionInterval: cfg.l2OutputOracleSubmissionInterval(),
_l2BlockTime: cfg.l2BlockTime(),
......@@ -468,6 +477,7 @@ contract Deploy is Deployer {
/// @notice Deploy the OptimismMintableERC20Factory
function deployOptimismMintableERC20Factory() public broadcast returns (address addr_) {
console.log("Deploying OptimismMintableERC20Factory implementation");
address l1standardBridgeProxy = mustGetAddress("L1StandardBridgeProxy");
OptimismMintableERC20Factory factory =
new OptimismMintableERC20Factory{ salt: _implSalt() }({_bridge: l1standardBridgeProxy});
......@@ -487,6 +497,7 @@ contract Deploy is Deployer {
/// @notice Deploy the DisputeGameFactory
function deployDisputeGameFactory() public onlyDevnet broadcast returns (address addr_) {
console.log("Deploying DisputeGameFactory implementation");
DisputeGameFactory factory = new DisputeGameFactory{ salt: _implSalt() }();
save("DisputeGameFactory", address(factory));
console.log("DisputeGameFactory deployed at %s", address(factory));
......@@ -496,6 +507,7 @@ contract Deploy is Deployer {
/// @notice Deploy the BlockOracle
function deployBlockOracle() public onlyDevnet broadcast returns (address addr_) {
console.log("Deploying BlockOracle implementation");
BlockOracle oracle = new BlockOracle{ salt: _implSalt() }();
save("BlockOracle", address(oracle));
console.log("BlockOracle deployed at %s", address(oracle));
......@@ -505,6 +517,7 @@ contract Deploy is Deployer {
/// @notice Deploy the ProtocolVersions
function deployProtocolVersions() public broadcast returns (address addr_) {
console.log("Deploying ProtocolVersions implementation");
ProtocolVersions versions = new ProtocolVersions{ salt: _implSalt() }();
save("ProtocolVersions", address(versions));
console.log("ProtocolVersions deployed at %s", address(versions));
......@@ -523,6 +536,7 @@ contract Deploy is Deployer {
/// @notice Deploy the PreimageOracle
function deployPreimageOracle() public onlyDevnet broadcast returns (address addr_) {
console.log("Deploying PreimageOracle implementation");
PreimageOracle preimageOracle = new PreimageOracle{ salt: _implSalt() }();
save("PreimageOracle", address(preimageOracle));
console.log("PreimageOracle deployed at %s", address(preimageOracle));
......@@ -532,6 +546,7 @@ contract Deploy is Deployer {
/// @notice Deploy Mips
function deployMips() public onlyDevnet broadcast returns (address addr_) {
console.log("Deploying Mips implementation");
MIPS mips = new MIPS{ salt: _implSalt() }(IPreimageOracle(mustGetAddress("PreimageOracle")));
save("Mips", address(mips));
console.log("MIPS deployed at %s", address(mips));
......@@ -541,6 +556,7 @@ contract Deploy is Deployer {
/// @notice Deploy the SystemConfig
function deploySystemConfig() public broadcast returns (address addr_) {
console.log("Deploying SystemConfig implementation");
ResourceMetering.ResourceConfig memory defaultConfig = Constants.DEFAULT_RESOURCE_CONFIG();
uint64 minimumGasLimit = uint64(defaultConfig.maxResourceLimit) + uint64(defaultConfig.systemTxMaxGas);
SystemConfig config = new SystemConfig({
......@@ -570,6 +586,7 @@ contract Deploy is Deployer {
/// @notice Deploy the L1StandardBridge
function deployL1StandardBridge() public broadcast returns (address addr_) {
console.log("Deploying L1StandardBridge implementation");
address l1CrossDomainMessengerProxy = mustGetAddress("L1CrossDomainMessengerProxy");
L1StandardBridge bridge = new L1StandardBridge{ salt: _implSalt() }({
......@@ -591,6 +608,7 @@ contract Deploy is Deployer {
/// @notice Deploy the L1ERC721Bridge
function deployL1ERC721Bridge() public broadcast returns (address addr_) {
console.log("Deploying L1ERC721Bridge implementation");
address l1CrossDomainMessengerProxy = mustGetAddress("L1CrossDomainMessengerProxy");
L1ERC721Bridge bridge = new L1ERC721Bridge{ salt: _implSalt() }({
_messenger: l1CrossDomainMessengerProxy,
......@@ -612,6 +630,7 @@ contract Deploy is Deployer {
/// @notice Transfer ownership of the address manager to the ProxyAdmin
function transferAddressManagerOwnership() public broadcast {
console.log("Transferring AddressManager ownership to ProxyAdmin");
AddressManager addressManager = AddressManager(mustGetAddress("AddressManager"));
address owner = addressManager.owner();
address proxyAdmin = mustGetAddress("ProxyAdmin");
......@@ -629,6 +648,7 @@ contract Deploy is Deployer {
/// @notice Initialize the DisputeGameFactory
function initializeDisputeGameFactory() public onlyDevnet broadcast {
console.log("Initializing DisputeGameFactory contract");
address disputeGameFactoryProxy = mustGetAddress("DisputeGameFactoryProxy");
address disputeGameFactory = mustGetAddress("DisputeGameFactory");
......@@ -644,6 +664,7 @@ contract Deploy is Deployer {
/// @notice Initialize the SystemConfig
function initializeSystemConfig() public broadcast {
console.log("Initializing SystemConfig contract");
address systemConfigProxy = mustGetAddress("SystemConfigProxy");
address systemConfig = mustGetAddress("SystemConfig");
......@@ -677,6 +698,7 @@ contract Deploy is Deployer {
/// @notice Initialize the L1StandardBridge
function initializeL1StandardBridge() public broadcast {
console.log("Initializing L1StandardBridge contract");
ProxyAdmin proxyAdmin = ProxyAdmin(mustGetAddress("ProxyAdmin"));
address l1StandardBridgeProxy = mustGetAddress("L1StandardBridgeProxy");
address l1StandardBridge = mustGetAddress("L1StandardBridge");
......@@ -703,6 +725,7 @@ contract Deploy is Deployer {
/// @notice Initialize the L1ERC721Bridge
function initializeL1ERC721Bridge() public broadcast {
console.log("Initializing L1ERC721Bridge contract");
ProxyAdmin proxyAdmin = ProxyAdmin(mustGetAddress("ProxyAdmin"));
address l1ERC721BridgeProxy = mustGetAddress("L1ERC721BridgeProxy");
address l1ERC721Bridge = mustGetAddress("L1ERC721Bridge");
......@@ -721,6 +744,7 @@ contract Deploy is Deployer {
/// @notice Ininitialize the OptimismMintableERC20Factory
function initializeOptimismMintableERC20Factory() public broadcast {
console.log("Initializing OptimismMintableERC20Factory contract");
address proxyAdmin = mustGetAddress("ProxyAdmin");
address optimismMintableERC20FactoryProxy = mustGetAddress("OptimismMintableERC20FactoryProxy");
address optimismMintableERC20Factory = mustGetAddress("OptimismMintableERC20Factory");
......@@ -741,6 +765,7 @@ contract Deploy is Deployer {
/// @notice initializeL1CrossDomainMessenger
function initializeL1CrossDomainMessenger() public broadcast {
console.log("Initializing L1CrossDomainMessenger contract");
ProxyAdmin proxyAdmin = ProxyAdmin(mustGetAddress("ProxyAdmin"));
address l1CrossDomainMessengerProxy = mustGetAddress("L1CrossDomainMessengerProxy");
address l1CrossDomainMessenger = mustGetAddress("L1CrossDomainMessenger");
......@@ -786,6 +811,7 @@ contract Deploy is Deployer {
/// @notice Initialize the L2OutputOracle
function initializeL2OutputOracle() public broadcast {
console.log("Initializing L2OutputOracle contract");
address l2OutputOracleProxy = mustGetAddress("L2OutputOracleProxy");
address l2OutputOracle = mustGetAddress("L2OutputOracle");
......@@ -813,6 +839,7 @@ contract Deploy is Deployer {
/// @notice Initialize the OptimismPortal
function initializeOptimismPortal() public broadcast {
console.log("Initializing OptimismPortal contract");
address optimismPortalProxy = mustGetAddress("OptimismPortalProxy");
address optimismPortal = mustGetAddress("OptimismPortal");
......@@ -832,6 +859,7 @@ contract Deploy is Deployer {
}
function initializeProtocolVersions() public broadcast {
console.log("Initializing ProtocolVersions contract");
address protocolVersionsProxy = mustGetAddress("ProtocolVersionsProxy");
address protocolVersions = mustGetAddress("ProtocolVersions");
......@@ -863,6 +891,7 @@ contract Deploy is Deployer {
/// @notice Transfer ownership of the DisputeGameFactory contract to the final system owner
function transferDisputeGameFactoryOwnership() public onlyDevnet broadcast {
console.log("Transferring DisputeGameFactory ownership to Safe");
DisputeGameFactory disputeGameFactory = DisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
address owner = disputeGameFactory.owner();
......@@ -875,6 +904,7 @@ contract Deploy is Deployer {
/// @notice Sets the implementation for the `FAULT` game type in the `DisputeGameFactory`
function setCannonFaultGameImplementation() public onlyDevnet broadcast {
console.log("Setting Cannon FaultDisputeGame implementation");
DisputeGameFactory factory = DisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
Claim mipsAbsolutePrestate;
......@@ -909,6 +939,7 @@ contract Deploy is Deployer {
/// @notice Sets the implementation for the alphabet game type in the `DisputeGameFactory`
function setAlphabetFaultGameImplementation() public onlyDevnet broadcast {
console.log("Setting Alphabet FaultDisputeGame implementation");
DisputeGameFactory factory = DisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
// Set the Alphabet FaultDisputeGame implementation in the factory.
......
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