@ens:contenthash.of
Read the decoded content hash of an ENS name (e.g. ipfs://…).
On-chain (@ens:contenthash.of!): Mainnet only; reads the raw content hash bytes (compare against @ens:contenthash) rather than the decoded URI, and a missing record reads as empty bytes.
Returns: string
Syntax
Section titled “Syntax”@ens:contenthash.of(name)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
name | string | ENS name (e.g. vitalik.eth) |
Examples
Section titled “Examples”# Read the content hash behind a nameset $hash @ens:contenthash.of("vitalik.eth")print $hashOn-chain face (@ens:contenthash.of!)
Section titled “On-chain face (@ens:contenthash.of!)”Mainnet only. Reads the raw multicodec bytes the resolver holds — the
decoded ipfs://… rendering is off-chain work — through the
@addr!-shaped resolver chain, with a missing resolver reading as empty
bytes instead of erroring. The plain @ens:contenthash encoder produces
the same raw bytes from a URI, so pinning a site's content is:
assert @ens:contenthash.of!(mysite.eth) == @ens:contenthash("ipfs://Qm...")