IENSSubnameIssuer
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
| Name | Type | Description |
|---|---|---|
| parentNode | bytes32 | The parent name's node (wrapped + controlled by this diamond). |
| label | string | The subname label. |
| owner | address | The owner of the new subname. |
| resolver | address | The resolver to set for the new subname. |
| ttl | uint64 | The TTL for the new subname. |
| fuses | uint32 | The fuses to burn on the new subname. |
| expiry | uint64 | The expiry timestamp for the new subname. |
Returns
| Name | Type | Description |
|---|---|---|
| node | bytes32 | The 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
| Name | Type | Description |
|---|---|---|
| nameWrapper | address | The NameWrapper to use. |
nameWrapper
Returns the configured NameWrapper.
function nameWrapper() external view returns (address);Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
Events
NameWrapperSet
Emitted when the configured NameWrapper is set or rotated.
event NameWrapperSet(address indexed nameWrapper);Parameters
| Name | Type | Description |
|---|---|---|
| nameWrapper | address | The NameWrapper address now in use. |
SubnameIssued
Emitted when a subname is issued.
event SubnameIssued(bytes32 indexed parentNode, bytes32 indexed node, address indexed owner);Parameters
| Name | Type | Description |
|---|---|---|
| parentNode | bytes32 | The parent name's node. |
| node | bytes32 | The newly created subname's node. |
| owner | address | The owner assigned to the new subname. |
Errors
ENSSubnameIssuerZeroNameWrapper
Thrown when a zero address is supplied as the NameWrapper.
error ENSSubnameIssuerZeroNameWrapper();