Commit 2589194
fix: hash .gwei names like the contract instead of ethers namehash
ethers' namehash applies Unicode NFC normalization, but the GNS contract only
lowercases ASCII and hashes raw UTF-8 bytes. Composed/decomposed twins of a
name are distinct, separately-registerable tokens on-chain, yet namehash folds
them to one id, so a lookup of the decomposed form would silently resolve to
the composed form's owner. Reproduce the contract's namehash exactly (keccak
label chain, ASCII-lowercase only, no NFC); verified against the deployed
contract's computeId for ASCII, subdomain, CJK, and both café twins.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent dd36502 commit 2589194
2 files changed
Lines changed: 20 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
| 29 | + | |
28 | 30 | | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
29 | 34 | | |
30 | 35 | | |
31 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
32 | 46 | | |
33 | 47 | | |
34 | 48 | | |
| |||
0 commit comments