Commit 6cfa9b4e authored by Maurelian's avatar Maurelian Committed by GitHub

Deploy Cleanup: Make Artifacts stand alone and etch into global state (#13648)

* Make Artifacts stand alone and etch into global state

* fix the things

* Remove extra artifacts etch

* feat: label and allowCheatCodes on artifacts

feat: restore deploy config label

* fix typo

* fix import

* fix import
parent b9382028
......@@ -6,8 +6,7 @@ import { stdJson } from "forge-std/StdJson.sol";
import { Vm } from "forge-std/Vm.sol";
import { Predeploys } from "src/libraries/Predeploys.sol";
import { Config } from "scripts/libraries/Config.sol";
import { StorageSlot } from "scripts/libraries/ForgeArtifacts.sol";
import { ForgeArtifacts } from "scripts/libraries/ForgeArtifacts.sol";
import { ForgeArtifacts, StorageSlot } from "scripts/libraries/ForgeArtifacts.sol";
import { Process } from "scripts/libraries/Process.sol";
/// @notice Represents a deployment. Is serialized to JSON as a key/value
......@@ -21,7 +20,7 @@ struct Deployment {
/// @notice Useful for accessing deployment artifacts from within scripts.
/// When a contract is deployed, call the `save` function to write its name and
/// contract address to disk. Inspired by `forge-deploy`.
abstract contract Artifacts {
contract Artifacts {
/// @notice Foundry cheatcode VM.
Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code")))));
......
......@@ -100,9 +100,9 @@ contract L2Genesis is Deployer {
function artifactDependencies() internal view returns (L1Dependencies memory l1Dependencies_) {
return L1Dependencies({
l1CrossDomainMessengerProxy: mustGetAddress("L1CrossDomainMessengerProxy"),
l1StandardBridgeProxy: mustGetAddress("L1StandardBridgeProxy"),
l1ERC721BridgeProxy: mustGetAddress("L1ERC721BridgeProxy")
l1CrossDomainMessengerProxy: artifacts.mustGetAddress("L1CrossDomainMessengerProxy"),
l1StandardBridgeProxy: artifacts.mustGetAddress("L1StandardBridgeProxy"),
l1ERC721BridgeProxy: artifacts.mustGetAddress("L1ERC721BridgeProxy")
});
}
......
......@@ -113,38 +113,38 @@ contract Deploy is Deployer {
/// @notice Returns the proxy addresses, not reverting if any are unset.
function _proxies() internal view returns (Types.ContractSet memory proxies_) {
proxies_ = Types.ContractSet({
L1CrossDomainMessenger: getAddress("L1CrossDomainMessengerProxy"),
L1StandardBridge: getAddress("L1StandardBridgeProxy"),
L2OutputOracle: getAddress("L2OutputOracleProxy"),
DisputeGameFactory: getAddress("DisputeGameFactoryProxy"),
DelayedWETH: getAddress("DelayedWETHProxy"),
PermissionedDelayedWETH: getAddress("PermissionedDelayedWETHProxy"),
AnchorStateRegistry: getAddress("AnchorStateRegistryProxy"),
OptimismMintableERC20Factory: getAddress("OptimismMintableERC20FactoryProxy"),
OptimismPortal: getAddress("OptimismPortalProxy"),
SystemConfig: getAddress("SystemConfigProxy"),
L1ERC721Bridge: getAddress("L1ERC721BridgeProxy"),
ProtocolVersions: getAddress("ProtocolVersionsProxy"),
SuperchainConfig: getAddress("SuperchainConfigProxy")
L1CrossDomainMessenger: artifacts.getAddress("L1CrossDomainMessengerProxy"),
L1StandardBridge: artifacts.getAddress("L1StandardBridgeProxy"),
L2OutputOracle: artifacts.getAddress("L2OutputOracleProxy"),
DisputeGameFactory: artifacts.getAddress("DisputeGameFactoryProxy"),
DelayedWETH: artifacts.getAddress("DelayedWETHProxy"),
PermissionedDelayedWETH: artifacts.getAddress("PermissionedDelayedWETHProxy"),
AnchorStateRegistry: artifacts.getAddress("AnchorStateRegistryProxy"),
OptimismMintableERC20Factory: artifacts.getAddress("OptimismMintableERC20FactoryProxy"),
OptimismPortal: artifacts.getAddress("OptimismPortalProxy"),
SystemConfig: artifacts.getAddress("SystemConfigProxy"),
L1ERC721Bridge: artifacts.getAddress("L1ERC721BridgeProxy"),
ProtocolVersions: artifacts.getAddress("ProtocolVersionsProxy"),
SuperchainConfig: artifacts.getAddress("SuperchainConfigProxy")
});
}
/// @notice Returns the impl addresses, not reverting if any are unset.
function _impls() internal view returns (Types.ContractSet memory impls_) {
impls_ = Types.ContractSet({
L1CrossDomainMessenger: getAddress("L1CrossDomainMessengerImpl"),
L1StandardBridge: getAddress("L1StandardBridgeImpl"),
L2OutputOracle: getAddress("L2OutputOracleImpl"),
DisputeGameFactory: getAddress("DisputeGameFactoryImpl"),
DelayedWETH: getAddress("DelayedWETHImpl"),
PermissionedDelayedWETH: getAddress("PermissionedDelayedWETHImpl"),
AnchorStateRegistry: getAddress("AnchorStateRegistryImpl"),
OptimismMintableERC20Factory: getAddress("OptimismMintableERC20FactoryImpl"),
OptimismPortal: getAddress("OptimismPortal2Impl"),
SystemConfig: getAddress("SystemConfigImpl"),
L1ERC721Bridge: getAddress("L1ERC721BridgeImpl"),
ProtocolVersions: getAddress("ProtocolVersionsImpl"),
SuperchainConfig: getAddress("SuperchainConfigImpl")
L1CrossDomainMessenger: artifacts.getAddress("L1CrossDomainMessengerImpl"),
L1StandardBridge: artifacts.getAddress("L1StandardBridgeImpl"),
L2OutputOracle: artifacts.getAddress("L2OutputOracleImpl"),
DisputeGameFactory: artifacts.getAddress("DisputeGameFactoryImpl"),
DelayedWETH: artifacts.getAddress("DelayedWETHImpl"),
PermissionedDelayedWETH: artifacts.getAddress("PermissionedDelayedWETHImpl"),
AnchorStateRegistry: artifacts.getAddress("AnchorStateRegistryImpl"),
OptimismMintableERC20Factory: artifacts.getAddress("OptimismMintableERC20FactoryImpl"),
OptimismPortal: artifacts.getAddress("OptimismPortal2Impl"),
SystemConfig: artifacts.getAddress("SystemConfigImpl"),
L1ERC721Bridge: artifacts.getAddress("L1ERC721BridgeImpl"),
ProtocolVersions: artifacts.getAddress("ProtocolVersionsImpl"),
SuperchainConfig: artifacts.getAddress("SuperchainConfigImpl")
});
}
......@@ -170,12 +170,12 @@ contract Deploy is Deployer {
console.log("Deploying a fresh OP Stack with existing SuperchainConfig and ProtocolVersions");
IProxy scProxy = IProxy(_superchainConfigProxy);
save("SuperchainConfigImpl", scProxy.implementation());
save("SuperchainConfigProxy", _superchainConfigProxy);
artifacts.save("SuperchainConfigImpl", scProxy.implementation());
artifacts.save("SuperchainConfigProxy", _superchainConfigProxy);
IProxy pvProxy = IProxy(_protocolVersionsProxy);
save("ProtocolVersionsImpl", pvProxy.implementation());
save("ProtocolVersionsProxy", _protocolVersionsProxy);
artifacts.save("ProtocolVersionsImpl", pvProxy.implementation());
artifacts.save("ProtocolVersionsProxy", _protocolVersionsProxy);
_run({ _needsSuperchain: false });
}
......@@ -208,8 +208,8 @@ contract Deploy is Deployer {
deployOpChain();
// Set the respected game type according to the deploy config
vm.startPrank(ISuperchainConfig(mustGetAddress("SuperchainConfigProxy")).guardian());
IOptimismPortal2(mustGetAddress("OptimismPortalProxy")).setRespectedGameType(
vm.startPrank(ISuperchainConfig(artifacts.mustGetAddress("SuperchainConfigProxy")).guardian());
IOptimismPortal2(artifacts.mustGetAddress("OptimismPortalProxy")).setRespectedGameType(
GameType.wrap(uint32(cfg.respectedGameType()))
);
vm.stopPrank();
......@@ -256,11 +256,11 @@ contract Deploy is Deployer {
// Run the deployment script.
ds.run(dsi, dso);
save("SuperchainProxyAdmin", address(dso.superchainProxyAdmin()));
save("SuperchainConfigProxy", address(dso.superchainConfigProxy()));
save("SuperchainConfigImpl", address(dso.superchainConfigImpl()));
save("ProtocolVersionsProxy", address(dso.protocolVersionsProxy()));
save("ProtocolVersionsImpl", address(dso.protocolVersionsImpl()));
artifacts.save("SuperchainProxyAdmin", address(dso.superchainProxyAdmin()));
artifacts.save("SuperchainConfigProxy", address(dso.superchainConfigProxy()));
artifacts.save("SuperchainConfigImpl", address(dso.superchainConfigImpl()));
artifacts.save("ProtocolVersionsProxy", address(dso.protocolVersionsProxy()));
artifacts.save("ProtocolVersionsImpl", address(dso.protocolVersionsImpl()));
// First run assertions for the ProtocolVersions and SuperchainConfig proxy contracts.
Types.ContractSet memory contracts = _proxies();
......@@ -268,11 +268,11 @@ contract Deploy is Deployer {
ChainAssertions.checkSuperchainConfig({ _contracts: contracts, _cfg: cfg, _isProxy: true, _isPaused: false });
// Then replace the ProtocolVersions proxy with the implementation address and run assertions on it.
contracts.ProtocolVersions = mustGetAddress("ProtocolVersionsImpl");
contracts.ProtocolVersions = artifacts.mustGetAddress("ProtocolVersionsImpl");
ChainAssertions.checkProtocolVersions({ _contracts: contracts, _cfg: cfg, _isProxy: false });
// Finally replace the SuperchainConfig proxy with the implementation address and run assertions on it.
contracts.SuperchainConfig = mustGetAddress("SuperchainConfigImpl");
contracts.SuperchainConfig = artifacts.mustGetAddress("SuperchainConfigImpl");
ChainAssertions.checkSuperchainConfig({ _contracts: contracts, _cfg: cfg, _isPaused: false, _isProxy: false });
}
......@@ -295,8 +295,8 @@ contract Deploy is Deployer {
dii.set(
dii.standardVersionsToml.selector, string.concat(vm.projectRoot(), "/test/fixtures/standard-versions.toml")
);
dii.set(dii.superchainConfigProxy.selector, mustGetAddress("SuperchainConfigProxy"));
dii.set(dii.protocolVersionsProxy.selector, mustGetAddress("ProtocolVersionsProxy"));
dii.set(dii.superchainConfigProxy.selector, artifacts.mustGetAddress("SuperchainConfigProxy"));
dii.set(dii.protocolVersionsProxy.selector, artifacts.mustGetAddress("ProtocolVersionsProxy"));
dii.set(dii.salt.selector, _implSalt());
if (_isInterop) {
......@@ -304,19 +304,19 @@ contract Deploy is Deployer {
}
di.run(dii, dio);
save("L1CrossDomainMessengerImpl", address(dio.l1CrossDomainMessengerImpl()));
save("OptimismMintableERC20FactoryImpl", address(dio.optimismMintableERC20FactoryImpl()));
save("SystemConfigImpl", address(dio.systemConfigImpl()));
save("L1StandardBridgeImpl", address(dio.l1StandardBridgeImpl()));
save("L1ERC721BridgeImpl", address(dio.l1ERC721BridgeImpl()));
artifacts.save("L1CrossDomainMessengerImpl", address(dio.l1CrossDomainMessengerImpl()));
artifacts.save("OptimismMintableERC20FactoryImpl", address(dio.optimismMintableERC20FactoryImpl()));
artifacts.save("SystemConfigImpl", address(dio.systemConfigImpl()));
artifacts.save("L1StandardBridgeImpl", address(dio.l1StandardBridgeImpl()));
artifacts.save("L1ERC721BridgeImpl", address(dio.l1ERC721BridgeImpl()));
// Fault proofs
save("OptimismPortal2Impl", address(dio.optimismPortalImpl()));
save("DisputeGameFactoryImpl", address(dio.disputeGameFactoryImpl()));
save("DelayedWETHImpl", address(dio.delayedWETHImpl()));
save("PreimageOracleSingleton", address(dio.preimageOracleSingleton()));
save("MipsSingleton", address(dio.mipsSingleton()));
save("OPContractsManager", address(dio.opcm()));
artifacts.save("OptimismPortal2Impl", address(dio.optimismPortalImpl()));
artifacts.save("DisputeGameFactoryImpl", address(dio.disputeGameFactoryImpl()));
artifacts.save("DelayedWETHImpl", address(dio.delayedWETHImpl()));
artifacts.save("PreimageOracleSingleton", address(dio.preimageOracleSingleton()));
artifacts.save("MipsSingleton", address(dio.mipsSingleton()));
artifacts.save("OPContractsManager", address(dio.opcm()));
Types.ContractSet memory contracts = _impls();
ChainAssertions.checkL1CrossDomainMessenger({ _contracts: contracts, _vm: vm, _isProxy: false });
......@@ -341,8 +341,8 @@ contract Deploy is Deployer {
});
ChainAssertions.checkOPContractsManager({
_contracts: contracts,
_opcm: OPContractsManager(mustGetAddress("OPContractsManager")),
_mips: IMIPS(mustGetAddress("MipsSingleton"))
_opcm: OPContractsManager(artifacts.mustGetAddress("OPContractsManager")),
_mips: IMIPS(artifacts.mustGetAddress("MipsSingleton"))
});
if (_isInterop) {
ChainAssertions.checkSystemConfigInterop({ _contracts: contracts, _cfg: cfg, _isProxy: false });
......@@ -356,32 +356,32 @@ contract Deploy is Deployer {
console.log("Deploying OP Chain");
// Ensure that the requisite contracts are deployed
address superchainConfigProxy = mustGetAddress("SuperchainConfigProxy");
OPContractsManager opcm = OPContractsManager(mustGetAddress("OPContractsManager"));
address superchainConfigProxy = artifacts.mustGetAddress("SuperchainConfigProxy");
OPContractsManager opcm = OPContractsManager(artifacts.mustGetAddress("OPContractsManager"));
OPContractsManager.DeployInput memory deployInput = getDeployInput();
OPContractsManager.DeployOutput memory deployOutput = opcm.deploy(deployInput);
// Save all deploy outputs from the OPCM, in the order they are declared in the DeployOutput struct
save("ProxyAdmin", address(deployOutput.opChainProxyAdmin));
save("AddressManager", address(deployOutput.addressManager));
save("L1ERC721BridgeProxy", address(deployOutput.l1ERC721BridgeProxy));
save("SystemConfigProxy", address(deployOutput.systemConfigProxy));
save("OptimismMintableERC20FactoryProxy", address(deployOutput.optimismMintableERC20FactoryProxy));
save("L1StandardBridgeProxy", address(deployOutput.l1StandardBridgeProxy));
save("L1CrossDomainMessengerProxy", address(deployOutput.l1CrossDomainMessengerProxy));
artifacts.save("ProxyAdmin", address(deployOutput.opChainProxyAdmin));
artifacts.save("AddressManager", address(deployOutput.addressManager));
artifacts.save("L1ERC721BridgeProxy", address(deployOutput.l1ERC721BridgeProxy));
artifacts.save("SystemConfigProxy", address(deployOutput.systemConfigProxy));
artifacts.save("OptimismMintableERC20FactoryProxy", address(deployOutput.optimismMintableERC20FactoryProxy));
artifacts.save("L1StandardBridgeProxy", address(deployOutput.l1StandardBridgeProxy));
artifacts.save("L1CrossDomainMessengerProxy", address(deployOutput.l1CrossDomainMessengerProxy));
// Fault Proof contracts
save("DisputeGameFactoryProxy", address(deployOutput.disputeGameFactoryProxy));
save("PermissionedDelayedWETHProxy", address(deployOutput.delayedWETHPermissionedGameProxy));
save("AnchorStateRegistryProxy", address(deployOutput.anchorStateRegistryProxy));
save("AnchorStateRegistryImpl", address(deployOutput.anchorStateRegistryImpl));
save("PermissionedDisputeGame", address(deployOutput.permissionedDisputeGame));
save("OptimismPortalProxy", address(deployOutput.optimismPortalProxy));
save("OptimismPortal2Proxy", address(deployOutput.optimismPortalProxy));
artifacts.save("DisputeGameFactoryProxy", address(deployOutput.disputeGameFactoryProxy));
artifacts.save("PermissionedDelayedWETHProxy", address(deployOutput.delayedWETHPermissionedGameProxy));
artifacts.save("AnchorStateRegistryProxy", address(deployOutput.anchorStateRegistryProxy));
artifacts.save("AnchorStateRegistryImpl", address(deployOutput.anchorStateRegistryImpl));
artifacts.save("PermissionedDisputeGame", address(deployOutput.permissionedDisputeGame));
artifacts.save("OptimismPortalProxy", address(deployOutput.optimismPortalProxy));
artifacts.save("OptimismPortal2Proxy", address(deployOutput.optimismPortalProxy));
// Check if the permissionless game implementation is already set
IDisputeGameFactory factory = IDisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
IDisputeGameFactory factory = IDisputeGameFactory(artifacts.mustGetAddress("DisputeGameFactoryProxy"));
address permissionlessGameImpl = address(factory.gameImpls(GameTypes.CANNON));
// Deploy and setup the PermissionlessDelayedWeth not provided by the OPCM.
......@@ -390,7 +390,7 @@ contract Deploy is Deployer {
permissionlessGameImpl == address(0),
"Deploy: The PermissionlessDelayedWETH is already set by the OPCM, it is no longer necessary to deploy it separately."
);
address delayedWETHImpl = mustGetAddress("DelayedWETHImpl");
address delayedWETHImpl = artifacts.mustGetAddress("DelayedWETHImpl");
address delayedWETHPermissionlessGameProxy = deployERC1967ProxyWithOwner("DelayedWETHProxy", msg.sender);
vm.broadcast(msg.sender);
IProxy(payable(delayedWETHPermissionlessGameProxy)).upgradeToAndCall({
......@@ -423,7 +423,7 @@ contract Deploy is Deployer {
/// @param _name The name of the proxy contract to be deployed.
/// @return addr_ The address of the deployed proxy contract.
function deployERC1967Proxy(string memory _name) public returns (address addr_) {
addr_ = deployERC1967ProxyWithOwner(_name, mustGetAddress("ProxyAdmin"));
addr_ = deployERC1967ProxyWithOwner(_name, artifacts.mustGetAddress("ProxyAdmin"));
}
/// @notice Deploys an ERC1967Proxy contract with a specified owner.
......@@ -440,7 +440,7 @@ contract Deploy is Deployer {
{
IProxy proxy = IProxy(
DeployUtils.create2AndSave({
_save: this,
_save: artifacts,
_salt: keccak256(abi.encode(_implSalt(), _name)),
_name: "Proxy",
_nick: _name,
......@@ -453,10 +453,10 @@ contract Deploy is Deployer {
/// @notice Deploy the DataAvailabilityChallengeProxy
function deployDataAvailabilityChallengeProxy() public broadcast returns (address addr_) {
address proxyAdmin = mustGetAddress("ProxyAdmin");
address proxyAdmin = artifacts.mustGetAddress("ProxyAdmin");
IProxy proxy = IProxy(
DeployUtils.create2AndSave({
_save: this,
_save: artifacts,
_salt: _implSalt(),
_name: "Proxy",
_nick: "DataAvailabilityChallengeProxy",
......@@ -477,7 +477,7 @@ contract Deploy is Deployer {
function deployDataAvailabilityChallenge() public broadcast returns (address addr_) {
IDataAvailabilityChallenge dac = IDataAvailabilityChallenge(
DeployUtils.create2AndSave({
_save: this,
_save: artifacts,
_salt: _implSalt(),
_name: "DataAvailabilityChallenge",
_nick: "DataAvailabilityChallengeImpl",
......@@ -494,8 +494,8 @@ contract Deploy is Deployer {
/// @notice Initialize the SystemConfig
function initializeSystemConfig() public broadcast {
console.log("Upgrading and initializing SystemConfig proxy");
address systemConfigProxy = mustGetAddress("SystemConfigProxy");
address systemConfig = mustGetAddress("SystemConfigImpl");
address systemConfigProxy = artifacts.mustGetAddress("SystemConfigProxy");
address systemConfig = artifacts.mustGetAddress("SystemConfigImpl");
bytes32 batcherHash = bytes32(uint256(uint160(cfg.batchSenderAddress())));
......@@ -504,7 +504,7 @@ contract Deploy is Deployer {
customGasTokenAddress = cfg.customGasTokenAddress();
}
IProxyAdmin proxyAdmin = IProxyAdmin(payable(mustGetAddress("ProxyAdmin")));
IProxyAdmin proxyAdmin = IProxyAdmin(payable(artifacts.mustGetAddress("ProxyAdmin")));
proxyAdmin.upgradeAndCall({
_proxy: payable(systemConfigProxy),
_implementation: systemConfig,
......@@ -520,12 +520,12 @@ contract Deploy is Deployer {
Constants.DEFAULT_RESOURCE_CONFIG(),
cfg.batchInboxAddress(),
ISystemConfig.Addresses({
l1CrossDomainMessenger: mustGetAddress("L1CrossDomainMessengerProxy"),
l1ERC721Bridge: mustGetAddress("L1ERC721BridgeProxy"),
l1StandardBridge: mustGetAddress("L1StandardBridgeProxy"),
disputeGameFactory: mustGetAddress("DisputeGameFactoryProxy"),
optimismPortal: mustGetAddress("OptimismPortalProxy"),
optimismMintableERC20Factory: mustGetAddress("OptimismMintableERC20FactoryProxy"),
l1CrossDomainMessenger: artifacts.mustGetAddress("L1CrossDomainMessengerProxy"),
l1ERC721Bridge: artifacts.mustGetAddress("L1ERC721BridgeProxy"),
l1StandardBridge: artifacts.mustGetAddress("L1StandardBridgeProxy"),
disputeGameFactory: artifacts.mustGetAddress("DisputeGameFactoryProxy"),
optimismPortal: artifacts.mustGetAddress("OptimismPortalProxy"),
optimismMintableERC20Factory: artifacts.mustGetAddress("OptimismMintableERC20FactoryProxy"),
gasPayingToken: customGasTokenAddress
})
)
......@@ -542,8 +542,8 @@ contract Deploy is Deployer {
/// @notice Initialize the DataAvailabilityChallenge
function initializeDataAvailabilityChallenge() public broadcast {
console.log("Upgrading and initializing DataAvailabilityChallenge proxy");
address dataAvailabilityChallengeProxy = mustGetAddress("DataAvailabilityChallengeProxy");
address dataAvailabilityChallenge = mustGetAddress("DataAvailabilityChallengeImpl");
address dataAvailabilityChallengeProxy = artifacts.mustGetAddress("DataAvailabilityChallengeProxy");
address dataAvailabilityChallenge = artifacts.mustGetAddress("DataAvailabilityChallengeImpl");
address finalSystemOwner = cfg.finalSystemOwner();
uint256 daChallengeWindow = cfg.daChallengeWindow();
......@@ -551,7 +551,7 @@ contract Deploy is Deployer {
uint256 daBondSize = cfg.daBondSize();
uint256 daResolverRefundPercentage = cfg.daResolverRefundPercentage();
IProxyAdmin proxyAdmin = IProxyAdmin(payable(mustGetAddress("ProxyAdmin")));
IProxyAdmin proxyAdmin = IProxyAdmin(payable(artifacts.mustGetAddress("ProxyAdmin")));
proxyAdmin.upgradeAndCall({
_proxy: payable(dataAvailabilityChallengeProxy),
_implementation: dataAvailabilityChallenge,
......@@ -584,7 +584,7 @@ contract Deploy is Deployer {
/// @notice Transfer ownership of the ProxyAdmin contract to the final system owner
function transferProxyAdminOwnership() public broadcast {
// Get the ProxyAdmin contract.
IProxyAdmin proxyAdmin = IProxyAdmin(mustGetAddress("ProxyAdmin"));
IProxyAdmin proxyAdmin = IProxyAdmin(artifacts.mustGetAddress("ProxyAdmin"));
// Transfer ownership to the final system owner if necessary.
address owner = proxyAdmin.owner();
......@@ -602,7 +602,8 @@ contract Deploy is Deployer {
/// @notice Transfer ownership of the DisputeGameFactory contract to the final system owner
function transferDisputeGameFactoryOwnership() public broadcast {
console.log("Transferring DisputeGameFactory ownership to Safe");
IDisputeGameFactory disputeGameFactory = IDisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
IDisputeGameFactory disputeGameFactory =
IDisputeGameFactory(artifacts.mustGetAddress("DisputeGameFactoryProxy"));
address owner = disputeGameFactory.owner();
address finalSystemOwner = cfg.finalSystemOwner();
......@@ -620,7 +621,7 @@ contract Deploy is Deployer {
/// @notice Transfer ownership of the DelayedWETH contract to the final system owner
function transferDelayedWETHOwnership() public broadcast {
console.log("Transferring DelayedWETH ownership to Safe");
IDelayedWETH weth = IDelayedWETH(mustGetAddress("DelayedWETHProxy"));
IDelayedWETH weth = IDelayedWETH(artifacts.mustGetAddress("DelayedWETHProxy"));
address owner = weth.owner();
address finalSystemOwner = cfg.finalSystemOwner();
......@@ -639,7 +640,7 @@ contract Deploy is Deployer {
/// @notice Transfer ownership of the permissioned DelayedWETH contract to the final system owner
function transferPermissionedDelayedWETHOwnership() public broadcast {
console.log("Transferring permissioned DelayedWETH ownership to Safe");
IDelayedWETH weth = IDelayedWETH(mustGetAddress("PermissionedDelayedWETHProxy"));
IDelayedWETH weth = IDelayedWETH(artifacts.mustGetAddress("PermissionedDelayedWETHProxy"));
address owner = weth.owner();
address finalSystemOwner = cfg.finalSystemOwner();
......@@ -714,8 +715,8 @@ contract Deploy is Deployer {
/// @notice Sets the implementation for the `CANNON` game type in the `DisputeGameFactory`
function setCannonFaultGameImplementation() public broadcast {
console.log("Setting Cannon FaultDisputeGame implementation");
IDisputeGameFactory factory = IDisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
IDelayedWETH weth = IDelayedWETH(mustGetAddress("DelayedWETHProxy"));
IDisputeGameFactory factory = IDisputeGameFactory(artifacts.mustGetAddress("DisputeGameFactoryProxy"));
IDelayedWETH weth = IDelayedWETH(artifacts.mustGetAddress("DelayedWETHProxy"));
// Set the Cannon FaultDisputeGame implementation in the factory.
_setFaultGameImplementation({
......@@ -727,9 +728,9 @@ contract Deploy is Deployer {
splitDepth: cfg.faultGameSplitDepth(),
clockExtension: Duration.wrap(uint64(cfg.faultGameClockExtension())),
maxClockDuration: Duration.wrap(uint64(cfg.faultGameMaxClockDuration())),
vm: IBigStepper(mustGetAddress("MipsSingleton")),
vm: IBigStepper(artifacts.mustGetAddress("MipsSingleton")),
weth: weth,
anchorStateRegistry: IAnchorStateRegistry(mustGetAddress("AnchorStateRegistryProxy")),
anchorStateRegistry: IAnchorStateRegistry(artifacts.mustGetAddress("AnchorStateRegistryProxy")),
l2ChainId: cfg.l2ChainID()
})
});
......@@ -738,8 +739,8 @@ 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");
IDisputeGameFactory factory = IDisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
IDelayedWETH weth = IDelayedWETH(mustGetAddress("DelayedWETHProxy"));
IDisputeGameFactory factory = IDisputeGameFactory(artifacts.mustGetAddress("DisputeGameFactoryProxy"));
IDelayedWETH weth = IDelayedWETH(artifacts.mustGetAddress("DelayedWETHProxy"));
Claim outputAbsolutePrestate = Claim.wrap(bytes32(cfg.faultGameAbsolutePrestate()));
_setFaultGameImplementation({
......@@ -752,9 +753,11 @@ contract Deploy is Deployer {
splitDepth: cfg.faultGameSplitDepth(),
clockExtension: Duration.wrap(uint64(cfg.faultGameClockExtension())),
maxClockDuration: Duration.wrap(uint64(cfg.faultGameMaxClockDuration())),
vm: IBigStepper(new AlphabetVM(outputAbsolutePrestate, IPreimageOracle(mustGetAddress("PreimageOracle")))),
vm: IBigStepper(
new AlphabetVM(outputAbsolutePrestate, IPreimageOracle(artifacts.mustGetAddress("PreimageOracle")))
),
weth: weth,
anchorStateRegistry: IAnchorStateRegistry(mustGetAddress("AnchorStateRegistryProxy")),
anchorStateRegistry: IAnchorStateRegistry(artifacts.mustGetAddress("AnchorStateRegistryProxy")),
l2ChainId: cfg.l2ChainID()
})
});
......@@ -763,13 +766,13 @@ contract Deploy is Deployer {
/// @notice Sets the implementation for the `ALPHABET` game type in the `DisputeGameFactory`
function setFastFaultGameImplementation() public onlyDevnet broadcast {
console.log("Setting Fast FaultDisputeGame implementation");
IDisputeGameFactory factory = IDisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
IDelayedWETH weth = IDelayedWETH(mustGetAddress("DelayedWETHProxy"));
IDisputeGameFactory factory = IDisputeGameFactory(artifacts.mustGetAddress("DisputeGameFactoryProxy"));
IDelayedWETH weth = IDelayedWETH(artifacts.mustGetAddress("DelayedWETHProxy"));
Claim outputAbsolutePrestate = Claim.wrap(bytes32(cfg.faultGameAbsolutePrestate()));
IPreimageOracle fastOracle = IPreimageOracle(
DeployUtils.create2AndSave({
_save: this,
_save: artifacts,
_salt: _implSalt(),
_name: "PreimageOracle",
_nick: "FastPreimageOracle",
......@@ -790,7 +793,7 @@ contract Deploy is Deployer {
maxClockDuration: Duration.wrap(0), // Resolvable immediately
vm: IBigStepper(new AlphabetVM(outputAbsolutePrestate, fastOracle)),
weth: weth,
anchorStateRegistry: IAnchorStateRegistry(mustGetAddress("AnchorStateRegistryProxy")),
anchorStateRegistry: IAnchorStateRegistry(artifacts.mustGetAddress("AnchorStateRegistryProxy")),
l2ChainId: cfg.l2ChainID()
})
});
......@@ -820,7 +823,7 @@ contract Deploy is Deployer {
_params.gameType,
IDisputeGame(
DeployUtils.create2AndSave({
_save: this,
_save: artifacts,
_salt: _implSalt(),
_name: "FaultDisputeGame",
_nick: string.concat("FaultDisputeGame_", vm.toString(rawGameType)),
......@@ -893,7 +896,7 @@ contract Deploy is Deployer {
/// @notice Reset the initialized value on a proxy contract so that it can be initialized again
function resetInitializedProxy(string memory _contractName) internal {
console.log("resetting initialized value on %s Proxy", _contractName);
address proxy = mustGetAddress(string.concat(_contractName, "Proxy"));
address proxy = artifacts.mustGetAddress(string.concat(_contractName, "Proxy"));
StorageSlot memory slot = ForgeArtifacts.getInitializedSlot(_contractName);
bytes32 slotVal = vm.load(proxy, bytes32(slot.slot));
uint256 value = uint256(slotVal);
......
......@@ -85,12 +85,12 @@ contract DeployOwnership is Deploy {
/// @notice Returns a GuardianConfig similar to that of the Guardian Safe on Mainnet.
function _getExampleGuardianConfig() internal view returns (GuardianConfig memory guardianConfig_) {
address[] memory exampleGuardianOwners = new address[](1);
exampleGuardianOwners[0] = mustGetAddress("SecurityCouncilSafe");
exampleGuardianOwners[0] = artifacts.mustGetAddress("SecurityCouncilSafe");
guardianConfig_ = GuardianConfig({
safeConfig: SafeConfig({ threshold: 1, owners: exampleGuardianOwners }),
deputyGuardianModuleConfig: DeputyGuardianModuleConfig({
deputyGuardian: mustGetAddress("FoundationOperationsSafe"),
superchainConfig: ISuperchainConfig(mustGetAddress("SuperchainConfigImpl"))
deputyGuardian: artifacts.mustGetAddress("FoundationOperationsSafe"),
superchainConfig: ISuperchainConfig(artifacts.mustGetAddress("SuperchainConfigImpl"))
})
});
}
......@@ -108,7 +108,7 @@ contract DeployOwnership is Deploy {
livenessInterval: 14 weeks,
thresholdPercentage: 75,
minOwners: 8,
fallbackOwner: mustGetAddress("FoundationUpgradeSafe")
fallbackOwner: artifacts.mustGetAddress("FoundationUpgradeSafe")
})
});
}
......@@ -174,14 +174,14 @@ contract DeployOwnership is Deploy {
);
addr_ = address(safeProxyFactory.createProxyWithNonce(address(safeSingleton), initData, uint256(salt)));
save(_name, addr_);
artifacts.save(_name, addr_);
console.log("New safe: %s deployed at %s\n Note that this safe is owned by the deployer key", _name, addr_);
}
/// @notice If the keepDeployer option was used with deploySafe(), this function can be used to remove the deployer.
/// Note this function does not have the broadcast modifier.
function removeDeployerFromSafe(string memory _name, uint256 _newThreshold) public {
Safe safe = Safe(mustGetAddress(_name));
Safe safe = Safe(artifacts.mustGetAddress(_name));
// The sentinel address is used to mark the start and end of the linked list of owners in the Safe.
address sentinelOwners = address(0x1);
......@@ -198,10 +198,10 @@ contract DeployOwnership is Deploy {
/// @notice Gets the address of the SafeProxyFactory and Safe singleton for use in deploying a new GnosisSafe.
function _getSafeFactory() internal returns (SafeProxyFactory safeProxyFactory_, Safe safeSingleton_) {
if (getAddress("SafeProxyFactory") != address(0)) {
if (artifacts.getAddress("SafeProxyFactory") != address(0)) {
// The SafeProxyFactory is already saved, we can just use it.
safeProxyFactory_ = SafeProxyFactory(getAddress("SafeProxyFactory"));
safeSingleton_ = Safe(getAddress("SafeSingleton"));
safeProxyFactory_ = SafeProxyFactory(artifacts.getAddress("SafeProxyFactory"));
safeSingleton_ = Safe(artifacts.getAddress("SafeSingleton"));
return (safeProxyFactory_, safeSingleton_);
}
......@@ -216,8 +216,8 @@ contract DeployOwnership is Deploy {
safeSingleton.code.length == 0 ? safeSingleton_ = new Safe() : safeSingleton_ = Safe(payable(safeSingleton));
save("SafeProxyFactory", address(safeProxyFactory_));
save("SafeSingleton", address(safeSingleton_));
artifacts.save("SafeProxyFactory", address(safeProxyFactory_));
artifacts.save("SafeSingleton", address(safeSingleton_));
}
/// @notice Deploys a Safe with a configuration similar to that of the Foundation Safe on Mainnet.
......@@ -245,18 +245,18 @@ contract DeployOwnership is Deploy {
/// @notice Deploy a LivenessGuard for use on the Security Council Safe.
/// Note this function does not have the broadcast modifier.
function deployLivenessGuard() public returns (address addr_) {
Safe councilSafe = Safe(payable(mustGetAddress("SecurityCouncilSafe")));
Safe councilSafe = Safe(payable(artifacts.mustGetAddress("SecurityCouncilSafe")));
addr_ = address(new LivenessGuard(councilSafe));
save("LivenessGuard", address(addr_));
artifacts.save("LivenessGuard", address(addr_));
console.log("New LivenessGuard deployed at %s", address(addr_));
}
/// @notice Deploy a LivenessModule for use on the Security Council Safe
/// Note this function does not have the broadcast modifier.
function deployLivenessModule() public returns (address addr_) {
Safe councilSafe = Safe(payable(mustGetAddress("SecurityCouncilSafe")));
address guard = mustGetAddress("LivenessGuard");
Safe councilSafe = Safe(payable(artifacts.mustGetAddress("SecurityCouncilSafe")));
address guard = artifacts.mustGetAddress("LivenessGuard");
LivenessModuleConfig memory livenessModuleConfig = _getExampleCouncilConfig().livenessModuleConfig;
addr_ = address(
......@@ -270,14 +270,14 @@ contract DeployOwnership is Deploy {
})
);
save("LivenessModule", address(addr_));
artifacts.save("LivenessModule", address(addr_));
console.log("New LivenessModule deployed at %s", address(addr_));
}
/// @notice Deploy a DeputyGuardianModule for use on the Security Council Safe.
/// Note this function does not have the broadcast modifier.
function deployDeputyGuardianModule() public returns (address addr_) {
Safe guardianSafe = Safe(payable(mustGetAddress("GuardianSafe")));
Safe guardianSafe = Safe(payable(artifacts.mustGetAddress("GuardianSafe")));
DeputyGuardianModuleConfig memory deputyGuardianModuleConfig =
_getExampleGuardianConfig().deputyGuardianModuleConfig;
addr_ = address(
......@@ -288,7 +288,7 @@ contract DeployOwnership is Deploy {
})
);
save("DeputyGuardianModule", addr_);
artifacts.save("DeputyGuardianModule", addr_);
console.log("New DeputyGuardianModule deployed at %s", addr_);
}
......@@ -310,7 +310,7 @@ contract DeployOwnership is Deploy {
function deployGuardianSafe() public broadcast returns (address addr_) {
// Config is hardcoded here as the Guardian Safe's configuration is inflexible.
address[] memory owners = new address[](1);
owners[0] = mustGetAddress("SecurityCouncilSafe");
owners[0] = artifacts.mustGetAddress("SecurityCouncilSafe");
addr_ = deploySafe({ _name: "GuardianSafe", _owners: owners, _threshold: 1, _keepDeployer: true });
console.log("Deployed and configured the Guardian Safe!");
......@@ -320,7 +320,7 @@ contract DeployOwnership is Deploy {
function deploySuperchainConfig() public broadcast {
ISuperchainConfig superchainConfig = ISuperchainConfig(
DeployUtils.create2AndSave({
_save: this,
_save: artifacts,
_salt: _implSalt(),
_name: "SuperchainConfig",
_nick: "SuperchainConfigImpl",
......@@ -335,7 +335,7 @@ contract DeployOwnership is Deploy {
/// @notice Configure the Guardian Safe with the DeputyGuardianModule.
function configureGuardianSafe() public broadcast returns (address addr_) {
addr_ = mustGetAddress("GuardianSafe");
addr_ = artifacts.mustGetAddress("GuardianSafe");
address deputyGuardianModule = deployDeputyGuardianModule();
_callViaSafe({
_safe: Safe(payable(addr_)),
......@@ -352,7 +352,7 @@ contract DeployOwnership is Deploy {
function configureSecurityCouncilSafe() public broadcast returns (address addr_) {
// Deploy and add the Deputy Guardian Module.
SecurityCouncilConfig memory exampleCouncilConfig = _getExampleCouncilConfig();
Safe safe = Safe(mustGetAddress("SecurityCouncilSafe"));
Safe safe = Safe(artifacts.mustGetAddress("SecurityCouncilSafe"));
// Deploy and add the Liveness Guard.
address guard = deployLivenessGuard();
......
......@@ -11,13 +11,19 @@ import { Process } from "scripts/libraries/Process.sol";
/// @title Deployer
/// @author tynes
/// @notice A contract that can make deploying and interacting with deployments easy.
abstract contract Deployer is Script, Artifacts {
abstract contract Deployer is Script {
DeployConfig public constant cfg =
DeployConfig(address(uint160(uint256(keccak256(abi.encode("optimism.deployconfig"))))));
Artifacts public constant artifacts =
Artifacts(address(uint160(uint256(keccak256(abi.encode("optimism.artifacts"))))));
/// @notice Sets up the artifacts contract.
function setUp() public virtual override {
Artifacts.setUp();
function setUp() public virtual {
vm.etch(address(artifacts), vm.getDeployedCode("Artifacts.s.sol:Artifacts"));
vm.label(address(cfg), "Artifacts");
vm.allowCheatcodes(address(artifacts));
artifacts.setUp();
console.log("Commit hash: %s", gitCommitHash());
......
......@@ -23,16 +23,21 @@ import { EIP1967Helper } from "test/mocks/EIP1967Helper.sol";
/// @title DeployPeriphery
/// @notice Script used to deploy periphery contracts.
contract DeployPeriphery is Script, Artifacts {
contract DeployPeriphery is Script {
/// @notice Error emitted when an address mismatch is detected.
error AddressMismatch(string, address, address);
/// @notice Deployment configuration.
PeripheryDeployConfig cfg;
Artifacts public constant artifacts =
Artifacts(address(uint160(uint256(keccak256(abi.encode("optimism.artifacts"))))));
/// @notice Sets up the deployment script.
function setUp() public override {
Artifacts.setUp();
function setUp() public {
vm.etch(address(artifacts), vm.getDeployedCode("Artifacts.s.sol:Artifacts"));
artifacts.setUp();
cfg = new PeripheryDeployConfig(Config.deployConfigPath());
console.log("Config path: %s", Config.deployConfigPath());
}
......@@ -94,12 +99,12 @@ contract DeployPeriphery is Script, Artifacts {
addr_ = _deployCreate2({
_name: "FaucetProxy",
_creationCode: type(Proxy).creationCode,
_constructorParams: abi.encode(mustGetAddress("ProxyAdmin"))
_constructorParams: abi.encode(artifacts.mustGetAddress("ProxyAdmin"))
});
Proxy proxy = Proxy(payable(addr_));
require(
EIP1967Helper.getAdmin(address(proxy)) == mustGetAddress("ProxyAdmin"),
EIP1967Helper.getAdmin(address(proxy)) == artifacts.mustGetAddress("ProxyAdmin"),
"DeployPeriphery: FaucetProxy admin mismatch"
);
}
......@@ -206,9 +211,9 @@ contract DeployPeriphery is Script, Artifacts {
/// @notice Initialize the Faucet.
function initializeFaucet() public broadcast {
ProxyAdmin proxyAdmin = ProxyAdmin(mustGetAddress("ProxyAdmin"));
address faucetProxy = mustGetAddress("FaucetProxy");
address faucet = mustGetAddress("Faucet");
ProxyAdmin proxyAdmin = ProxyAdmin(artifacts.mustGetAddress("ProxyAdmin"));
address faucetProxy = artifacts.mustGetAddress("FaucetProxy");
address faucet = artifacts.mustGetAddress("Faucet");
address implementationAddress = proxyAdmin.getProxyImplementation(faucetProxy);
if (implementationAddress == faucet) {
console.log("Faucet proxy implementation already set");
......@@ -225,7 +230,7 @@ contract DeployPeriphery is Script, Artifacts {
/// @notice Installs the OnChain AuthModule on the Faucet contract.
function installOnChainAuthModule() public broadcast {
_installAuthModule({
_faucet: Faucet(mustGetAddress("FaucetProxy")),
_faucet: Faucet(artifacts.mustGetAddress("FaucetProxy")),
_name: "OnChainAuthModule",
_config: Faucet.ModuleConfig({
name: "OnChainAuthModule",
......@@ -239,7 +244,7 @@ contract DeployPeriphery is Script, Artifacts {
/// @notice Installs the OffChain AuthModule on the Faucet contract.
function installOffChainAuthModule() public broadcast {
_installAuthModule({
_faucet: Faucet(mustGetAddress("FaucetProxy")),
_faucet: Faucet(artifacts.mustGetAddress("FaucetProxy")),
_name: "OffChainAuthModule",
_config: Faucet.ModuleConfig({
name: "OffChainAuthModule",
......@@ -252,7 +257,7 @@ contract DeployPeriphery is Script, Artifacts {
/// @notice Installs all of the auth modules in the faucet contract.
function installFaucetAuthModulesConfigs() public {
Faucet faucet = Faucet(mustGetAddress("FaucetProxy"));
Faucet faucet = Faucet(artifacts.mustGetAddress("FaucetProxy"));
console.log("Installing auth modules at %s", address(faucet));
installOnChainAuthModule();
installOffChainAuthModule();
......@@ -276,9 +281,9 @@ contract DeployPeriphery is Script, Artifacts {
address preComputedAddress = vm.computeCreate2Address(salt, keccak256(initCode));
if (preComputedAddress.code.length > 0) {
console.log("%s already deployed at %s", _name, preComputedAddress);
address savedAddress = getAddress(_name);
address savedAddress = artifacts.getAddress(_name);
if (savedAddress == address(0)) {
save(_name, preComputedAddress);
artifacts.save(_name, preComputedAddress);
} else if (savedAddress != preComputedAddress) {
revert AddressMismatch(_name, preComputedAddress, savedAddress);
}
......@@ -288,7 +293,7 @@ contract DeployPeriphery is Script, Artifacts {
addr_ := create2(0, add(initCode, 0x20), mload(initCode), salt)
}
require(addr_ != address(0), "DeployPeriphery: deployment failed");
save(_name, addr_);
artifacts.save(_name, addr_);
console.log("%s deployed at %s", _name, addr_);
}
}
......@@ -298,7 +303,7 @@ contract DeployPeriphery is Script, Artifacts {
/// @param _name The name of the auth module.
/// @param _config The configuration of the auth module.
function _installAuthModule(Faucet _faucet, string memory _name, Faucet.ModuleConfig memory _config) internal {
AdminFaucetAuthModule module = AdminFaucetAuthModule(mustGetAddress(_name));
AdminFaucetAuthModule module = AdminFaucetAuthModule(artifacts.mustGetAddress(_name));
if (_faucet.isModuleEnabled(module)) {
console.log("%s already installed.", _name);
} else {
......
GasBenchMark_L1BlockInterop_DepositsComplete:test_depositsComplete_benchmark() (gas: 7567)
GasBenchMark_L1BlockInterop_DepositsComplete_Warm:test_depositsComplete_benchmark() (gas: 5567)
GasBenchMark_L1BlockInterop_SetValuesInterop:test_setL1BlockValuesInterop_benchmark() (gas: 175677)
GasBenchMark_L1BlockInterop_SetValuesInterop_Warm:test_setL1BlockValuesInterop_benchmark() (gas: 5099)
GasBenchMark_L1BlockInterop_SetValuesInterop:test_setL1BlockValuesInterop_benchmark() (gas: 175722)
GasBenchMark_L1BlockInterop_SetValuesInterop_Warm:test_setL1BlockValuesInterop_benchmark() (gas: 5144)
GasBenchMark_L1Block_SetValuesEcotone:test_setL1BlockValuesEcotone_benchmark() (gas: 158531)
GasBenchMark_L1Block_SetValuesEcotone_Warm:test_setL1BlockValuesEcotone_benchmark() (gas: 7597)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 369309)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2967471)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 564458)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 369264)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2967493)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 564413)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 4076606)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 467070)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 467092)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 3512819)
GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 72667)
\ No newline at end of file
......@@ -57,7 +57,7 @@ contract DataAvailabilityChallengeTest is CommonTest {
// EntryPoint will revert if using amount > type(uint112).max.
vm.assume(sender != Preinstalls.EntryPoint_v060);
vm.assume(sender != address(dataAvailabilityChallenge));
vm.assume(sender != deploy.mustGetAddress("DataAvailabilityChallengeImpl"));
vm.assume(sender != artifacts.mustGetAddress("DataAvailabilityChallengeImpl"));
vm.deal(sender, amount);
vm.prank(sender);
......
......@@ -29,7 +29,7 @@ contract L1CrossDomainMessenger_Test is CommonTest {
/// @notice Marked virtual to be overridden in
/// test/kontrol/deployment/DeploymentSummary.t.sol
function test_constructor_succeeds() external virtual {
IL1CrossDomainMessenger impl = IL1CrossDomainMessenger(deploy.mustGetAddress("L1CrossDomainMessengerImpl"));
IL1CrossDomainMessenger impl = IL1CrossDomainMessenger(artifacts.mustGetAddress("L1CrossDomainMessengerImpl"));
assertEq(address(impl.superchainConfig()), address(0));
assertEq(address(impl.PORTAL()), address(0));
assertEq(address(impl.portal()), address(0));
......
......@@ -69,7 +69,7 @@ contract L1ERC721Bridge_Test is CommonTest {
/// @notice Marked virtual to be overridden in
/// test/kontrol/deployment/DeploymentSummary.t.sol
function test_constructor_succeeds() public virtual {
IL1ERC721Bridge impl = IL1ERC721Bridge(deploy.mustGetAddress("L1ERC721BridgeImpl"));
IL1ERC721Bridge impl = IL1ERC721Bridge(artifacts.mustGetAddress("L1ERC721BridgeImpl"));
assertEq(address(impl.MESSENGER()), address(0));
assertEq(address(impl.messenger()), address(0));
assertEq(address(impl.superchainConfig()), address(0));
......
......@@ -38,7 +38,7 @@ contract L1StandardBridge_Initialize_Test is CommonTest {
/// @notice Marked virtual to be overridden in
/// test/kontrol/deployment/DeploymentSummary.t.sol
function test_constructor_succeeds() external virtual {
IL1StandardBridge impl = IL1StandardBridge(deploy.mustGetAddress("L1StandardBridgeImpl"));
IL1StandardBridge impl = IL1StandardBridge(artifacts.mustGetAddress("L1StandardBridgeImpl"));
assertEq(address(impl.superchainConfig()), address(0));
// The constructor now uses _disableInitializers, whereas OP Mainnet has these values in storage
......
......@@ -42,7 +42,7 @@ contract OptimismPortal2_Test is CommonTest {
/// @notice Marked virtual to be overridden in
/// test/kontrol/deployment/DeploymentSummary.t.sol
function test_constructor_succeeds() external virtual {
IOptimismPortal2 opImpl = IOptimismPortal2(payable(deploy.mustGetAddress("OptimismPortal2Impl")));
IOptimismPortal2 opImpl = IOptimismPortal2(payable(artifacts.mustGetAddress("OptimismPortal2Impl")));
assertEq(address(opImpl.disputeGameFactory()), address(0));
assertEq(address(opImpl.systemConfig()), address(0));
assertEq(address(opImpl.superchainConfig()), address(0));
......
......@@ -28,7 +28,7 @@ contract ProtocolVersions_Initialize_Test is ProtocolVersions_Init {
skipIfForkTest(
"ProtocolVersions_Initialize_Test: cannot test initialization on forked network against hardhat config"
);
IProtocolVersions protocolVersionsImpl = IProtocolVersions(deploy.mustGetAddress("ProtocolVersionsImpl"));
IProtocolVersions protocolVersionsImpl = IProtocolVersions(artifacts.mustGetAddress("ProtocolVersionsImpl"));
address owner = deploy.cfg().finalSystemOwner();
assertEq(ProtocolVersion.unwrap(protocolVersions.required()), ProtocolVersion.unwrap(required));
......@@ -42,7 +42,7 @@ contract ProtocolVersions_Initialize_Test is ProtocolVersions_Init {
/// @dev Ensures that the events are emitted during initialization.
function test_initialize_events_succeeds() external {
IProtocolVersions protocolVersionsImpl = IProtocolVersions(deploy.mustGetAddress("ProtocolVersionsImpl"));
IProtocolVersions protocolVersionsImpl = IProtocolVersions(artifacts.mustGetAddress("ProtocolVersionsImpl"));
// Wipe out the initialized slot so the proxy can be initialized again
vm.store(address(protocolVersions), bytes32(0), bytes32(0));
......
......@@ -42,8 +42,8 @@ contract SystemConfig_Initialize_Test is SystemConfig_Init {
batcherHash = bytes32(uint256(uint160(deploy.cfg().batchSenderAddress())));
gasLimit = uint64(deploy.cfg().l2GenesisBlockGasLimit());
unsafeBlockSigner = deploy.cfg().p2pSequencerAddress();
systemConfigImpl = deploy.mustGetAddress("SystemConfigImpl");
optimismMintableERC20Factory = deploy.mustGetAddress("OptimismMintableERC20FactoryProxy");
systemConfigImpl = artifacts.mustGetAddress("SystemConfigImpl");
optimismMintableERC20Factory = artifacts.mustGetAddress("OptimismMintableERC20FactoryProxy");
}
/// @dev Tests that constructor sets the correct values.
......
......@@ -24,7 +24,7 @@ contract L2CrossDomainMessenger_Test is CommonTest {
/// @dev Tests that the implementation is initialized correctly.
function test_constructor_succeeds() external view {
IL2CrossDomainMessenger impl =
IL2CrossDomainMessenger(EIP1967Helper.getImplementation(deploy.mustGetAddress("L2CrossDomainMessenger")));
IL2CrossDomainMessenger(EIP1967Helper.getImplementation(artifacts.mustGetAddress("L2CrossDomainMessenger")));
assertEq(address(impl.OTHER_MESSENGER()), address(0));
assertEq(address(impl.otherMessenger()), address(0));
assertEq(address(impl.l1CrossDomainMessenger()), address(0));
......
......@@ -27,7 +27,7 @@ contract L2StandardBridge_Test is CommonTest {
/// @dev Test that the bridge's constructor sets the correct values.
function test_constructor_succeeds() external view {
IL2StandardBridge impl =
IL2StandardBridge(payable(EIP1967Helper.getImplementation(deploy.mustGetAddress("L2StandardBridge"))));
IL2StandardBridge(payable(EIP1967Helper.getImplementation(artifacts.mustGetAddress("L2StandardBridge"))));
// The implementation contract is initialized with a 0 L1 bridge address,
// but the L2 cross-domain-messenger is always set to the predeploy address for both proxy and implementation.
assertEq(address(impl.MESSENGER()), Predeploys.L2_CROSS_DOMAIN_MESSENGER, "constructor zero check MESSENGER");
......
......@@ -106,7 +106,7 @@ contract PredeploysBaseTest is CommonTest {
}
if (_isInitializable(addr)) {
assertEq(l2Genesis.loadInitializedSlot({ _sourceName: cname, _deploymentName: cname }), uint8(1));
assertEq(artifacts.loadInitializedSlot({ _sourceName: cname, _deploymentName: cname }), uint8(1));
}
}
}
......
......@@ -43,8 +43,8 @@ contract DeployOwnershipTest is Test, DeployOwnership {
/// @dev Test the example Foundation Safe configurations, against the expected configuration, and
/// check that they both have the same configuration.
function test_exampleFoundationSafes_configuration_succeeds() public {
Safe upgradeSafe = Safe(payable(mustGetAddress("FoundationUpgradeSafe")));
Safe operationsSafe = Safe(payable(mustGetAddress("FoundationOperationsSafe")));
Safe upgradeSafe = Safe(payable(artifacts.mustGetAddress("FoundationUpgradeSafe")));
Safe operationsSafe = Safe(payable(artifacts.mustGetAddress("FoundationOperationsSafe")));
SafeConfig memory exampleFoundationConfig = _getExampleFoundationConfig();
// Ensure the safes both match the example configuration
......@@ -58,13 +58,13 @@ contract DeployOwnershipTest is Test, DeployOwnership {
/// @dev Test the example Security Council Safe configuration.
function test_exampleSecurityCouncilSafe_configuration_succeeds() public {
Safe securityCouncilSafe = Safe(payable(mustGetAddress("SecurityCouncilSafe")));
Safe securityCouncilSafe = Safe(payable(artifacts.mustGetAddress("SecurityCouncilSafe")));
SecurityCouncilConfig memory exampleSecurityCouncilConfig = _getExampleCouncilConfig();
_checkSafeConfig(exampleSecurityCouncilConfig.safeConfig, securityCouncilSafe);
// Guard Checks
address livenessGuard = mustGetAddress("LivenessGuard");
address livenessGuard = artifacts.mustGetAddress("LivenessGuard");
// The Safe's getGuard method is internal, so we read directly from storage
// https://github.com/safe-global/safe-contracts/blob/v1.4.0/contracts/base/GuardManager.sol#L66-L72
......@@ -77,7 +77,7 @@ contract DeployOwnershipTest is Test, DeployOwnership {
}
// Module Checks
address livenessModule = mustGetAddress("LivenessModule");
address livenessModule = artifacts.mustGetAddress("LivenessModule");
(address[] memory modules, address nextModule) =
ModuleManager(securityCouncilSafe).getModulesPaginated(SENTINEL_MODULES, 2);
assertEq(modules.length, 1);
......@@ -97,14 +97,14 @@ contract DeployOwnershipTest is Test, DeployOwnership {
/// @dev Test the example Guardian Safe configuration.
function test_exampleGuardianSafe_configuration_succeeds() public view {
Safe guardianSafe = Safe(payable(mustGetAddress("GuardianSafe")));
Safe guardianSafe = Safe(payable(artifacts.mustGetAddress("GuardianSafe")));
address[] memory owners = new address[](1);
owners[0] = mustGetAddress("SecurityCouncilSafe");
owners[0] = artifacts.mustGetAddress("SecurityCouncilSafe");
GuardianConfig memory guardianConfig = _getExampleGuardianConfig();
_checkSafeConfig(guardianConfig.safeConfig, guardianSafe);
// DeputyGuardianModule checks
address deputyGuardianModule = mustGetAddress("DeputyGuardianModule");
address deputyGuardianModule = artifacts.mustGetAddress("DeputyGuardianModule");
(address[] memory modules, address nextModule) =
ModuleManager(guardianSafe).getModulesPaginated(SENTINEL_MODULES, 2);
assertEq(modules.length, 1);
......
......@@ -57,21 +57,25 @@ contract ForkLive is Deployer {
// Superchain shared contracts
saveProxyAndImpl("SuperchainConfig", superchainToml, ".superchain_config_addr");
saveProxyAndImpl("ProtocolVersions", superchainToml, ".protocol_versions_addr");
save("OPContractsManager", vm.parseTomlAddress(superchainToml, ".op_contracts_manager_proxy_addr"));
artifacts.save("OPContractsManager", vm.parseTomlAddress(superchainToml, ".op_contracts_manager_proxy_addr"));
// Core contracts
save("ProxyAdmin", vm.parseTomlAddress(opToml, ".addresses.ProxyAdmin"));
artifacts.save("ProxyAdmin", vm.parseTomlAddress(opToml, ".addresses.ProxyAdmin"));
saveProxyAndImpl("SystemConfig", opToml, ".addresses.SystemConfigProxy");
// Bridge contracts
address optimismPortal = vm.parseTomlAddress(opToml, ".addresses.OptimismPortalProxy");
save("OptimismPortalProxy", optimismPortal);
save("OptimismPortal2Impl", EIP1967Helper.getImplementation(optimismPortal));
artifacts.save("OptimismPortalProxy", optimismPortal);
artifacts.save("OptimismPortal2Impl", EIP1967Helper.getImplementation(optimismPortal));
address addressManager = vm.parseTomlAddress(opToml, ".addresses.AddressManager");
save("AddressManager", addressManager);
save("L1CrossDomainMessengerImpl", IAddressManager(addressManager).getAddress("OVM_L1CrossDomainMessenger"));
save("L1CrossDomainMessengerProxy", vm.parseTomlAddress(opToml, ".addresses.L1CrossDomainMessengerProxy"));
artifacts.save("AddressManager", addressManager);
artifacts.save(
"L1CrossDomainMessengerImpl", IAddressManager(addressManager).getAddress("OVM_L1CrossDomainMessenger")
);
artifacts.save(
"L1CrossDomainMessengerProxy", vm.parseTomlAddress(opToml, ".addresses.L1CrossDomainMessengerProxy")
);
saveProxyAndImpl("OptimismMintableERC20Factory", opToml, ".addresses.OptimismMintableERC20FactoryProxy");
saveProxyAndImpl("L1StandardBridge", opToml, ".addresses.L1StandardBridgeProxy");
saveProxyAndImpl("L1ERC721Bridge", opToml, ".addresses.L1ERC721BridgeProxy");
......@@ -82,16 +86,17 @@ contract ForkLive is Deployer {
saveProxyAndImpl("DelayedWETH", opToml, ".addresses.DelayedWETHProxy");
// Fault proof non-proxied contracts
save("PreimageOracle", vm.parseTomlAddress(opToml, ".addresses.PreimageOracle"));
save("MipsSingleton", vm.parseTomlAddress(opToml, ".addresses.MIPS"));
IDisputeGameFactory disputeGameFactory = IDisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
save("FaultDisputeGame", vm.parseTomlAddress(opToml, ".addresses.FaultDisputeGame"));
artifacts.save("PreimageOracle", vm.parseTomlAddress(opToml, ".addresses.PreimageOracle"));
artifacts.save("MipsSingleton", vm.parseTomlAddress(opToml, ".addresses.MIPS"));
IDisputeGameFactory disputeGameFactory =
IDisputeGameFactory(artifacts.mustGetAddress("DisputeGameFactoryProxy"));
artifacts.save("FaultDisputeGame", vm.parseTomlAddress(opToml, ".addresses.FaultDisputeGame"));
// The PermissionedDisputeGame and PermissionedDelayedWETHProxy are not listed in the registry for OP, so we
// look it up onchain
IFaultDisputeGame permissionedDisputeGame =
IFaultDisputeGame(address(disputeGameFactory.gameImpls(GameTypes.PERMISSIONED_CANNON)));
save("PermissionedDisputeGame", address(permissionedDisputeGame));
save("PermissionedDelayedWETHProxy", address(permissionedDisputeGame.weth()));
artifacts.save("PermissionedDisputeGame", address(permissionedDisputeGame));
artifacts.save("PermissionedDelayedWETHProxy", address(permissionedDisputeGame.weth()));
}
/// @notice Saves the proxy and implementation addresses for a contract name
......@@ -100,9 +105,9 @@ contract ForkLive is Deployer {
/// @param _tomlKey The key in the superchain config file to get the proxy address
function saveProxyAndImpl(string memory _contractName, string memory _tomlPath, string memory _tomlKey) internal {
address proxy = vm.parseTomlAddress(_tomlPath, _tomlKey);
save(string.concat(_contractName, "Proxy"), proxy);
artifacts.save(string.concat(_contractName, "Proxy"), proxy);
address impl = EIP1967Helper.getImplementation(proxy);
require(impl != address(0), "Upgrade: Implementation address is zero");
save(string.concat(_contractName, "Impl"), impl);
artifacts.save(string.concat(_contractName, "Impl"), impl);
}
}
......@@ -11,7 +11,7 @@ import { ForkLive } from "test/setup/ForkLive.s.sol";
import { Fork, LATEST_FORK } from "scripts/libraries/Config.sol";
import { L2Genesis, L1Dependencies } from "scripts/L2Genesis.s.sol";
import { OutputMode, Fork, ForkUtils } from "scripts/libraries/Config.sol";
import { Artifacts } from "scripts/Artifacts.s.sol";
// Libraries
import { Predeploys } from "src/libraries/Predeploys.sol";
import { Preinstalls } from "src/libraries/Preinstalls.sol";
......@@ -65,6 +65,11 @@ contract Setup {
/// mutating any nonces. MUST not have constructor logic.
Deploy internal constant deploy = Deploy(address(uint160(uint256(keccak256(abi.encode("optimism.deploy"))))));
/// @notice The address of the Artifacts contract. Set into state by Deployer.setUp() with `etch` to avoid
/// mutating any nonces. MUST not have constructor logic.
Artifacts public constant artifacts =
Artifacts(address(uint160(uint256(keccak256(abi.encode("optimism.artifacts"))))));
L2Genesis internal constant l2Genesis =
L2Genesis(address(uint160(uint256(keccak256(abi.encode("optimism.l2genesis"))))));
......@@ -149,7 +154,7 @@ contract Setup {
// deploy.setUp() will either:
// 1. deploy a fresh system or
// 2. fork from L1
// It will then save the appropriate name/address pairs to disk using Artifacts.save()
// It will then save the appropriate name/address pairs to disk using artifacts.save()
deploy.setUp();
console.log("Setup: L1 setup done!");
......@@ -197,26 +202,26 @@ contract Setup {
deploy.run();
console.log("Setup: completed L1 deployment, registering addresses now");
optimismPortal2 = IOptimismPortal2(deploy.mustGetAddress("OptimismPortalProxy"));
systemConfig = ISystemConfig(deploy.mustGetAddress("SystemConfigProxy"));
l1StandardBridge = IL1StandardBridge(deploy.mustGetAddress("L1StandardBridgeProxy"));
l1CrossDomainMessenger = IL1CrossDomainMessenger(deploy.mustGetAddress("L1CrossDomainMessengerProxy"));
optimismPortal2 = IOptimismPortal2(artifacts.mustGetAddress("OptimismPortalProxy"));
systemConfig = ISystemConfig(artifacts.mustGetAddress("SystemConfigProxy"));
l1StandardBridge = IL1StandardBridge(artifacts.mustGetAddress("L1StandardBridgeProxy"));
l1CrossDomainMessenger = IL1CrossDomainMessenger(artifacts.mustGetAddress("L1CrossDomainMessengerProxy"));
vm.label(
AddressAliasHelper.applyL1ToL2Alias(address(l1CrossDomainMessenger)), "L1CrossDomainMessengerProxy_aliased"
);
addressManager = IAddressManager(deploy.mustGetAddress("AddressManager"));
l1ERC721Bridge = IL1ERC721Bridge(deploy.mustGetAddress("L1ERC721BridgeProxy"));
addressManager = IAddressManager(artifacts.mustGetAddress("AddressManager"));
l1ERC721Bridge = IL1ERC721Bridge(artifacts.mustGetAddress("L1ERC721BridgeProxy"));
l1OptimismMintableERC20Factory =
IOptimismMintableERC20Factory(deploy.mustGetAddress("OptimismMintableERC20FactoryProxy"));
protocolVersions = IProtocolVersions(deploy.mustGetAddress("ProtocolVersionsProxy"));
superchainConfig = ISuperchainConfig(deploy.mustGetAddress("SuperchainConfigProxy"));
anchorStateRegistry = IAnchorStateRegistry(deploy.mustGetAddress("AnchorStateRegistryProxy"));
disputeGameFactory = IDisputeGameFactory(deploy.mustGetAddress("DisputeGameFactoryProxy"));
delayedWeth = IDelayedWETH(deploy.mustGetAddress("DelayedWETHProxy"));
IOptimismMintableERC20Factory(artifacts.mustGetAddress("OptimismMintableERC20FactoryProxy"));
protocolVersions = IProtocolVersions(artifacts.mustGetAddress("ProtocolVersionsProxy"));
superchainConfig = ISuperchainConfig(artifacts.mustGetAddress("SuperchainConfigProxy"));
anchorStateRegistry = IAnchorStateRegistry(artifacts.mustGetAddress("AnchorStateRegistryProxy"));
disputeGameFactory = IDisputeGameFactory(artifacts.mustGetAddress("DisputeGameFactoryProxy"));
delayedWeth = IDelayedWETH(artifacts.mustGetAddress("DelayedWETHProxy"));
if (deploy.cfg().useAltDA()) {
dataAvailabilityChallenge =
IDataAvailabilityChallenge(deploy.mustGetAddress("DataAvailabilityChallengeProxy"));
IDataAvailabilityChallenge(artifacts.mustGetAddress("DataAvailabilityChallengeProxy"));
}
console.log("Setup: registered L1 deployments");
}
......
......@@ -33,7 +33,7 @@ contract OptimismMintableTokenFactory_Test is CommonTest {
/// @notice Tests that the upgrade is successful.
function test_upgrading_succeeds() external {
IProxy proxy = IProxy(deploy.mustGetAddress("OptimismMintableERC20FactoryProxy"));
IProxy proxy = IProxy(artifacts.mustGetAddress("OptimismMintableERC20FactoryProxy"));
// Check an unused slot before upgrading.
bytes32 slot21Before = vm.load(address(l1OptimismMintableERC20Factory), bytes32(uint256(21)));
assertEq(bytes32(0), slot21Before);
......
......@@ -57,7 +57,7 @@ contract Initializer_Test is CommonTest {
contracts.push(
InitializeableContract({
name: "SuperchainConfigImpl",
target: deploy.mustGetAddress("SuperchainConfigImpl"),
target: artifacts.mustGetAddress("SuperchainConfigImpl"),
initCalldata: abi.encodeCall(superchainConfig.initialize, (address(0), false))
})
);
......@@ -73,7 +73,7 @@ contract Initializer_Test is CommonTest {
contracts.push(
InitializeableContract({
name: "L1CrossDomainMessengerImpl",
target: deploy.mustGetAddress("L1CrossDomainMessengerImpl"),
target: artifacts.mustGetAddress("L1CrossDomainMessengerImpl"),
initCalldata: abi.encodeCall(
l1CrossDomainMessenger.initialize, (superchainConfig, optimismPortal2, systemConfig)
)
......@@ -93,7 +93,7 @@ contract Initializer_Test is CommonTest {
contracts.push(
InitializeableContract({
name: "DisputeGameFactoryImpl",
target: deploy.mustGetAddress("DisputeGameFactoryImpl"),
target: artifacts.mustGetAddress("DisputeGameFactoryImpl"),
initCalldata: abi.encodeCall(disputeGameFactory.initialize, (address(0)))
})
);
......@@ -109,7 +109,7 @@ contract Initializer_Test is CommonTest {
contracts.push(
InitializeableContract({
name: "DelayedWETHImpl",
target: deploy.mustGetAddress("DelayedWETHImpl"),
target: artifacts.mustGetAddress("DelayedWETHImpl"),
initCalldata: abi.encodeCall(delayedWeth.initialize, (address(0), ISuperchainConfig(address(0))))
})
);
......@@ -125,7 +125,7 @@ contract Initializer_Test is CommonTest {
contracts.push(
InitializeableContract({
name: "OptimismPortal2Impl",
target: deploy.mustGetAddress("OptimismPortal2Impl"),
target: artifacts.mustGetAddress("OptimismPortal2Impl"),
initCalldata: abi.encodeCall(
optimismPortal2.initialize,
(
......@@ -157,7 +157,7 @@ contract Initializer_Test is CommonTest {
contracts.push(
InitializeableContract({
name: "SystemConfigImpl",
target: deploy.mustGetAddress("SystemConfigImpl"),
target: artifacts.mustGetAddress("SystemConfigImpl"),
initCalldata: abi.encodeCall(
systemConfig.initialize,
(
......@@ -229,7 +229,7 @@ contract Initializer_Test is CommonTest {
contracts.push(
InitializeableContract({
name: "ProtocolVersionsImpl",
target: deploy.mustGetAddress("ProtocolVersionsImpl"),
target: artifacts.mustGetAddress("ProtocolVersionsImpl"),
initCalldata: abi.encodeCall(
protocolVersions.initialize, (address(0), ProtocolVersion.wrap(1), ProtocolVersion.wrap(2))
)
......@@ -249,7 +249,7 @@ contract Initializer_Test is CommonTest {
contracts.push(
InitializeableContract({
name: "L1StandardBridgeImpl",
target: deploy.mustGetAddress("L1StandardBridgeImpl"),
target: artifacts.mustGetAddress("L1StandardBridgeImpl"),
initCalldata: abi.encodeCall(
l1StandardBridge.initialize, (l1CrossDomainMessenger, superchainConfig, systemConfig)
)
......@@ -269,7 +269,7 @@ contract Initializer_Test is CommonTest {
contracts.push(
InitializeableContract({
name: "L1ERC721BridgeImpl",
target: deploy.mustGetAddress("L1ERC721BridgeImpl"),
target: artifacts.mustGetAddress("L1ERC721BridgeImpl"),
initCalldata: abi.encodeCall(l1ERC721Bridge.initialize, (l1CrossDomainMessenger, superchainConfig))
})
);
......@@ -285,7 +285,7 @@ contract Initializer_Test is CommonTest {
contracts.push(
InitializeableContract({
name: "OptimismMintableERC20FactoryImpl",
target: deploy.mustGetAddress("OptimismMintableERC20FactoryImpl"),
target: artifacts.mustGetAddress("OptimismMintableERC20FactoryImpl"),
initCalldata: abi.encodeCall(l1OptimismMintableERC20Factory.initialize, (address(l1StandardBridge)))
})
);
......@@ -301,7 +301,7 @@ contract Initializer_Test is CommonTest {
contracts.push(
InitializeableContract({
name: "DataAvailabilityChallengeImpl",
target: deploy.mustGetAddress("DataAvailabilityChallengeImpl"),
target: artifacts.mustGetAddress("DataAvailabilityChallengeImpl"),
initCalldata: abi.encodeCall(dataAvailabilityChallenge.initialize, (address(0), 0, 0, 0, 0))
})
);
......@@ -418,7 +418,7 @@ contract Initializer_Test is CommonTest {
string memory deploymentName = _getRealContractName(_contract.name);
// Grab the value of the "initialized" storage slot.
uint8 initializedSlotVal = deploy.loadInitializedSlot({
uint8 initializedSlotVal = artifacts.loadInitializedSlot({
_sourceName: _removeSuffix(deploymentName),
_deploymentName: deploymentName
});
......
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