dmihal / eth-permit

Lightweight library for signing ERC-2612 permit signatures.
https://www.npmjs.com/package/eth-permit
139 stars 30 forks source link

signERC2612Permit not working on Ganache/Buidler #2

Closed gorgos closed 2 years ago

gorgos commented 3 years ago

@dmihal I tried to fix it and the following changes made it work:

  1. Change https://github.com/dmihal/eth-permit/blob/5dfcfa5caa20012943b16c73b39c32f04fb6e1cc/src/rpc.ts#L37 to const result = await send(provider, 'eth_signTypedData', [fromAddress, JSON.parse(_typeData)]); (two changes)

  2. Add jsonrpc: '2.0', to https://github.com/dmihal/eth-permit/blob/5dfcfa5caa20012943b16c73b39c32f04fb6e1cc/src/rpc.ts#L4.

Do you have any insights on this?

ghardin1314 commented 3 years ago

Apparently metamask knows about this and a fix is shipped. Already working on firefox and will be working on chrome next week. Discussed here

dmihal commented 3 years ago

The new version tries eth_signTypedData_v4 & eth_signTypedData

Let me know if anyone's still having issues