Skip to content
This repository was archived by the owner on Jan 24, 2021. It is now read-only.

Commit d773f20

Browse files
committedApr 3, 2020
Added example output to test.js.
1 parent 6712023 commit d773f20

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
 

‎test.js

+24
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,27 @@ console.dir(
2424

2525
), { depth: null }
2626
)
27+
// The output:
28+
// { formatId:
29+
// '0xe42d80bf41ec9c11a0a39c1fd6eefd7af8f53973a63d684fb96e8f7b020999ed',
30+
// formatStringIds:
31+
// [ '0x66d451826846c1df870209f7abb7844fb8764120f7f67f5d64f25efdadb4f02e',
32+
// '0xa1221a2f1ba88d8b8b253c04b62178470e289ec05d9c6b6665f0bc3370005e11' ],
33+
// strings:
34+
// [ { string:
35+
// 'Hello! Would you like to send "ricmoo.eth" $0.00512409557532672 (DAI)?',
36+
// metadata: { locale: 'en' } },
37+
// { string:
38+
// 'Bonjour! Souhaitez-vous transf\u{e9}rer 0,00512409557532672$ (DAI) \u{e0} "ricmoo.eth"?'
39+
// metadata: { locale: 'fr' } } ],
40+
// argTypes: [ 'bytes32', 'uint256', 'skip:string' ],
41+
// formatArgTypes: [ 'address', 'bytes32', 'bytes32', 'uint256' ],
42+
// bytes:
43+
// '0x1234567890123456789012345678901234567890e42d80bf41ec9c11a0a39c1fd6eefd7af8f53973a63d684fb96e8f7b020999edbf074faa138b72c65adbdcfb329847e4f2c04bde7f7dd7fcad5a52d2f395a5580000000000000000000000000000000000000000000000000012345678900000' }
44+
//
45+
// A UI that is using English would show:
46+
// Hello! Would you like to send "ricmoo.eth" $0.00512409557532672 (DAI)?
47+
//
48+
// And upon signing the bytes, a contract could easily verify that (as long as
49+
// the client correctly showed the above text and signed the bytes) that nothing
50+
// has been tampered with an the user agreed.

0 commit comments

Comments
 (0)
This repository has been archived.