From e8fb8961ec00ac9714b02b0ccb932308fef1dd85 Mon Sep 17 00:00:00 2001 From: Flux <175354924+0xiamflux@users.noreply.github.com> Date: Thu, 25 Sep 2025 11:32:39 -0400 Subject: [PATCH 1/4] chore: add fmt fix to template --- src/template/L1PortalExecuteL2Call.sol | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/template/L1PortalExecuteL2Call.sol b/src/template/L1PortalExecuteL2Call.sol index a2968cd49d..be08de20f6 100644 --- a/src/template/L1PortalExecuteL2Call.sol +++ b/src/template/L1PortalExecuteL2Call.sol @@ -10,13 +10,7 @@ import {SimpleTaskBase} from "../tasks/types/SimpleTaskBase.sol"; /// @notice Interface for the OptimismPortal2 contract on L1. interface IOptimismPortal2 { - function depositTransaction( - address _to, - uint256 _value, - uint64 _gasLimit, - bool _isCreation, - bytes memory _data - ) + function depositTransaction(address _to, uint256 _value, uint64 _gasLimit, bool _isCreation, bytes memory _data) external payable; } @@ -114,9 +108,8 @@ contract L1PortalExecuteL2Call is SimpleTaskBase { /// @notice Validate that exactly one action to the portal with the expected calldata and value was captured. function _validate(VmSafe.AccountAccess[] memory, Action[] memory _actions, address) internal view override { - bytes memory _expected = abi.encodeCall( - IOptimismPortal2.depositTransaction, (l2Target, valueWei, gasLimit, isCreation, l2Data) - ); + bytes memory _expected = + abi.encodeCall(IOptimismPortal2.depositTransaction, (l2Target, valueWei, gasLimit, isCreation, l2Data)); bool _found; uint256 _matches; From 0a30c982a279ea4897c51a9ff3ff8f036e5783ba Mon Sep 17 00:00:00 2001 From: Flux <175354924+0xiamflux@users.noreply.github.com> Date: Thu, 25 Sep 2025 11:57:24 -0400 Subject: [PATCH 2/4] fix: lib import path in template --- src/template/L1PortalExecuteL2Call.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/template/L1PortalExecuteL2Call.sol b/src/template/L1PortalExecuteL2Call.sol index be08de20f6..01dadf9f32 100644 --- a/src/template/L1PortalExecuteL2Call.sol +++ b/src/template/L1PortalExecuteL2Call.sol @@ -4,8 +4,8 @@ pragma solidity 0.8.15; import {VmSafe} from "forge-std/Vm.sol"; import {stdToml} from "forge-std/StdToml.sol"; -import {MultisigTaskPrinter} from "../../libraries/MultisigTaskPrinter.sol"; -import {Action} from "../../libraries/MultisigTypes.sol"; +import {MultisigTaskPrinter} from "../libraries/MultisigTaskPrinter.sol"; +import {Action} from "../libraries/MultisigTypes.sol"; import {SimpleTaskBase} from "../tasks/types/SimpleTaskBase.sol"; /// @notice Interface for the OptimismPortal2 contract on L1. From 8bdcf19d4716a1929fff2b74bbab4899d066f5f4 Mon Sep 17 00:00:00 2001 From: Flux <175354924+0xiamflux@users.noreply.github.com> Date: Thu, 25 Sep 2025 12:11:11 -0400 Subject: [PATCH 3/4] refactor: make value passed to portal 0 --- src/template/L1PortalExecuteL2Call.sol | 13 +++---------- .../eth/014-noop-call-optimismportal/config.toml | 1 - 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/template/L1PortalExecuteL2Call.sol b/src/template/L1PortalExecuteL2Call.sol index 01dadf9f32..bf38365a6b 100644 --- a/src/template/L1PortalExecuteL2Call.sol +++ b/src/template/L1PortalExecuteL2Call.sol @@ -27,8 +27,6 @@ contract L1PortalExecuteL2Call is SimpleTaskBase { address public l2Target; /// @notice The calldata to be executed on l2Target. bytes public l2Data; - /// @notice The ETH value to forward to L2. - uint256 public valueWei; /// @notice The L2 gas limit. uint64 public gasLimit; /// @notice Whether to create a contract on L2. @@ -86,11 +84,6 @@ contract L1PortalExecuteL2Call is SimpleTaskBase { gasLimit = uint64(_gasLimitTmp); // Optional fields - valueWei = 0; - try vm.parseTomlUint(_toml, ".value") returns (uint256 _v) { - valueWei = _v; - } catch {} - isCreation = false; try vm.parseTomlBool(_toml, ".isCreation") returns (bool _b) { isCreation = _b; @@ -103,18 +96,18 @@ contract L1PortalExecuteL2Call is SimpleTaskBase { /// @notice Build the portal deposit action. WARNING: State changes here are reverted after capture. function _build(address) internal override { // Record the L1 portal call with value for action extraction. - IOptimismPortal2(portal).depositTransaction{value: valueWei}(l2Target, valueWei, gasLimit, isCreation, l2Data); + IOptimismPortal2(portal).depositTransaction(l2Target, 0, gasLimit, isCreation, l2Data); } /// @notice Validate that exactly one action to the portal with the expected calldata and value was captured. function _validate(VmSafe.AccountAccess[] memory, Action[] memory _actions, address) internal view override { bytes memory _expected = - abi.encodeCall(IOptimismPortal2.depositTransaction, (l2Target, valueWei, gasLimit, isCreation, l2Data)); + abi.encodeCall(IOptimismPortal2.depositTransaction, (l2Target, 0, gasLimit, isCreation, l2Data)); bool _found; uint256 _matches; for (uint256 _i = 0; _i < _actions.length; _i++) { - if (_actions[_i].target == portal && _actions[_i].value == valueWei) { + if (_actions[_i].target == portal && _actions[_i].value == 0) { if (keccak256(_actions[_i].arguments) == keccak256(_expected)) { _found = true; _matches++; diff --git a/test/tasks/example/eth/014-noop-call-optimismportal/config.toml b/test/tasks/example/eth/014-noop-call-optimismportal/config.toml index 3c3c71ca2f..939b3c231d 100644 --- a/test/tasks/example/eth/014-noop-call-optimismportal/config.toml +++ b/test/tasks/example/eth/014-noop-call-optimismportal/config.toml @@ -5,7 +5,6 @@ portal = "0xbEb5Fc579115071764c7423A4f12eDde41f106Ed" # L1 OptimismPortal l2Target = "0xcDF27F107725988f2261Ce2256bDfCdE8B382B10" # OptimismGovernor Proxy l2Data = "0x3659cfe6000000000000000000000000ecbf4ed9f47302f00f0f039a691e7db83bdd2624" # upgradeTo(currentImpl) -> 0xecbf4ed9f47302f00f0f039a691e7db83bdd2624 gasLimit = 500000 -value = 0 isCreation = false [addresses] From 1f551f39e74f83af2c0d9f31ddc23942ed55a3a8 Mon Sep 17 00:00:00 2001 From: Flux <175354924+0xiamflux@users.noreply.github.com> Date: Thu, 25 Sep 2025 12:15:37 -0400 Subject: [PATCH 4/4] fix: library path --- test/tasks/Regression.t.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tasks/Regression.t.sol b/test/tasks/Regression.t.sol index 76ec9a227b..0ebb6ccdfd 100644 --- a/test/tasks/Regression.t.sol +++ b/test/tasks/Regression.t.sol @@ -36,7 +36,7 @@ import {BlacklistGamesV400} from "src/template/BlacklistGamesV400.sol"; import {OPCMUpgradeV220toV410} from "src/template/OPCMUpgradeV220toV410.sol"; import {OPCMUpgradeV410} from "src/template/OPCMUpgradeV410.sol"; import {OPCMUpgradeSuperchainConfigV410} from "src/template/OPCMUpgradeSuperchainConfigV410.sol"; -import {L1PortalExecuteL2Call} from "src/improvements/template/L1PortalExecuteL2Call.sol"; +import {L1PortalExecuteL2Call} from "src/template/L1PortalExecuteL2Call.sol"; /// @notice Ensures that simulating the task consistently produces the same call data and data to sign. /// This guarantees determinism if a bug is introduced in the task logic, the call data or data to sign