How to create types for structs that have contract types instead of address? #4647
Unanswered
HareemSaad
asked this question in
Q&A
Replies: 1 comment 2 replies
-
You’re correct, the struct in ethers (and what Solidity does internally) should just be Can you provide an example with simple code that shows what is generated that is incorrect against what is correct? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The struct I want to sign using ether's v5.7 (or 6) is as following,
Now if I change IERC20 to address in the struct and the typehash on the contract side ether's seems to generate correct signatures, but with IERC20 it generates incorrect signatures.
(cross checked it with foundry vm.sign produces the correct signature which ercrecover accepts but the library does not)
I am more inclined to find out a way to somehow make it work without changing the contract, so is there a way it will work with IERC20 instead of address?
Basic implementation here -> https://github.com/HareemSaad/Hashv4-Typed-Singing-Discussion
P.S I know there was a similar discussion before but that did not revolve around ways to make it work or if it could work for that matter.
Beta Was this translation helpful? Give feedback.
All reactions