Commit 889b59c7 authored by alvarius's avatar alvarius Committed by GitHub

op-plasma: add data availability challenge contract (#9356)

* feat: add op-plasma data availability challenge contract

* fix: usePlasma and remove plasma template

* add DAC to Spec.t.sol

* add DAC to initialize config

* fix tests

* formatting

* add setter for plasma mode

* use alternative approach for enabling plasma mode in tests]

* extend test config output

* regen bindings

* add usePlasma to config.go

* add usePlasma to config.go

* allow enabling plasma in test environment

* initialize data availability challenge contract in constructor

* use proxy in DAC test

* fix spec test

* update bindings

* update type of usePlasma in config.go

* skip DAC in setup.go check for now

* skip DAC in setup.go if UsePlasma is wrong

* forge fmt

* gas snapshot

* add semver lock

* add snapshot

* improve comments

* absolute import

* bound refund percentage

* turn DAC test into a CommonTest

* set semver to 1.0.0

* add versioned commitments

* regenerate bindings

* regenerate snapshots

* update spec

* update gas snapshot

* add DAC to SystemConfig

* update semver

* update gas snapshot

* invariant

* snapshot

* bindings

* reorder deployment to have the DAC address before SystemConfig

* update spec

* move the DAC test to test/L1

* update snapshots

* add precision to the variable resolution cost

* regen artifacts

* semver lock

* bindings

* revert system config changes

* validate commitment length

* rebuild go bindings

* update constants

* remove indexed from commitment event

* semver lock

* add balance changed event to withdraw

* add method to get challenge status

* use basefee instead of gasprice

* use existing dac in test

* add sane default values to deploy config

* pre-pr

* go bindings

* assume challenger and resolver are different entities for balance checks in the resolver test

* add test for validate commitment, move out _getCommitmentType

---------
Co-authored-by: default avatartchardin <tdotchardin@gmail.com>
parent 256d3d7c
......@@ -41,7 +41,8 @@
"DelayedVetoable",
"ISemver",
"StorageSetter",
"SuperchainConfig"
"SuperchainConfig",
"DataAvailabilityChallenge"
],
"remote": [
{
......
This diff is collapsed.
This diff is collapsed.
......@@ -241,6 +241,18 @@ type DeployConfig struct {
// proofs instead of the older output oracle mechanism.
UseFaultProofs bool `json:"useFaultProofs"`
// UsePlasma is a flag that indicates if the system is using op-plasma
UsePlasma bool `json:"usePlasma"`
// DaChallengeWindow represents the block interval during which the availability of a data commitment can be challenged.
DaChallengeWindow uint64 `json:"daChallengeWindow"`
// DaResolveWindow represents the block interval during which a data availability challenge can be resolved.
DaResolveWindow uint64 `json:"daResolveWindow"`
// DaBondSize represents the required bond size to initiate a data availability challenge.
DaBondSize uint64 `json:"daBondSize"`
// DaResolverRefundPercentage represents the percentage of the resolving cost to be refunded to the resolver
// such as 100 means 100% refund.
DaResolverRefundPercentage uint64 `json:"daResolverRefundPercentage"`
// When Cancun activates. Relative to L1 genesis.
L1CancunTimeOffset *hexutil.Uint64 `json:"l1CancunTimeOffset,omitempty"`
}
......@@ -617,6 +629,8 @@ type L1Deployments struct {
SystemConfigProxy common.Address `json:"SystemConfigProxy"`
ProtocolVersions common.Address `json:"ProtocolVersions"`
ProtocolVersionsProxy common.Address `json:"ProtocolVersionsProxy"`
DataAvailabilityChallenge common.Address `json:"DataAvailabilityChallenge"`
DataAvailabilityChallengeProxy common.Address `json:"DataAvailabilityChallengeProxy"`
}
// GetName will return the name of the contract given an address.
......@@ -634,7 +648,7 @@ func (d *L1Deployments) GetName(addr common.Address) string {
}
// Check will ensure that the L1Deployments are sane
func (d *L1Deployments) Check() error {
func (d *L1Deployments) Check(deployConfig *DeployConfig) error {
val := reflect.ValueOf(d)
if val.Kind() == reflect.Ptr {
val = val.Elem()
......@@ -642,7 +656,14 @@ func (d *L1Deployments) Check() error {
for i := 0; i < val.NumField(); i++ {
name := val.Type().Field(i).Name
// Skip the non production ready contracts
if name == "DisputeGameFactory" || name == "DisputeGameFactoryProxy" || name == "BlockOracle" {
if name == "DisputeGameFactory" ||
name == "DisputeGameFactoryProxy" ||
name == "BlockOracle" {
continue
}
if !deployConfig.UsePlasma &&
(name == "DataAvailabilityChallenge" ||
name == "DataAvailabilityChallengeProxy") {
continue
}
if val.Field(i).Interface().(common.Address) == (common.Address{}) {
......
......@@ -80,5 +80,10 @@
"proofMaturityDelaySeconds": 12,
"disputeGameFinalityDelaySeconds": 6,
"respectedGameType": 0,
"useFaultProofs": false
"useFaultProofs": false,
"usePlasma": false,
"daBondSize": 0,
"daChallengeWindow": 0,
"daResolveWindow": 0,
"daResolverRefundPercentage": 0
}
......@@ -103,7 +103,7 @@ func Setup(t require.TestingT, deployParams *DeployParams, alloc *AllocParams) *
require.NoError(t, deployConf.Check())
l1Deployments := config.L1Deployments.Copy()
require.NoError(t, l1Deployments.Check())
require.NoError(t, l1Deployments.Check(deployConf))
l1Genesis, err := genesis.BuildL1DeveloperGenesis(deployConf, config.L1Allocs, l1Deployments)
require.NoError(t, err, "failed to create l1 genesis")
......
......@@ -95,7 +95,7 @@ func DefaultSystemConfig(t *testing.T) SystemConfig {
e2eutils.ApplyDeployConfigForks(deployConfig)
require.NoError(t, deployConfig.Check(), "Deploy config is invalid, do you need to run make devnet-allocs?")
l1Deployments := config.L1Deployments.Copy()
require.NoError(t, l1Deployments.Check())
require.NoError(t, l1Deployments.Check(deployConfig))
require.Equal(t, secrets.Addresses().Batcher, deployConfig.BatchSenderAddress)
require.Equal(t, secrets.Addresses().SequencerP2P, deployConfig.P2PSequencerAddress)
......
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 356552)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2954759)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 549114)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2954737)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 549159)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 4061135)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 450330)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 450308)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 3496057)
GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 59803)
GasBenchMark_L2OutputOracle:test_proposeL2Output_benchmark() (gas: 92951)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 68360)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 68991)
GasBenchMark_OptimismPortal:test_proveWithdrawalTransaction_benchmark() (gas: 155559)
\ No newline at end of file
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 69013)
GasBenchMark_OptimismPortal:test_proveWithdrawalTransaction_benchmark() (gas: 155553)
\ No newline at end of file
......@@ -61,5 +61,10 @@
"proofMaturityDelaySeconds": 12,
"disputeGameFinalityDelaySeconds": 6,
"respectedGameType": 0,
"useFaultProofs": false
"useFaultProofs": false,
"usePlasma": false,
"daChallengeWindow": 1000,
"daResolveWindow": 1000,
"daBondSize": 1000000,
"daResolverRefundPercentage": 0
}
......@@ -56,5 +56,10 @@
"disputeGameFinalityDelaySeconds": 6,
"respectedGameType": 0,
"useFaultProofs": false,
"fundDevAccounts": false
"fundDevAccounts": false,
"usePlasma": false,
"daChallengeWindow": 100,
"daResolveWindow": 100,
"daBondSize": 1000,
"daResolverRefundPercentage": 50
}
......@@ -29,6 +29,7 @@ import { OptimismMintableERC20Factory } from "src/universal/OptimismMintableERC2
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol";
import { ResourceMetering } from "src/L1/ResourceMetering.sol";
import { DataAvailabilityChallenge } from "src/L1/DataAvailabilityChallenge.sol";
import { Constants } from "src/libraries/Constants.sol";
import { DisputeGameFactory } from "src/dispute/DisputeGameFactory.sol";
import { FaultDisputeGame } from "src/dispute/FaultDisputeGame.sol";
......@@ -279,6 +280,9 @@ contract Deploy is Deployer {
function _run() internal {
deploySafe();
setupSuperchain();
if (cfg.usePlasma()) {
setupOpPlasma();
}
setupOpChain();
}
......@@ -392,6 +396,14 @@ contract Deploy is Deployer {
}
}
/// @notice Add Plasma setup to the OP chain
function setupOpPlasma() public {
console.log("Deploying OP Plasma");
deployDataAvailabilityChallengeProxy();
deployDataAvailabilityChallenge();
initializeDataAvailabilityChallenge();
}
////////////////////////////////////////////////////////////////
// Non-Proxied Deployment Functions //
////////////////////////////////////////////////////////////////
......@@ -511,6 +523,20 @@ contract Deploy is Deployer {
addr_ = address(proxy);
}
/// @notice Deploy the DataAvailabilityChallengeProxy
function deployDataAvailabilityChallengeProxy() public broadcast returns (address addr_) {
console.log("Deploying proxy for DataAvailabilityChallenge");
address proxyAdmin = mustGetAddress("ProxyAdmin");
Proxy proxy = new Proxy({ _admin: proxyAdmin });
require(EIP1967Helper.getAdmin(address(proxy)) == proxyAdmin);
save("DataAvailabilityChallengeProxy", address(proxy));
console.log("DataAvailabilityChallengeProxy deployed at %s", address(proxy));
addr_ = address(proxy);
}
////////////////////////////////////////////////////////////////
// Implementation Deployment Functions //
////////////////////////////////////////////////////////////////
......@@ -760,6 +786,16 @@ contract Deploy is Deployer {
require(addressManager.owner() == proxyAdmin);
}
/// @notice Deploy the DataAvailabilityChallenge
function deployDataAvailabilityChallenge() public broadcast returns (address addr_) {
console.log("Deploying DataAvailabilityChallenge implementation");
DataAvailabilityChallenge dac = new DataAvailabilityChallenge();
save("DataAvailabilityChallenge", address(dac));
console.log("DataAvailabilityChallenge deployed at %s", address(dac));
addr_ = address(dac);
}
////////////////////////////////////////////////////////////////
// Initialize Functions //
////////////////////////////////////////////////////////////////
......@@ -1241,4 +1277,36 @@ contract Deploy is Deployer {
vm.toString(rawGameType)
);
}
/// @notice Initialize the DataAvailabilityChallenge
function initializeDataAvailabilityChallenge() public broadcast {
console.log("Upgrading and initializing DataAvailabilityChallenge proxy");
address dataAvailabilityChallengeProxy = mustGetAddress("DataAvailabilityChallengeProxy");
address dataAvailabilityChallenge = mustGetAddress("DataAvailabilityChallenge");
address finalSystemOwner = cfg.finalSystemOwner();
uint256 daChallengeWindow = cfg.daChallengeWindow();
uint256 daResolveWindow = cfg.daResolveWindow();
uint256 daBondSize = cfg.daBondSize();
uint256 daResolverRefundPercentage = cfg.daResolverRefundPercentage();
_upgradeAndCallViaSafe({
_proxy: payable(dataAvailabilityChallengeProxy),
_implementation: dataAvailabilityChallenge,
_innerCallData: abi.encodeCall(
DataAvailabilityChallenge.initialize,
(finalSystemOwner, daChallengeWindow, daResolveWindow, daBondSize, daResolverRefundPercentage)
)
});
DataAvailabilityChallenge dac = DataAvailabilityChallenge(payable(dataAvailabilityChallengeProxy));
string memory version = dac.version();
console.log("DataAvailabilityChallenge version: %s", version);
require(dac.owner() == finalSystemOwner);
require(dac.challengeWindow() == daChallengeWindow);
require(dac.resolveWindow() == daResolveWindow);
require(dac.bondSize() == daBondSize);
require(dac.resolverRefundPercentage() == daResolverRefundPercentage);
}
}
......@@ -70,6 +70,11 @@ contract DeployConfig is Script {
uint256 public disputeGameFinalityDelaySeconds;
uint256 public respectedGameType;
bool public useFaultProofs;
bool public usePlasma;
uint256 public daChallengeWindow;
uint256 public daResolveWindow;
uint256 public daBondSize;
uint256 public daResolverRefundPercentage;
function read(string memory _path) public {
console.log("DeployConfig: reading file %s", _path);
......@@ -135,6 +140,12 @@ contract DeployConfig is Script {
preimageOracleMinProposalSize = stdJson.readUint(_json, "$.preimageOracleMinProposalSize");
preimageOracleChallengePeriod = stdJson.readUint(_json, "$.preimageOracleChallengePeriod");
preimageOracleCancunActivationTimestamp = stdJson.readUint(_json, "$.preimageOracleCancunActivationTimestamp");
usePlasma = _readOr(_json, "$.usePlasma", false);
daChallengeWindow = _readOr(_json, "$.daChallengeWindow", 1000);
daResolveWindow = _readOr(_json, "$.daResolveWindow", 1000);
daBondSize = _readOr(_json, "$.daBondSize", 1000000000);
daResolverRefundPercentage = _readOr(_json, "$.daResolverRefundPercentage", 0);
}
function l1StartingBlockTag() public returns (bytes32) {
......@@ -165,6 +176,11 @@ contract DeployConfig is Script {
return uint256(_l2OutputOracleStartingTimestamp);
}
/// @notice Allow the `usePlasma` config to be overridden in testing environments
function setUsePlasma(bool _usePlasma) public {
usePlasma = _usePlasma;
}
function _getBlockByTag(string memory _tag) internal returns (bytes32) {
string[] memory cmd = new string[](3);
cmd[0] = Executables.bash;
......@@ -173,4 +189,12 @@ contract DeployConfig is Script {
bytes memory res = vm.ffi(cmd);
return abi.decode(res, (bytes32));
}
function _readOr(string memory json, string memory key, bool defaultValue) internal view returns (bool) {
return vm.keyExists(json, key) ? stdJson.readBool(json, key) : defaultValue;
}
function _readOr(string memory json, string memory key, uint256 defaultValue) internal view returns (uint256) {
return vm.keyExists(json, key) ? stdJson.readUint(json, key) : defaultValue;
}
}
......@@ -7,6 +7,10 @@
"initCodeHash": "0xf4c3155413be4a4ebaaba66b9f9daaf12db7b090afdea739dfb8a543df357289",
"sourceCodeHash": "0x2ed7a2d6d66839fb3d207952f44b001bce349334adc40ce66d0503ce64e48548"
},
"src/L1/DataAvailabilityChallenge.sol": {
"initCodeHash": "0x39d938938b13abb2455959960c2ee96d48149fd16a7fb69f1f6699460d5019be",
"sourceCodeHash": "0xf6c72a2cca24cfa7c9274d720e93b05d665a2751cca3d747105e6c511ccffc73"
},
"src/L1/DelayedVetoable.sol": {
"initCodeHash": "0x84f78e56211500a768b2c5bbafde8e7b411bd64c237297370d7d22326b68357c",
"sourceCodeHash": "0xc59b8574531162e016d7342aeb6e79d05574e90dbea6c0e5ede35b65010ad894"
......
[
{
"bytes": "1",
"label": "_initialized",
"offset": 0,
"slot": "0",
"type": "uint8"
},
{
"bytes": "1",
"label": "_initializing",
"offset": 1,
"slot": "0",
"type": "bool"
},
{
"bytes": "1600",
"label": "__gap",
"offset": 0,
"slot": "1",
"type": "uint256[50]"
},
{
"bytes": "20",
"label": "_owner",
"offset": 0,
"slot": "51",
"type": "address"
},
{
"bytes": "1568",
"label": "__gap",
"offset": 0,
"slot": "52",
"type": "uint256[49]"
},
{
"bytes": "32",
"label": "challengeWindow",
"offset": 0,
"slot": "101",
"type": "uint256"
},
{
"bytes": "32",
"label": "resolveWindow",
"offset": 0,
"slot": "102",
"type": "uint256"
},
{
"bytes": "32",
"label": "bondSize",
"offset": 0,
"slot": "103",
"type": "uint256"
},
{
"bytes": "32",
"label": "resolverRefundPercentage",
"offset": 0,
"slot": "104",
"type": "uint256"
},
{
"bytes": "32",
"label": "balances",
"offset": 0,
"slot": "105",
"type": "mapping(address => uint256)"
},
{
"bytes": "32",
"label": "challenges",
"offset": 0,
"slot": "106",
"type": "mapping(uint256 => mapping(bytes => struct Challenge))"
}
]
\ No newline at end of file
......@@ -8,6 +8,7 @@ import { ProtocolVersions } from "src/L1/ProtocolVersions.sol";
import { OptimismPortal } from "src/L1/OptimismPortal.sol";
import { OptimismPortal2 } from "src/L1/OptimismPortal2.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol";
import { DataAvailabilityChallenge } from "src/L1/DataAvailabilityChallenge.sol";
/// @title Specification_Test
/// @dev Specifies common security properties of entrypoints to L1 contracts, including authorization and
......@@ -35,7 +36,8 @@ contract Specification_Test is CommonTest {
MESSENGER,
L1PROXYADMINOWNER,
GOVERNANCETOKENOWNER,
MINTMANAGEROWNER
MINTMANAGEROWNER,
DATAAVAILABILITYCHALLENGEOWNER
}
/// @notice Represents the specification of a function.
......@@ -56,6 +58,47 @@ contract Specification_Test is CommonTest {
function setUp() public override {
super.setUp();
// DataAvailabilityChallenge
_addSpec({ _name: "DataAvailabilityChallenge", _sel: _getSel("owner()") });
_addSpec({
_name: "DataAvailabilityChallenge",
_sel: _getSel("renounceOwnership()"),
_auth: Role.DATAAVAILABILITYCHALLENGEOWNER
});
_addSpec({
_name: "DataAvailabilityChallenge",
_sel: _getSel("transferOwnership(address)"),
_auth: Role.DATAAVAILABILITYCHALLENGEOWNER
});
_addSpec({ _name: "DataAvailabilityChallenge", _sel: _getSel("version()") });
_addSpec({ _name: "DataAvailabilityChallenge", _sel: _getSel("fixedResolutionCost()") });
_addSpec({ _name: "DataAvailabilityChallenge", _sel: _getSel("variableResolutionCost()") });
_addSpec({ _name: "DataAvailabilityChallenge", _sel: _getSel("variableResolutionCostPrecision()") });
_addSpec({ _name: "DataAvailabilityChallenge", _sel: _getSel("bondSize()") });
_addSpec({ _name: "DataAvailabilityChallenge", _sel: _getSel("challengeWindow()") });
_addSpec({ _name: "DataAvailabilityChallenge", _sel: _getSel("resolveWindow()") });
_addSpec({ _name: "DataAvailabilityChallenge", _sel: _getSel("resolverRefundPercentage()") });
_addSpec({ _name: "DataAvailabilityChallenge", _sel: _getSel("balances(address)") });
_addSpec({ _name: "DataAvailabilityChallenge", _sel: DataAvailabilityChallenge.initialize.selector });
_addSpec({
_name: "DataAvailabilityChallenge",
_sel: DataAvailabilityChallenge.setBondSize.selector,
_auth: Role.DATAAVAILABILITYCHALLENGEOWNER
});
_addSpec({
_name: "DataAvailabilityChallenge",
_sel: DataAvailabilityChallenge.setResolverRefundPercentage.selector,
_auth: Role.DATAAVAILABILITYCHALLENGEOWNER
});
_addSpec({ _name: "DataAvailabilityChallenge", _sel: DataAvailabilityChallenge.deposit.selector });
_addSpec({ _name: "DataAvailabilityChallenge", _sel: DataAvailabilityChallenge.withdraw.selector });
_addSpec({ _name: "DataAvailabilityChallenge", _sel: DataAvailabilityChallenge.getChallenge.selector });
_addSpec({ _name: "DataAvailabilityChallenge", _sel: DataAvailabilityChallenge.getChallengeStatus.selector });
_addSpec({ _name: "DataAvailabilityChallenge", _sel: DataAvailabilityChallenge.validateCommitment.selector });
_addSpec({ _name: "DataAvailabilityChallenge", _sel: DataAvailabilityChallenge.challenge.selector });
_addSpec({ _name: "DataAvailabilityChallenge", _sel: DataAvailabilityChallenge.resolve.selector });
_addSpec({ _name: "DataAvailabilityChallenge", _sel: DataAvailabilityChallenge.unlockBond.selector });
// DelayedVetoable
_addSpec({ _name: "DelayedVetoable", _sel: _getSel("delay()") });
_addSpec({ _name: "DelayedVetoable", _sel: _getSel("initiator()") });
......
......@@ -17,6 +17,8 @@ contract CommonTest is Test, Setup, Events {
FFIInterface constant ffi = FFIInterface(address(uint160(uint256(keccak256(abi.encode("optimism.ffi"))))));
bool usePlasmaOverride;
function setUp() public virtual override {
alice = makeAddr("alice");
bob = makeAddr("bob");
......@@ -24,6 +26,12 @@ contract CommonTest is Test, Setup, Events {
vm.deal(bob, 10000 ether);
Setup.setUp();
// Override the plasma config after the deploy script initialized the config
if (usePlasmaOverride) {
deploy.cfg().setUsePlasma(true);
}
vm.etch(address(ffi), vm.getDeployedCode("FFIInterface.sol:FFIInterface"));
vm.label(address(ffi), "FFIInterface");
......@@ -103,4 +111,14 @@ contract CommonTest is Test, Setup, Events {
bytes32(uint256(1))
);
}
function enablePlasma() public {
// Check if the system has already been deployed, based off of the heuristic that alice and bob have not been
// set by the `setUp` function yet.
if (!(alice == address(0) && bob == address(0))) {
revert("CommonTest: Cannot enable plasma after deployment. Consider overriding `setUp`.");
}
usePlasmaOverride = true;
}
}
......@@ -32,6 +32,7 @@ import { AddressAliasHelper } from "src/vendor/AddressAliasHelper.sol";
import { Executables } from "scripts/Executables.sol";
import { Vm } from "forge-std/Vm.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { DataAvailabilityChallenge } from "src/L1/DataAvailabilityChallenge.sol";
/// @title Setup
/// @dev This contact is responsible for setting up the contracts in state. It currently
......@@ -58,6 +59,7 @@ contract Setup {
OptimismMintableERC20Factory l1OptimismMintableERC20Factory;
ProtocolVersions protocolVersions;
SuperchainConfig superchainConfig;
DataAvailabilityChallenge dataAvailabilityChallenge;
L2CrossDomainMessenger l2CrossDomainMessenger =
L2CrossDomainMessenger(payable(Predeploys.L2_CROSS_DOMAIN_MESSENGER));
......@@ -132,6 +134,13 @@ contract Setup {
vm.label(address(superchainConfig), "SuperchainConfig");
vm.label(deploy.mustGetAddress("SuperchainConfigProxy"), "SuperchainConfigProxy");
vm.label(AddressAliasHelper.applyL1ToL2Alias(address(l1CrossDomainMessenger)), "L1CrossDomainMessenger_aliased");
if (deploy.cfg().usePlasma()) {
dataAvailabilityChallenge =
DataAvailabilityChallenge(deploy.mustGetAddress("DataAvailabilityChallengeProxy"));
vm.label(address(dataAvailabilityChallenge), "DataAvailabilityChallengeProxy");
vm.label(deploy.mustGetAddress("DataAvailabilityChallenge"), "DataAvailabilityChallenge");
}
}
/// @dev Sets up the L2 contracts. Depends on `L1()` being called first.
......
......@@ -30,6 +30,7 @@ contract Initializer_Test is Bridge_Initializer {
InitializeableContract[] contracts;
function setUp() public override {
super.enablePlasma();
// Run the `Bridge_Initializer`'s `setUp()` function.
super.setUp();
......@@ -288,6 +289,22 @@ contract Initializer_Test is Bridge_Initializer {
initializedSlotVal: deploy.loadInitializedSlot("OptimismMintableERC20FactoryProxy")
})
);
// DataAvailabilityChallengeImpl
contracts.push(
InitializeableContract({
target: deploy.mustGetAddress("DataAvailabilityChallenge"),
initCalldata: abi.encodeCall(dataAvailabilityChallenge.initialize, (address(0), 0, 0, 0, 0)),
initializedSlotVal: deploy.loadInitializedSlot("DataAvailabilityChallenge")
})
);
// DataAvailabilityChallengeProxy
contracts.push(
InitializeableContract({
target: address(dataAvailabilityChallenge),
initCalldata: abi.encodeCall(dataAvailabilityChallenge.initialize, (address(0), 0, 0, 0, 0)),
initializedSlotVal: deploy.loadInitializedSlot("DataAvailabilityChallengeProxy")
})
);
}
/// @notice Tests that:
......
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