How to use compact signatures with EIP2098 #3123
Replies: 4 comments 3 replies
-
UPDATE: It was a configuration error. You can ignore this. |
Beta Was this translation helpful? Give feedback.
-
@ricmoo Why does
equal to
and not:
|
Beta Was this translation helpful? Give feedback.
-
Hey @rahulrumalla I'm trying to use Openzeppelin's ECDSA.sol contract's (address signer, uint256 signerPK) = makeAddrAndKey("signer");
(uint8 v, bytes32 r, bytes32 s) = vm.sign(signerPK, hash);
bytes memory signature = abi.encodePacked(v, r, s);
address recoveredSigner = ECDSA.recover(hash, signature);
assertEq(recoveredSigner, signer); but I get the error VM::sign(<pk>, 0x46a4a6b86560880572154cc245188597806bacb2ed65aa43fdd0c670c5f762dc) [staticcall]
│ └─ ← 27, 0x1b5ae0bf91052a8ac3cfbc285fb915cca056865a1db7b832b851e2907107540b, 0x01a519d1066a48c2f4e43fb12f35144065c7dc82ee057f284502d34908703ca5
└─ ← "ECDSA: invalid signature 'v' value" Since you've solved this, just wanted to check if you could help here. I'm discussing this on another thread with Openzeppelin as well. Thread link. Let me know :) |
Beta Was this translation helpful? Give feedback.
-
can any one help me function removeLiquidityETHWithPermit( |
Beta Was this translation helpful? Give feedback.
-
Hi. I'm having trouble figuring out the right way to construct the argument using ethers.js for a contract that's using EIP2098
I'm using foundry and in my solidity unit tests, I'm able to call via the following. Sharing the following for reference on how the signature is constructed in the test
On the front-end using ethers, I am accessing the individual params of the signature to prepare the call to contract
I'm wondering what would be right signature param I need to use to call the contract with, is it
yParityAndS
orcompact
or?And would I need to encode this in a different way as the signature parameter on the function is
bytes
?Currently, the call is failing when using either the
compact
oryParityAndS
field. It could be something missed on the hash itself, but I wanted to check here if there was something obvious that I was doing wrong.Thanks 🙏
Beta Was this translation helpful? Give feedback.
All reactions