solidity
solidity copied to clipboard
Support namehash at compile-time
In order to at least somewhat support ENS (we cannot fully support it because that creates issues with source verification), we could have compile-time evaluation of the namehash function on string literals.
bytse32 node = namehash("abc.def.eth");
Some pointers:
- https://twitter.com/nicksdjohnson/status/1397012527511334913
- https://github.com/danfinlay/eth-ens-namehash/blob/master/index.js
- https://github.com/ethers-io/ethers.js/blob/master/packages/strings/src.ts/idna.ts
Duplicate of #6956 ?
Maybe duplicate, but could also be sub-issue.
Suggestion: implement UTF normalization as a compiler builtin and implement namehash in the standard library.
Pro: This would allow us to gain experience with the standard library. Con: Unless we actually have compile-time evaluation of pure functions, this would still generate some runtime code (which hopefully would be optimised, i.e. the recent keccak256 optimiser steps).
The alternative to this is #1650 and have namehash supplied via JSON.
This issue has been marked as stale due to inactivity for the last 90 days. It will be automatically closed in 7 days.
Hi everyone! This issue has been automatically closed due to inactivity. If you think this issue is still relevant in the latest Solidity version and you have something to contribute, feel free to reopen. However, unless the issue is a concrete proposal that can be implemented, we recommend starting a language discussion on the forum instead.