Skip to content
Lattice

ENSSubnameIssuer

Git Source

Inherits: IENSSubnameIssuer

Title: ENSSubnameIssuer

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)

Stateless Diamond facet letting a diamond that owns a parent ENS name mint subnames (e.g. treasury.myproto.eth) via the ENS NameWrapper.

All logic lives in ENSSubnameIssuerLib. Issuance is gated on ENS_SUBNAME_ISSUER_ROLE; the NameWrapper is supplied at init and rotated per chain via setNameWrapper.

Notes:

  • lattice-version: 0.1.0
  • lattice-source: Lattice original

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 virtual returns (bytes32);

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
<none>bytes32The 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 virtual;

Parameters

NameTypeDescription
nameWrapper_addressThe NameWrapper to use.

nameWrapper

Returns the configured NameWrapper.

function nameWrapper() external view virtual returns (address);

Returns

NameTypeDescription
<none>address

exportSelectors

ERC-8153 selector export: this facet's cuttable selectors, tightly packed (4 bytes each).

Excludes exportSelectors() itself (0x0ef22643) - it is never cut into a diamond. Order matches forge inspect ENSSubnameIssuer methodIdentifiers (alphabetical by signature); kept in exact parity by ExportSelectorsParityTest. Chunks: issueSubname(bytes32,string,address,address,uint64,uint32,uint64) 0xf15cd0d2 nameWrapper() 0xa8e5fbc0 setNameWrapper(address) 0x371412f1

function exportSelectors() external pure virtual returns (bytes memory selectors);

Returns

NameTypeDescription
selectorsbytes