Latest 4 txns

TxHash Age From To Value [TxFee]
0xa83c630f768cd301057698f5a27da69f1aabdd1247db44260d65c1d3ee072d06131 days 2 hrs ago0x4cd98f82decade2d152e256efd1f8d5a334a3e28  IN   0x94a0998c466744b53db002ff4d29cfcdb0aea6c60 Ether0.00931268
0x7d82de9f1db4e9fdadc084a9589ed9645298a31529840ab8eba60cb2b1362c2c131 days 2 hrs ago0x4cd98f82decade2d152e256efd1f8d5a334a3e28  IN   0x94a0998c466744b53db002ff4d29cfcdb0aea6c60 Ether0.00930884
0x271fc40e5e9b1a8cc5839c16b05e9e52820576c8568d106af0f006e0990555b5131 days 2 hrs ago0x4cd98f82decade2d152e256efd1f8d5a334a3e28  IN   0x94a0998c466744b53db002ff4d29cfcdb0aea6c60 Ether0.00044438
0xc91a073d9bbd78f8776d49d66c3da8764030652962ea961f254307b94282ffb3131 days 2 hrs ago0x4cd98f82decade2d152e256efd1f8d5a334a3e28  IN    Contract Creation0 Ether0.01536869
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
View All
ParentTxHash Block Age From To Value
Warning: The Compiled Contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity) SolidityCompiler Bugs.

Contract Source Code Verified (Similar Match)
Note: Displaying Similar Match Verified Source Code At Contract 0xebcea5882be5aa088aee9550d95667f33f93dae7(Excluding Constructor Arguments if any)
Contract Name: Tavern
Compiler Text: v0.4.24+commit.e67f0147
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.24;

/**
 * @title -LORDLESS tavern - Tavern
 * Tavern contract records the core attributes of Tavern
 * 
 * ████████╗  █████╗  ██╗   ██╗ ███████╗ ██████╗  ███╗   ██╗ ██╗
 * ╚══██╔══╝ ██╔══██╗ ██║   ██║ ██╔════╝ ██╔══██╗ ████╗  ██║ ██║
 *    ██║    ███████║ ██║   ██║ █████╗   ██████╔╝ ██╔██╗ ██║ ██║
 *    ██║    ██╔══██║ ╚██╗ ██╔╝ ██╔══╝   ██╔══██╗ ██║╚██╗██║ ╚═╝
 *    ██║    ██║  ██║  ╚████╔╝  ███████╗ ██║  ██║ ██║ ╚████║ ██╗
 *    ╚═╝    ╚═╝  ╚═╝   ╚═══╝   ╚══════╝ ╚═╝  ╚═╝ ╚═╝  ╚═══╝ ╚═╝
 * 
 * ---
 * POWERED BY
 * ╦   ╔═╗ ╦═╗ ╔╦╗ ╦   ╔═╗ ╔═╗ ╔═╗      ╔╦╗ ╔═╗ ╔═╗ ╔╦╗
 * ║   ║ ║ ╠╦╝  ║║ ║   ║╣  ╚═╗ ╚═╗       ║  ║╣  ╠═╣ ║║║
 * ╩═╝ ╚═╝ ╩╚═ ═╩╝ ╩═╝ ╚═╝ ╚═╝ ╚═╝       ╩  ╚═╝ ╩ ╩ ╩ ╩
 * game at https://lordless.io
 * code at https://github.com/lordlessio
 */


// File: node_modules/zeppelin-solidity/contracts/access/rbac/Roles.sol

/**
 * @title Roles
 * @author Francisco Giordano (@frangio)
 * @dev Library for managing addresses assigned to a Role.
 * See RBAC.sol for example usage.
 */
library Roles {
  struct Role {
    mapping (address => bool) bearer;
  }

  /**
   * @dev give an address access to this role
   */
  function add(Role storage _role, address _addr)
    internal
  {
    _role.bearer[_addr] = true;
  }

  /**
   * @dev remove an address' access to this role
   */
  function remove(Role storage _role, address _addr)
    internal
  {
    _role.bearer[_addr] = false;
  }

  /**
   * @dev check if an address has this role
   * // reverts
   */
  function check(Role storage _role, address _addr)
    internal
    view
  {
    require(has(_role, _addr));
  }

  /**
   * @dev check if an address has this role
   * @return bool
   */
  function has(Role storage _role, address _addr)
    internal
    view
    returns (bool)
  {
    return _role.bearer[_addr];
  }
}

// File: node_modules/zeppelin-solidity/contracts/access/rbac/RBAC.sol

/**
 * @title RBAC (Role-Based Access Control)
 * @author Matt Condon (@Shrugs)
 * @dev Stores and provides setters and getters for roles and addresses.
 * Supports unlimited numbers of roles and addresses.
 * See //contracts/mocks/RBACMock.sol for an example of usage.
 * This RBAC method uses strings to key roles. It may be beneficial
 * for you to write your own implementation of this interface using Enums or similar.
 */
contract RBAC {
  using Roles for Roles.Role;

  mapping (string => Roles.Role) private roles;

  event RoleAdded(address indexed operator, string role);
  event RoleRemoved(address indexed operator, string role);

  /**
   * @dev reverts if addr does not have role
   * @param _operator address
   * @param _role the name of the role
   * // reverts
   */
  function checkRole(address _operator, string _role)
    public
    view
  {
    roles[_role].check(_operator);
  }

  /**
   * @dev determine if addr has role
   * @param _operator address
   * @param _role the name of the role
   * @return bool
   */
  function hasRole(address _operator, string _role)
    public
    view
    returns (bool)
  {
    return roles[_role].has(_operator);
  }

  /**
   * @dev add a role to an address
   * @param _operator address
   * @param _role the name of the role
   */
  function addRole(address _operator, string _role)
    internal
  {
    roles[_role].add(_operator);
    emit RoleAdded(_operator, _role);
  }

  /**
   * @dev remove a role from an address
   * @param _operator address
   * @param _role the name of the role
   */
  function removeRole(address _operator, string _role)
    internal
  {
    roles[_role].remove(_operator);
    emit RoleRemoved(_operator, _role);
  }

  /**
   * @dev modifier to scope access to a single role (uses msg.sender as addr)
   * @param _role the name of the role
   * // reverts
   */
  modifier onlyRole(string _role)
  {
    checkRole(msg.sender, _role);
    _;
  }

  /**
   * @dev modifier to scope access to a set of roles (uses msg.sender as addr)
   * @param _roles the names of the roles to scope access to
   * // reverts
   *
   * @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this
   *  see: https://github.com/ethereum/solidity/issues/2467
   */
  // modifier onlyRoles(string[] _roles) {
  //     bool hasAnyRole = false;
  //     for (uint8 i = 0; i < _roles.length; i++) {
  //         if (hasRole(msg.sender, _roles[i])) {
  //             hasAnyRole = true;
  //             break;
  //         }
  //     }

  //     require(hasAnyRole);

  //     _;
  // }
}

// File: node_modules/zeppelin-solidity/contracts/ownership/Ownable.sol

/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
  address public owner;


  event OwnershipRenounced(address indexed previousOwner);
  event OwnershipTransferred(
    address indexed previousOwner,
    address indexed newOwner
  );


  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  constructor() public {
    owner = msg.sender;
  }

  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }

  /**
   * @dev Allows the current owner to relinquish control of the contract.
   * @notice Renouncing to ownership will leave the contract without an owner.
   * It will not be possible to call the functions with the `onlyOwner`
   * modifier anymore.
   */
  function renounceOwnership() public onlyOwner {
    emit OwnershipRenounced(owner);
    owner = address(0);
  }

  /**
   * @dev Allows the current owner to transfer control of the contract to a newOwner.
   * @param _newOwner The address to transfer ownership to.
   */
  function transferOwnership(address _newOwner) public onlyOwner {
    _transferOwnership(_newOwner);
  }

  /**
   * @dev Transfers control of the contract to a newOwner.
   * @param _newOwner The address to transfer ownership to.
   */
  function _transferOwnership(address _newOwner) internal {
    require(_newOwner != address(0));
    emit OwnershipTransferred(owner, _newOwner);
    owner = _newOwner;
  }
}

// File: node_modules/zeppelin-solidity/contracts/ownership/Superuser.sol

/**
 * @title Superuser
 * @dev The Superuser contract defines a single superuser who can transfer the ownership
 * of a contract to a new address, even if he is not the owner.
 * A superuser can transfer his role to a new address.
 */
contract Superuser is Ownable, RBAC {
  string public constant ROLE_SUPERUSER = "superuser";

  constructor () public {
    addRole(msg.sender, ROLE_SUPERUSER);
  }

  /**
   * @dev Throws if called by any account that's not a superuser.
   */
  modifier onlySuperuser() {
    checkRole(msg.sender, ROLE_SUPERUSER);
    _;
  }

  modifier onlyOwnerOrSuperuser() {
    require(msg.sender == owner || isSuperuser(msg.sender));
    _;
  }

  /**
   * @dev getter to determine if address has superuser role
   */
  function isSuperuser(address _addr)
    public
    view
    returns (bool)
  {
    return hasRole(_addr, ROLE_SUPERUSER);
  }

  /**
   * @dev Allows the current superuser to transfer his role to a newSuperuser.
   * @param _newSuperuser The address to transfer ownership to.
   */
  function transferSuperuser(address _newSuperuser) public onlySuperuser {
    require(_newSuperuser != address(0));
    removeRole(msg.sender, ROLE_SUPERUSER);
    addRole(_newSuperuser, ROLE_SUPERUSER);
  }

  /**
   * @dev Allows the current superuser or owner to transfer control of the contract to a newOwner.
   * @param _newOwner The address to transfer ownership to.
   */
  function transferOwnership(address _newOwner) public onlyOwnerOrSuperuser {
    _transferOwnership(_newOwner);
  }
}

// File: contracts/tavern/IPower.sol

interface IPower {
  function setTavernContract(address tavern) external;
  function influenceByToken(uint256 tokenId) external view returns(uint256);
  function levelByToken(uint256 tokenId) external view returns(uint256);
  function weightsApportion(uint256 userLevel, uint256 lordLevel) external view returns(uint256);

   /* Events */

  event SetTavernContract (
    address tavern
  );
}

// File: contracts/tavern/ITavern.sol

/**
 * @title Tavern Interface
 */

interface ITavern {

  function setPowerContract(address _powerContract) external;
  function influenceByToken(uint256 tokenId) external view returns(uint256);
  function levelByToken(uint256 tokenId) external view returns(uint256);
  function weightsApportion(uint256 ulevel1, uint256 ulevel2) external view returns(uint256);

  function tavern(uint256 tokenId) external view returns (uint256, int, int, uint8, uint256);
  function isBuilt(uint256 tokenId) external view returns (bool);

  function build(
    uint256 tokenId,
    int longitude,
    int latitude,
    uint8 popularity
    ) external;

  function batchBuild(
    uint256[] tokenIds,
    int[] longitudes,
    int[] latitudes,
    uint8[] popularitys
    ) external;

  function activenessUpgrade(uint256 tokenId, uint256 deltaActiveness) external;
  function batchActivenessUpgrade(uint256[] tokenIds, uint256[] deltaActiveness) external;

  function popularitySetting(uint256 tokenId, uint8 popularity) external;
  function batchPopularitySetting(uint256[] tokenIds, uint8[] popularitys) external;
  
  /* Events */

  event Build (
    uint256 time,
    uint256 indexed tokenId,
    int longitude,
    int latitude,
    uint8 popularity
  );

  event ActivenessUpgrade (
    uint256 indexed tokenId,
    uint256 oActiveness,
    uint256 newActiveness
  );

  event PopularitySetting (
    uint256 indexed tokenId,
    uint256 oPopularity,
    uint256 newPopularity
  );
}

// File: contracts/lib/SafeMath.sol

/**
 * @title SafeMath
 */
library SafeMath {
  /**
  * @dev Integer division of two numbers, truncating the quotient.
  */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    // uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return a / b;
  }

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  function mul(uint256 a, uint256 b) 
      internal 
      pure 
      returns (uint256 c) 
  {
    if (a == 0) {
      return 0;
    }
    c = a * b;
    require(c / a == b, "SafeMath mul failed");
    return c;
  }

  /**
  * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 a, uint256 b)
      internal
      pure
      returns (uint256) 
  {
    require(b <= a, "SafeMath sub failed");
    return a - b;
  }

  /**
  * @dev Adds two numbers, throws on overflow.
  */
  function add(uint256 a, uint256 b)
      internal
      pure
      returns (uint256 c) 
  {
    c = a + b;
    require(c >= a, "SafeMath add failed");
    return c;
  }
  
  /**
    * @dev gives square root of given x.
    */
  function sqrt(uint256 x)
      internal
      pure
      returns (uint256 y) 
  {
    uint256 z = ((add(x,1)) / 2);
    y = x;
    while (z < y) 
    {
      y = z;
      z = ((add((x / z),z)) / 2);
    }
  }
  
  /**
    * @dev gives square. batchplies x by x
    */
  function sq(uint256 x)
      internal
      pure
      returns (uint256)
  {
    return (mul(x,x));
  }
  
  /**
    * @dev x to the power of y 
    */
  function pwr(uint256 x, uint256 y)
      internal 
      pure 
      returns (uint256)
  {
    if (x==0)
        return (0);
    else if (y==0)
        return (1);
    else 
    {
      uint256 z = x;
      for (uint256 i=1; i < y; i++)
        z = mul(z,x);
      return (z);
    }
  }
}

// File: contracts/tavern/TavernBase.sol

contract TavernBase is ITavern {
  using SafeMath for *;

  struct Tavern {
    uint256 initAt; // The time of tavern init
    int longitude; // The longitude of tavern
    int latitude; // The latitude of tavern
    uint8 popularity; // The popularity of tavern
    uint256 activeness; // The activeness of tavern
  }
  
  uint8 public constant decimals = 16; // longitude latitude decimals

  mapping(uint256 => Tavern) internal tokenTaverns;
  
  function _tavern(uint256 _tokenId) internal view returns (uint256, int, int, uint8, uint256) {
    Tavern storage tavern = tokenTaverns[_tokenId];
    return (
      tavern.initAt, 
      tavern.longitude, 
      tavern.latitude, 
      tavern.popularity, 
      tavern.activeness
    );
  }
  
  function _isBuilt(uint256 _tokenId) internal view returns (bool){
    Tavern storage tavern = tokenTaverns[_tokenId];
    return (tavern.initAt > 0);
  }

  function _build(
    uint256 _tokenId,
    int _longitude,
    int _latitude,
    uint8 _popularity
    ) internal {

    // Check whether tokenid has been initialized
    require(!_isBuilt(_tokenId));
    require(_isLongitude(_longitude));
    require(_isLatitude(_latitude));
    require(_popularity != 0);
    uint256 time = block.timestamp;
    Tavern memory tavern = Tavern(
      time, _longitude, _latitude, _popularity, uint256(0)
    );
    tokenTaverns[_tokenId] = tavern;
    emit Build(time, _tokenId, _longitude, _latitude, _popularity);
  }
  
  function _batchBuild(
    uint256[] _tokenIds,
    int[] _longitudes,
    int[] _latitudes,
    uint8[] _popularitys
    ) internal {
    uint256 i = 0;
    while (i < _tokenIds.length) {
      _build(
        _tokenIds[i],
        _longitudes[i],
        _latitudes[i],
        _popularitys[i]
      );
      i += 1;
    }

    
  }

  function _activenessUpgrade(uint256 _tokenId, uint256 _deltaActiveness) internal {
    require(_isBuilt(_tokenId));
    Tavern storage tavern = tokenTaverns[_tokenId];
    uint256 oActiveness = tavern.activeness;
    uint256 newActiveness = tavern.activeness.add(_deltaActiveness);
    tavern.activeness = newActiveness;
    tokenTaverns[_tokenId] = tavern;
    emit ActivenessUpgrade(_tokenId, oActiveness, newActiveness);
  }
  function _batchActivenessUpgrade(uint256[] _tokenIds, uint256[] __deltaActiveness) internal {
    uint256 i = 0;
    while (i < _tokenIds.length) {
      _activenessUpgrade(_tokenIds[i], __deltaActiveness[i]);
      i += 1;
    }
  }

  function _popularitySetting(uint256 _tokenId, uint8 _popularity) internal {
    require(_isBuilt(_tokenId));
    uint8 oPopularity = tokenTaverns[_tokenId].popularity;
    tokenTaverns[_tokenId].popularity = _popularity;
    emit PopularitySetting(_tokenId, oPopularity, _popularity);
  }

  function _batchPopularitySetting(uint256[] _tokenIds, uint8[] _popularitys) internal {
    uint256 i = 0;
    while (i < _tokenIds.length) {
      _popularitySetting(_tokenIds[i], _popularitys[i]);
      i += 1;
    }
  }

  function _isLongitude (
    int _param
  ) internal pure returns (bool){
    
    return( 
      _param <= 180 * int(10 ** uint256(decimals))&&
      _param >= -180 * int(10 ** uint256(decimals))
      );
  } 

  function _isLatitude (
    int _param
  ) internal pure returns (bool){
    return( 
      _param <= 90 * int(10 ** uint256(decimals))&&
      _param >= -90 * int(10 ** uint256(decimals))
      );
  } 
}

// File: contracts/tavern/Tavern.sol


contract Tavern is ITavern, TavernBase, Superuser {
  
  IPower public powerContract;

  /**
   * @dev set power contract address
   * @param _powerContract contract address
   */
  function setPowerContract(address _powerContract) onlySuperuser external{
    powerContract = IPower(_powerContract);
  }

  
  /**
   * @dev get Tavern's influence by tokenId
   * @param tokenId tokenId
   * @return uint256 Tavern's influence 
   *
   * The influence of Tavern determines its ability to distribute candy daily.
   */
  function influenceByToken(uint256 tokenId) external view returns(uint256) {
    return powerContract.influenceByToken(tokenId);
  }


  /**
   * @dev get Tavern's weightsApportion 
   * @param userLevel userLevel
   * @param lordLevel lordLevel
   * @return uint256 Tavern's weightsApportion
   * The candy that the user rewards when completing the candy mission will be assigned to the user and the lord. 
   * The distribution ratio is determined by weightsApportion
   */
  function weightsApportion(uint256 userLevel, uint256 lordLevel) external view returns(uint256){
    return powerContract.weightsApportion(userLevel, lordLevel);
  }

  /**
   * @dev get Tavern's level by tokenId
   * @param tokenId tokenId
   * @return uint256 Tavern's level
   */
  function levelByToken(uint256 tokenId) external view returns(uint256) {
    return powerContract.levelByToken(tokenId);
  }

  /**
   * @dev get a Tavern's infomation 
   * @param tokenId tokenId
   * @return uint256 Tavern's construction time
   * @return int Tavern's longitude value 
   * @return int Tavern's latitude value
   * @return uint8 Tavern's popularity
   * @return uint256 Tavern's activeness
   */
  function tavern(uint256 tokenId) external view returns (uint256, int, int, uint8, uint256){
    return super._tavern(tokenId);
  }

  /**
   * @dev check the tokenId is built 
   * @param tokenId tokenId
   * @return bool tokenId is built 
   */
  function isBuilt(uint256 tokenId) external view returns (bool){
    return super._isBuilt(tokenId);
  }

  /**
   * @dev build a tavern
   * @param tokenId tokenId
   * @param longitude longitude value 
   * @param latitude latitude value
   * @param popularity popularity
   */
  function build(
    uint256 tokenId,
    int longitude,
    int latitude,
    uint8 popularity
  ) external onlySuperuser {
    super._build(tokenId, longitude, latitude, popularity);
  }

  /**
   * @dev build batch tavern in one transaction
   * @param tokenIds Array of tokenId
   * @param longitudes Array of longitude value 
   * @param latitudes Array of latitude value
   * @param popularitys Array of popularity
   */
  function batchBuild(
    uint256[] tokenIds,
    int[] longitudes,
    int[] latitudes,
    uint8[] popularitys
    ) external onlySuperuser{

    super._batchBuild(
      tokenIds,
      longitudes,
      latitudes,
      popularitys
    );
  }

  /**
   * @dev upgrade Tavern's activeness 
   * @param tokenId tokenId
   * @param deltaActiveness delta activeness
   */
  function activenessUpgrade(uint256 tokenId, uint256 deltaActiveness) onlyOwnerOrSuperuser external {
    super._activenessUpgrade(tokenId, deltaActiveness);
  }

  /**
   * @dev upgrade batch Taverns's activeness 
   * @param tokenIds Array of tokenId
   * @param deltaActiveness  array of delta activeness
   */
  function batchActivenessUpgrade(uint256[] tokenIds, uint256[] deltaActiveness) onlyOwnerOrSuperuser external {
    super._batchActivenessUpgrade(tokenIds, deltaActiveness);
  }

  /**
   * @dev set Taverns's popularity 
   * @param tokenId Tavern's tokenId
   * @param popularity Tavern's popularity
   */
  function popularitySetting(uint256 tokenId, uint8 popularity) onlySuperuser external {
    super._popularitySetting(tokenId, popularity);
  }

  /**
   * @dev set batch Taverns's popularity 
   * @param tokenIds Array of tokenId
   * @param popularitys Array of popularity
   */
  function batchPopularitySetting(uint256[] tokenIds, uint8[] popularitys) onlySuperuser external {
    super._batchPopularitySetting(tokenIds, popularitys);
  }
}

    Contract ABI  
[{"constant":false,"inputs":[{"name":"tokenIds","type":"uint256[]"},{"name":"popularitys","type":"uint8[]"}],"name":"batchPopularitySetting","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"tokenIds","type":"uint256[]"},{"name":"longitudes","type":"int256[]"},{"name":"latitudes","type":"int256[]"},{"name":"popularitys","type":"uint8[]"}],"name":"batchBuild","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_operator","type":"address"},{"name":"_role","type":"string"}],"name":"checkRole","outputs":[],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"tokenId","type":"uint256"},{"name":"popularity","type":"uint8"}],"name":"popularitySetting","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_operator","type":"address"},{"name":"_role","type":"string"}],"name":"hasRole","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"tokenId","type":"uint256"},{"name":"deltaActiveness","type":"uint256"}],"name":"activenessUpgrade","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"tokenId","type":"uint256"},{"name":"longitude","type":"int256"},{"name":"latitude","type":"int256"},{"name":"popularity","type":"uint8"}],"name":"build","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"powerContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"tokenId","type":"uint256"}],"name":"levelByToken","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newSuperuser","type":"address"}],"name":"transferSuperuser","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"tokenId","type":"uint256"}],"name":"influenceByToken","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"tokenId","type":"uint256"}],"name":"isBuilt","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"tokenId","type":"uint256"}],"name":"tavern","outputs":[{"name":"","type":"uint256"},{"name":"","type":"int256"},{"name":"","type":"int256"},{"name":"","type":"uint8"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"userLevel","type":"uint256"},{"name":"lordLevel","type":"uint256"}],"name":"weightsApportion","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_powerContract","type":"address"}],"name":"setPowerContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"tokenIds","type":"uint256[]"},{"name":"deltaActiveness","type":"uint256[]"}],"name":"batchActivenessUpgrade","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_addr","type":"address"}],"name":"isSuperuser","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ROLE_SUPERUSER","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"operator","type":"address"},{"indexed":false,"name":"role","type":"string"}],"name":"RoleAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"operator","type":"address"},{"indexed":false,"name":"role","type":"string"}],"name":"RoleRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"}],"name":"OwnershipRenounced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"time","type":"uint256"},{"indexed":true,"name":"tokenId","type":"uint256"},{"indexed":false,"name":"longitude","type":"int256"},{"indexed":false,"name":"latitude","type":"int256"},{"indexed":false,"name":"popularity","type":"uint8"}],"name":"Build","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"tokenId","type":"uint256"},{"indexed":false,"name":"oActiveness","type":"uint256"},{"indexed":false,"name":"newActiveness","type":"uint256"}],"name":"ActivenessUpgrade","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"tokenId","type":"uint256"},{"indexed":false,"name":"oPopularity","type":"uint256"},{"indexed":false,"name":"newPopularity","type":"uint256"}],"name":"PopularitySetting","type":"event"}]

  Contract Creation Code Switch To Opcodes View
60018054600160a060020a0319163390811790915560c0604052600960809081527f737570657275736572000000000000000000000000000000000000000000000060a052610057919064010000000061005c810204565b61019f565b6100d3826002836040518082805190602001908083835b602083106100925780518252601f199092019160209182019101610073565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092209291505064010000000061017a810261143a1704565b81600160a060020a03167fbfec83d64eaa953f2708271a023ab9ee82057f8f3578d548c1a4ba0b5b700489826040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013c578181015183820152602001610124565b50505050905090810190601f1680156101695780820380516001836020036101000a031916815260200191505b509250505060405180910390a25050565b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6114de80620001af6000396000f3006080604052600436106101275763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305bf4ecc811461012c578063079e0e0e1461015a5780630988ca8c1461019e5780630fce349e14610205578063217fe6c61461022357806326f35ff21461029e578063313ce567146102b957806334122952146102e45780633617653e146103085780634b2422521461033957806357c393fa1461036357806367a7804b14610384578063715018a61461039c5780638da5cb5b146103b1578063a013ab77146103c6578063acb461df146103de578063ae9f96c714610424578063b63c2ac41461043f578063b7b47e3114610460578063bceee05e1461048c578063ebb4f484146104ad578063f2fde38b14610537575b600080fd5b34801561013857600080fd5b506101586024600480358281019290820135918135918201910135610558565b005b34801561016657600080fd5b5061015860246004803582810192908201359181358083019290820135916044358083019290820135916064359182019101356105ec565b3480156101aa57600080fd5b5060408051602060046024803582810135601f8101859004850286018501909652858552610158958335600160a060020a03169536956044949193909101919081908401838280828437509497506106da9650505050505050565b34801561021157600080fd5b5061015860043560ff60243516610748565b34801561022f57600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261028a958335600160a060020a031695369560449491939091019190819084018382808284375094975061077f9650505050505050565b604080519115158252519081900360200190f35b3480156102aa57600080fd5b506101586004356024356107f2565b3480156102c557600080fd5b506102ce610824565b6040805160ff9092168252519081900360200190f35b3480156102f057600080fd5b5061015860043560243560443560ff60643516610829565b34801561031457600080fd5b5061031d610862565b60408051600160a060020a039092168252519081900360200190f35b34801561034557600080fd5b50610351600435610871565b60408051918252519081900360200190f35b34801561036f57600080fd5b50610158600160a060020a0360043516610909565b34801561039057600080fd5b506103516004356109a8565b3480156103a857600080fd5b50610158610a0e565b3480156103bd57600080fd5b5061031d610a7c565b3480156103d257600080fd5b5061028a600435610a8b565b3480156103ea57600080fd5b506103f6600435610a9c565b6040805195865260208601949094528484019290925260ff1660608401526080830152519081900360a00190f35b34801561043057600080fd5b50610351600435602435610abf565b34801561044b57600080fd5b50610158600160a060020a0360043516610b5f565b34801561046c57600080fd5b506101586024600480358281019290820135918135918201910135610bbb565b34801561049857600080fd5b5061028a600160a060020a0360043516610c44565b3480156104b957600080fd5b506104c2610c73565b6040805160208082528351818301528351919283929083019185019080838360005b838110156104fc5781810151838201526020016104e4565b50505050905090810190601f1680156105295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561054357600080fd5b50610158600160a060020a0360043516610c98565b610585336040805190810160405280600981526020016000805160206114938339815191528152506106da565b6105e68484808060200260200160405190810160405280939291908181526020018383602002808284375050604080516020808a02828101820190935289825290955089945088935083925085019084908082843750610cc9945050505050565b50505050565b610619336040805190810160405280600981526020016000805160206114938339815191528152506106da565b6106d08888808060200260200160405190810160405280939291908181526020018383602002808284375050604080516020808e0282810182019093528d82529095508d94508c93508392508501908490808284375050604080516020808d0282810182019093528c82529095508c94508b93508392508501908490808284375050604080516020808c0282810182019093528b82529095508b94508a935083925085019084908082843750610d1a945050505050565b5050505050505050565b610744826002836040518082805190602001908083835b602083106107105780518252601f1990920191602091820191016106f1565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050610d9d565b5050565b610775336040805190810160405280600981526020016000805160206114938339815191528152506106da565b6107448282610db2565b60006107eb836002846040518082805190602001908083835b602083106107b75780518252601f199092019160209182019101610798565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050610e30565b9392505050565b600154600160a060020a031633148061080f575061080f33610c44565b151561081a57600080fd5b6107448282610e4f565b601081565b610856336040805190810160405280600981526020016000805160206114938339815191528152506106da565b6105e684848484610f27565b600354600160a060020a031681565b600354604080517f4b242252000000000000000000000000000000000000000000000000000000008152600481018490529051600092600160a060020a031691634b24225291602480830192602092919082900301818787803b1580156108d757600080fd5b505af11580156108eb573d6000803e3d6000fd5b505050506040513d602081101561090157600080fd5b505192915050565b610936336040805190810160405280600981526020016000805160206114938339815191528152506106da565b600160a060020a038116151561094b57600080fd5b61097833604080519081016040528060098152602001600080516020611493833981519152815250611069565b6109a58160408051908101604052806009815260200160008051602061149383398151915281525061117a565b50565b600354604080517f67a7804b000000000000000000000000000000000000000000000000000000008152600481018490529051600092600160a060020a0316916367a7804b91602480830192602092919082900301818787803b1580156108d757600080fd5b600154600160a060020a03163314610a2557600080fd5b600154604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26001805473ffffffffffffffffffffffffffffffffffffffff19169055565b600154600160a060020a031681565b6000610a968261124c565b92915050565b6000806000806000610aad8661125f565b939a9299509097509550909350915050565b600354604080517fae9f96c700000000000000000000000000000000000000000000000000000000815260048101859052602481018490529051600092600160a060020a03169163ae9f96c791604480830192602092919082900301818787803b158015610b2c57600080fd5b505af1158015610b40573d6000803e3d6000fd5b505050506040513d6020811015610b5657600080fd5b50519392505050565b610b8c336040805190810160405280600981526020016000805160206114938339815191528152506106da565b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600154600160a060020a0316331480610bd85750610bd833610c44565b1515610be357600080fd5b6105e68484808060200260200160405190810160405280939291908181526020018383602002808284375050604080516020808a02828101820190935289825290955089945088935083925085019084908082843750611292945050505050565b6000610a968260408051908101604052806009815260200160008051602061149383398151915281525061077f565b6040805180820190915260098152600080516020611493833981519152602082015281565b600154600160a060020a0316331480610cb55750610cb533610c44565b1515610cc057600080fd5b6109a5816112de565b60005b8251811015610d1557610d0d8382815181101515610ce657fe5b906020019060200201518383815181101515610cfe57fe5b90602001906020020151610db2565b600101610ccc565b505050565b60005b8451811015610d9657610d8e8582815181101515610d3757fe5b906020019060200201518583815181101515610d4f57fe5b906020019060200201518584815181101515610d6757fe5b906020019060200201518585815181101515610d7f57fe5b90602001906020020151610f27565b600101610d1d565b5050505050565b610da78282610e30565b151561074457600080fd5b6000610dbd8361124c565b1515610dc857600080fd5b5060008281526020818152604091829020600301805460ff85811660ff198316811790935584519116808252928101919091528251919285927facd6459292f3aac14dbebedda828c584d92b27d310bf89be5d401ba749889d559281900390910190a2505050565b600160a060020a03166000908152602091909152604090205460ff1690565b6000806000610e5d8561124c565b1515610e6857600080fd5b600085815260208190526040902060048101549093509150610e90828563ffffffff61135c16565b600480850182815560008881526020818152604091829020885481556001808a0154908201556002808a0154908201556003808a0154908201805460ff191660ff909216919091179055925492909301919091558051858152918201839052805192935087927f76616e42f6ab2514ff6fd15dbcb0b35ef9486f70572d831315927a901dd061cb9281900390910190a25050505050565b6000610f3161145f565b610f3a8661124c565b15610f4457600080fd5b610f4d856113ce565b1515610f5857600080fd5b610f61846113f3565b1515610f6c57600080fd5b60ff83161515610f7b57600080fd5b42915060a0604051908101604052808381526020018681526020018581526020018460ff168152602001600081525090508060008088815260200190815260200160002060008201518160000155602082015181600101556040820151816002015560608201518160030160006101000a81548160ff021916908360ff16021790555060808201518160040155905050857ffc2ab367d562309ce194380f232507104de3834c43e4a7a34800f35bd60220c983878787604051808581526020018481526020018381526020018260ff1660ff16815260200194505050505060405180910390a2505050505050565b6110d3826002836040518082805190602001908083835b6020831061109f5780518252601f199092019160209182019101611080565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050611418565b81600160a060020a03167fd211483f91fc6eff862467f8de606587a30c8fc9981056f051b897a418df803a826040518080602001828103825283818151815260200191508051906020019080838360005b8381101561113c578181015183820152602001611124565b50505050905090810190601f1680156111695780820380516001836020036101000a031916815260200191505b509250505060405180910390a25050565b6111e4826002836040518082805190602001908083835b602083106111b05780518252601f199092019160209182019101611191565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092209291505061143a565b81600160a060020a03167fbfec83d64eaa953f2708271a023ab9ee82057f8f3578d548c1a4ba0b5b700489826040518080602001828103825283818151815260200191508051906020019080838360008381101561113c578181015183820152602001611124565b6000908152602081905260408120541190565b6000908152602081905260409020805460018201546002830154600384015460049094015492949193909260ff90911691565b60005b8251811015610d15576112d683828151811015156112af57fe5b9060200190602002015183838151811015156112c757fe5b90602001906020020151610e4f565b600101611295565b600160a060020a03811615156112f357600080fd5b600154604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b81810182811015610a9657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f536166654d61746820616464206661696c656400000000000000000000000000604482015290519081900360640190fd5b60006718fae27693b400008213801590610a965750506718fae27693b3ffff19131590565b6000670c7d713b49da00008213801590610a96575050670c7d713b49d9ffff19131590565b600160a060020a0316600090815260209190915260409020805460ff19169055565b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b60a060405190810160405280600081526020016000815260200160008152602001600060ff16815260200160008152509056007375706572757365720000000000000000000000000000000000000000000000a165627a7a7230582004f54cde46833eaadcef6fd7612f7a9acf415d1cbd62321da6abb4f54a0209bb0029

   Swarm Source:
bzzr://04f54cde46833eaadcef6fd7612f7a9acf415d1cbd62321da6abb4f54a0209bb

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward