Blockwell

Estate

About

Stats

Public Functions 49
Event Types 13
Code Size 56,622 bytes

Events (13) keyboard_arrow_up

AddLand Event

Parameters help
_estateId
uint256 help
_landId
uint256 help

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

CreateEstate Event

Parameters help
_owner
address help
_estateId
uint256 help
_data
string help

Migrated Event

Parameters help
contractName
string help
migrationId
string help

OwnershipTransferred Event

Parameters help
previousOwner
address help
newOwner
address help

RemoveLand Event

Parameters help
_estateId
uint256 help
_landId
uint256 help
_destinatary
address help

SetEstateLandBalanceToken Event

Parameters help
_previousEstateLandBalance
address help
_newEstateLandBalance
address help

SetLANDRegistry Event

Parameters help
_registry
address help

Transfer Event

Parameters help
_from
address help
_to
address help
_tokenId
uint256 help

Update Event

Parameters help
_assetId
uint256 help
_holder
address help
_operator
address help
_data
string help

UpdateManager Event

Parameters help
_owner
address help
_operator
address help
_caller
address help
_approved
bool help

UpdateOperator Event

Parameters help
_estateId
uint256 help
_operator
address help

INITIALIZED_ID Constant

string help
initialized

InterfaceId_ERC721Enumerable Constant

bytes4 help
0x780e9d63

InterfaceId_ERC721Metadata Constant

bytes4 help
0x5b5e139f

InterfaceId_ERC165 Constant

bytes4 help
0x01ffc9a7

InterfaceId_ERC721 Constant

bytes4 help
0x80ac58cd

InterfaceId_ERC721Exists Constant

bytes4 help
0x4f558e79

ERC721_RECEIVED Constant

bytes4 help
0x150b7a02

ERC721_RECEIVED Constant

bytes4 help
0x150b7a02

InterfaceId_GetMetadata Constant

bytes4 help
UNKNOWN VALUE

InterfaceId_VerifyFingerprint Constant

bytes4 help
UNKNOWN VALUE

owner Variable

address help

registry Variable

address help

estateLandBalance Variable

address help

landIdEstate Variable

mapping(uint256 => uint256) help

updateOperator Variable

mapping(uint256 => address) help

registeredBalance Variable

mapping(address => bool) help

migrated Variable

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

name_ Variable

string help
Internal Variable

symbol_ Variable

string help
Internal Variable

ownedTokens Variable

mapping(address => uint256[]) help
Internal Variable

ownedTokensIndex Variable

mapping(uint256 => uint256) help
Internal Variable

allTokens Variable

uint256[] help
Internal Variable

allTokensIndex Variable

mapping(uint256 => uint256) help
Internal Variable

tokenURIs Variable

mapping(uint256 => string) help
Internal Variable

tokenOwner Variable

mapping(uint256 => address) help
Internal Variable

tokenApprovals Variable

mapping(uint256 => address) help
Internal Variable

ownedTokensCount Variable

mapping(address => uint256) help
Internal Variable

operatorApprovals Variable

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

estateLandIds Variable

mapping(uint256 => uint256[]) help
Internal Variable

estateLandIndex Variable

mapping(uint256 => mapping(uint256 => uint256)) help
Internal Variable

estateData Variable

mapping(uint256 => string) help
Internal Variable

updateManager Variable

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

Functions Expand All Collapse All

isMigrated keyboard_arrow_up

Parameters help

Name Type
contractName
string help
migrationId
string help

Properties

Visibility help public
Mutability help view
Source Code
function isMigrated(string contractName, string migrationId)
  public
  view
  returns (bool)
{
  return migrated[contractName][migrationId];
}

initialize keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function initialize() public isInitializer("Migratable", "1.2.1") {}

initialize keyboard_arrow_up

Parameters help

Name Type
_sender
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function initialize(address _sender) public isInitializer("Ownable", "1.9.0") {
  owner = _sender;
}

transferOwnership keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transferOwnership(address newOwner) public onlyOwner {
  require(newOwner != address(0));
  emit OwnershipTransferred(owner, newOwner);
  owner = newOwner;
}

onERC721Received keyboard_arrow_up

Parameters help

Name Type
_operator
address help
_from
address help
_tokenId
uint256 help
_data
bytes help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Requirements help

Source Code
function onERC721Received(
  address _operator,
  address _from,
  uint256 _tokenId,
  bytes _data
) public onlyRegistry returns (bytes4) {
  uint256 estateId = _bytesToUint(_data);
  _pushLandId(estateId, _tokenId);
  return ERC721_RECEIVED;
}

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));
  return ownedTokensCount[_owner];
}

ownerOf keyboard_arrow_up

Parameters help

Name Type
_tokenId
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
function ownerOf(uint256 _tokenId) public view returns (address _owner);

exists keyboard_arrow_up

Parameters help

Name Type
_tokenId
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
function exists(uint256 _tokenId) public view returns (bool) {
  address owner = tokenOwner[_tokenId];
  return owner != address(0);
}

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);
  require(msg.sender == owner || isApprovedForAll(owner, msg.sender));

  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
Source Code
function getApproved(uint256 _tokenId) public view returns (address) {
  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);
  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];
}

Parameters help

Name Type
_from
address help
_to
address help
_tokenId
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transferFrom(
  address _from,
  address _to,
  uint256 _tokenId
) public {
  updateOperator[_tokenId] = address(0);
  _updateEstateLandBalance(_from, _to, estateLandIds[_tokenId].length);
  super.transferFrom(_from, _to, _tokenId);
}

safeTransferFrom 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

canTransfer checks for the following:
null

Requirements help

null
Source Code
function safeTransferFrom(
  address _from,
  address _to,
  uint256 _tokenId
) public canTransfer(_tokenId) {
  // solium-disable-next-line arg-overflow
  safeTransferFrom(_from, _to, _tokenId, "");
}

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

Modifiers help

canTransfer checks for the following:
null

Requirements help

null
Source Code
function safeTransferFrom(
  address _from,
  address _to,
  uint256 _tokenId,
  bytes _data
) public canTransfer(_tokenId) {
  transferFrom(_from, _to, _tokenId);
  // solium-disable-next-line arg-overflow
  require(checkAndCallSafeTransfer(_from, _to, _tokenId, _data));
}

Parameters help

This function has no parameters.

Properties

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

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function symbol() external view returns (string) {
  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) public view returns (string) {
  require(exists(_tokenId));
  return tokenURIs[_tokenId];
}

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));
  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());
  return allTokens[_index];
}

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 _supportsInterface(_interfaceId);
}

initialize keyboard_arrow_up

Parameters help

Name Type
_name
string help
_symbol
string help

Properties

Visibility help public
Mutability help transaction
Source Code
function initialize(string _name, string _symbol)
  public
  isInitializer("ERC721Token", "1.9.0")
{
  name_ = _name;
  symbol_ = _symbol;
}

mint keyboard_arrow_up

Parameters help

Name Type
to
address help
metadata
string help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function mint(address to, string metadata)
  external
  onlyRegistry
  returns (uint256)
{
  return _mintEstate(to, metadata);
}

transferLand keyboard_arrow_up

Parameters help

Name Type
estateId
uint256 help
landId
uint256 help
destinatary
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

canTransfer checks for the following:
null
Source Code
function transferLand(
  uint256 estateId,
  uint256 landId,
  address destinatary
) external canTransfer(estateId) {
  return _transferLand(estateId, landId, destinatary);
}

transferManyLands keyboard_arrow_up

Parameters help

Name Type
estateId
uint256 help
landIds
uint256[] help
destinatary
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

canTransfer checks for the following:
null
Source Code
function transferManyLands(
  uint256 estateId,
  uint256[] landIds,
  address destinatary
) external canTransfer(estateId) {
  uint256 length = landIds.length;
  for (uint256 i = 0; i < length; i++) {
    _transferLand(estateId, landIds[i], destinatary);
  }
}

getLandEstateId keyboard_arrow_up

Parameters help

Name Type
landId
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
function getLandEstateId(uint256 landId) external view returns (uint256) {
  return landIdEstate[landId];
}

setLANDRegistry keyboard_arrow_up

Parameters help

Name Type
_registry
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function setLANDRegistry(address _registry) external onlyOwner {
  require(
    _registry.isContract(),
    "The LAND registry address should be a contract"
  );
  require(_registry != 0, "The LAND registry address should be valid");
  registry = LANDRegistry(_registry);
  emit SetLANDRegistry(registry);
}

ping keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function ping() external {
  registry.ping();
}

getEstateSize keyboard_arrow_up

Parameters help

Name Type
estateId
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
function getEstateSize(uint256 estateId) external view returns (uint256) {
  return estateLandIds[estateId].length;
}

getLANDsSize keyboard_arrow_up

Parameters help

Name Type
_owner
address help

Properties

Visibility help public
Mutability help view
Source Code
function getLANDsSize(address _owner) public view returns (uint256) {
  // Avoid balanceOf to not compute an unnecesary require
  uint256 landsSize;
  uint256 balance = ownedTokensCount[_owner];
  for (uint256 i; i < balance; i++) {
    uint256 estateId = ownedTokens[_owner][i];
    landsSize += estateLandIds[estateId].length;
  }
  return landsSize;
}

updateMetadata keyboard_arrow_up

getMetadata keyboard_arrow_up

isUpdateAuthorized keyboard_arrow_up

Parameters help

Name Type
operator
address help
estateId
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
function isUpdateAuthorized(address operator, uint256 estateId)
  external
  view
  returns (bool)
{
  return _isUpdateAuthorized(operator, estateId);
}

setUpdateManager keyboard_arrow_up

Parameters help

Name Type
_owner
address help
_operator
address help
_approved
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
function setUpdateManager(
  address _owner,
  address _operator,
  bool _approved
) external {
  require(
    _operator != msg.sender,
    "The operator should be different from owner"
  );
  require(
    _owner == msg.sender || operatorApprovals[_owner][msg.sender],
    "Unauthorized user"
  );

  updateManager[_owner][_operator] = _approved;

  emit UpdateManager(_owner, _operator, msg.sender, _approved);
}

setUpdateOperator keyboard_arrow_up

Parameters help

Name Type
estateId
uint256 help
operator
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

canSetUpdateOperator checks for the following:
One or more of the following: -null
Source Code
function setUpdateOperator(uint256 estateId, address operator)
  public
  canSetUpdateOperator(estateId)
{
  updateOperator[estateId] = operator;
  emit UpdateOperator(estateId, operator);
}

setManyUpdateOperator keyboard_arrow_up

Parameters help

Name Type
_estateIds
uint256[] help
_operator
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function setManyUpdateOperator(uint256[] _estateIds, address _operator) public {
  for (uint256 i = 0; i < _estateIds.length; i++) {
    setUpdateOperator(_estateIds[i], _operator);
  }
}

setLandUpdateOperator keyboard_arrow_up

Parameters help

Name Type
estateId
uint256 help
landId
uint256 help
operator
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

canSetUpdateOperator checks for the following:
One or more of the following: -null
Source Code
function setLandUpdateOperator(
  uint256 estateId,
  uint256 landId,
  address operator
) public canSetUpdateOperator(estateId) {
  require(
    landIdEstate[landId] == estateId,
    "The LAND is not part of the Estate"
  );
  registry.setUpdateOperator(landId, operator);
}

setManyLandUpdateOperator keyboard_arrow_up

Parameters help

Name Type
_estateId
uint256 help
_landIds
uint256[] help
_operator
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

canSetUpdateOperator checks for the following:
One or more of the following: -null
Source Code
function setManyLandUpdateOperator(
  uint256 _estateId,
  uint256[] _landIds,
  address _operator
) public canSetUpdateOperator(_estateId) {
  for (uint256 i = 0; i < _landIds.length; i++) {
    require(
      landIdEstate[_landIds[i]] == _estateId,
      "The LAND is not part of the Estate"
    );
  }
  registry.setManyUpdateOperator(_landIds, _operator);
}

initialize keyboard_arrow_up

Parameters help

Name Type
_name
string help
_symbol
string help
_registry
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function initialize(
  string _name,
  string _symbol,
  address _registry
) public isInitializer("EstateRegistry", "0.0.2") {
  require(_registry != 0, "The registry should be a valid address");

  ERC721Token.initialize(_name, _symbol);
  Ownable.initialize(msg.sender);
  registry = LANDRegistry(_registry);
}

getFingerprint keyboard_arrow_up

Parameters help

Name Type
estateId
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
function getFingerprint(uint256 estateId) public view returns (bytes32 result) {
  result = keccak256(abi.encodePacked("estateId", estateId));

  uint256 length = estateLandIds[estateId].length;
  for (uint256 i = 0; i < length; i++) {
    result ^= keccak256(abi.encodePacked(estateLandIds[estateId][i]));
  }
  return result;
}

verifyFingerprint keyboard_arrow_up

Parameters help

Name Type
estateId
uint256 help
fingerprint
bytes help

Properties

Visibility help public
Mutability help view
Source Code
function verifyFingerprint(uint256 estateId, bytes fingerprint)
  public
  view
  returns (bool)
{
  return getFingerprint(estateId) == _bytesToBytes32(fingerprint);
}

safeTransferManyFrom keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
estateIds
uint256[] help

Properties

Visibility help public
Mutability help transaction
Source Code
function safeTransferManyFrom(
  address from,
  address to,
  uint256[] estateIds
) public {
  safeTransferManyFrom(from, to, estateIds, "");
}

safeTransferManyFrom keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
estateIds
uint256[] help
data
bytes help

Properties

Visibility help public
Mutability help transaction
Source Code
function safeTransferManyFrom(
  address from,
  address to,
  uint256[] estateIds,
  bytes data
) public {
  for (uint256 i = 0; i < estateIds.length; i++) {
    safeTransferFrom(from, to, estateIds[i], data);
  }
}

updateLandData keyboard_arrow_up

Parameters help

Name Type
estateId
uint256 help
landId
uint256 help
data
string help

Properties

Visibility help public
Mutability help transaction
Source Code
function updateLandData(
  uint256 estateId,
  uint256 landId,
  string data
) public {
  _updateLandData(estateId, landId, data);
}

updateManyLandData keyboard_arrow_up

Parameters help

Name Type
estateId
uint256 help
landIds
uint256[] help
data
string help

Properties

Visibility help public
Mutability help transaction
Source Code
function updateManyLandData(
  uint256 estateId,
  uint256[] landIds,
  string data
) public {
  uint256 length = landIds.length;
  for (uint256 i = 0; i < length; i++) {
    _updateLandData(estateId, landIds[i], data);
  }
}

registerBalance keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function registerBalance() external {
  require(
    !registeredBalance[msg.sender],
    "Register Balance::The user is already registered"
  );

  // Get balance of the sender
  uint256 currentBalance = estateLandBalance.balanceOf(msg.sender);
  if (currentBalance > 0) {
    require(
      estateLandBalance.destroyTokens(msg.sender, currentBalance),
      "Register Balance::Could not destroy tokens"
    );
  }

  // Set balance as registered
  registeredBalance[msg.sender] = true;

  // Get LAND balance
  uint256 newBalance = getLANDsSize(msg.sender);

  // Generate Tokens
  require(
    estateLandBalance.generateTokens(msg.sender, newBalance),
    "Register Balance::Could not generate tokens"
  );
}

unregisterBalance keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function unregisterBalance() external {
  require(
    registeredBalance[msg.sender],
    "Unregister Balance::The user not registered"
  );

  // Set balance as unregistered
  registeredBalance[msg.sender] = false;

  // Get balance
  uint256 currentBalance = estateLandBalance.balanceOf(msg.sender);

  // Destroy Tokens
  require(
    estateLandBalance.destroyTokens(msg.sender, currentBalance),
    "Unregister Balance::Could not destroy tokens"
  );
}

setEstateLandBalanceToken keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function setEstateLandBalanceToken() external {
  require(estateLandBalance == address(0), "estateLandBalance was set");
  _setEstateLandBalanceToken(
    address(0x8568f23f343694650370fe5e254b55bfb704a6c7)
  );
}

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 EstateRegistry._supportsInterface keyboard_arrow_up

Parameters help

Name Type
_interfaceId
bytes4 help

Properties

Visibility help internal
Mutability help view
Source Code
function _supportsInterface(bytes4 _interfaceId) internal view returns (bool) {
  // solium-disable-next-line operator-whitespace
  return
    super._supportsInterface(_interfaceId) ||
    _interfaceId == InterfaceId_GetMetadata ||
    _interfaceId == InterfaceId_VerifyFingerprint;
}

internal EstateRegistry._mintEstate keyboard_arrow_up

Parameters help

Name Type
to
address help
metadata
string help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _mintEstate(address to, string metadata) internal returns (uint256) {
  require(to != address(0), "You can not mint to an empty address");
  uint256 estateId = _getNewEstateId();
  _mint(to, estateId);
  _updateMetadata(estateId, metadata);
  emit CreateEstate(to, estateId, metadata);
  return estateId;
}

internal EstateRegistry._updateMetadata keyboard_arrow_up

internal EstateRegistry._getNewEstateId keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _getNewEstateId() internal view returns (uint256) {
  return totalSupply().add(1);
}

internal EstateRegistry._pushLandId keyboard_arrow_up

Parameters help

Name Type
estateId
uint256 help
landId
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _pushLandId(uint256 estateId, uint256 landId) internal {
  require(exists(estateId), "The Estate id should exist");
  require(landIdEstate[landId] == 0, "The LAND is already owned by an Estate");
  require(
    registry.ownerOf(landId) == address(this),
    "The EstateRegistry cannot manage the LAND"
  );

  estateLandIds[estateId].push(landId);

  landIdEstate[landId] = estateId;

  estateLandIndex[estateId][landId] = estateLandIds[estateId].length;

  address owner = ownerOf(estateId);
  _updateEstateLandBalance(address(registry), owner, 1);

  emit AddLand(estateId, landId);
}

internal EstateRegistry._transferLand keyboard_arrow_up

Parameters help

Name Type
estateId
uint256 help
landId
uint256 help
destinatary
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _transferLand(
  uint256 estateId,
  uint256 landId,
  address destinatary
) internal {
  require(
    destinatary != address(0),
    "You can not transfer LAND to an empty address"
  );

  uint256[] storage landIds = estateLandIds[estateId];
  mapping(uint256 => uint256) landIndex = estateLandIndex[estateId];

  /**
   * Using 1-based indexing to be able to make this check
   */
  require(landIndex[landId] != 0, "The LAND is not part of the Estate");

  uint256 lastIndexInArray = landIds.length.sub(1);

  /**
   * Get the landIndex of this token in the landIds list
   */
  uint256 indexInArray = landIndex[landId].sub(1);

  /**
   * Get the landId at the end of the landIds list
   */
  uint256 tempTokenId = landIds[lastIndexInArray];

  /**
   * Store the last token in the position previously occupied by landId
   */
  landIndex[tempTokenId] = indexInArray.add(1);
  landIds[indexInArray] = tempTokenId;

  /**
   * Delete the landIds[last element]
   */
  delete landIds[lastIndexInArray];
  landIds.length = lastIndexInArray;

  /**
   * Drop this landId from both the landIndex and landId list
   */
  landIndex[landId] = 0;

  /**
   * Drop this landId Estate
   */
  landIdEstate[landId] = 0;

  address owner = ownerOf(estateId);
  _updateEstateLandBalance(owner, address(registry), 1);

  registry.safeTransferFrom(this, destinatary, landId);

  emit RemoveLand(estateId, landId, destinatary);
}

internal EstateRegistry._isUpdateAuthorized keyboard_arrow_up

Parameters help

Name Type
operator
address help
estateId
uint256 help

Properties

Visibility help internal
Mutability help view
Source Code
function _isUpdateAuthorized(address operator, uint256 estateId)
  internal
  view
  returns (bool)
{
  address owner = ownerOf(estateId);

  return
    isApprovedOrOwner(operator, estateId) ||
    updateOperator[estateId] == operator ||
    updateManager[owner][operator];
}

internal EstateRegistry._isLandUpdateAuthorized keyboard_arrow_up

Parameters help

Name Type
operator
address help
estateId
uint256 help
landId
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _isLandUpdateAuthorized(
  address operator,
  uint256 estateId,
  uint256 landId
) internal returns (bool) {
  return
    _isUpdateAuthorized(operator, estateId) ||
    registry.updateOperator(landId) == operator;
}

internal EstateRegistry._bytesToUint keyboard_arrow_up

Parameters help

Name Type
b
bytes help

Properties

Visibility help internal
Mutability help pure
Source Code
function _bytesToUint(bytes b) internal pure returns (uint256) {
  return uint256(_bytesToBytes32(b));
}

internal EstateRegistry._bytesToBytes32 keyboard_arrow_up

Parameters help

Name Type
b
bytes help

Properties

Visibility help internal
Mutability help pure
Source Code
function _bytesToBytes32(bytes b) internal pure returns (bytes32) {
  bytes32 out;

  for (uint256 i = 0; i < b.length; i++) {
    out |= bytes32(b[i] & 0xFF) >> i.mul(8);
  }

  return out;
}

internal EstateRegistry._updateLandData keyboard_arrow_up

Parameters help

Name Type
estateId
uint256 help
landId
uint256 help
data
string help

Properties

Visibility help internal
Mutability help transaction

Modifiers help

onlyLandUpdateAuthorized checks for the following:
null
Source Code
function _updateLandData(
  uint256 estateId,
  uint256 landId,
  string data
) internal onlyLandUpdateAuthorized(estateId, landId) {
  require(
    landIdEstate[landId] == estateId,
    "The LAND is not part of the Estate"
  );
  int256 x;
  int256 y;
  (x, y) = registry.decodeTokenId(landId);
  registry.updateLandData(x, y, data);
}

internal EstateRegistry._setEstateLandBalanceToken keyboard_arrow_up

Parameters help

Name Type
_newEstateLandBalance
address help

Properties

Visibility help internal
Mutability help transaction

Requirements help

UNKNOWN VALUE must not be equal to UNKNOWN VALUE
Source Code
function _setEstateLandBalanceToken(address _newEstateLandBalance) internal {
  require(
    _newEstateLandBalance != address(0),
    "New estateLandBalance should not be zero address"
  );
  emit SetEstateLandBalanceToken(estateLandBalance, _newEstateLandBalance);
  estateLandBalance = IMiniMeToken(_newEstateLandBalance);
}

internal EstateRegistry._updateEstateLandBalance keyboard_arrow_up

Parameters help

Name Type
_from
address help
_to
address help
_amount
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _updateEstateLandBalance(
  address _from,
  address _to,
  uint256 _amount
) internal {
  if (registeredBalance[_from]) {
    estateLandBalance.destroyTokens(_from, _amount);
  }

  if (registeredBalance[_to]) {
    estateLandBalance.generateTokens(_to, _amount);
  }
}

internal Migratable.validateMigrationIsPending keyboard_arrow_up

Parameters help

Name Type
contractName
string help
migrationId
string help

Properties

Visibility help private
Mutability help view

Requirements help

Source Code
function validateMigrationIsPending(string contractName, string migrationId)
  private
  view
{
  require(
    !isMigrated(contractName, migrationId),
    "Requested target migration ID has already been run"
  );
}

internal ERC721Token._supportsInterface keyboard_arrow_up

Parameters help

Name Type
_interfaceId
bytes4 help

Properties

Visibility help internal
Mutability help view
Source Code
function _supportsInterface(bytes4 _interfaceId) internal view returns (bool) {
  return
    super._supportsInterface(_interfaceId) ||
    _interfaceId == InterfaceId_ERC721Enumerable ||
    _interfaceId == InterfaceId_ERC721Metadata;
}

internal ERC721Token._setTokenURI keyboard_arrow_up

Parameters help

Name Type
_tokenId
uint256 help
_uri
string help

Properties

Visibility help internal
Mutability help transaction

Requirements help

null
Source Code
function _setTokenURI(uint256 _tokenId, string _uri) internal {
  require(exists(_tokenId));
  tokenURIs[_tokenId] = _uri;
}

internal ERC721Token.addTokenTo keyboard_arrow_up

Parameters help

Name Type
_to
address help
_tokenId
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function addTokenTo(address _to, uint256 _tokenId) internal {
  super.addTokenTo(_to, _tokenId);
  uint256 length = ownedTokens[_to].length;
  ownedTokens[_to].push(_tokenId);
  ownedTokensIndex[_tokenId] = length;
}

internal ERC721Token.removeTokenFrom keyboard_arrow_up

Parameters help

Name Type
_from
address help
_tokenId
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function removeTokenFrom(address _from, uint256 _tokenId) internal {
  super.removeTokenFrom(_from, _tokenId);

  uint256 tokenIndex = ownedTokensIndex[_tokenId];
  uint256 lastTokenIndex = ownedTokens[_from].length.sub(1);
  uint256 lastToken = ownedTokens[_from][lastTokenIndex];

  ownedTokens[_from][tokenIndex] = lastToken;
  ownedTokens[_from][lastTokenIndex] = 0;
  // Note that this will handle single-element arrays. In that case, both tokenIndex and lastTokenIndex are going to
  // be zero. Then we can make sure that we will remove _tokenId from the ownedTokens list since we are first swapping
  // the lastToken to the first position, and then dropping the element placed in the last position of the list

  ownedTokens[_from].length--;
  ownedTokensIndex[_tokenId] = 0;
  ownedTokensIndex[lastToken] = tokenIndex;
}

internal ERC721Token._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 {
  super._mint(_to, _tokenId);

  allTokensIndex[_tokenId] = allTokens.length;
  allTokens.push(_tokenId);
}

internal ERC721Token._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 {
  super._burn(_owner, _tokenId);

  // Clear metadata (if any)
  if (bytes(tokenURIs[_tokenId]).length != 0) {
    delete tokenURIs[_tokenId];
  }

  // Reorg all tokens array
  uint256 tokenIndex = allTokensIndex[_tokenId];
  uint256 lastTokenIndex = allTokens.length.sub(1);
  uint256 lastToken = allTokens[lastTokenIndex];

  allTokens[tokenIndex] = lastToken;
  allTokens[lastTokenIndex] = 0;

  allTokens.length--;
  allTokensIndex[_tokenId] = 0;
  allTokensIndex[lastToken] = tokenIndex;
}

internal Migratable.validateMigrationIsPending keyboard_arrow_up

Parameters help

Name Type
contractName
string help
migrationId
string help

Properties

Visibility help private
Mutability help view

Requirements help

Source Code
function validateMigrationIsPending(string contractName, string migrationId)
  private
  view
{
  require(
    !isMigrated(contractName, migrationId),
    "Requested target migration ID has already been run"
  );
}

internal ERC165Support._supportsInterface keyboard_arrow_up

Parameters help

Name Type
_interfaceId
bytes4 help

Properties

Visibility help internal
Mutability help view
Source Code
function _supportsInterface(bytes4 _interfaceId) internal view returns (bool) {
  return _interfaceId == InterfaceId_ERC165;
}

internal ERC721BasicToken._supportsInterface keyboard_arrow_up

Parameters help

Name Type
_interfaceId
bytes4 help

Properties

Visibility help internal
Mutability help view
Source Code
function _supportsInterface(bytes4 _interfaceId) internal view returns (bool) {
  return
    super._supportsInterface(_interfaceId) ||
    _interfaceId == InterfaceId_ERC721 ||
    _interfaceId == InterfaceId_ERC721Exists;
}

internal ERC721BasicToken.isApprovedOrOwner keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_tokenId
uint256 help

Properties

Visibility help internal
Mutability help view
Source Code
function isApprovedOrOwner(address _spender, uint256 _tokenId)
  internal
  view
  returns (bool)
{
  address owner = ownerOf(_tokenId);
  // Disable solium check because of
  // https://github.com/duaraghav8/Solium/issues/175
  // solium-disable-next-line operator-whitespace
  return (_spender == owner ||
    getApproved(_tokenId) == _spender ||
    isApprovedForAll(owner, _spender));
}

internal ERC721BasicToken._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));
  addTokenTo(_to, _tokenId);
  emit Transfer(address(0), _to, _tokenId);
}

internal ERC721BasicToken._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 {
  clearApproval(_owner, _tokenId);
  removeTokenFrom(_owner, _tokenId);
  emit Transfer(_owner, address(0), _tokenId);
}

internal ERC721BasicToken.clearApproval keyboard_arrow_up

Parameters help

Name Type
_owner
address help
_tokenId
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function clearApproval(address _owner, uint256 _tokenId) internal {
  require(ownerOf(_tokenId) == _owner);
  if (tokenApprovals[_tokenId] != address(0)) {
    tokenApprovals[_tokenId] = address(0);
  }
}

internal ERC721BasicToken.addTokenTo keyboard_arrow_up

Parameters help

Name Type
_to
address help
_tokenId
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function addTokenTo(address _to, uint256 _tokenId) internal {
  require(tokenOwner[_tokenId] == address(0));
  tokenOwner[_tokenId] = _to;
  ownedTokensCount[_to] = ownedTokensCount[_to].add(1);
}

internal ERC721BasicToken.removeTokenFrom keyboard_arrow_up

Parameters help

Name Type
_from
address help
_tokenId
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function removeTokenFrom(address _from, uint256 _tokenId) internal {
  require(ownerOf(_tokenId) == _from);
  ownedTokensCount[_from] = ownedTokensCount[_from].sub(1);
  tokenOwner[_tokenId] = address(0);
}

internal ERC721BasicToken.checkAndCallSafeTransfer 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 checkAndCallSafeTransfer(
  address _from,
  address _to,
  uint256 _tokenId,
  bytes _data
) internal returns (bool) {
  if (!_to.isContract()) {
    return true;
  }
  bytes4 retval = ERC721Receiver(_to).onERC721Received(
    msg.sender,
    _from,
    _tokenId,
    _data
  );
  return (retval == ERC721_RECEIVED);
}

internal ERC165Support._supportsInterface keyboard_arrow_up

Parameters help

Name Type
_interfaceId
bytes4 help

Properties

Visibility help internal
Mutability help view
Source Code
function _supportsInterface(bytes4 _interfaceId) internal view returns (bool) {
  return _interfaceId == InterfaceId_ERC165;
}

internal Migratable.validateMigrationIsPending keyboard_arrow_up

Parameters help

Name Type
contractName
string help
migrationId
string help

Properties

Visibility help private
Mutability help view

Requirements help

Source Code
function validateMigrationIsPending(string contractName, string migrationId)
  private
  view
{
  require(
    !isMigrated(contractName, migrationId),
    "Requested target migration ID has already been run"
  );
}