From 5a39e21d2ed596296e8551228dc4dd84ec0dccb7 Mon Sep 17 00:00:00 2001 From: mfw78 Date: Sun, 2 Aug 2026 07:22:14 +0000 Subject: [PATCH] refactor: make ERC1271Forwarder.isValidSignature overridable Two ABI-neutral token changes: `bytes memory` to `bytes calldata`, and `virtual`. Same selector, same external ABI, body untouched. A contract co-inheriting this forwarder with another ERC-1271 implementation cannot compile otherwise: solc forbids co-inheriting public functions whose data locations differ, and the function was not overridable. That combination is what an EIP-7702 account needs, since it has to answer both the ComposableCow order payload and a direct owner signature. The account itself lives in nxm-rs/nexum-account and depends on this repository for the forwarder, so nothing else moves here. --- src/ERC1271Forwarder.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ERC1271Forwarder.sol b/src/ERC1271Forwarder.sol index 7ebe671d..6a1a2055 100644 --- a/src/ERC1271Forwarder.sol +++ b/src/ERC1271Forwarder.sol @@ -26,7 +26,7 @@ abstract contract ERC1271Forwarder is ERC1271 { * @param _hash GPv2Order.Data digest * @param signature The abi.encoded tuple of (GPv2Order.Data, ComposableCow.PayloadStruct) */ - function isValidSignature(bytes32 _hash, bytes memory signature) public view override returns (bytes4) { + function isValidSignature(bytes32 _hash, bytes calldata signature) public view virtual override returns (bytes4) { (GPv2Order.Data memory order, ComposableCow.PayloadStruct memory payload) = abi.decode(signature, (GPv2Order.Data, ComposableCow.PayloadStruct)); bytes32 domainSeparator = composableCow.domainSeparator();