@ens:expiry
Registration expiry timestamp of a .eth name.
On-chain (@ens:expiry!): Mainnet only, since an assertion reads the chain it runs on, and an unregistered name reads as 0 rather than erroring.
Returns: number
Syntax
Section titled “Syntax”@ens:expiry(name)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
name | string | .eth second-level name (e.g. vitalik.eth) |
Examples
Section titled “Examples”# Check when a name expiresset $expiry @ens:expiry("vitalik.eth")print $expirySee Also
Section titled “See Also”On-chain face (@ens:expiry!)
Section titled “On-chain face (@ens:expiry!)”Mainnet only. An assertion is judged on the chain it runs on, and there is no way to reach the ENS registry from another chain, so the on-chain face refuses at composition time rather than staticcalling an address with no code and reverting opaquely later.
Sepolia is refused too, deliberately. The plain face resolves against mainnet
through a dedicated client, so a sepolia registry would answer about a
DIFFERENT namespace: @ens:expiry and @ens:expiry! would return two unrelated
answers and both would look right. Off mainnet, use the plain face — it
resolves at composition time and is not restricted by the executing chain.
- An unregistered name reads as
0. The plain face throws instead. - On ENSv2 the name is read where it is registered when the assertion is judged: in ENSv2's ETHRegistry for a .eth name, in its parent's subregistry for a subname; while its .eth name is still on ENS v1, on ENS v1. A name migrated between building and executing is read on ENSv2.
- An ENS v1 subname has no expiry and reads as
0; an ENSv2 subname has its own.