From c8edbe24cb9579ee9dd7b0f8d164647d6af3a056 Mon Sep 17 00:00:00 2001 From: Maurelian Date: Tue, 15 Oct 2024 13:43:04 -0400 Subject: [PATCH] test: Remove exceptions for unlabelled fdg contracts (#12462) * test: Remove exceptions for unlabelled fdg contracts * fix: Unused import --- .../contracts-bedrock/scripts/Artifacts.s.sol | 7 ------- .../test/vendor/Initializable.t.sol | 16 +++------------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/packages/contracts-bedrock/scripts/Artifacts.s.sol b/packages/contracts-bedrock/scripts/Artifacts.s.sol index d43bd6915455..ff63f6bb3762 100644 --- a/packages/contracts-bedrock/scripts/Artifacts.s.sol +++ b/packages/contracts-bedrock/scripts/Artifacts.s.sol @@ -216,13 +216,6 @@ abstract contract Artifacts { /// @notice Returns the value of the internal `_initialized` storage slot for a given contract. function loadInitializedSlot(string memory _contractName) public returns (uint8 initialized_) { - // FaultDisputeGame and PermissionedDisputeGame are initializable but cannot be loaded with - // this function yet because they are not properly labeled in the deploy script. - // TODO: Remove this restriction once the deploy script is fixed. - if (LibString.eq(_contractName, "FaultDisputeGame") || LibString.eq(_contractName, "PermissionedDisputeGame")) { - revert UnsupportedInitializableContract(_contractName); - } - address contractAddress; // Check if the contract name ends with `Proxy` and, if so, get the implementation address if (LibString.endsWith(_contractName, "Proxy")) { diff --git a/packages/contracts-bedrock/test/vendor/Initializable.t.sol b/packages/contracts-bedrock/test/vendor/Initializable.t.sol index 3d1465704aff..17fb79339ca1 100644 --- a/packages/contracts-bedrock/test/vendor/Initializable.t.sol +++ b/packages/contracts-bedrock/test/vendor/Initializable.t.sol @@ -6,7 +6,7 @@ import { Bridge_Initializer } from "test/setup/Bridge_Initializer.sol"; // Scripts import { Executables } from "scripts/libraries/Executables.sol"; -import { ForgeArtifacts, StorageSlot } from "scripts/libraries/ForgeArtifacts.sol"; +import { ForgeArtifacts } from "scripts/libraries/ForgeArtifacts.sol"; import { Process } from "scripts/libraries/Process.sol"; // Libraries @@ -473,19 +473,9 @@ contract Initializer_Test is Bridge_Initializer { InitializeableContract memory _contract = contracts[i]; string memory name = _getRealContractName(_contract.name); - // Grab the value of the "initialized" storage slot. Must handle special case for the - // FaultDisputeGame and PermissionedDisputeGame contracts since these have a different - // name for the "initialized" storage slot and are currently not properly labeled in - // the deployment script. - // TODO: Update deployment script to properly label the dispute game contracts. + // Grab the value of the "initialized" storage slot. uint8 initializedSlotVal; - if (LibString.eq(name, "FaultDisputeGame") || LibString.eq(name, "PermissionedDisputeGame")) { - StorageSlot memory slot = ForgeArtifacts.getInitializedSlot(name); - bytes32 slotVal = vm.load(_contract.target, bytes32(vm.parseUint(slot.slot))); - initializedSlotVal = uint8((uint256(slotVal) >> (slot.offset * 8)) & 0xFF); - } else { - initializedSlotVal = deploy.loadInitializedSlot(name); - } + initializedSlotVal = deploy.loadInitializedSlot(name); // Assert that the contract is already initialized. assertTrue(