Custom Registrar (Decentraland)
contract DCLRegistrar is ERC721Full, Ownable {
function _register(
string memory _subdomain,
bytes32 subdomainLabelHash,
address _beneficiary,
uint256 _createdDate
) internal {
// Create new subdomain and assign the _beneficiary as the owner
registry.setSubnodeOwner(domainNameHash, subdomainLabelHash, _beneficiary);
// Mint an ERC721 token with the sud domain label hash as its id
_mint(_beneficiary, uint256(subdomainLabelHash));
// Map the ERC721 token id with the subdomain for reversion.
subdomains[subdomainLabelHash] = _subdomain;
// Emit registered name event
emit NameRegistered(msg.sender, _beneficiary, subdomainLabelHash, _subdomain,
}
}