Skip to content

Commit

Permalink
Update eth_signTypedData_v4 example (#274)
Browse files Browse the repository at this point in the history
The example `eth_signTypedData_v4` message has been updated to include
a field that can reproduce this bug: MetaMask/metamask-mobile#7792
That signing bug results in invalid signatures for any messages that
include a `bytes` field with the value `0x`.
  • Loading branch information
Gudahtt authored Nov 22, 2023
1 parent 3603320 commit e4778fc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2111,6 +2111,7 @@ const initializeFormElements = () => {
],
},
],
attachment: '0x',
},
primaryType: 'Mail',
types: {
Expand All @@ -2128,6 +2129,7 @@ const initializeFormElements = () => {
{ name: 'from', type: 'Person' },
{ name: 'to', type: 'Person[]' },
{ name: 'contents', type: 'string' },
{ name: 'attachment', type: 'bytes' },
],
Person: [
{ name: 'name', type: 'string' },
Expand Down Expand Up @@ -2181,6 +2183,7 @@ const initializeFormElements = () => {
],
},
],
attachment: '0x',
},
primaryType: 'Mail',
types: {
Expand All @@ -2198,6 +2201,7 @@ const initializeFormElements = () => {
{ name: 'from', type: 'Person' },
{ name: 'to', type: 'Person[]' },
{ name: 'contents', type: 'string' },
{ name: 'attachment', type: 'bytes' },
],
Person: [
{ name: 'name', type: 'string' },
Expand Down

0 comments on commit e4778fc

Please sign in to comment.