Skip to content

isValidSignature implementation bug #54

Description

@MakiBM

There is a public view override of isValidSignature that does something strange which is probably causing an issue.

See attached image.

Screenshot 2024-04-18 at 12 43 03

Per interface, IERC1271 the isValidSignature is taking hash as its argument, while your implementation takes that through getMessageHash(abi.encode(digest)) where digest is actually already hashed.

We get our signature created on the wallet side using "sign typed data"

Wallet Address: 0x0353e55535b26cfeba6e2b4abd3feaa8c6477d0d
Signer Address: 0x719C69387f7644642FC0F3577FC1dDc996e42af3
Hash: 0x03fba88cd7469badb066eab75fde4e4c7d717000e522b86971690e83971afc4f
Signature: 0x0b50bcf153358604c8897471e244c4e585c95f5951414d849a89aaa85e8eb98a10610ddb050284c7d97af8cee50e24fe3d56db1a6a953b9591dfcdd0fd8e5d401c

Ecrecover return that signer is 0x719C69387f7644642FC0F3577FC1dDc996e42af3 (which is correct)
BUT, 0x0353e55535B26cFeba6E2b4ABD3fEAA8c6477d0D contract returns not correct value.

If everything’s ok, then isValidSignature should return 0x1626ba7e (as per https://ethereum.org/en/developers/tutorials/eip-1271-smart-contract-signatures/)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions