Blockwell

Estate

About

Stats

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

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

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() isInitializer("Migratable", "1.2.1") public {
  }

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

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

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

transferFrom keyboard_arrow_up

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

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

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));
    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)
  {
    uint length = landIds.length;
    for (uint 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 (uint 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 (uint 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 (uint 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 (uint 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 {
    uint length = landIds.length;
    for (uint 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));
  }