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

isValidSignature implementation bug #54

Open
MakiBM opened this issue Apr 18, 2024 · 0 comments
Open

isValidSignature implementation bug #54

MakiBM opened this issue Apr 18, 2024 · 0 comments

Comments

@MakiBM
Copy link

MakiBM commented Apr 18, 2024

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/)

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

1 participant