Blockwell

DCL Registrar

About

Stats

Public Functions 38
Event Types 16
Code Size 70,836 bytes

Library Use

Uses Address for address.

Approval Event

Parameters help
owner
address help
approved
address help
tokenId
uint256 help

ApprovalForAll Event

Parameters help
owner
address help
operator
address help
approved
bool help

BaseURI Event

Parameters help
_oldBaseURI
string help
_newBaseURI
string help

BaseUpdated Event

Parameters help
_previousBase
IBaseRegistrar help
_newBase
IBaseRegistrar help

CallForwarwedToResolver Event

Parameters help
_resolver
address help
_data
bytes help
res
bytes help

ControllerAdded Event

Parameters help
_controller
address help

ControllerRemoved Event

Parameters help
_controller
address help

DomainReclaimed Event

Parameters help
_tokenId
uint256 help

DomainTransferred Event

Parameters help
_newOwner
address help
_tokenId
uint256 help

MigrationFinished Event

Parameters help

NameRegistered Event

Parameters help
_caller
address help
_beneficiary
address help
_labelHash
bytes32 help
_subdomain
string help
_createdDate
uint256 help

OwnershipTransferred Event

Parameters help
previousOwner
address help
newOwner
address help

Reclaimed Event

Parameters help
_caller
address help
_owner
address help
_tokenId
uint256 help

RegistryUpdated Event

Parameters help
_previousRegistry
IENSRegistry help
_newRegistry
IENSRegistry help

ResolverUpdated Event

Parameters help
_oldResolver
address help
_newResolver
address help

Transfer Event

Parameters help
from
address help
to
address help
tokenId
uint256 help

Functions Expand All Collapse All

owner keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function owner() public view returns (address) {
        return _owner;
    }

isOwner keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function isOwner() public view returns (bool) {
        return _msgSender() == _owner;
    }

renounceOwnership keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
    function renounceOwnership() public onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

transferOwnership keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null

Requirements help

Source Code
    function transferOwnership(address newOwner) public onlyOwner {
        _transferOwnership(newOwner);
    }

balanceOf keyboard_arrow_up

Parameters help

Name Type
owner
address help

Properties

Visibility help public
Mutability help view

Requirements help

Source Code
    function balanceOf(address owner) public view returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");

        return _ownedTokensCount[owner].current();
    }

ownerOf keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help public
Mutability help view

Requirements help

Source Code
    function ownerOf(uint256 tokenId) public view returns (address) {
        address owner = _tokenOwner[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");

        return owner;
    }

safeTransferFrom keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function safeTransferFrom(address from, address to, uint256 tokenId) public {
        safeTransferFrom(from, to, tokenId, "");
    }

transferFrom keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function transferFrom(address from, address to, uint256 tokenId) public {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transferFrom(from, to, tokenId);
    }

approve keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function approve(address to, uint256 tokenId) public {
        address owner = ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _tokenApprovals[tokenId] = to;
        emit Approval(owner, to, tokenId);
    }

getApproved keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help public
Mutability help view

Requirements help

null
Source Code
    function getApproved(uint256 tokenId) public view returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

setApprovalForAll keyboard_arrow_up

Parameters help

Name Type
to
address help
approved
bool help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function setApprovalForAll(address to, bool approved) public {
        require(to != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][to] = approved;
        emit ApprovalForAll(_msgSender(), to, approved);
    }

isApprovedForAll keyboard_arrow_up

Parameters help

Name Type
owner
address help
operator
address help

Properties

Visibility help public
Mutability help view
Source Code
    function isApprovedForAll(address owner, address operator) public view returns (bool) {
        return _operatorApprovals[owner][operator];
    }

safeTransferFrom keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
tokenId
uint256 help
_data
bytes help

Properties

Visibility help public
Mutability help transaction
Source Code
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransferFrom(from, to, tokenId, _data);
    }

name keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function name() external view returns (string memory) {
        return _name;
    }

symbol keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function symbol() external view returns (string memory) {
        return _symbol;
    }

tokenURI keyboard_arrow_up

Parameters help

Name Type
_tokenId
uint256 help

Properties

Visibility help public
Mutability help view

Requirements help

null
Source Code
    function tokenURI(uint256 _tokenId) external view returns (string memory) {
        if (bytes(baseURI).length == 0) {
            return "";
        }

        require(_exists(_tokenId), "ERC721Metadata: received a URI query for a nonexistent token");
        return string(abi.encodePacked(baseURI, _toLowerCase(subdomains[bytes32(_tokenId)])));
    }

supportsInterface keyboard_arrow_up

Parameters help

Name Type
interfaceId
bytes4 help

Properties

Visibility help public
Mutability help view
Source Code
    function supportsInterface(bytes4 interfaceId) external view returns (bool) {
        return _supportedInterfaces[interfaceId];
    }

totalSupply keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function totalSupply() public view returns (uint256) {
        return _allTokens.length;
    }

tokenOfOwnerByIndex keyboard_arrow_up

Parameters help

Name Type
owner
address help
index
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
    function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) {
        require(index < balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

tokenByIndex keyboard_arrow_up

Parameters help

Name Type
index
uint256 help

Properties

Visibility help public
Mutability help view

Requirements help

Source Code
    function tokenByIndex(uint256 index) public view returns (uint256) {
        require(index < totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

migrateNames keyboard_arrow_up

Parameters help

Name Type
_names
bytes32[] help
_beneficiaries
address[] help
_createdDates
uint256[] help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
    function migrateNames(
        bytes32[] calldata _names,
        address[] calldata _beneficiaries,
        uint256[] calldata _createdDates
    ) external onlyOwner isNotMigrated {
        for (uint256 i = 0; i < _names.length; i++) {
            string memory name = _bytes32ToString(_names[i]);
            _register(
                name,
                keccak256(abi.encodePacked(_toLowerCase(name))),
                _beneficiaries[i],
                _createdDates[i]
            );
        }
    }

register keyboard_arrow_up

Parameters help

Name Type
_subdomain
string help
_beneficiary
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Requirements help

Source Code
    function register(
        string calldata _subdomain,
        address _beneficiary
    ) external onlyController isMigrated {
        // Make sure this contract owns the domain
        _checkOwnerOfDomain();
        // Create labelhash for the subdomain
        bytes32 subdomainLabelHash = keccak256(abi.encodePacked(_toLowerCase(_subdomain)));
        // Make sure it is free
        require(_available(subdomainLabelHash), "Subdomain already owned");
        // solium-disable-next-line security/no-block-members
        _register(_subdomain, subdomainLabelHash, _beneficiary, now);
    }

reclaim keyboard_arrow_up

Parameters help

Name Type
_tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyController checks for the following:
Source Code
    function reclaim(uint256 _tokenId) public onlyController {
        address owner = ownerOf(_tokenId);

        registry.setSubnodeOwner(domainNameHash, bytes32(_tokenId), ownerOf(_tokenId));

        emit Reclaimed(msg.sender, owner, _tokenId);
    }

reclaim keyboard_arrow_up

Parameters help

Name Type
_tokenId
uint256 help
_owner
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

null
Source Code
    function reclaim(uint256 _tokenId, address _owner) public {
        // Check if the sender is authorized to manage the subdomain
        require(
            _isApprovedOrOwner(msg.sender, _tokenId),
            "Only an authorized account can change the subdomain settings"
        );

        registry.setSubnodeOwner(domainNameHash, bytes32(_tokenId), _owner);

        emit Reclaimed(msg.sender, _owner, _tokenId);
    }

onERC721Received keyboard_arrow_up

Parameters help

Name Type
address help
address help
_tokenId
uint256 help
bytes help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function onERC721Received(
        address /* _operator */,
        address /* _from */,
        uint256 _tokenId,
        bytes memory /* _data */
    )
        public
        returns (bytes4)
    {
        require(msg.sender == address(base), "Only base can send NFTs to this contract");

        // Re-claim to update the owner at the ENS Registry
        base.reclaim(_tokenId, address(this));
        return ERC721_RECEIVED;
    }

available keyboard_arrow_up

Parameters help

Name Type
_subdomain
string help

Properties

Visibility help public
Mutability help view
Source Code
    function available(string memory _subdomain) public view returns (bool) {
        // Create labelhash for the subdomain
        bytes32 subdomainLabelHash = keccak256(abi.encodePacked(_toLowerCase(_subdomain)));
        return _available(subdomainLabelHash);
    }

getTokenId keyboard_arrow_up

Parameters help

Name Type
_subdomain
string help

Properties

Visibility help public
Mutability help view

Requirements help

null
Source Code
    function getTokenId(string memory _subdomain) public view returns (uint256) {
        string memory subdomain = _toLowerCase(_subdomain);
        bytes32 subdomainLabelHash = keccak256(abi.encodePacked(subdomain));
        uint256 tokenId = uint256(subdomainLabelHash);

        require(
            _exists(tokenId),
            "The subdomain is not registered"
        );

        return tokenId;
    }

getOwnerOf keyboard_arrow_up

Parameters help

Name Type
_subdomain
string help

Properties

Visibility help public
Mutability help view

Requirements help

Source Code
    function getOwnerOf(string memory _subdomain) public view returns (address) {
        return ownerOf(getTokenId(_subdomain));
    }

reclaimDomain keyboard_arrow_up

Parameters help

Name Type
_tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
    function reclaimDomain(uint256 _tokenId) public onlyOwner {
        base.reclaim(_tokenId, address(this));

        emit DomainReclaimed(_tokenId);
    }

transferDomainOwnership keyboard_arrow_up

Parameters help

Name Type
_owner
address help
_tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
    function transferDomainOwnership(address _owner, uint256 _tokenId) public onlyOwner {
        base.transferFrom(address(this), _owner, _tokenId);
        emit DomainTransferred(_owner, _tokenId);
    }

setResolver keyboard_arrow_up

Parameters help

Name Type
_resolver
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
    function setResolver(address _resolver) public onlyOwner {
        address resolver = registry.resolver(domainNameHash);

        require(_resolver.isContract(), "New resolver should be a contract");
        require(_resolver != resolver, "New resolver should be different from old");

        _checkNotAllowedAddresses(_resolver);

        registry.setResolver(domainNameHash, _resolver);

        emit ResolverUpdated(resolver, _resolver);
    }

forwardToResolver keyboard_arrow_up

Parameters help

Name Type
_data
bytes help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
    function forwardToResolver(bytes memory _data) public onlyOwner {
        address resolver = registry.resolver(domainNameHash);

        _checkNotAllowedAddresses(resolver);

        (bool success, bytes memory res) = resolver.call(_data);

        require(success, "Call failed");

        // Make sure this contract is still the owner of the domain
        _checkOwnerOfDomain();

        emit CallForwarwedToResolver(resolver, _data, res);
    }

addController keyboard_arrow_up

Parameters help

Name Type
controller
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
    function addController(address controller) external onlyOwner {
        require(!controllers[controller], "The controller was already added");
        controllers[controller] = true;
        emit ControllerAdded(controller);
    }

removeController keyboard_arrow_up

Parameters help

Name Type
controller
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
    function removeController(address controller) external onlyOwner {
        require(controllers[controller], "The controller is already disabled");
        controllers[controller] = false;
        emit ControllerRemoved(controller);
    }

updateRegistry keyboard_arrow_up

Parameters help

Name Type
_registry
IENSRegistry help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
    function updateRegistry(IENSRegistry _registry) public onlyOwner {
        require(registry != _registry, "New registry should be different from old");
        require(address(_registry).isContract(), "New registry should be a contract");

        emit RegistryUpdated(registry, _registry);

        registry = _registry;
    }

updateBase keyboard_arrow_up

Parameters help

Name Type
_base
IBaseRegistrar help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
    function updateBase(IBaseRegistrar _base) public onlyOwner {
        require(base != _base, "New base should be different from old");
        require(address(_base).isContract(), "New base should be a contract");

        emit BaseUpdated(base, _base);

        base = _base;
    }

updateBaseURI keyboard_arrow_up

Parameters help

Name Type
_baseURI
string help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null

Requirements help

Source Code
    function updateBaseURI(string memory _baseURI) public onlyOwner {
        require(
            keccak256(abi.encodePacked((baseURI))) != keccak256(abi.encodePacked((_baseURI))),
            "Base URI should be different from old"
        );
        emit BaseURI(baseURI, _baseURI);
        baseURI = _baseURI;
    }

migrationFinished keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
    function migrationFinished() external onlyOwner isNotMigrated {
        migrated = true;
        emit MigrationFinished();
    }