refactor: make ERC1271Forwarder.isValidSignature overridable - #61
Merged
Conversation
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.
mfw78
force-pushed
the
refactor/forwarder-overridable
branch
from
August 2, 2026 12:12
a716ee9 to
5a39e21
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on
develop. #59 is stacked on this, so this merges first.Two ABI-neutral token changes to
ERC1271Forwarder.isValidSignature:bytes memorytobytes calldata, andvirtual. Same selector, same external ABI, body untouched.Why
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 is not hypothetical. An owner that wants to answer both the ComposableCow order payload and a direct signature of its own has to implement
isValidSignaturetwice over and dispatch between them, which requires overriding this one.Nothing here assumes a
Safe, and it never did:isValidSafeSignaturetakes one only as a typed address,_authreads the registry's ownrootsandsingleOrders,test/ComposableCow.base.t.solalready hasTestNonSafeWallet, and_buildSignaturealready has a catch branch commented "Assume a non-Safe wallet". This makes that path usable by an owner that also has signature logic of its own.#60 carried more alongside this and is closed.
Verification
172 tests pass,
forge buildandforge fmt --checkclean, descriptors current. No behaviour changes, so no test changes.