signTypedData presents uint as hexadecimal in MetaMask UI
See original GitHub issueHi @ricmoo thank you for the EIP712 integration,
I’m currently looking to move my projects to Signer.signTypedData
, everything I need works as expected, except I’m facing a presentational issue when signing data containing uint
type with MetaMask.
uint
,…,uint256
are presented to MetaMask’s users in hexadecimal format.uint
are displayed human readable when callingWeb3Provider.send('eth_signTypedData_v4', args)
.
The issue seems to be only presentational as the resulting signature is the same in both cases.
Here is a demo of the issue: https://codesandbox.io/s/gracious-raman-id9cg?file=/src/index.js
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Signing Data - MetaMask Docs
# Sign Typed Data Message Parameters · Will only be accepted for a specific website/contract. · Makes sure signatures are valid only where...
Read more >EIP-712: Signing and Verifying Typed Ethereum messages
Currently signed messages are an opaque hex string displayed to the user with little context about the items that make up the message....
Read more >Documentation - Ethers.js
A connection to the Ethereum network (a Provider); Holds your private key and can sign things (a Signer). Connecting to MetaMask. // A...
Read more >Populus Documentation - Web3.py
Allow hex for value field when validating via validate_payable() contracts method ... Add documentation for web3.py unit tests - #1324.
Read more >Changelog - metamask-extension - GitCode
The MetaMask browser extension enables browsing Ethereum blockchain ... #11153: Prevent UI crash when the transaction being retried or canceled is missing.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looks great, thank you @ricmoo! 🎉
The JSON-RPC definition of
signTypedData
is a bit loose in explaining what the payload should look like for values. Currently, I convert everything to a value compatible with results (e.g. quantity for numbers, which is a hex string without any leading zeros). I can make the payload generator return decimal numbers easy enough, but that should be something I would expect the client (i.e. MetaMask) to handle for display logic.I’ll ping them for their opinions and maybe they have better docs as to input value formats. 😃