Blockwell

.crypto

About

Stats

Public Functions 38
Event Types 7
Code Size 42,261 bytes

Events (7) keyboard_arrow_up

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

NewURI Event

Parameters help
tokenId
uint256 help
uri
string help

NewURIPrefix Event

Parameters help
prefix
string help

Resolve Event

Parameters help
tokenId
uint256 help
to
address help

Sync Event

Parameters help
resolver
address help
updateId
uint256 help
tokenId
uint256 help

Transfer Event

Parameters help
from
address help
to
address help
tokenId
uint256 help

_CRYPTO_HASH Constant

uint256 help
0x0f4a10a4f46c288cea365fcf45cccf0e9d901b945b9829ccdb54c10dc3cb7a6f

_ERC721_RECEIVED Constant

bytes4 help
0x150b7a02

_INTERFACE_ID_ERC721 Constant

bytes4 help
0x80ac58cd

_INTERFACE_ID_ERC165 Constant

bytes4 help
0x01ffc9a7

_tokenURIs Variable

mapping(uint256 => string) help
Internal Variable

_prefix Variable

string help
Internal Variable

_tokenResolvers Variable

mapping(uint256 => address) help
Internal Variable

_controllers Variable

Roles.Role help
Internal Variable

_tokenOwner Variable

mapping(uint256 => address) help
Internal Variable

_tokenApprovals Variable

mapping(uint256 => address) help
Internal Variable

_ownedTokensCount Variable

mapping(address => Counters.Counter) help
Internal Variable

_operatorApprovals Variable

mapping(address => mapping(address => bool)) help
Internal Variable

_supportedInterfaces Variable

mapping(bytes4 => bool) help
Internal Variable

Functions Expand All Collapse All

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, "");
}

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(msg.sender, tokenId),
    "ERC721: transfer caller is not owner nor approved"
  );

  _transferFrom(from, to, tokenId);
}

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(
    msg.sender == owner || isApprovedForAll(owner, msg.sender),
    "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
Source Code
function setApprovalForAll(address to, bool approved) public {
  require(to != msg.sender, "ERC721: approve to caller");

  _operatorApprovals[msg.sender][to] = approved;
  emit ApprovalForAll(msg.sender, 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 {
  transferFrom(from, to, tokenId);
  require(
    _checkOnERC721Received(from, to, tokenId, _data),
    "ERC721: transfer to non ERC721Receiver implementer"
  );
}

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];
}

burn keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function burn(uint256 tokenId) public {
  //solhint-disable-next-line max-line-length
  require(
    _isApprovedOrOwner(msg.sender, tokenId),
    "ERC721Burnable: caller is not owner nor approved"
  );
  _burn(tokenId);
}

isController keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help view
Source Code
function isController(address account) public view returns (bool) {
  return _controllers.has(account);
}

addController keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyController checks for the following:
null
Source Code
function addController(address account) public onlyController {
  _addController(account);
}

renounceController keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function renounceController() public {
  _removeController(msg.sender);
}

Parameters help

This function has no parameters.

Properties

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

Parameters help

This function has no parameters.

Properties

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

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) {
  require(_exists(tokenId));
  return string(abi.encodePacked(_prefix, _tokenURIs[tokenId]));
}

controlledSetTokenURIPrefix keyboard_arrow_up

Parameters help

Name Type
prefix
string help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyController checks for the following:
null
Source Code
function controlledSetTokenURIPrefix(string calldata prefix)
  external
  onlyController
{
  _prefix = prefix;
  emit NewURIPrefix(prefix);
}

isApprovedOrOwner keyboard_arrow_up

Parameters help

Name Type
spender
address help
tokenId
uint256 help

Properties

Visibility help public
Mutability help view

Requirements help

null
Source Code
function isApprovedOrOwner(address spender, uint256 tokenId)
  external
  view
  returns (bool)
{
  return _isApprovedOrOwner(spender, tokenId);
}

mintChild keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help
label
string help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyApprovedOrOwner checks for the following:
null
Source Code
function mintChild(
  address to,
  uint256 tokenId,
  string calldata label
) external onlyApprovedOrOwner(tokenId) {
  _mintChild(to, tokenId, label);
}

controlledMintChild keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help
label
string help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyController checks for the following:
null
Source Code
function controlledMintChild(
  address to,
  uint256 tokenId,
  string calldata label
) external onlyController {
  _mintChild(to, tokenId, label);
}

transferFromChild keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
tokenId
uint256 help
label
string help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyApprovedOrOwner checks for the following:
null
Source Code
function transferFromChild(
  address from,
  address to,
  uint256 tokenId,
  string calldata label
) external onlyApprovedOrOwner(tokenId) {
  _transferFrom(from, to, _childId(tokenId, label));
}

controlledTransferFrom keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyController checks for the following:
null
Source Code
function controlledTransferFrom(
  address from,
  address to,
  uint256 tokenId
) external onlyController {
  _transferFrom(from, to, tokenId);
}

safeTransferFromChild keyboard_arrow_up

Parameters help

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

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyApprovedOrOwner checks for the following:
null
Source Code
function safeTransferFromChild(
  address from,
  address to,
  uint256 tokenId,
  string memory label,
  bytes memory _data
) public onlyApprovedOrOwner(tokenId) {
  uint256 childId = _childId(tokenId, label);
  _transferFrom(from, to, childId);
  require(_checkOnERC721Received(from, to, childId, _data));
}

safeTransferFromChild keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
tokenId
uint256 help
label
string help

Properties

Visibility help public
Mutability help transaction
Source Code
function safeTransferFromChild(
  address from,
  address to,
  uint256 tokenId,
  string calldata label
) external {
  safeTransferFromChild(from, to, tokenId, label, "");
}

controlledSafeTransferFrom 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

Modifiers help

onlyController checks for the following:
null
Source Code
function controlledSafeTransferFrom(
  address from,
  address to,
  uint256 tokenId,
  bytes calldata _data
) external onlyController {
  _transferFrom(from, to, tokenId);
  require(_checkOnERC721Received(from, to, tokenId, _data));
}

burnChild keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help
label
string help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyApprovedOrOwner checks for the following:
null
Source Code
function burnChild(uint256 tokenId, string calldata label)
  external
  onlyApprovedOrOwner(tokenId)
{
  _burn(_childId(tokenId, label));
}

controlledBurn keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyController checks for the following:
null
Source Code
function controlledBurn(uint256 tokenId) external onlyController {
  _burn(tokenId);
}

resolveTo keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyApprovedOrOwner checks for the following:
null

Requirements help

null
Source Code
function resolveTo(address to, uint256 tokenId)
  external
  onlyApprovedOrOwner(tokenId)
{
  _resolveTo(to, tokenId);
}

resolverOf keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help public
Mutability help view

Requirements help

Source Code
function resolverOf(uint256 tokenId) external view returns (address) {
  address resolver = _tokenResolvers[tokenId];
  require(resolver != address(0));
  return resolver;
}

controlledResolveTo keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyController checks for the following:
null

Requirements help

null
Source Code
function controlledResolveTo(address to, uint256 tokenId)
  external
  onlyController
{
  _resolveTo(to, tokenId);
}

root keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help pure
Source Code
function root() public pure returns (uint256) {
  return _CRYPTO_HASH;
}

childIdOf keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help
label
string help

Properties

Visibility help public
Mutability help pure

Requirements help

Source Code
function childIdOf(uint256 tokenId, string calldata label)
  external
  pure
  returns (uint256)
{
  return _childId(tokenId, label);
}

safeMintChild keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help
label
string help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyApprovedOrOwner checks for the following:
null
Source Code
function safeMintChild(
  address to,
  uint256 tokenId,
  string calldata label
) external onlyApprovedOrOwner(tokenId) {
  _safeMintChild(to, tokenId, label, "");
}

safeMintChild keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help
label
string help
_data
bytes help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyApprovedOrOwner checks for the following:
null
Source Code
function safeMintChild(
  address to,
  uint256 tokenId,
  string calldata label,
  bytes calldata _data
) external onlyApprovedOrOwner(tokenId) {
  _safeMintChild(to, tokenId, label, _data);
}

controlledSafeMintChild keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help
label
string help
_data
bytes help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyController checks for the following:
null
Source Code
function controlledSafeMintChild(
  address to,
  uint256 tokenId,
  string calldata label,
  bytes calldata _data
) external onlyController {
  _safeMintChild(to, tokenId, label, _data);
}

setOwner keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyApprovedOrOwner checks for the following:
null
Source Code
function setOwner(address to, uint256 tokenId)
  external
  onlyApprovedOrOwner(tokenId)
{
  super._transferFrom(ownerOf(tokenId), to, tokenId);
}

sync keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help
updateId
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function sync(uint256 tokenId, uint256 updateId) external {
  require(_tokenResolvers[tokenId] == msg.sender);
  emit Sync(msg.sender, updateId, tokenId);
}

Internal Functions Expand All Collapse All

Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.

internal Registry._childId keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help
label
string help

Properties

Visibility help internal
Mutability help pure

Requirements help

Source Code
function _childId(uint256 tokenId, string memory label)
  internal
  pure
  returns (uint256)
{
  require(bytes(label).length != 0);
  return
    uint256(
      keccak256(abi.encodePacked(tokenId, keccak256(abi.encodePacked(label))))
    );
}

internal Registry._mintChild keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help
label
string help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _mintChild(
  address to,
  uint256 tokenId,
  string memory label
) internal {
  uint256 childId = _childId(tokenId, label);
  _mint(to, childId);

  require(bytes(label).length != 0);
  require(_exists(childId));

  bytes memory domain = abi.encodePacked(label, ".", _tokenURIs[tokenId]);

  _tokenURIs[childId] = string(domain);
  emit NewURI(childId, string(domain));
}

internal Registry._safeMintChild keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help
label
string help
_data
bytes help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _safeMintChild(
  address to,
  uint256 tokenId,
  string memory label,
  bytes memory _data
) internal {
  _mintChild(to, tokenId, label);
  require(
    _checkOnERC721Received(address(0), to, _childId(tokenId, label), _data)
  );
}

internal Registry._transferFrom keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
tokenId
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _transferFrom(
  address from,
  address to,
  uint256 tokenId
) internal {
  super._transferFrom(from, to, tokenId);
  // Clear resolver (if any)
  if (_tokenResolvers[tokenId] != address(0x0)) {
    delete _tokenResolvers[tokenId];
  }
}

internal Registry._burn keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _burn(uint256 tokenId) internal {
  super._burn(tokenId);
  // Clear resolver (if any)
  if (_tokenResolvers[tokenId] != address(0x0)) {
    delete _tokenResolvers[tokenId];
  }
  // Clear metadata (if any)
  if (bytes(_tokenURIs[tokenId]).length != 0) {
    delete _tokenURIs[tokenId];
  }
}

internal Registry._resolveTo keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

null
Source Code
function _resolveTo(address to, uint256 tokenId) internal {
  require(_exists(tokenId));
  emit Resolve(tokenId, to);
  _tokenResolvers[tokenId] = to;
}

internal ControllerRole._addController keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _addController(address account) internal {
  _controllers.add(account);
  // emit ControllerAdded(account);
}

internal ControllerRole._removeController keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _removeController(address account) internal {
  _controllers.remove(account);
  // emit ControllerRemoved(account);
}

internal ERC721._exists keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help internal
Mutability help view
Source Code
function _exists(uint256 tokenId) internal view returns (bool) {
  address owner = _tokenOwner[tokenId];
  return owner != address(0);
}

internal ERC721._isApprovedOrOwner keyboard_arrow_up

Parameters help

Name Type
spender
address help
tokenId
uint256 help

Properties

Visibility help internal
Mutability help view

Requirements help

null
Source Code
function _isApprovedOrOwner(address spender, uint256 tokenId)
  internal
  view
  returns (bool)
{
  require(_exists(tokenId), "ERC721: operator query for nonexistent token");
  address owner = ownerOf(tokenId);
  return (spender == owner ||
    getApproved(tokenId) == spender ||
    isApprovedForAll(owner, spender));
}

internal ERC721._mint keyboard_arrow_up

Parameters help

Name Type
to
address help
tokenId
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _mint(address to, uint256 tokenId) internal {
  require(to != address(0), "ERC721: mint to the zero address");
  require(!_exists(tokenId), "ERC721: token already minted");

  _tokenOwner[tokenId] = to;
  _ownedTokensCount[to].increment();

  emit Transfer(address(0), to, tokenId);
}

internal ERC721._burn keyboard_arrow_up

Parameters help

Name Type
owner
address help
tokenId
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _burn(address owner, uint256 tokenId) internal {
  require(ownerOf(tokenId) == owner, "ERC721: burn of token that is not own");

  _clearApproval(tokenId);

  _ownedTokensCount[owner].decrement();
  _tokenOwner[tokenId] = address(0);

  emit Transfer(owner, address(0), tokenId);
}

internal ERC721._burn keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _burn(uint256 tokenId) internal {
  _burn(ownerOf(tokenId), tokenId);
}

internal ERC721._transferFrom keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
tokenId
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _transferFrom(
  address from,
  address to,
  uint256 tokenId
) internal {
  require(
    ownerOf(tokenId) == from,
    "ERC721: transfer of token that is not own"
  );
  require(to != address(0), "ERC721: transfer to the zero address");

  _clearApproval(tokenId);

  _ownedTokensCount[from].decrement();
  _ownedTokensCount[to].increment();

  _tokenOwner[tokenId] = to;

  emit Transfer(from, to, tokenId);
}

internal ERC721._checkOnERC721Received keyboard_arrow_up

Parameters help

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

Properties

Visibility help internal
Mutability help transaction
Source Code
function _checkOnERC721Received(
  address from,
  address to,
  uint256 tokenId,
  bytes memory _data
) internal returns (bool) {
  if (!to.isContract()) {
    return true;
  }

  bytes4 retval = IERC721Receiver(to).onERC721Received(
    msg.sender,
    from,
    tokenId,
    _data
  );
  return (retval == _ERC721_RECEIVED);
}

internal ERC721._clearApproval keyboard_arrow_up

Parameters help

Name Type
tokenId
uint256 help

Properties

Visibility help private
Mutability help transaction
Source Code
function _clearApproval(uint256 tokenId) private {
  if (_tokenApprovals[tokenId] != address(0)) {
    _tokenApprovals[tokenId] = address(0);
  }
}

internal ERC165.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
constructor() internal {
  // Derived contracts need only register support for their own interfaces,
  // we register support for ERC165 itself here
  _registerInterface(_INTERFACE_ID_ERC165);
}

internal ERC165._registerInterface keyboard_arrow_up

Parameters help

Name Type
interfaceId
bytes4 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _registerInterface(bytes4 interfaceId) internal {
  require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
  _supportedInterfaces[interfaceId] = true;
}