You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.
How to encode types for JSONRPC:
When encoding UNFORMATTED DATA ("byte arrays"): encode as hex, prefix with "0x", two hex digits per byte. Examples:
0x41 (size 1, "A")
0x004200 (size 3, "\0B\0")
0x (size 0, "")
WRONG: 0xf0f0f (must be even number of digits - should be 0x0f0f0f)
WRONG: 004200 (must be prefixed 0x - should be 0x004200)
When encoding QUANTITIES ("integers", "numbers"): encode as hex, prefix with "0x", the most compact representation (slight exception: zero should be represented as "0x0"). Examples:
0x41 (65 in decimal)
0x400 (1024 in decimal)
WRONG: 0x (should always have at least one digit - zero is "0x0")
WRONG: 0x0400 (no leading zeroes - should be 0x400)
return values of 0x00 should be 0x
UPDATE: per comment below zero should be represented as "0x0"
The text was updated successfully, but these errors were encountered: