Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function signature mismatch for isValidSignature() #440

Closed
shoenseiwaso opened this issue Sep 7, 2022 · 2 comments
Closed

Function signature mismatch for isValidSignature() #440

shoenseiwaso opened this issue Sep 7, 2022 · 2 comments
Assignees
Milestone

Comments

@shoenseiwaso
Copy link

The signature for isValidSignature() in contracts/interfaces/ISignatureValidator.sol mismatches with the one in contracts/handler/CompatibilityFallbackHandler.sol. Compilation fails with solc v0.8.16 (and probably others).

TypeError: Data locations of parameters have to be the same when overriding non-external functions, but they differ.
  --> contracts/handler/CompatibilityFallbackHandler.sol:28:5:
   |
28 |     function isValidSignature(bytes calldata _data, bytes calldata _signature) public view override returns (bytes4) {
   |     ^ (Relevant source part starts here and spans across multiple lines).
Note: Overridden function is here:
  --> contracts/interfaces/ISignatureValidator.sol:19:5:
   |
19 |     function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

One fix is to simply update the interface to match the implementation (i.e. memory ==> calldata).

@rmeissner
Copy link
Member

Already tracked here #394

@mmv08
Copy link
Member

mmv08 commented Jan 10, 2023

fixed by #394

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants