NameWrapper is ENS new imported contract. it can be used a wrap a domain name as 1155 NFT. When a domain is wrapped, domain owner need to invoke NameWrapper
's method to manage domain config for example resolver
, ttl
, subRecord
.
For more info about NameWrapper
, please refer to NameWrapper, and this introduction - ENS Name Wrapper: Features, Benefits & Possibilities in Web3
NameWrapper is compatible with 1155 API, which means wrapped names are ERC1155 tokens. In addition to implementing ERC1155, wrapped names have an ERC721-compatible ownerOf function to return the owner of a wrapped name.
NOTE: A name's 1155 tokenId in NameWrapper is the the namehash of the complete name
.
const namehash = require('eth-ens-namehash');
const name = 'domain.web3';
const tokenId = namehash.hash(name);
To wrap or unwrap a name, check this introduction
Related methods:
- wrapETH2LD
- unwrapETH2LD
- registerAndWrapETH2LD
- wrap
- unwrap
Currently if one buy a CNS name, it will automatically wrap the name.
function renew(
uint256 tokenId,
uint256 duration,
uint32 fuses,
uint64 expiry
) external override onlyController returns (uint256 expires);
function setSubnodeOwner(
bytes32 parentNode,
string calldata label,
address owner,
uint32 fuses,
uint64 expiry
)
function setSubnodeRecord(
bytes32 parentNode,
string memory label,
address owner,
address resolver,
uint64 ttl,
uint32 fuses,
uint64 expiry
)
function setRecord(
bytes32 node,
address owner,
address resolver,
uint64 ttl
)
function setResolver(bytes32 node, address resolver)
function setTTL(bytes32 node, uint64 ttl)
This method can return all domains owned by an address.
function userDomains(address user) public view returns (string[] memory);
The returned domains is encoded as DNS Name Notation and Message Compression Technique
- setApprovalForAll
- balanceOf
- safeTransferFrom