Skip to content
Lattice

IENSSubnameIssuer

Git Source

Title: IENSSubnameIssuer

Authors: David Dada <daveproxy80@gmail.com> (https://github.com/dadadave80), Modified from ENS (https://github.com/ensdomains/ens-contracts), Integrates the ENS NameWrapper (https://docs.ens.domains/wrapper/overview)

External interface for the ENS subname-issuer facet: lets a diamond that owns a parent ENS name mint subnames (e.g. treasury.myproto.eth) via the ENS NameWrapper.

Issuance is gated on ENS_SUBNAME_ISSUER_ROLE. The diamond must be authorized to modify the parent name in the NameWrapper. Setting the new subname's forward addr record and the child's reverse record are the owner's / child's responsibility (a future ENS reverse-record module). Verify the deployed NameWrapper signature for your chain before mainnet — see INameWrapper.

Functions

issueSubname

Mints label.<parent> via the NameWrapper, owned by owner with resolver set.

Gated on ENS_SUBNAME_ISSUER_ROLE. The diamond must own/approve parentNode in the NameWrapper. To make the subname forward-resolve, the owner sets the addr record on resolver; the child sets its reverse record via a future ENS reverse-record module.

function issueSubname(
        bytes32 parentNode,
        string calldata label,
        address owner,
        address resolver,
        uint64 ttl,
        uint32 fuses,
        uint64 expiry
    ) external returns (bytes32 node);

Parameters

NameTypeDescription
parentNodebytes32The parent name's node (wrapped + controlled by this diamond).
labelstringThe subname label.
owneraddressThe owner of the new subname.
resolveraddressThe resolver to set for the new subname.
ttluint64The TTL for the new subname.
fusesuint32The fuses to burn on the new subname.
expiryuint64The expiry timestamp for the new subname.

Returns

NameTypeDescription
nodebytes32The newly created subname's node.

setNameWrapper

Sets or rotates the NameWrapper (per-chain configuration).

Gated on ENS_SUBNAME_ISSUER_ROLE. Reverts ENSSubnameIssuerZeroNameWrapper for zero.

function setNameWrapper(address nameWrapper) external;

Parameters

NameTypeDescription
nameWrapperaddressThe NameWrapper to use.

nameWrapper

Returns the configured NameWrapper.

function nameWrapper() external view returns (address);

Returns

NameTypeDescription
<none>address

Events

NameWrapperSet

Emitted when the configured NameWrapper is set or rotated.

event NameWrapperSet(address indexed nameWrapper);

Parameters

NameTypeDescription
nameWrapperaddressThe NameWrapper address now in use.

SubnameIssued

Emitted when a subname is issued.

event SubnameIssued(bytes32 indexed parentNode, bytes32 indexed node, address indexed owner);

Parameters

NameTypeDescription
parentNodebytes32The parent name's node.
nodebytes32The newly created subname's node.
owneraddressThe owner assigned to the new subname.

Errors

ENSSubnameIssuerZeroNameWrapper

Thrown when a zero address is supplied as the NameWrapper.

error ENSSubnameIssuerZeroNameWrapper();