ens:set-contenthash
Set the content hash of an ENS name.
Supports runtime fields inside smart blocks. Use explicit @helper! expressions or captured outputs; other fields are evaluated at build time.
Syntax
Section titled “Syntax”ens:set-contenthash <name> <hash>Arguments
Section titled “Arguments”| Name | Type | Evaluation | Description |
|---|---|---|---|
name | string | Build time | ENS name (e.g. mydao.eth) |
hash | string | Runtime in smart blocks | Content hash ("ipfs://Qm…", "ipns://…", "skynet://…" or encoded 0x bytes) |
Examples
Section titled “Examples”load ens
# Point mydao.eth at an IPFS CIDens:set-contenthash mydao.eth "ipfs://QmRAQB6YaCyidP37UdDnjFY5vQuiBrcqdyoW1CuDgwxkD4"
# Point at an IPNS nameens:set-contenthash mydao.eth "ipns://k51qzi5uqu5dlvj2baxnqndepeb86cbk3ng7n3i46uzyxzyqj2xjonzllnv0v8"- On an ENSv2 name the record is written to the name's resolver in ENSv2's ETHRegistry, which must be an ENSv2 resolver (see ens:create-resolver), by an account with the role to set it there. Subnames of ENSv2 names are not supported yet.
- Accepts
ipfs,ipnsandskynetURIs (codec:hashorcodec://hash) or already-encoded EIP-15770xbytes (e.g. from@ens:contenthash).
See Also
Section titled “See Also”- @ens:contenthash — encode a content hash
- @ens:contenthash.of — read a content hash