This is an example / proof-of-concept: Lockable resolver by serenae-fansubs · Pull Request #262 · ensdomains/ens-contracts · GitHub
Deployed on:
- Mainnet:
0x7759277C7E6c34230840c4C28d799fBb643CB23f
- Goerli:
0x59c227Bac76bB479FbD51e12032fDDD7179aBf9F
I wrote about this use-case a while ago (and also in that Mirror article): Lock resolved records | ENS Support
At the time I left that “custom resolver contract” as an exercise for the user to create. Well here is one I created and you can play around with now! It’s just a fork of the PublicResolver that allows the owner to “lock” various record types (or everything):
Lock specific record types
lockABI(node)
lockAddr(node)
lockContenthash(node)
lockDNS(node)
lockInterface(node)
lockName(node)
lockPubkey(node)
lockText(node)
Lock specific text record keys but not others
lockText(node, 'avatar')
lockText(node, 'url')
Lock everything
lockAll(node)
Once a specific record type (or everything) is locked, it cannot be unlocked.
This can be used in conjunction with the CANNOT_SET_RESOLVER
fuse on wrapped names to create an immutable name that is guaranteed to resolve to records forever (or at least until the name expires).
Example steps (on mainnet):
- Set the resolver on your name to
0x7759277C7E6c34230840c4C28d799fBb643CB23f
- Set the contenthash for your name: https://etherscan.io/address/0x7759277c7e6c34230840c4c28d799fbb643cb23f#writeContract#F19
- Lock the contenthash for your name: https://etherscan.io/address/0x7759277c7e6c34230840c4c28d799fbb643cb23f#writeContract#F6
- Revoke the wrapped “set resolver” permission
Now your ENS name/subname will resolve to that decentralized website and it cannot be changed (not even if name ownership changes).
With this solution, you do not need to send the name to a burn address to make a name immutable. You can retain ownership, and even retain the ability to edit whatever other records you want. So you can “lock all records” if you want, or you can pick-and-choose which ones to make immutable.
Hope it helps!