diff --git a/packages/contracts-bedrock/.gas-snapshot b/packages/contracts-bedrock/.gas-snapshot index ecfb713d05a0..3564748212d9 100644 --- a/packages/contracts-bedrock/.gas-snapshot +++ b/packages/contracts-bedrock/.gas-snapshot @@ -1,7 +1,7 @@ -GasBenchMark_L1BlockIsthmus_DepositsComplete:test_depositsComplete_benchmark() (gas: 7567) -GasBenchMark_L1BlockIsthmus_DepositsComplete_Warm:test_depositsComplete_benchmark() (gas: 5567) -GasBenchMark_L1BlockIsthmus_SetValuesIsthmus:test_setL1BlockValuesIsthmus_benchmark() (gas: 175657) -GasBenchMark_L1BlockIsthmus_SetValuesIsthmus_Warm:test_setL1BlockValuesIsthmus_benchmark() (gas: 5121) +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_L1Block_SetValuesEcotone:test_setL1BlockValuesEcotone_benchmark() (gas: 158531) GasBenchMark_L1Block_SetValuesEcotone_Warm:test_setL1BlockValuesEcotone_benchmark() (gas: 7597) GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 369242) diff --git a/packages/contracts-bedrock/scripts/L2Genesis.s.sol b/packages/contracts-bedrock/scripts/L2Genesis.s.sol index ceae376ee5c2..ae4773a2eebd 100644 --- a/packages/contracts-bedrock/scripts/L2Genesis.s.sol +++ b/packages/contracts-bedrock/scripts/L2Genesis.s.sol @@ -384,7 +384,7 @@ contract L2Genesis is Deployer { /// @notice This predeploy is following the safety invariant #1. function setL1Block() public { if (cfg.useInterop()) { - string memory cname = "L1BlockIsthmus"; + string memory cname = "L1BlockInterop"; address impl = Predeploys.predeployToCodeNamespace(Predeploys.L1_BLOCK_ATTRIBUTES); console.log("Setting %s implementation at: %s", cname, impl); vm.etch(impl, vm.getDeployedCode(string.concat(cname, ".sol:", cname))); diff --git a/packages/contracts-bedrock/semver-lock.json b/packages/contracts-bedrock/semver-lock.json index b68db55580f2..51666e0d6fba 100644 --- a/packages/contracts-bedrock/semver-lock.json +++ b/packages/contracts-bedrock/semver-lock.json @@ -45,7 +45,7 @@ }, "src/L1/OptimismPortalInterop.sol": { "initCodeHash": "0x1c8372865dbf38225de4d843ca696a17f0d9e3cacf13c10a3d065ba19bdca05e", - "sourceCodeHash": "0xe6a7794799915f408cb57c73af266670de8a3f02408d3dbc2c97db25d3e42635" + "sourceCodeHash": "0x5e0f8540d605da9d6470fc6e321dcb6f6c2d46feb9358a0857a2b50674e27795" }, "src/L1/ProtocolVersions.sol": { "initCodeHash": "0x8f033874dd8b36615b2209d553660dcff1ff91ca2bad3ca1de7b441dbfba4842", @@ -61,7 +61,7 @@ }, "src/L1/SystemConfigInterop.sol": { "initCodeHash": "0x1f500e310170769ffc747e08ad1d5b0de4b0f58534001bc4d4d563ec058bb331", - "sourceCodeHash": "0xcb6008cb49a06f87eb5b6cb4651e5e4aafe0b1f33000eccd165226c04f6b63c6" + "sourceCodeHash": "0xdd61b3f0e69d3187b212cb93add237e9ccc174b7e04848597229f2f144275e1d" }, "src/L2/BaseFeeVault.sol": { "initCodeHash": "0x3bfcd57e25ad54b66c374f63e24e33a6cf107044aa8f5f69ef21202c380b5c5b", @@ -69,7 +69,7 @@ }, "src/L2/CrossL2Inbox.sol": { "initCodeHash": "0x0ee27866b4bf864a0b68ab25ea9559d7f2722b0396d02f2e8e089c6a1a5a6a93", - "sourceCodeHash": "0xe6f453049035e0d77e4d7a92904b448bc17e04dd3d99e738b9af20e20986ce64" + "sourceCodeHash": "0x383400ce56e5e694050e682b53cc539977054ce33266af9e136ab11ae1af2b87" }, "src/L2/ETHLiquidity.sol": { "initCodeHash": "0x713c18f95a6a746d0703f475f3ae10c106c9b9ecb64d881a2e61b8969b581371", @@ -83,9 +83,9 @@ "initCodeHash": "0xd12353c5bf71c6765cc9292eecf262f216e67f117f4ba6287796a5207dbca00f", "sourceCodeHash": "0xfe3a9585d9bfca8428e12759cab68a3114374e5c37371cfe08bb1976a9a5a041" }, - "src/L2/L1BlockIsthmus.sol": { - "initCodeHash": "0xb7a7a113056e4ac44824350b79fed5ea423e880223edcf1220e8f8b3172f50c5", - "sourceCodeHash": "0x6be7e7402c4dfc10e1407e070712a3f9f352db45f8a8ab296e8f6bc56a341f47" + "src/L2/L1BlockInterop.sol": { + "initCodeHash": "0x77b3b2151fe14ea36a640469115a5e4de27f7654a9606a9d0701522c6a4ad887", + "sourceCodeHash": "0x7417677643e1df1ae1782513b94c7821097b9529d3f8626c3bcb8b3a9ae0d180" }, "src/L2/L1FeeVault.sol": { "initCodeHash": "0x3bfcd57e25ad54b66c374f63e24e33a6cf107044aa8f5f69ef21202c380b5c5b", diff --git a/packages/contracts-bedrock/snapshots/abi/L1BlockIsthmus.json b/packages/contracts-bedrock/snapshots/abi/L1BlockInterop.json similarity index 99% rename from packages/contracts-bedrock/snapshots/abi/L1BlockIsthmus.json rename to packages/contracts-bedrock/snapshots/abi/L1BlockInterop.json index d827b32a9cab..ab089f0cec55 100644 --- a/packages/contracts-bedrock/snapshots/abi/L1BlockIsthmus.json +++ b/packages/contracts-bedrock/snapshots/abi/L1BlockInterop.json @@ -354,7 +354,7 @@ }, { "inputs": [], - "name": "setL1BlockValuesIsthmus", + "name": "setL1BlockValuesInterop", "outputs": [], "stateMutability": "nonpayable", "type": "function" diff --git a/packages/contracts-bedrock/snapshots/storageLayout/L1BlockIsthmus.json b/packages/contracts-bedrock/snapshots/storageLayout/L1BlockInterop.json similarity index 100% rename from packages/contracts-bedrock/snapshots/storageLayout/L1BlockIsthmus.json rename to packages/contracts-bedrock/snapshots/storageLayout/L1BlockInterop.json diff --git a/packages/contracts-bedrock/src/L1/OptimismPortalInterop.sol b/packages/contracts-bedrock/src/L1/OptimismPortalInterop.sol index fd33c5286ebd..8c3e36a0e077 100644 --- a/packages/contracts-bedrock/src/L1/OptimismPortalInterop.sol +++ b/packages/contracts-bedrock/src/L1/OptimismPortalInterop.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.15; // Contracts import { OptimismPortal2 } from "src/L1/OptimismPortal2.sol"; -import { L1BlockIsthmus, ConfigType } from "src/L2/L1BlockIsthmus.sol"; +import { L1BlockInterop, ConfigType } from "src/L2/L1BlockInterop.sol"; // Libraries import { Predeploys } from "src/libraries/Predeploys.sol"; @@ -48,7 +48,7 @@ contract OptimismPortalInterop is OptimismPortal2 { uint256(0), // value uint64(SYSTEM_DEPOSIT_GAS_LIMIT), // gasLimit false, // isCreation, - abi.encodeCall(L1BlockIsthmus.setConfig, (_type, _value)) + abi.encodeCall(L1BlockInterop.setConfig, (_type, _value)) ) ); } diff --git a/packages/contracts-bedrock/src/L1/SystemConfigInterop.sol b/packages/contracts-bedrock/src/L1/SystemConfigInterop.sol index ee5b052e04ec..e560d9182e4c 100644 --- a/packages/contracts-bedrock/src/L1/SystemConfigInterop.sol +++ b/packages/contracts-bedrock/src/L1/SystemConfigInterop.sol @@ -5,7 +5,7 @@ pragma solidity 0.8.15; import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import { IOptimismPortalInterop as IOptimismPortal } from "src/L1/interfaces/IOptimismPortalInterop.sol"; import { SystemConfig } from "src/L1/SystemConfig.sol"; -import { ConfigType } from "src/L2/L1BlockIsthmus.sol"; +import { ConfigType } from "src/L2/L1BlockInterop.sol"; // Libraries import { Constants } from "src/libraries/Constants.sol"; diff --git a/packages/contracts-bedrock/src/L1/interfaces/IOptimismPortalInterop.sol b/packages/contracts-bedrock/src/L1/interfaces/IOptimismPortalInterop.sol index 682518897362..487cc1503e34 100644 --- a/packages/contracts-bedrock/src/L1/interfaces/IOptimismPortalInterop.sol +++ b/packages/contracts-bedrock/src/L1/interfaces/IOptimismPortalInterop.sol @@ -7,7 +7,7 @@ import { IDisputeGame } from "src/dispute/interfaces/IDisputeGame.sol"; import { IDisputeGameFactory } from "src/dispute/interfaces/IDisputeGameFactory.sol"; import { ISystemConfig } from "src/L1/interfaces/ISystemConfig.sol"; import { ISuperchainConfig } from "src/L1/interfaces/ISuperchainConfig.sol"; -import { ConfigType } from "src/L2/L1BlockIsthmus.sol"; +import { ConfigType } from "src/L2/L1BlockInterop.sol"; interface IOptimismPortalInterop { error AlreadyFinalized(); diff --git a/packages/contracts-bedrock/src/L2/CrossL2Inbox.sol b/packages/contracts-bedrock/src/L2/CrossL2Inbox.sol index 437e0c62a2e3..e96fdf5b56bf 100644 --- a/packages/contracts-bedrock/src/L2/CrossL2Inbox.sol +++ b/packages/contracts-bedrock/src/L2/CrossL2Inbox.sol @@ -7,7 +7,7 @@ import { ISemver } from "src/universal/interfaces/ISemver.sol"; import { ICrossL2Inbox } from "src/L2/interfaces/ICrossL2Inbox.sol"; import { SafeCall } from "src/libraries/SafeCall.sol"; import { IDependencySet } from "src/L2/interfaces/IDependencySet.sol"; -import { IL1BlockIsthmus } from "src/L2/interfaces/IL1BlockIsthmus.sol"; +import { IL1BlockInterop } from "src/L2/interfaces/IL1BlockInterop.sol"; /// @notice Thrown when the caller is not DEPOSITOR_ACCOUNT when calling `setInteropStart()` error NotDepositor(); @@ -140,7 +140,7 @@ contract CrossL2Inbox is ICrossL2Inbox, ISemver, TransientReentrancyAware { reentrantAware { // We need to know if this is being called on a depositTx - if (IL1BlockIsthmus(Predeploys.L1_BLOCK_ATTRIBUTES).isDeposit()) revert NoExecutingDeposits(); + if (IL1BlockInterop(Predeploys.L1_BLOCK_ATTRIBUTES).isDeposit()) revert NoExecutingDeposits(); // Check the Identifier. _checkIdentifier(_id); @@ -165,7 +165,7 @@ contract CrossL2Inbox is ICrossL2Inbox, ISemver, TransientReentrancyAware { /// @param _msgHash Hash of the message payload to call target with. function validateMessage(Identifier calldata _id, bytes32 _msgHash) external { // We need to know if this is being called on a depositTx - if (IL1BlockIsthmus(Predeploys.L1_BLOCK_ATTRIBUTES).isDeposit()) revert NoExecutingDeposits(); + if (IL1BlockInterop(Predeploys.L1_BLOCK_ATTRIBUTES).isDeposit()) revert NoExecutingDeposits(); // Check the Identifier. _checkIdentifier(_id); diff --git a/packages/contracts-bedrock/src/L2/L1BlockIsthmus.sol b/packages/contracts-bedrock/src/L2/L1BlockInterop.sol similarity index 94% rename from packages/contracts-bedrock/src/L2/L1BlockIsthmus.sol rename to packages/contracts-bedrock/src/L2/L1BlockInterop.sol index c9643659030e..15ea67f5e6b3 100644 --- a/packages/contracts-bedrock/src/L2/L1BlockIsthmus.sol +++ b/packages/contracts-bedrock/src/L2/L1BlockInterop.sol @@ -11,7 +11,7 @@ import { StaticConfig } from "src/libraries/StaticConfig.sol"; import { Predeploys } from "src/libraries/Predeploys.sol"; import "src/libraries/L1BlockErrors.sol"; -/// @notice Enum representing different types of configurations that can be set on L1BlockIsthmus. +/// @notice Enum representing different types of configurations that can be set on L1BlockInterop. /// @custom:value SET_GAS_PAYING_TOKEN Represents the config type for setting the gas paying token. /// @custom:value ADD_DEPENDENCY Represents the config type for adding a chain to the interop dependency set. /// @custom:value REMOVE_DEPENDENCY Represents the config type for removing a chain from the interop dependency set. @@ -23,9 +23,9 @@ enum ConfigType { /// @custom:proxied true /// @custom:predeploy 0x4200000000000000000000000000000000000015 -/// @title L1BlockIsthmus -/// @notice Isthmus extenstions of L1Block. -contract L1BlockIsthmus is L1Block { +/// @title L1BlockInterop +/// @notice Interop extenstions of L1Block. +contract L1BlockInterop is L1Block { using EnumerableSet for EnumerableSet.UintSet; /// @notice Event emitted when a new dependency is added to the interop dependency set. @@ -42,9 +42,9 @@ contract L1BlockIsthmus is L1Block { /// keccak256(abi.encode(uint256(keccak256("l1Block.identifier.isDeposit")) - 1)) & ~bytes32(uint256(0xff)) uint256 internal constant IS_DEPOSIT_SLOT = 0x921bd3a089295c6e5540e8fba8195448d253efd6f2e3e495b499b627dc36a300; - /// @custom:semver +isthmus + /// @custom:semver +interop function version() public pure override returns (string memory) { - return string.concat(super.version(), "+isthmus"); + return string.concat(super.version(), "+interop"); } /// @notice Returns whether the call was triggered from a a deposit or not. @@ -70,10 +70,10 @@ contract L1BlockIsthmus is L1Block { return uint8(dependencySet.length()); } - /// @notice Updates the `isDeposit` flag and sets the L1 block values for an Isthmus upgraded chain. + /// @notice Updates the `isDeposit` flag and sets the L1 block values for an Interop upgraded chain. /// It updates the L1 block values through the `setL1BlockValuesEcotone` function. /// It forwards the calldata to the internally-used `setL1BlockValuesEcotone` function. - function setL1BlockValuesIsthmus() external { + function setL1BlockValuesInterop() external { // Set the isDeposit flag to true. assembly { sstore(IS_DEPOSIT_SLOT, 1) diff --git a/packages/contracts-bedrock/src/L2/interfaces/IL1BlockIsthmus.sol b/packages/contracts-bedrock/src/L2/interfaces/IL1BlockInterop.sol similarity index 96% rename from packages/contracts-bedrock/src/L2/interfaces/IL1BlockIsthmus.sol rename to packages/contracts-bedrock/src/L2/interfaces/IL1BlockInterop.sol index 7ff15eda51b0..2278e61624e9 100644 --- a/packages/contracts-bedrock/src/L2/interfaces/IL1BlockIsthmus.sol +++ b/packages/contracts-bedrock/src/L2/interfaces/IL1BlockInterop.sol @@ -7,7 +7,7 @@ enum ConfigType { REMOVE_DEPENDENCY } -interface IL1BlockIsthmus { +interface IL1BlockInterop { error AlreadyDependency(); error CantRemovedDependency(); error DependencySetSizeTooLarge(); @@ -52,7 +52,7 @@ interface IL1BlockIsthmus { ) external; function setL1BlockValuesEcotone() external; - function setL1BlockValuesIsthmus() external; + function setL1BlockValuesInterop() external; function timestamp() external view returns (uint64); function version() external pure returns (string memory); } diff --git a/packages/contracts-bedrock/src/libraries/Encoding.sol b/packages/contracts-bedrock/src/libraries/Encoding.sol index 7ab1a285841f..a47f437575c3 100644 --- a/packages/contracts-bedrock/src/libraries/Encoding.sol +++ b/packages/contracts-bedrock/src/libraries/Encoding.sol @@ -184,7 +184,7 @@ library Encoding { /// @param _blobBaseFee L1 blob base fee. /// @param _hash L1 blockhash. /// @param _batcherHash Versioned hash to authenticate batcher by. - function encodeSetL1BlockValuesIsthmus( + function encodeSetL1BlockValuesInterop( uint32 _baseFeeScalar, uint32 _blobBaseFeeScalar, uint64 _sequenceNumber, @@ -199,7 +199,7 @@ library Encoding { pure returns (bytes memory) { - bytes4 functionSignature = bytes4(keccak256("setL1BlockValuesIsthmus()")); + bytes4 functionSignature = bytes4(keccak256("setL1BlockValuesInterop()")); return abi.encodePacked( functionSignature, _baseFeeScalar, diff --git a/packages/contracts-bedrock/test/BenchmarkTest.t.sol b/packages/contracts-bedrock/test/BenchmarkTest.t.sol index 063ed6944946..a129736c771b 100644 --- a/packages/contracts-bedrock/test/BenchmarkTest.t.sol +++ b/packages/contracts-bedrock/test/BenchmarkTest.t.sol @@ -10,7 +10,7 @@ import { Bridge_Initializer } from "test/setup/Bridge_Initializer.sol"; // Libraries import { Types } from "src/libraries/Types.sol"; import { SafeCall } from "src/libraries/SafeCall.sol"; -import { L1BlockIsthmus } from "src/L2/L1BlockIsthmus.sol"; +import { L1BlockInterop } from "src/L2/L1BlockInterop.sol"; import { Encoding } from "src/libraries/Encoding.sol"; // Interfaces @@ -254,13 +254,13 @@ contract GasBenchMark_L1Block_SetValuesEcotone_Warm is GasBenchMark_L1Block { } } -contract GasBenchMark_L1BlockIsthmus is GasBenchMark_L1Block { - L1BlockIsthmus l1BlockIsthmus; +contract GasBenchMark_L1BlockInterop is GasBenchMark_L1Block { + L1BlockInterop l1BlockInterop; function setUp() public virtual override { super.setUp(); - l1BlockIsthmus = new L1BlockIsthmus(); - setValuesCalldata = Encoding.encodeSetL1BlockValuesIsthmus( + l1BlockInterop = new L1BlockInterop(); + setValuesCalldata = Encoding.encodeSetL1BlockValuesInterop( type(uint32).max, type(uint32).max, type(uint64).max, @@ -274,42 +274,42 @@ contract GasBenchMark_L1BlockIsthmus is GasBenchMark_L1Block { } } -contract GasBenchMark_L1BlockIsthmus_SetValuesIsthmus is GasBenchMark_L1BlockIsthmus { - function test_setL1BlockValuesIsthmus_benchmark() external { - SafeCall.call({ _target: address(l1BlockIsthmus), _calldata: setValuesCalldata }); +contract GasBenchMark_L1BlockInterop_SetValuesInterop is GasBenchMark_L1BlockInterop { + function test_setL1BlockValuesInterop_benchmark() external { + SafeCall.call({ _target: address(l1BlockInterop), _calldata: setValuesCalldata }); } } -contract GasBenchMark_L1BlockIsthmus_SetValuesIsthmus_Warm is GasBenchMark_L1BlockIsthmus { +contract GasBenchMark_L1BlockInterop_SetValuesInterop_Warm is GasBenchMark_L1BlockInterop { function setUp() public virtual override { - SafeCall.call({ _target: address(l1BlockIsthmus), _calldata: setValuesCalldata }); + SafeCall.call({ _target: address(l1BlockInterop), _calldata: setValuesCalldata }); } - function test_setL1BlockValuesIsthmus_benchmark() external { - SafeCall.call({ _target: address(l1BlockIsthmus), _calldata: setValuesCalldata }); + function test_setL1BlockValuesInterop_benchmark() external { + SafeCall.call({ _target: address(l1BlockInterop), _calldata: setValuesCalldata }); } } -contract GasBenchMark_L1BlockIsthmus_DepositsComplete is GasBenchMark_L1BlockIsthmus { +contract GasBenchMark_L1BlockInterop_DepositsComplete is GasBenchMark_L1BlockInterop { function test_depositsComplete_benchmark() external { SafeCall.call({ - _target: address(l1BlockIsthmus), - _calldata: abi.encodeWithSelector(l1BlockIsthmus.depositsComplete.selector) + _target: address(l1BlockInterop), + _calldata: abi.encodeWithSelector(l1BlockInterop.depositsComplete.selector) }); } } -contract GasBenchMark_L1BlockIsthmus_DepositsComplete_Warm is GasBenchMark_L1BlockIsthmus { +contract GasBenchMark_L1BlockInterop_DepositsComplete_Warm is GasBenchMark_L1BlockInterop { function setUp() public virtual override { super.setUp(); // Set the isDeposit flag to true so then we can benchmark when it is reset. - SafeCall.call({ _target: address(l1BlockIsthmus), _calldata: setValuesCalldata }); + SafeCall.call({ _target: address(l1BlockInterop), _calldata: setValuesCalldata }); } function test_depositsComplete_benchmark() external { SafeCall.call({ - _target: address(l1BlockIsthmus), - _calldata: abi.encodeWithSelector(l1BlockIsthmus.depositsComplete.selector) + _target: address(l1BlockInterop), + _calldata: abi.encodeWithSelector(l1BlockInterop.depositsComplete.selector) }); } } diff --git a/packages/contracts-bedrock/test/L1/OptimismPortalInterop.t.sol b/packages/contracts-bedrock/test/L1/OptimismPortalInterop.t.sol index 6e0235774df6..bc9a980276aa 100644 --- a/packages/contracts-bedrock/test/L1/OptimismPortalInterop.t.sol +++ b/packages/contracts-bedrock/test/L1/OptimismPortalInterop.t.sol @@ -12,7 +12,7 @@ import "src/libraries/PortalErrors.sol"; // Target contract dependencies import "src/libraries/PortalErrors.sol"; import { OptimismPortalInterop } from "src/L1/OptimismPortalInterop.sol"; -import { L1BlockIsthmus, ConfigType } from "src/L2/L1BlockIsthmus.sol"; +import { L1BlockInterop, ConfigType } from "src/L2/L1BlockInterop.sol"; // Interfaces import { IOptimismPortalInterop } from "src/L1/interfaces/IOptimismPortalInterop.sol"; @@ -35,7 +35,7 @@ contract OptimismPortalInterop_Test is CommonTest { _mint: 0, _gasLimit: 200_000, _isCreation: false, - _data: abi.encodeCall(L1BlockIsthmus.setConfig, (ConfigType.SET_GAS_PAYING_TOKEN, _value)) + _data: abi.encodeCall(L1BlockInterop.setConfig, (ConfigType.SET_GAS_PAYING_TOKEN, _value)) }); vm.prank(address(_optimismPortalInterop().systemConfig())); @@ -58,7 +58,7 @@ contract OptimismPortalInterop_Test is CommonTest { _mint: 0, _gasLimit: 200_000, _isCreation: false, - _data: abi.encodeCall(L1BlockIsthmus.setConfig, (ConfigType.ADD_DEPENDENCY, _value)) + _data: abi.encodeCall(L1BlockInterop.setConfig, (ConfigType.ADD_DEPENDENCY, _value)) }); vm.prank(address(_optimismPortalInterop().systemConfig())); @@ -81,7 +81,7 @@ contract OptimismPortalInterop_Test is CommonTest { _mint: 0, _gasLimit: 200_000, _isCreation: false, - _data: abi.encodeCall(L1BlockIsthmus.setConfig, (ConfigType.REMOVE_DEPENDENCY, _value)) + _data: abi.encodeCall(L1BlockInterop.setConfig, (ConfigType.REMOVE_DEPENDENCY, _value)) }); vm.prank(address(_optimismPortalInterop().systemConfig())); diff --git a/packages/contracts-bedrock/test/L1/SystemConfigInterop.t.sol b/packages/contracts-bedrock/test/L1/SystemConfigInterop.t.sol index 6cd3c8b3145c..0e47529c760c 100644 --- a/packages/contracts-bedrock/test/L1/SystemConfigInterop.t.sol +++ b/packages/contracts-bedrock/test/L1/SystemConfigInterop.t.sol @@ -6,7 +6,7 @@ import { CommonTest } from "test/setup/CommonTest.sol"; // Contracts import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; -import { ConfigType } from "src/L2/L1BlockIsthmus.sol"; +import { ConfigType } from "src/L2/L1BlockInterop.sol"; // Libraries import { Constants } from "src/libraries/Constants.sol"; diff --git a/packages/contracts-bedrock/test/L2/CrossL2Inbox.t.sol b/packages/contracts-bedrock/test/L2/CrossL2Inbox.t.sol index 0d3175d41ed1..8078e2c01c74 100644 --- a/packages/contracts-bedrock/test/L2/CrossL2Inbox.t.sol +++ b/packages/contracts-bedrock/test/L2/CrossL2Inbox.t.sol @@ -19,7 +19,7 @@ import { NotDepositor, InteropStartAlreadySet } from "src/L2/CrossL2Inbox.sol"; -import { IL1BlockIsthmus } from "src/L2/interfaces/IL1BlockIsthmus.sol"; +import { IL1BlockInterop } from "src/L2/interfaces/IL1BlockInterop.sol"; import { ICrossL2Inbox } from "src/L2/interfaces/ICrossL2Inbox.sol"; /// @title CrossL2InboxWithModifiableTransientStorage @@ -160,7 +160,7 @@ contract CrossL2InboxTest is Test { // Ensure is not a deposit transaction vm.mockCall({ callee: Predeploys.L1_BLOCK_ATTRIBUTES, - data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), + data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector), returnData: abi.encode(false) }); @@ -222,7 +222,7 @@ contract CrossL2InboxTest is Test { // Ensure is not a deposit transaction vm.mockCall({ callee: Predeploys.L1_BLOCK_ATTRIBUTES, - data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), + data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector), returnData: abi.encode(false) }); @@ -282,7 +282,7 @@ contract CrossL2InboxTest is Test { // Ensure it is a deposit transaction vm.mockCall({ callee: Predeploys.L1_BLOCK_ATTRIBUTES, - data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), + data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector), returnData: abi.encode(true) }); @@ -312,7 +312,7 @@ contract CrossL2InboxTest is Test { // Ensure is not a deposit transaction vm.mockCall({ callee: Predeploys.L1_BLOCK_ATTRIBUTES, - data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), + data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector), returnData: abi.encode(false) }); @@ -346,7 +346,7 @@ contract CrossL2InboxTest is Test { // Ensure is not a deposit transaction vm.mockCall({ callee: Predeploys.L1_BLOCK_ATTRIBUTES, - data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), + data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector), returnData: abi.encode(false) }); @@ -375,7 +375,7 @@ contract CrossL2InboxTest is Test { // Ensure is not a deposit transaction vm.mockCall({ callee: Predeploys.L1_BLOCK_ATTRIBUTES, - data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), + data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector), returnData: abi.encode(false) }); @@ -419,7 +419,7 @@ contract CrossL2InboxTest is Test { // Ensure is not a deposit transaction vm.mockCall({ callee: Predeploys.L1_BLOCK_ATTRIBUTES, - data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), + data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector), returnData: abi.encode(false) }); @@ -464,7 +464,7 @@ contract CrossL2InboxTest is Test { // Ensure is not a deposit transaction vm.mockCall({ callee: Predeploys.L1_BLOCK_ATTRIBUTES, - data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), + data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector), returnData: abi.encode(false) }); @@ -485,7 +485,7 @@ contract CrossL2InboxTest is Test { // Ensure it is a deposit transaction vm.mockCall({ callee: Predeploys.L1_BLOCK_ATTRIBUTES, - data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), + data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector), returnData: abi.encode(true) }); @@ -508,7 +508,7 @@ contract CrossL2InboxTest is Test { // Ensure is not a deposit transaction vm.mockCall({ callee: Predeploys.L1_BLOCK_ATTRIBUTES, - data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), + data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector), returnData: abi.encode(false) }); @@ -537,7 +537,7 @@ contract CrossL2InboxTest is Test { // Ensure is not a deposit transaction vm.mockCall({ callee: Predeploys.L1_BLOCK_ATTRIBUTES, - data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), + data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector), returnData: abi.encode(false) }); @@ -571,7 +571,7 @@ contract CrossL2InboxTest is Test { // Ensure is not a deposit transaction vm.mockCall({ callee: Predeploys.L1_BLOCK_ATTRIBUTES, - data: abi.encodeWithSelector(IL1BlockIsthmus.isDeposit.selector), + data: abi.encodeWithSelector(IL1BlockInterop.isDeposit.selector), returnData: abi.encode(false) }); diff --git a/packages/contracts-bedrock/test/L2/L1BlockIsthmus.t.sol b/packages/contracts-bedrock/test/L2/L1BlockIsthmus.t.sol index 1c2407dd73ab..6f0ef2188b8c 100644 --- a/packages/contracts-bedrock/test/L2/L1BlockIsthmus.t.sol +++ b/packages/contracts-bedrock/test/L2/L1BlockIsthmus.t.sol @@ -8,17 +8,17 @@ import { CommonTest } from "test/setup/CommonTest.sol"; import { StaticConfig } from "src/libraries/StaticConfig.sol"; // Target contract dependencies -import { L1BlockIsthmus, ConfigType } from "src/L2/L1BlockIsthmus.sol"; +import { L1BlockInterop, ConfigType } from "src/L2/L1BlockInterop.sol"; import { Predeploys } from "src/libraries/Predeploys.sol"; import "src/libraries/L1BlockErrors.sol"; -contract L1BlockIsthmusTest is CommonTest { +contract L1BlockInteropTest is CommonTest { event GasPayingTokenSet(address indexed token, uint8 indexed decimals, bytes32 name, bytes32 symbol); event DependencyAdded(uint256 indexed chainId); event DependencyRemoved(uint256 indexed chainId); modifier prankDepositor() { - vm.startPrank(_l1BlockIsthmus().DEPOSITOR_ACCOUNT()); + vm.startPrank(_l1BlockInterop().DEPOSITOR_ACCOUNT()); _; vm.stopPrank(); } @@ -34,14 +34,14 @@ contract L1BlockIsthmusTest is CommonTest { function testFuzz_isInDependencySet_succeeds(uint256 _chainId) public prankDepositor { vm.assume(_chainId != block.chainid); - _l1BlockIsthmus().setConfig(ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(_chainId)); + _l1BlockInterop().setConfig(ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(_chainId)); - assertTrue(_l1BlockIsthmus().isInDependencySet(_chainId)); + assertTrue(_l1BlockInterop().isInDependencySet(_chainId)); } /// @dev Tests that `isInDependencySet` returns true when the chain's chain ID is passed as the input. function test_isInDependencySet_chainChainId_succeeds() public view { - assertTrue(_l1BlockIsthmus().isInDependencySet(block.chainid)); + assertTrue(_l1BlockInterop().isInDependencySet(block.chainid)); } /// @dev Tests that `isInDependencySet` reverts when the input chain ID is not in the dependency set @@ -50,16 +50,16 @@ contract L1BlockIsthmusTest is CommonTest { vm.assume(_chainId != block.chainid); // Check that the chain ID is not in the dependency set - assertFalse(_l1BlockIsthmus().isInDependencySet(_chainId)); + assertFalse(_l1BlockInterop().isInDependencySet(_chainId)); } /// @dev Tests that `isInDependencySet` returns false when the dependency set is empty. function testFuzz_isInDependencySet_dependencySetEmpty_succeeds(uint256 _chainId) public view { vm.assume(_chainId != block.chainid); - assertEq(_l1BlockIsthmus().dependencySetSize(), 0); + assertEq(_l1BlockInterop().dependencySetSize(), 0); - assertFalse(_l1BlockIsthmus().isInDependencySet(_chainId)); + assertFalse(_l1BlockInterop().isInDependencySet(_chainId)); } /// @dev Tests that the dependency set size is correct when adding an arbitrary number of chain IDs. @@ -70,16 +70,16 @@ contract L1BlockIsthmusTest is CommonTest { for (uint256 i = 0; i < _dependencySetSize; i++) { if (i == block.chainid) continue; - _l1BlockIsthmus().setConfig(ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(i)); + _l1BlockInterop().setConfig(ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(i)); uniqueCount++; } - assertEq(_l1BlockIsthmus().dependencySetSize(), uniqueCount); + assertEq(_l1BlockInterop().dependencySetSize(), uniqueCount); } /// @dev Tests that the dependency set size is correct when the dependency set is empty. function test_dependencySetSize_dependencySetEmpty_succeeds() public view { - assertEq(_l1BlockIsthmus().dependencySetSize(), 0); + assertEq(_l1BlockInterop().dependencySetSize(), 0); } /// @dev Tests that the config for setting the gas paying token succeeds. @@ -97,7 +97,7 @@ contract L1BlockIsthmusTest is CommonTest { vm.expectEmit(address(l1Block)); emit GasPayingTokenSet({ token: _token, decimals: _decimals, name: _name, symbol: _symbol }); - _l1BlockIsthmus().setConfig( + _l1BlockInterop().setConfig( ConfigType.SET_GAS_PAYING_TOKEN, StaticConfig.encodeSetGasPayingToken({ _token: _token, _decimals: _decimals, _name: _name, _symbol: _symbol }) ); @@ -115,7 +115,7 @@ contract L1BlockIsthmusTest is CommonTest { vm.assume(_token != address(vm)); vm.expectRevert(NotDepositor.selector); - _l1BlockIsthmus().setConfig( + _l1BlockInterop().setConfig( ConfigType.SET_GAS_PAYING_TOKEN, StaticConfig.encodeSetGasPayingToken({ _token: _token, _decimals: _decimals, _name: _name, _symbol: _symbol }) ); @@ -128,41 +128,41 @@ contract L1BlockIsthmusTest is CommonTest { vm.expectEmit(address(l1Block)); emit DependencyAdded(_chainId); - _l1BlockIsthmus().setConfig(ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(_chainId)); + _l1BlockInterop().setConfig(ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(_chainId)); } /// @dev Tests that adding a dependency reverts if it's the chain's chain id function test_setConfig_addDependency_chainChainId_reverts() public prankDepositor { vm.expectRevert(AlreadyDependency.selector); - _l1BlockIsthmus().setConfig(ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(block.chainid)); + _l1BlockInterop().setConfig(ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(block.chainid)); } /// @dev Tests that adding a dependency already in the set reverts function test_setConfig_addDependency_alreadyDependency_reverts(uint256 _chainId) public prankDepositor { vm.assume(_chainId != block.chainid); - _l1BlockIsthmus().setConfig(ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(_chainId)); + _l1BlockInterop().setConfig(ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(_chainId)); vm.expectRevert(AlreadyDependency.selector); - _l1BlockIsthmus().setConfig(ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(_chainId)); + _l1BlockInterop().setConfig(ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(_chainId)); } /// @dev Tests that setting the add dependency config as not the depositor reverts. function testFuzz_setConfig_addDependency_notDepositor_reverts(uint256 _chainId) public { vm.expectRevert(NotDepositor.selector); - _l1BlockIsthmus().setConfig(ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(_chainId)); + _l1BlockInterop().setConfig(ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(_chainId)); } /// @dev Tests that setting the add dependency config when the dependency set size is too large reverts. function test_setConfig_addDependency_dependencySetSizeTooLarge_reverts() public prankDepositor { for (uint256 i = 0; i < type(uint8).max; i++) { - _l1BlockIsthmus().setConfig(ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(i)); + _l1BlockInterop().setConfig(ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(i)); } - assertEq(_l1BlockIsthmus().dependencySetSize(), type(uint8).max); + assertEq(_l1BlockInterop().dependencySetSize(), type(uint8).max); vm.expectRevert(DependencySetSizeTooLarge.selector); - _l1BlockIsthmus().setConfig(ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(1)); + _l1BlockInterop().setConfig(ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(1)); } /// @dev Tests that the config for removing a dependency can be set. @@ -170,24 +170,24 @@ contract L1BlockIsthmusTest is CommonTest { vm.assume(_chainId != block.chainid); // Add the chain ID to the dependency set before removing it - _l1BlockIsthmus().setConfig(ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(_chainId)); + _l1BlockInterop().setConfig(ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(_chainId)); vm.expectEmit(address(l1Block)); emit DependencyRemoved(_chainId); - _l1BlockIsthmus().setConfig(ConfigType.REMOVE_DEPENDENCY, StaticConfig.encodeRemoveDependency(_chainId)); + _l1BlockInterop().setConfig(ConfigType.REMOVE_DEPENDENCY, StaticConfig.encodeRemoveDependency(_chainId)); } /// @dev Tests that setting the remove dependency config as not the depositor reverts. function testFuzz_setConfig_removeDependency_notDepositor_reverts(uint256 _chainId) public { vm.expectRevert(NotDepositor.selector); - _l1BlockIsthmus().setConfig(ConfigType.REMOVE_DEPENDENCY, StaticConfig.encodeRemoveDependency(_chainId)); + _l1BlockInterop().setConfig(ConfigType.REMOVE_DEPENDENCY, StaticConfig.encodeRemoveDependency(_chainId)); } /// @dev Tests that setting the remove dependency config for the chain's chain ID reverts. function test_setConfig_removeDependency_chainChainId_reverts() public prankDepositor { vm.expectRevert(CantRemovedDependency.selector); - _l1BlockIsthmus().setConfig(ConfigType.REMOVE_DEPENDENCY, StaticConfig.encodeRemoveDependency(block.chainid)); + _l1BlockInterop().setConfig(ConfigType.REMOVE_DEPENDENCY, StaticConfig.encodeRemoveDependency(block.chainid)); } /// @dev Tests that setting the remove dependency config for a chain ID that is not in the dependency set reverts. @@ -195,50 +195,50 @@ contract L1BlockIsthmusTest is CommonTest { vm.assume(_chainId != block.chainid); vm.expectRevert(NotDependency.selector); - _l1BlockIsthmus().setConfig(ConfigType.REMOVE_DEPENDENCY, StaticConfig.encodeRemoveDependency(_chainId)); + _l1BlockInterop().setConfig(ConfigType.REMOVE_DEPENDENCY, StaticConfig.encodeRemoveDependency(_chainId)); } - /// @dev Returns the L1BlockIsthmus instance. - function _l1BlockIsthmus() internal view returns (L1BlockIsthmus) { - return L1BlockIsthmus(address(l1Block)); + /// @dev Returns the L1BlockInterop instance. + function _l1BlockInterop() internal view returns (L1BlockInterop) { + return L1BlockInterop(address(l1Block)); } } -contract L1BlockIsthmusIsDeposit_Test is L1BlockIsthmusTest { +contract L1BlockInteropIsDeposit_Test is L1BlockInteropTest { /// @dev Tests that `isDeposit` reverts if the caller is not the cross L2 inbox. function test_isDeposit_notCrossL2Inbox_reverts(address _caller) external { vm.assume(_caller != Predeploys.CROSS_L2_INBOX); vm.expectRevert(NotCrossL2Inbox.selector); - _l1BlockIsthmus().isDeposit(); + _l1BlockInterop().isDeposit(); } /// @dev Tests that `isDeposit` always returns the correct value. function test_isDeposit_succeeds() external { // Assert is false if the value is not updated vm.prank(Predeploys.CROSS_L2_INBOX); - assertEq(_l1BlockIsthmus().isDeposit(), false); + assertEq(_l1BlockInterop().isDeposit(), false); - /// @dev Assuming that `setL1BlockValuesIsthmus` will set the proper value. That function is tested as well - vm.prank(_l1BlockIsthmus().DEPOSITOR_ACCOUNT()); - _l1BlockIsthmus().setL1BlockValuesIsthmus(); + /// @dev Assuming that `setL1BlockValuesInterop` will set the proper value. That function is tested as well + vm.prank(_l1BlockInterop().DEPOSITOR_ACCOUNT()); + _l1BlockInterop().setL1BlockValuesInterop(); // Assert is true if the value is updated vm.prank(Predeploys.CROSS_L2_INBOX); - assertEq(_l1BlockIsthmus().isDeposit(), true); + assertEq(_l1BlockInterop().isDeposit(), true); } } -contract L1BlockIsthmusSetL1BlockValuesIsthmus_Test is L1BlockIsthmusTest { - /// @dev Tests that `setL1BlockValuesIsthmus` reverts if sender address is not the depositor - function test_setL1BlockValuesIsthmus_notDepositor_reverts(address _caller) external { - vm.assume(_caller != _l1BlockIsthmus().DEPOSITOR_ACCOUNT()); +contract L1BlockInteropSetL1BlockValuesInterop_Test is L1BlockInteropTest { + /// @dev Tests that `setL1BlockValuesInterop` reverts if sender address is not the depositor + function test_setL1BlockValuesInterop_notDepositor_reverts(address _caller) external { + vm.assume(_caller != _l1BlockInterop().DEPOSITOR_ACCOUNT()); vm.prank(_caller); vm.expectRevert(NotDepositor.selector); - _l1BlockIsthmus().setL1BlockValuesIsthmus(); + _l1BlockInterop().setL1BlockValuesInterop(); } - /// @dev Tests that `setL1BlockValuesIsthmus` succeeds if sender address is the depositor - function test_setL1BlockValuesIsthmus_succeeds( + /// @dev Tests that `setL1BlockValuesInterop` succeeds if sender address is the depositor + function test_setL1BlockValuesInterop_succeeds( uint32 baseFeeScalar, uint32 blobBaseFeeScalar, uint64 sequenceNumber, @@ -251,62 +251,62 @@ contract L1BlockIsthmusSetL1BlockValuesIsthmus_Test is L1BlockIsthmusTest { ) external { - // Ensure the `isDepositTransaction` flag is false before calling `setL1BlockValuesIsthmus` + // Ensure the `isDepositTransaction` flag is false before calling `setL1BlockValuesInterop` vm.prank(Predeploys.CROSS_L2_INBOX); - assertEq(_l1BlockIsthmus().isDeposit(), false); + assertEq(_l1BlockInterop().isDeposit(), false); bytes memory setValuesEcotoneCalldata = abi.encodePacked( baseFeeScalar, blobBaseFeeScalar, sequenceNumber, timestamp, number, baseFee, blobBaseFee, hash, batcherHash ); - vm.prank(_l1BlockIsthmus().DEPOSITOR_ACCOUNT()); + vm.prank(_l1BlockInterop().DEPOSITOR_ACCOUNT()); (bool success,) = address(l1Block).call( - abi.encodePacked(L1BlockIsthmus.setL1BlockValuesIsthmus.selector, setValuesEcotoneCalldata) + abi.encodePacked(L1BlockInterop.setL1BlockValuesInterop.selector, setValuesEcotoneCalldata) ); assertTrue(success, "function call failed"); // Assert that the `isDepositTransaction` flag was properly set to true vm.prank(Predeploys.CROSS_L2_INBOX); - assertEq(_l1BlockIsthmus().isDeposit(), true); + assertEq(_l1BlockInterop().isDeposit(), true); // Assert `setL1BlockValuesEcotone` was properly called, forwarding the calldata to it - assertEq(_l1BlockIsthmus().baseFeeScalar(), baseFeeScalar, "base fee scalar not properly set"); - assertEq(_l1BlockIsthmus().blobBaseFeeScalar(), blobBaseFeeScalar, "blob base fee scalar not properly set"); - assertEq(_l1BlockIsthmus().sequenceNumber(), sequenceNumber, "sequence number not properly set"); - assertEq(_l1BlockIsthmus().timestamp(), timestamp, "timestamp not properly set"); - assertEq(_l1BlockIsthmus().number(), number, "number not properly set"); - assertEq(_l1BlockIsthmus().basefee(), baseFee, "base fee not properly set"); - assertEq(_l1BlockIsthmus().blobBaseFee(), blobBaseFee, "blob base fee not properly set"); - assertEq(_l1BlockIsthmus().hash(), hash, "hash not properly set"); - assertEq(_l1BlockIsthmus().batcherHash(), batcherHash, "batcher hash not properly set"); + assertEq(_l1BlockInterop().baseFeeScalar(), baseFeeScalar, "base fee scalar not properly set"); + assertEq(_l1BlockInterop().blobBaseFeeScalar(), blobBaseFeeScalar, "blob base fee scalar not properly set"); + assertEq(_l1BlockInterop().sequenceNumber(), sequenceNumber, "sequence number not properly set"); + assertEq(_l1BlockInterop().timestamp(), timestamp, "timestamp not properly set"); + assertEq(_l1BlockInterop().number(), number, "number not properly set"); + assertEq(_l1BlockInterop().basefee(), baseFee, "base fee not properly set"); + assertEq(_l1BlockInterop().blobBaseFee(), blobBaseFee, "blob base fee not properly set"); + assertEq(_l1BlockInterop().hash(), hash, "hash not properly set"); + assertEq(_l1BlockInterop().batcherHash(), batcherHash, "batcher hash not properly set"); } } -contract L1BlockDepositsComplete_Test is L1BlockIsthmusTest { +contract L1BlockDepositsComplete_Test is L1BlockInteropTest { // @dev Tests that `depositsComplete` reverts if the caller is not the depositor. function test_deposits_is_depositor_reverts(address _caller) external { - vm.assume(_caller != _l1BlockIsthmus().DEPOSITOR_ACCOUNT()); + vm.assume(_caller != _l1BlockInterop().DEPOSITOR_ACCOUNT()); vm.expectRevert(NotDepositor.selector); - _l1BlockIsthmus().depositsComplete(); + _l1BlockInterop().depositsComplete(); } // @dev Tests that `depositsComplete` succeeds if the caller is the depositor. function test_depositsComplete_succeeds() external { // Set the `isDeposit` flag to true - vm.prank(_l1BlockIsthmus().DEPOSITOR_ACCOUNT()); - _l1BlockIsthmus().setL1BlockValuesIsthmus(); + vm.prank(_l1BlockInterop().DEPOSITOR_ACCOUNT()); + _l1BlockInterop().setL1BlockValuesInterop(); // Assert that the `isDeposit` flag was properly set to true vm.prank(Predeploys.CROSS_L2_INBOX); - assertTrue(_l1BlockIsthmus().isDeposit()); + assertTrue(_l1BlockInterop().isDeposit()); // Call `depositsComplete` - vm.prank(_l1BlockIsthmus().DEPOSITOR_ACCOUNT()); - _l1BlockIsthmus().depositsComplete(); + vm.prank(_l1BlockInterop().DEPOSITOR_ACCOUNT()); + _l1BlockInterop().depositsComplete(); // Assert that the `isDeposit` flag was properly set to false /// @dev Assuming that `isDeposit()` wil return the proper value. That function is tested as well vm.prank(Predeploys.CROSS_L2_INBOX); - assertEq(_l1BlockIsthmus().isDeposit(), false); + assertEq(_l1BlockInterop().isDeposit(), false); } }