ETH Price: $1,890.94 (-1.03%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Buy GUM75066032019-04-05 6:59:492174 days ago1554447589IN
MCH: Gum Gateway 6
0.05 ETH0.0002850510
Buy GUM74316562019-03-24 13:29:132185 days ago1553434153IN
MCH: Gum Gateway 6
0.1 ETH0.000028441
Pause73966872019-03-19 2:51:122191 days ago1552963872IN
MCH: Gum Gateway 6
0 ETH0.000087242
Withdraw Ether73966832019-03-19 2:50:162191 days ago1552963816IN
MCH: Gum Gateway 6
0 ETH0.00005952
Buy GUM73961222019-03-19 0:43:432191 days ago1552956223IN
MCH: Gum Gateway 6
0.05 ETH0.0007576110
Buy GUM73959612019-03-19 0:03:352191 days ago1552953815IN
MCH: Gum Gateway 6
0.05 ETH0.000181464
Buy GUM73958052019-03-18 23:26:392191 days ago1552951599IN
MCH: Gum Gateway 6
0.1 ETH0.000049431
Buy GUM73943312019-03-18 17:48:162191 days ago1552931296IN
MCH: Gum Gateway 6
0.05 ETH0.000172923
Buy GUM73941952019-03-18 17:18:232191 days ago1552929503IN
MCH: Gum Gateway 6
5 ETH0.000099172
Buy GUM73941852019-03-18 17:16:052191 days ago1552929365IN
MCH: Gum Gateway 6
0.05 ETH0.000429256
Buy GUM73941452019-03-18 17:09:022191 days ago1552928942IN
MCH: Gum Gateway 6
0.1 ETH0.000429256
Buy GUM73941042019-03-18 16:57:222191 days ago1552928242IN
MCH: Gum Gateway 6
0.1 ETH0.000429256
Buy GUM73940882019-03-18 16:52:322191 days ago1552927952IN
MCH: Gum Gateway 6
0.1 ETH0.000430146
Buy GUM73940632019-03-18 16:48:032191 days ago1552927683IN
MCH: Gum Gateway 6
0.1 ETH0.000429256
Buy GUM73939502019-03-18 16:23:222191 days ago1552926202IN
MCH: Gum Gateway 6
0.1 ETH0.000151652
Buy GUM73939472019-03-18 16:23:072191 days ago1552926187IN
MCH: Gum Gateway 6
0.1 ETH0.000151652
Buy GUM73938382019-03-18 16:03:022191 days ago1552924982IN
MCH: Gum Gateway 6
0.1 ETH0.000507357.09167832
Buy GUM73937562019-03-18 15:45:502191 days ago1552923950IN
MCH: Gum Gateway 6
0.05 ETH0.000215073
Buy GUM73937472019-03-18 15:44:332191 days ago1552923873IN
MCH: Gum Gateway 6
0.1 ETH0.000078781.1
Buy GUM73937102019-03-18 15:37:302191 days ago1552923450IN
MCH: Gum Gateway 6
0.05 ETH0.000286424
Buy GUM73934632019-03-18 14:39:442191 days ago1552919984IN
MCH: Gum Gateway 6
0.1 ETH0.000119112.40625
Buy GUM73929642019-03-18 12:53:122191 days ago1552913592IN
MCH: Gum Gateway 6
0.1 ETH0.000341214.5
Buy GUM73928952019-03-18 12:33:552191 days ago1552912435IN
MCH: Gum Gateway 6
0.05 ETH0.000115452
Buy GUM73928002019-03-18 12:10:022191 days ago1552911002IN
MCH: Gum Gateway 6
0.05 ETH0.000227473
Buy GUM73925642019-03-18 11:17:122192 days ago1552907832IN
MCH: Gum Gateway 6
0.1 ETH0.000099161.99999988
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Method Block
From
To
-73966832019-03-19 2:50:162191 days ago1552963816
MCH: Gum Gateway 6
1,442.675 ETH
-73961222019-03-19 0:43:432191 days ago1552956223
MCH: Gum Gateway 6
0.015 ETH
-73943312019-03-18 17:48:162191 days ago1552931296
MCH: Gum Gateway 6
0.01 ETH
-73941852019-03-18 17:16:052191 days ago1552929365
MCH: Gum Gateway 6
0.015 ETH
-73941452019-03-18 17:09:022191 days ago1552928942
MCH: Gum Gateway 6
0.03 ETH
-73941042019-03-18 16:57:222191 days ago1552928242
MCH: Gum Gateway 6
0.03 ETH
-73940882019-03-18 16:52:322191 days ago1552927952
MCH: Gum Gateway 6
0.03 ETH
-73940632019-03-18 16:48:032191 days ago1552927683
MCH: Gum Gateway 6
0.03 ETH
-73939502019-03-18 16:23:222191 days ago1552926202
MCH: Gum Gateway 6
0.03 ETH
-73939472019-03-18 16:23:072191 days ago1552926187
MCH: Gum Gateway 6
0.03 ETH
-73938382019-03-18 16:03:022191 days ago1552924982
MCH: Gum Gateway 6
0.03 ETH
-73937562019-03-18 15:45:502191 days ago1552923950
MCH: Gum Gateway 6
0.015 ETH
-73937472019-03-18 15:44:332191 days ago1552923873
MCH: Gum Gateway 6
0.03 ETH
-73937102019-03-18 15:37:302191 days ago1552923450
MCH: Gum Gateway 6
0.015 ETH
-73929642019-03-18 12:53:122191 days ago1552913592
MCH: Gum Gateway 6
0.03 ETH
-73928952019-03-18 12:33:552191 days ago1552912435
MCH: Gum Gateway 6
0.01 ETH
-73928002019-03-18 12:10:022191 days ago1552911002
MCH: Gum Gateway 6
0.015 ETH
-73925622019-03-18 11:16:562192 days ago1552907816
MCH: Gum Gateway 6
0.03 ETH
-73925612019-03-18 11:16:402192 days ago1552907800
MCH: Gum Gateway 6
0.03 ETH
-73922902019-03-18 10:12:552192 days ago1552903975
MCH: Gum Gateway 6
0.015 ETH
-73921752019-03-18 9:47:242192 days ago1552902444
MCH: Gum Gateway 6
0.3 ETH
-73921752019-03-18 9:47:242192 days ago1552902444
MCH: Gum Gateway 6
0.3 ETH
-73919792019-03-18 8:59:492192 days ago1552899589
MCH: Gum Gateway 6
0.015 ETH
-73919792019-03-18 8:59:492192 days ago1552899589
MCH: Gum Gateway 6
0.01 ETH
-73918092019-03-18 8:21:442192 days ago1552897304
MCH: Gum Gateway 6
0.03 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MCHGUMGatewayV6

Compiler Version
v0.5.4+commit.9549d8ff

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2019-02-22
*/

pragma solidity ^0.5.2;

// File: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/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 private _owner;

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

    /**
     * @dev The Ownable constructor sets the original `owner` of the contract to the sender
     * account.
     */
    constructor () internal {
        _owner = msg.sender;
        emit OwnershipTransferred(address(0), _owner);
    }

    /**
     * @return the address of the owner.
     */
    function owner() public view returns (address) {
        return _owner;
    }

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

    /**
     * @return true if `msg.sender` is the owner of the contract.
     */
    function isOwner() public view returns (bool) {
        return 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 OwnershipTransferred(_owner, address(0));
        _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: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/contracts/token/ERC20/IERC20.sol

/**
 * @title ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
interface IERC20 {
    function transfer(address to, uint256 value) external returns (bool);

    function approve(address spender, uint256 value) external returns (bool);

    function transferFrom(address from, address to, uint256 value) external returns (bool);

    function totalSupply() external view returns (uint256);

    function balanceOf(address who) external view returns (uint256);

    function allowance(address owner, address spender) external view returns (uint256);

    event Transfer(address indexed from, address indexed to, uint256 value);

    event Approval(address indexed owner, address indexed spender, uint256 value);
}

// File: contracts/lib/github.com/contract-library/contract-library-0.0.4/contracts/ownership/Withdrawable.sol

contract Withdrawable is Ownable {
  function withdrawEther() external onlyOwner {
    msg.sender.transfer(address(this).balance);
  }

  function withdrawToken(IERC20 _token) external onlyOwner {
    require(_token.transfer(msg.sender, _token.balanceOf(address(this))));
  }
}

// File: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/contracts/access/Roles.sol

/**
 * @title Roles
 * @dev Library for managing addresses assigned to a Role.
 */
library Roles {
    struct Role {
        mapping (address => bool) bearer;
    }

    /**
     * @dev give an account access to this role
     */
    function add(Role storage role, address account) internal {
        require(account != address(0));
        require(!has(role, account));

        role.bearer[account] = true;
    }

    /**
     * @dev remove an account's access to this role
     */
    function remove(Role storage role, address account) internal {
        require(account != address(0));
        require(has(role, account));

        role.bearer[account] = false;
    }

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

// File: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/contracts/access/roles/PauserRole.sol

contract PauserRole {
    using Roles for Roles.Role;

    event PauserAdded(address indexed account);
    event PauserRemoved(address indexed account);

    Roles.Role private _pausers;

    constructor () internal {
        _addPauser(msg.sender);
    }

    modifier onlyPauser() {
        require(isPauser(msg.sender));
        _;
    }

    function isPauser(address account) public view returns (bool) {
        return _pausers.has(account);
    }

    function addPauser(address account) public onlyPauser {
        _addPauser(account);
    }

    function renouncePauser() public {
        _removePauser(msg.sender);
    }

    function _addPauser(address account) internal {
        _pausers.add(account);
        emit PauserAdded(account);
    }

    function _removePauser(address account) internal {
        _pausers.remove(account);
        emit PauserRemoved(account);
    }
}

// File: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/contracts/lifecycle/Pausable.sol

/**
 * @title Pausable
 * @dev Base contract which allows children to implement an emergency stop mechanism.
 */
contract Pausable is PauserRole {
    event Paused(address account);
    event Unpaused(address account);

    bool private _paused;

    constructor () internal {
        _paused = false;
    }

    /**
     * @return true if the contract is paused, false otherwise.
     */
    function paused() public view returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     */
    modifier whenNotPaused() {
        require(!_paused);
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     */
    modifier whenPaused() {
        require(_paused);
        _;
    }

    /**
     * @dev called by the owner to pause, triggers stopped state
     */
    function pause() public onlyPauser whenNotPaused {
        _paused = true;
        emit Paused(msg.sender);
    }

    /**
     * @dev called by the owner to unpause, returns to normal state
     */
    function unpause() public onlyPauser whenPaused {
        _paused = false;
        emit Unpaused(msg.sender);
    }
}

// File: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/contracts/math/SafeMath.sol

/**
 * @title SafeMath
 * @dev Unsigned math operations with safety checks that revert on error
 */
library SafeMath {
    /**
    * @dev Multiplies two unsigned integers, reverts on overflow.
    */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b);

        return c;
    }

    /**
    * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
    */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
    * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
    */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a);
        uint256 c = a - b;

        return c;
    }

    /**
    * @dev Adds two unsigned integers, reverts on overflow.
    */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a);

        return c;
    }

    /**
    * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
    * reverts when dividing by zero.
    */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b != 0);
        return a % b;
    }
}

// File: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/contracts/utils/ReentrancyGuard.sol

/**
 * @title Helps contracts guard against reentrancy attacks.
 * @author Remco Bloemen <remco@2π.com>, Eenae <[email protected]>
 * @dev If you mark a function `nonReentrant`, you should also
 * mark it `external`.
 */
contract ReentrancyGuard {
    /// @dev counter to allow mutex lock with only one SSTORE operation
    uint256 private _guardCounter;

    constructor () internal {
        // The counter starts at one to prevent changing it from zero to a non-zero
        // value, which is a more expensive operation.
        _guardCounter = 1;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _guardCounter += 1;
        uint256 localCounter = _guardCounter;
        _;
        require(localCounter == _guardCounter);
    }
}

// File: contracts/lib/github.com/contract-library/contract-library-0.0.4/contracts/DJTBase.sol

contract DJTBase is Withdrawable, Pausable, ReentrancyGuard {
    using SafeMath for uint256;
}

// File: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/contracts/cryptography/ECDSA.sol

/**
 * @title Elliptic curve signature operations
 * @dev Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d
 * TODO Remove this library once solidity supports passing a signature to ecrecover.
 * See https://github.com/ethereum/solidity/issues/864
 */

library ECDSA {
    /**
     * @dev Recover signer address from a message by using their signature
     * @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address.
     * @param signature bytes signature, the signature is generated using web3.eth.sign()
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        bytes32 r;
        bytes32 s;
        uint8 v;

        // Check the signature length
        if (signature.length != 65) {
            return (address(0));
        }

        // Divide the signature in r, s and v variables
        // ecrecover takes the signature parameters, and the only way to get them
        // currently is to use assembly.
        // solhint-disable-next-line no-inline-assembly
        assembly {
            r := mload(add(signature, 0x20))
            s := mload(add(signature, 0x40))
            v := byte(0, mload(add(signature, 0x60)))
        }

        // Version of signature should be 27 or 28, but 0 and 1 are also possible versions
        if (v < 27) {
            v += 27;
        }

        // If the version is correct return the signer address
        if (v != 27 && v != 28) {
            return (address(0));
        } else {
            return ecrecover(hash, v, r, s);
        }
    }

    /**
     * toEthSignedMessageHash
     * @dev prefix a bytes32 value with "\x19Ethereum Signed Message:"
     * and hash the result
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }
}

// File: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/contracts/introspection/IERC165.sol

/**
 * @title IERC165
 * @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md
 */
interface IERC165 {
    /**
     * @notice Query if a contract implements an interface
     * @param interfaceId The interface identifier, as specified in ERC-165
     * @dev Interface identification is specified in ERC-165. This function
     * uses less than 30,000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

// File: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/contracts/token/ERC721/IERC721.sol

/**
 * @title ERC721 Non-Fungible Token Standard basic interface
 * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract IERC721 is IERC165 {
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    function balanceOf(address owner) public view returns (uint256 balance);
    function ownerOf(uint256 tokenId) public view returns (address owner);

    function approve(address to, uint256 tokenId) public;
    function getApproved(uint256 tokenId) public view returns (address operator);

    function setApprovalForAll(address operator, bool _approved) public;
    function isApprovedForAll(address owner, address operator) public view returns (bool);

    function transferFrom(address from, address to, uint256 tokenId) public;
    function safeTransferFrom(address from, address to, uint256 tokenId) public;

    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public;
}

// File: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/contracts/token/ERC721/IERC721Receiver.sol

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
contract IERC721Receiver {
    /**
     * @notice Handle the receipt of an NFT
     * @dev The ERC721 smart contract calls this function on the recipient
     * after a `safeTransfer`. This function MUST return the function selector,
     * otherwise the caller will revert the transaction. The selector to be
     * returned can be obtained as `this.onERC721Received.selector`. This
     * function MAY throw to revert and reject the transfer.
     * Note: the ERC721 contract address is always the message sender.
     * @param operator The address which called `safeTransferFrom` function
     * @param from The address which previously owned the token
     * @param tokenId The NFT identifier which is being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
     */
    function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data)
    public returns (bytes4);
}

// File: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/contracts/utils/Address.sol

/**
 * Utility library of inline functions on addresses
 */
library Address {
    /**
     * Returns whether the target address is a contract
     * @dev This function will return false if invoked during the constructor of a contract,
     * as the code is not actually created until after the constructor finishes.
     * @param account address of the account to check
     * @return whether the target address is a contract
     */
    function isContract(address account) internal view returns (bool) {
        uint256 size;
        // XXX Currently there is no better way to check if there is a contract in an address
        // than to check the size of the code at that address.
        // See https://ethereum.stackexchange.com/a/14016/36603
        // for more details about how this works.
        // TODO Check this again before the Serenity release, because all addresses will be
        // contracts then.
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }
}

// File: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/contracts/introspection/ERC165.sol

/**
 * @title ERC165
 * @author Matt Condon (@shrugs)
 * @dev Implements ERC165 using a lookup table.
 */
contract ERC165 is IERC165 {
    bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;
    /**
     * 0x01ffc9a7 ===
     *     bytes4(keccak256('supportsInterface(bytes4)'))
     */

    /**
     * @dev a mapping of interface id to whether or not it's supported
     */
    mapping(bytes4 => bool) private _supportedInterfaces;

    /**
     * @dev A contract implementing SupportsInterfaceWithLookup
     * implement ERC165 itself
     */
    constructor () internal {
        _registerInterface(_INTERFACE_ID_ERC165);
    }

    /**
     * @dev implement supportsInterface(bytes4) using a lookup table
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool) {
        return _supportedInterfaces[interfaceId];
    }

    /**
     * @dev internal method for registering an interface
     */
    function _registerInterface(bytes4 interfaceId) internal {
        require(interfaceId != 0xffffffff);
        _supportedInterfaces[interfaceId] = true;
    }
}

// File: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/contracts/token/ERC721/ERC721.sol

/**
 * @title ERC721 Non-Fungible Token Standard basic implementation
 * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract ERC721 is ERC165, IERC721 {
    using SafeMath for uint256;
    using Address for address;

    // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
    // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector`
    bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;

    // Mapping from token ID to owner
    mapping (uint256 => address) private _tokenOwner;

    // Mapping from token ID to approved address
    mapping (uint256 => address) private _tokenApprovals;

    // Mapping from owner to number of owned token
    mapping (address => uint256) private _ownedTokensCount;

    // Mapping from owner to operator approvals
    mapping (address => mapping (address => bool)) private _operatorApprovals;

    bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;
    /*
     * 0x80ac58cd ===
     *     bytes4(keccak256('balanceOf(address)')) ^
     *     bytes4(keccak256('ownerOf(uint256)')) ^
     *     bytes4(keccak256('approve(address,uint256)')) ^
     *     bytes4(keccak256('getApproved(uint256)')) ^
     *     bytes4(keccak256('setApprovalForAll(address,bool)')) ^
     *     bytes4(keccak256('isApprovedForAll(address,address)')) ^
     *     bytes4(keccak256('transferFrom(address,address,uint256)')) ^
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256)')) ^
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)'))
     */

    constructor () public {
        // register the supported interfaces to conform to ERC721 via ERC165
        _registerInterface(_INTERFACE_ID_ERC721);
    }

    /**
     * @dev Gets the balance of the specified address
     * @param owner address to query the balance of
     * @return uint256 representing the amount owned by the passed address
     */
    function balanceOf(address owner) public view returns (uint256) {
        require(owner != address(0));
        return _ownedTokensCount[owner];
    }

    /**
     * @dev Gets the owner of the specified token ID
     * @param tokenId uint256 ID of the token to query the owner of
     * @return owner address currently marked as the owner of the given token ID
     */
    function ownerOf(uint256 tokenId) public view returns (address) {
        address owner = _tokenOwner[tokenId];
        require(owner != address(0));
        return owner;
    }

    /**
     * @dev Approves another address to transfer the given token ID
     * The zero address indicates there is no approved address.
     * There can only be one approved address per token at a given time.
     * Can only be called by the token owner or an approved operator.
     * @param to address to be approved for the given token ID
     * @param tokenId uint256 ID of the token to be approved
     */
    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);
    }

    /**
     * @dev Gets the approved address for a token ID, or zero if no address set
     * Reverts if the token ID does not exist.
     * @param tokenId uint256 ID of the token to query the approval of
     * @return address currently approved for the given token ID
     */
    function getApproved(uint256 tokenId) public view returns (address) {
        require(_exists(tokenId));
        return _tokenApprovals[tokenId];
    }

    /**
     * @dev Sets or unsets the approval of a given operator
     * An operator is allowed to transfer all tokens of the sender on their behalf
     * @param to operator address to set the approval
     * @param approved representing the status of the approval to be set
     */
    function setApprovalForAll(address to, bool approved) public {
        require(to != msg.sender);
        _operatorApprovals[msg.sender][to] = approved;
        emit ApprovalForAll(msg.sender, to, approved);
    }

    /**
     * @dev Tells whether an operator is approved by a given owner
     * @param owner owner address which you want to query the approval of
     * @param operator operator address which you want to query the approval of
     * @return bool whether the given operator is approved by the given owner
     */
    function isApprovedForAll(address owner, address operator) public view returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev Transfers the ownership of a given token ID to another address
     * Usage of this method is discouraged, use `safeTransferFrom` whenever possible
     * Requires the msg sender to be the owner, approved, or operator
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
    */
    function transferFrom(address from, address to, uint256 tokenId) public {
        require(_isApprovedOrOwner(msg.sender, tokenId));

        _transferFrom(from, to, tokenId);
    }

    /**
     * @dev Safely transfers the ownership of a given token ID to another address
     * If the target address is a contract, it must implement `onERC721Received`,
     * which is called upon a safe transfer, and return the magic value
     * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
     * the transfer is reverted.
     *
     * Requires the msg sender to be the owner, approved, or operator
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
    */
    function safeTransferFrom(address from, address to, uint256 tokenId) public {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev Safely transfers the ownership of a given token ID to another address
     * If the target address is a contract, it must implement `onERC721Received`,
     * which is called upon a safe transfer, and return the magic value
     * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
     * the transfer is reverted.
     * Requires the msg sender to be the owner, approved, or operator
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes data to send along with a safe transfer check
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public {
        transferFrom(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data));
    }

    /**
     * @dev Returns whether the specified token exists
     * @param tokenId uint256 ID of the token to query the existence of
     * @return whether the token exists
     */
    function _exists(uint256 tokenId) internal view returns (bool) {
        address owner = _tokenOwner[tokenId];
        return owner != address(0);
    }

    /**
     * @dev Returns whether the given spender can transfer a given token ID
     * @param spender address of the spender to query
     * @param tokenId uint256 ID of the token to be transferred
     * @return bool whether the msg.sender is approved for the given token ID,
     *    is an operator of the owner, or is the owner of the token
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) {
        address owner = ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Internal function to mint a new token
     * Reverts if the given token ID already exists
     * @param to The address that will own the minted token
     * @param tokenId uint256 ID of the token to be minted
     */
    function _mint(address to, uint256 tokenId) internal {
        require(to != address(0));
        require(!_exists(tokenId));

        _tokenOwner[tokenId] = to;
        _ownedTokensCount[to] = _ownedTokensCount[to].add(1);

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

    /**
     * @dev Internal function to burn a specific token
     * Reverts if the token does not exist
     * Deprecated, use _burn(uint256) instead.
     * @param owner owner of the token to burn
     * @param tokenId uint256 ID of the token being burned
     */
    function _burn(address owner, uint256 tokenId) internal {
        require(ownerOf(tokenId) == owner);

        _clearApproval(tokenId);

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

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

    /**
     * @dev Internal function to burn a specific token
     * Reverts if the token does not exist
     * @param tokenId uint256 ID of the token being burned
     */
    function _burn(uint256 tokenId) internal {
        _burn(ownerOf(tokenId), tokenId);
    }

    /**
     * @dev Internal function to transfer ownership of a given token ID to another address.
     * As opposed to transferFrom, this imposes no restrictions on msg.sender.
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
    */
    function _transferFrom(address from, address to, uint256 tokenId) internal {
        require(ownerOf(tokenId) == from);
        require(to != address(0));

        _clearApproval(tokenId);

        _ownedTokensCount[from] = _ownedTokensCount[from].sub(1);
        _ownedTokensCount[to] = _ownedTokensCount[to].add(1);

        _tokenOwner[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }

    /**
     * @dev Internal function to invoke `onERC721Received` on a target address
     * The call is not executed if the target address is not a contract
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
        internal returns (bool)
    {
        if (!to.isContract()) {
            return true;
        }

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

    /**
     * @dev Private function to clear current approval of a given token ID
     * @param tokenId uint256 ID of the token to be transferred
     */
    function _clearApproval(uint256 tokenId) private {
        if (_tokenApprovals[tokenId] != address(0)) {
            _tokenApprovals[tokenId] = address(0);
        }
    }
}

// File: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/contracts/access/roles/MinterRole.sol

contract MinterRole {
    using Roles for Roles.Role;

    event MinterAdded(address indexed account);
    event MinterRemoved(address indexed account);

    Roles.Role private _minters;

    constructor () internal {
        _addMinter(msg.sender);
    }

    modifier onlyMinter() {
        require(isMinter(msg.sender));
        _;
    }

    function isMinter(address account) public view returns (bool) {
        return _minters.has(account);
    }

    function addMinter(address account) public onlyMinter {
        _addMinter(account);
    }

    function renounceMinter() public {
        _removeMinter(msg.sender);
    }

    function _addMinter(address account) internal {
        _minters.add(account);
        emit MinterAdded(account);
    }

    function _removeMinter(address account) internal {
        _minters.remove(account);
        emit MinterRemoved(account);
    }
}

// File: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/contracts/token/ERC721/ERC721Mintable.sol

/**
 * @title ERC721Mintable
 * @dev ERC721 minting logic
 */
contract ERC721Mintable is ERC721, MinterRole {
    /**
     * @dev Function to mint tokens
     * @param to The address that will receive the minted tokens.
     * @param tokenId The token id to mint.
     * @return A boolean that indicates if the operation was successful.
     */
    function mint(address to, uint256 tokenId) public onlyMinter returns (bool) {
        _mint(to, tokenId);
        return true;
    }
}

// File: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/contracts/token/ERC721/ERC721Pausable.sol

/**
 * @title ERC721 Non-Fungible Pausable token
 * @dev ERC721 modified with pausable transfers.
 **/
contract ERC721Pausable is ERC721, Pausable {
    function approve(address to, uint256 tokenId) public whenNotPaused {
        super.approve(to, tokenId);
    }

    function setApprovalForAll(address to, bool approved) public whenNotPaused {
        super.setApprovalForAll(to, approved);
    }

    function transferFrom(address from, address to, uint256 tokenId) public whenNotPaused {
        super.transferFrom(from, to, tokenId);
    }
}

// File: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/contracts/token/ERC721/IERC721Enumerable.sol

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract IERC721Enumerable is IERC721 {
    function totalSupply() public view returns (uint256);
    function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256 tokenId);

    function tokenByIndex(uint256 index) public view returns (uint256);
}

// File: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/contracts/token/ERC721/ERC721Enumerable.sol

/**
 * @title ERC-721 Non-Fungible Token with optional enumeration extension logic
 * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract ERC721Enumerable is ERC165, ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => uint256[]) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

    bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63;
    /**
     * 0x780e9d63 ===
     *     bytes4(keccak256('totalSupply()')) ^
     *     bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) ^
     *     bytes4(keccak256('tokenByIndex(uint256)'))
     */

    /**
     * @dev Constructor function
     */
    constructor () public {
        // register the supported interface to conform to ERC721 via ERC165
        _registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
    }

    /**
     * @dev Gets the token ID at a given index of the tokens list of the requested owner
     * @param owner address owning the tokens list to be accessed
     * @param index uint256 representing the index to be accessed of the requested tokens list
     * @return uint256 token ID at the given index of the tokens list owned by the requested address
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) {
        require(index < balanceOf(owner));
        return _ownedTokens[owner][index];
    }

    /**
     * @dev Gets the total amount of tokens stored by the contract
     * @return uint256 representing the total amount of tokens
     */
    function totalSupply() public view returns (uint256) {
        return _allTokens.length;
    }

    /**
     * @dev Gets the token ID at a given index of all the tokens in this contract
     * Reverts if the index is greater or equal to the total number of tokens
     * @param index uint256 representing the index to be accessed of the tokens list
     * @return uint256 token ID at the given index of the tokens list
     */
    function tokenByIndex(uint256 index) public view returns (uint256) {
        require(index < totalSupply());
        return _allTokens[index];
    }

    /**
     * @dev Internal function to transfer ownership of a given token ID to another address.
     * As opposed to transferFrom, this imposes no restrictions on msg.sender.
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
    */
    function _transferFrom(address from, address to, uint256 tokenId) internal {
        super._transferFrom(from, to, tokenId);

        _removeTokenFromOwnerEnumeration(from, tokenId);

        _addTokenToOwnerEnumeration(to, tokenId);
    }

    /**
     * @dev Internal function to mint a new token
     * Reverts if the given token ID already exists
     * @param to address the beneficiary that will own the minted token
     * @param tokenId uint256 ID of the token to be minted
     */
    function _mint(address to, uint256 tokenId) internal {
        super._mint(to, tokenId);

        _addTokenToOwnerEnumeration(to, tokenId);

        _addTokenToAllTokensEnumeration(tokenId);
    }

    /**
     * @dev Internal function to burn a specific token
     * Reverts if the token does not exist
     * Deprecated, use _burn(uint256) instead
     * @param owner owner of the token to burn
     * @param tokenId uint256 ID of the token being burned
     */
    function _burn(address owner, uint256 tokenId) internal {
        super._burn(owner, tokenId);

        _removeTokenFromOwnerEnumeration(owner, tokenId);
        // Since tokenId will be deleted, we can clear its slot in _ownedTokensIndex to trigger a gas refund
        _ownedTokensIndex[tokenId] = 0;

        _removeTokenFromAllTokensEnumeration(tokenId);
    }

    /**
     * @dev Gets the list of token IDs of the requested owner
     * @param owner address owning the tokens
     * @return uint256[] List of token IDs owned by the requested address
     */
    function _tokensOfOwner(address owner) internal view returns (uint256[] storage) {
        return _ownedTokens[owner];
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        _ownedTokensIndex[tokenId] = _ownedTokens[to].length;
        _ownedTokens[to].push(tokenId);
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the _ownedTokensIndex mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _ownedTokens[from].length.sub(1);
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        _ownedTokens[from].length--;

        // Note that _ownedTokensIndex[tokenId] hasn't been cleared: it still points to the old slot (now occcupied by
        // lasTokenId, or just over the end of the array if the token was the last one).
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length.sub(1);
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        _allTokens.length--;
        _allTokensIndex[tokenId] = 0;
    }
}

// File: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/contracts/token/ERC721/IERC721Metadata.sol

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract IERC721Metadata is IERC721 {
    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

// File: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/contracts/token/ERC721/ERC721Metadata.sol

contract ERC721Metadata is ERC165, ERC721, IERC721Metadata {
    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Optional mapping for token URIs
    mapping(uint256 => string) private _tokenURIs;

    bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;
    /**
     * 0x5b5e139f ===
     *     bytes4(keccak256('name()')) ^
     *     bytes4(keccak256('symbol()')) ^
     *     bytes4(keccak256('tokenURI(uint256)'))
     */

    /**
     * @dev Constructor function
     */
    constructor (string memory name, string memory symbol) public {
        _name = name;
        _symbol = symbol;

        // register the supported interfaces to conform to ERC721 via ERC165
        _registerInterface(_INTERFACE_ID_ERC721_METADATA);
    }

    /**
     * @dev Gets the token name
     * @return string representing the token name
     */
    function name() external view returns (string memory) {
        return _name;
    }

    /**
     * @dev Gets the token symbol
     * @return string representing the token symbol
     */
    function symbol() external view returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns an URI for a given token ID
     * Throws if the token ID does not exist. May return an empty string.
     * @param tokenId uint256 ID of the token to query
     */
    function tokenURI(uint256 tokenId) external view returns (string memory) {
        require(_exists(tokenId));
        return _tokenURIs[tokenId];
    }

    /**
     * @dev Internal function to set the token URI for a given token
     * Reverts if the token ID does not exist
     * @param tokenId uint256 ID of the token to set its URI
     * @param uri string URI to assign
     */
    function _setTokenURI(uint256 tokenId, string memory uri) internal {
        require(_exists(tokenId));
        _tokenURIs[tokenId] = uri;
    }

    /**
     * @dev Internal function to burn a specific token
     * Reverts if the token does not exist
     * Deprecated, use _burn(uint256) instead
     * @param owner owner of the token to burn
     * @param tokenId uint256 ID of the token being burned by the msg.sender
     */
    function _burn(address owner, uint256 tokenId) internal {
        super._burn(owner, tokenId);

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

// File: contracts/lib/github.com/OpenZeppelin/openzeppelin-solidity-2.1.2/contracts/token/ERC721/ERC721FUll.sol

/**
 * @title Full ERC721 Token
 * This implementation includes all the required and some optional functionality of the ERC721 standard
 * Moreover, it includes approve all functionality using operator terminology
 * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract ERC721Full is ERC721, ERC721Enumerable, ERC721Metadata {
    constructor (string memory name, string memory symbol) public ERC721Metadata(name, symbol) {
        // solhint-disable-previous-line no-empty-blocks
    }
}

// File: contracts/LandSectorAsset.sol

/* solhint-disable indent*/
pragma solidity 0.5.4;





contract LandSectorAsset is ERC721Full, ERC721Mintable, ERC721Pausable {


  uint256 public constant SHARE_RATE_DECIMAL = 10**18;

  uint16 public constant LEGENDARY_RARITY = 5;
  uint16 public constant EPIC_RARITY = 4;
  uint16 public constant RARE_RARITY = 3;
  uint16 public constant UNCOMMON_RARITY = 2;
  uint16 public constant COMMON_RARITY = 1;

  uint16 public constant NO_LAND = 0;

  string public tokenURIPrefix = "https://www.mycryptoheroes.net/metadata/land/";

  mapping(uint16 => uint256) private landTypeToTotalVolume;
  mapping(uint16 => uint256) private landTypeToSectorSupplyLimit;
  mapping(uint16 => mapping(uint16 => uint256)) private landTypeAndRarityToSectorSupply;
  mapping(uint16 => uint256[]) private landTypeToLandSectorList;
  mapping(uint16 => uint256) private landTypeToLandSectorIndex;
  mapping(uint16 => mapping(uint16 => uint256)) private landTypeAndRarityToLandSectorCount;
  mapping(uint16 => uint256) private rarityToSectorVolume;

  event MintEvent(
    address indexed assetOwner,
    uint256 tokenId,
    uint256 at,
    bytes32 indexed eventHash
  );

  constructor() public ERC721Full("MyCryptoHeroes:Land", "MCHL") {
    rarityToSectorVolume[5] = 100;
    rarityToSectorVolume[4] = 20;
    rarityToSectorVolume[3] = 5;
    rarityToSectorVolume[2] = 2;
    rarityToSectorVolume[1] = 1;
    landTypeToTotalVolume[NO_LAND] = 0;
  }

  function setSupplyAndSector(
    uint16 _landType,
    uint256 _totalVolume,
    uint256 _sectorSupplyLimit,
    uint256 legendarySupply,
    uint256 epicSupply,
    uint256 rareSupply,
    uint256 uncommonSupply,
    uint256 commonSupply
  ) external onlyMinter {
    require(_landType != 0, "landType 0 is noland");
    require(_totalVolume != 0, "totalVolume must not be 0");
    require(getMintedSectorCount(_landType) == 0, "This LandType already exists");
    require(
      legendarySupply.mul(rarityToSectorVolume[LEGENDARY_RARITY])
      .add(epicSupply.mul(rarityToSectorVolume[EPIC_RARITY]))
      .add(rareSupply.mul(rarityToSectorVolume[RARE_RARITY]))
      .add(uncommonSupply.mul(rarityToSectorVolume[UNCOMMON_RARITY]))
      .add(commonSupply.mul(rarityToSectorVolume[COMMON_RARITY]))
      == _totalVolume
    );
    require(
      legendarySupply
      .add(epicSupply)
      .add(rareSupply)
      .add(uncommonSupply)
      .add(commonSupply)
      == _sectorSupplyLimit
    );
    landTypeToTotalVolume[_landType] = _totalVolume;
    landTypeToSectorSupplyLimit[_landType] = _sectorSupplyLimit;
    landTypeAndRarityToSectorSupply[_landType][LEGENDARY_RARITY] = legendarySupply;
    landTypeAndRarityToSectorSupply[_landType][EPIC_RARITY] = epicSupply;
    landTypeAndRarityToSectorSupply[_landType][RARE_RARITY] = rareSupply;
    landTypeAndRarityToSectorSupply[_landType][UNCOMMON_RARITY] = uncommonSupply;
    landTypeAndRarityToSectorSupply[_landType][COMMON_RARITY] = commonSupply;
  }

  function setTokenURIPrefix(string calldata _tokenURIPrefix) external onlyMinter {
    tokenURIPrefix = _tokenURIPrefix;
  }

  function isAlreadyMinted(uint256 _tokenId) public view returns (bool) {
    return _exists(_tokenId);
  }

  function isValidLandSector(uint256 _tokenId) public view returns (bool) {
    uint16 rarity = getRarity(_tokenId);
    if (!(rarityToSectorVolume[rarity] > 0)) {
      return false;
    }
    uint16 landType = getLandType(_tokenId);
    if (!(landTypeToTotalVolume[landType] > 0)) {
      return false;
    }
    uint256 serial = _tokenId % 10000;
    if (serial > landTypeAndRarityToSectorSupply[landType][rarity]) {
      return false;
    }
    return true;
  }

  function getTotalVolume(uint16 _landType) public view returns (uint256) {
    return landTypeToTotalVolume[_landType];
  }

  function getSectorSupplyLimit(uint16 _landType) public view returns (uint256) {
    return landTypeToSectorSupplyLimit[_landType];
  }

  function getLandType(uint256 _landSector) public view returns (uint16) {
    uint16 _landType = uint16((_landSector.div(10000)) % 1000);
    return _landType;
  }

  function getRarity(uint256 _landSector) public view returns (uint16) {
    return uint16(_landSector.div(10**7));
  }

  function getMintedSectorCount(uint16 _landType) public view returns (uint256) {
    return landTypeToLandSectorIndex[_landType];
  }

  function getMintedSectorCountByRarity(uint16 _landType, uint16 _rarity) public view returns (uint256) {
    return landTypeAndRarityToLandSectorCount[_landType][_rarity];
  }

  function getSectorSupplyByRarity(uint16 _landType, uint16 _rarity) public view returns (uint256) {
    return landTypeAndRarityToSectorSupply[_landType][_rarity];
  }

  function getMintedSectorList(uint16 _landType) public view returns (uint256[] memory) {
    return landTypeToLandSectorList[_landType];
  }

  function getSectorVolumeByRarity(uint16 _rarity) public view returns (uint256) {
    return rarityToSectorVolume[_rarity];
  }

  function getShareRateWithDecimal(uint256 _landSector) public view returns (uint256, uint256) {
    return (
      getSectorVolumeByRarity(getRarity(_landSector))
        .mul(SHARE_RATE_DECIMAL)
        .div(getTotalVolume(getLandType(_landSector))),
      SHARE_RATE_DECIMAL
    );
  }

  function mintLandSector(address _owner, uint256 _landSector, bytes32 _eventHash) public onlyMinter {
    require(!isAlreadyMinted(_landSector));
    require(isValidLandSector(_landSector));
    uint16 _landType = getLandType(_landSector);
    require(landTypeToLandSectorIndex[_landType] < landTypeToSectorSupplyLimit[_landType]);
    uint16 rarity = getRarity(_landSector);
    require(landTypeAndRarityToLandSectorCount[_landType][rarity] < landTypeAndRarityToSectorSupply[_landType][rarity], "supply over");
    _mint(_owner, _landSector);
    landTypeToLandSectorList[_landType].push(_landSector);
    landTypeToLandSectorIndex[_landType]++;
    landTypeAndRarityToLandSectorCount[_landType][rarity]++;

    emit MintEvent(
      _owner,
      _landSector,
      block.timestamp,
      _eventHash
    );
  }

  function tokenURI(uint256 tokenId) public view returns (string memory) {
    bytes32 tokenIdBytes;
    if (tokenId == 0) {
      tokenIdBytes = "0";
    } else {
      uint256 value = tokenId;
      while (value > 0) {
        tokenIdBytes = bytes32(uint256(tokenIdBytes) / (2 ** 8));
        tokenIdBytes |= bytes32(((value % 10) + 48) * 2 ** (8 * 31));
        value /= 10;
      }
    }

    bytes memory prefixBytes = bytes(tokenURIPrefix);
    bytes memory tokenURIBytes = new bytes(prefixBytes.length + tokenIdBytes.length);

    uint8 i;
    uint8 index = 0;

    for (i = 0; i < prefixBytes.length; i++) {
      tokenURIBytes[index] = prefixBytes[i];
      index++;
    }

    for (i = 0; i < tokenIdBytes.length; i++) {
      tokenURIBytes[index] = tokenIdBytes[i];
      index++;
    }

    return string(tokenURIBytes);
  }
}
/* solhint-enable indent*/

// File: contracts/MCHLandPool.sol

/* solhint-disable indent*/
pragma solidity 0.5.4;







contract MCHLandPool is Ownable, Pausable, ReentrancyGuard {
  using SafeMath for uint256;


  LandSectorAsset public landSectorAsset;

  mapping(uint16 => uint256) private landTypeToTotalAmount;
  mapping(uint256 => uint256) private landSectorToWithdrawnAmount;
  mapping(address => bool) private allowedAddresses;

  event EthAddedToPool(
    uint16 indexed landType,
    address txSender,
    address indexed purchaseBy,
    uint256 value,
    uint256 at
  );

  event WithdrawEther(
    uint256 indexed landSector,
    address indexed lord,
    uint256 value,
    uint256 at
  );

  event AllowedAddressSet(
    address allowedAddress,
    bool allowedStatus
  );

  constructor(address _landSectorAssetAddress) public {
    landSectorAsset = LandSectorAsset(_landSectorAssetAddress);
  }

  function setLandSectorAssetAddress(address _landSectorAssetAddress) external onlyOwner() {
    landSectorAsset = LandSectorAsset(_landSectorAssetAddress);
  }

  function setAllowedAddress(address _address, bool desired) external onlyOwner() {
    allowedAddresses[_address] = desired;
    emit AllowedAddressSet(
      _address,
      desired
    );
  }

  function addEthToLandPool(uint16 _landType, address _purchaseBy) external payable whenNotPaused() nonReentrant() {
    require(landSectorAsset.getTotalVolume(_landType) > 0);
    require(allowedAddresses[msg.sender]);
    landTypeToTotalAmount[_landType] += msg.value;

    emit EthAddedToPool(
      _landType,
      msg.sender,
      _purchaseBy,
      msg.value,
      block.timestamp
    );
  }

  function withdrawMyAllRewards() external whenNotPaused() nonReentrant() {
    require(getWithdrawableBalance(msg.sender) > 0);

    uint256 withdrawValue;
    uint256 balance = landSectorAsset.balanceOf(msg.sender);
    
    for (uint256 i=balance; i > 0; i--) {
      uint256 landSector = landSectorAsset.tokenOfOwnerByIndex(msg.sender, i-1);
      uint256 tmpAmount = getLandSectorWithdrawableBalance(landSector);
      withdrawValue += tmpAmount;
      landSectorToWithdrawnAmount[landSector] += tmpAmount;

      emit WithdrawEther(
        landSector,
        msg.sender,
        tmpAmount,
        block.timestamp
      );
    }
    msg.sender.transfer(withdrawValue);
  }

  function withdrawMyReward(uint256 _landSector) external whenNotPaused() nonReentrant() {
    require(landSectorAsset.ownerOf(_landSector) == msg.sender);
    uint256 withdrawableAmount = getLandSectorWithdrawableBalance(_landSector);
    require(withdrawableAmount > 0);

    landSectorToWithdrawnAmount[_landSector] += withdrawableAmount;
    msg.sender.transfer(withdrawableAmount);

    emit WithdrawEther(
      _landSector,
      msg.sender,
      withdrawableAmount,
      block.timestamp
    );
  }

  function getAllowedAddress(address _address) public view returns (bool) {
    return allowedAddresses[_address];
  }

  function getTotalEthBackAmountPerLandType(uint16 _landType) public view returns (uint256) {
    return landTypeToTotalAmount[_landType];
  }

  function getLandSectorWithdrawnAmount(uint256 _landSector) public view returns (uint256) {
    return landSectorToWithdrawnAmount[_landSector];
  }

  function getLandSectorWithdrawableBalance(uint256 _landSector) public view returns (uint256) {
    require(landSectorAsset.isValidLandSector(_landSector));
    uint16 _landType = landSectorAsset.getLandType(_landSector);
    (uint256 shareRate, uint256 decimal) = landSectorAsset.getShareRateWithDecimal(_landSector);
    uint256 maxAmount = landTypeToTotalAmount[_landType]
      .mul(shareRate)
      .div(decimal);
    return maxAmount.sub(landSectorToWithdrawnAmount[_landSector]);
  }

  function getWithdrawableBalance(address _lordAddress) public view returns (uint256) {
    uint256 balance = landSectorAsset.balanceOf(_lordAddress);
    uint256 withdrawableAmount;

    for (uint256 i=balance; i > 0; i--) {
      uint256 landSector = landSectorAsset.tokenOfOwnerByIndex(_lordAddress, i-1);
      withdrawableAmount += getLandSectorWithdrawableBalance(landSector);
    }

    return withdrawableAmount;
  }
}
/* solhint-enable indent*/

// File: contracts/access/roles/OperatorRole.sol

contract OperatorRole is Ownable {
    using Roles for Roles.Role;

    event OperatorAdded(address indexed account);
    event OperatorRemoved(address indexed account);

    Roles.Role private operators;

    constructor() public {
        operators.add(msg.sender);
    }

    modifier onlyOperator() {
        require(isOperator(msg.sender));
        _;
    }
    
    function isOperator(address account) public view returns (bool) {
        return operators.has(account);
    }

    function addOperator(address account) public onlyOwner() {
        operators.add(account);
        emit OperatorAdded(account);
    }

    function removeOperator(address account) public onlyOwner() {
        operators.remove(account);
        emit OperatorRemoved(account);
    }

}

// File: contracts/Referrers.sol

contract Referrers is OperatorRole {
  using Roles for Roles.Role;

  event ReferrerAdded(address indexed account);
  event ReferrerRemoved(address indexed account);

  Roles.Role private referrers;

  uint32 internal index;
  uint16 public constant limit = 10;
  mapping(uint32 => address) internal indexToAddress;
  mapping(address => uint32) internal addressToIndex;

  modifier onlyReferrer() {
    require(isReferrer(msg.sender));
    _;
  }

  function getNumberOfAddresses() public view onlyOperator() returns (uint32) {
    return index;
  }

  function addressOfIndex(uint32 _index) onlyOperator() public view returns (address) {
    return indexToAddress[_index];
  }
  
  function isReferrer(address _account) public view returns (bool) {
    return referrers.has(_account);
  }

  function addReferrer(address _account) public onlyOperator() {
    referrers.add(_account);
    indexToAddress[index] = _account;
    addressToIndex[_account] = index;
    index++;
    emit ReferrerAdded(_account);
  }

  function addReferrers(address[limit] memory accounts) public onlyOperator() {
    for (uint16 i=0; i<limit; i++) {
      if (accounts[i] != address(0x0)) {
        addReferrer(accounts[i]);
      }
    }
  }

  function removeReferrer(address _account) public onlyOperator() {
    referrers.remove(_account);
    indexToAddress[addressToIndex[_account]] = address(0x0);
    emit ReferrerRemoved(_account);
  }
}

// File: contracts/MCHGUMGatewayV6.sol

/* solhint-disable indent*/

pragma solidity ^0.5.2;







contract MCHGUMGatewayV6 is DJTBase {

  LandSectorAsset public landSectorAsset;
  MCHLandPool public landPool;
  Referrers public referrers;
  address public validater;
  bool public isInGUMUpTerm;

  uint256 public landPercentage;
  uint256 internal referralPercentage;

  mapping(uint256 => bool) private payableOption;

  // Define purchaseType
  // enum PurchaseType {
  //   PURCHASE_NORMAL = 0;
  //   PURCHASE_ETH_BACK = 1;
  //   PURCHASE_GUM_UP = 1;
  // }
  uint8 public purchaseTypeNormal = 0;
  // uint8 public purchaseTypeETHBack = 1;
  uint8 public purchaseTypeGUMUP;
  // uint8 public purchaseTypeRegular = 3;

  event LandPercentageUpdated(
    uint256 landPercentage
  );

  event Sold(
    address indexed user,
    address indexed referrer,
    uint8 purchaseType,
    uint256 grossValue,
    uint256 referralValue,
    uint256 landValue,
    uint256 netValue,
    uint256 indexed landType,
    uint256 at
  );

  event GUMUpTermUpdated(
    bool isInGUMUpTerm
  );

  event PurchaseTypeGUMUPUpdated(
    uint8 purchaseTypeGUMUP
  );

  constructor(
    address _validater,
    address _referrersAddress
  ) public {
    validater = _validater;
    referrers = Referrers(_referrersAddress);
    landPercentage = 30;
    referralPercentage = 20;
    purchaseTypeGUMUP = 2;
    payableOption[0.05 ether] = true;
    payableOption[0.1 ether] = true;
    payableOption[0.5 ether] = true;
    payableOption[1 ether] = true;
    payableOption[5 ether] = true;
    payableOption[10 ether] = true;
  }

  function setLandSectorAssetAddress(address _landSectorAssetAddress) external onlyOwner() {
    landSectorAsset = LandSectorAsset(_landSectorAssetAddress);
  }

  function setLandPoolAddress(address payable _landPoolAddress) external onlyOwner() {
    landPool = MCHLandPool(_landPoolAddress);
  }

  function setValidater(address _varidater) external onlyOwner() {
    validater = _varidater;
  }

  function updateLandPercentage(uint256 _newLandPercentage) external onlyOwner() {
    landPercentage = _newLandPercentage;
    emit LandPercentageUpdated(
      landPercentage
    );
  }

  function setReferrersContractAddress(address _referrersAddress) external onlyOwner() {
    referrers = Referrers(_referrersAddress);
  }

  function setPurchaseTypeGUMUP(uint8 _newNum) external onlyOwner() {
    require(_newNum != 0 || _newNum != 1 || _newNum != 3);
    purchaseTypeGUMUP = _newNum;
    emit PurchaseTypeGUMUPUpdated(
      purchaseTypeGUMUP
    );
  }

  function setGUMUpTerm(bool _desired) external onlyOwner() {
    isInGUMUpTerm = _desired;
    emit GUMUpTermUpdated(
      isInGUMUpTerm
    );
  }

  function updateReferralPercentage(uint256 _newReferralPercentage) external onlyOwner() {
    referralPercentage = _newReferralPercentage;
  }

  function setPayableOption(uint256 _option, bool desired) external onlyOwner() {
    payableOption[_option] = desired;
  }

  function buyGUM(uint16 _landType, address payable _referrer, bytes calldata _signature) external payable whenNotPaused() nonReentrant() {
    require(payableOption[msg.value]);
    require(validateSig(_signature, _landType), "invalid signature");

    // Refarrer check
    address payable referrer;
    if (_referrer == msg.sender) {
      referrer = address(0x0);
    } else {
      referrer = _referrer;
    }

    uint256 netValue = msg.value;
    uint256 referralValue;
    uint256 landValue;
    if ((_referrer != address(0x0)) && referrers.isReferrer(_referrer)) {
      referralValue = msg.value.mul(referralPercentage).div(100);
      netValue = netValue.sub(referralValue);
      _referrer.transfer(referralValue);
    }

    if (landSectorAsset.getTotalVolume(_landType) != 0) {
      landValue = msg.value.mul(landPercentage).div(100);
      netValue = netValue.sub(landValue);
      landPool.addEthToLandPool.value(landValue)(_landType, msg.sender);
    }

    uint8 purchaseType;
    purchaseType = purchaseTypeNormal;
    if (isInGUMUpTerm) {
      purchaseType = purchaseTypeGUMUP;
    }

    emit Sold(
      msg.sender,
      referrer,
      purchaseType,
      msg.value,
      referralValue,
      landValue,
      netValue,
      _landType,
      block.timestamp
    );
  }

  function getPayableOption(uint256 _option) public view returns (bool) {
    return payableOption[_option];
  }

  function validateSig(bytes memory _signature, uint16 _landType) private view returns (bool) {
    require(validater != address(0));
    uint256 _message = uint256(msg.sender) + uint256(_landType);
    address signer = ECDSA.recover(ECDSA.toEthSignedMessageHash(bytes32(_message)), _signature);
    return (signer == validater);
  }
}
/* solhint-enable indent*/

Contract Security Audit

Contract ABI

API
[{"constant":false,"inputs":[{"name":"_desired","type":"bool"}],"name":"setGUMUpTerm","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"referrers","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_referrersAddress","type":"address"}],"name":"setReferrersContractAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_landSectorAssetAddress","type":"address"}],"name":"setLandSectorAssetAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isPauser","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newNum","type":"uint8"}],"name":"setPurchaseTypeGUMUP","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"landPercentage","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newReferralPercentage","type":"uint256"}],"name":"updateReferralPercentage","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"isInGUMUpTerm","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"purchaseTypeGUMUP","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_landPoolAddress","type":"address"}],"name":"setLandPoolAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_landType","type":"uint16"},{"name":"_referrer","type":"address"},{"name":"_signature","type":"bytes"}],"name":"buyGUM","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_option","type":"uint256"},{"name":"desired","type":"bool"}],"name":"setPayableOption","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renouncePauser","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_option","type":"uint256"}],"name":"getPayableOption","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"withdrawEther","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newLandPercentage","type":"uint256"}],"name":"updateLandPercentage","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"}],"name":"addPauser","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"withdrawToken","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":"isOwner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"landPool","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"purchaseTypeNormal","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_varidater","type":"address"}],"name":"setValidater","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"validater","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"landSectorAsset","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_validater","type":"address"},{"name":"_referrersAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"landPercentage","type":"uint256"}],"name":"LandPercentageUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"user","type":"address"},{"indexed":true,"name":"referrer","type":"address"},{"indexed":false,"name":"purchaseType","type":"uint8"},{"indexed":false,"name":"grossValue","type":"uint256"},{"indexed":false,"name":"referralValue","type":"uint256"},{"indexed":false,"name":"landValue","type":"uint256"},{"indexed":false,"name":"netValue","type":"uint256"},{"indexed":true,"name":"landType","type":"uint256"},{"indexed":false,"name":"at","type":"uint256"}],"name":"Sold","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"isInGUMUpTerm","type":"bool"}],"name":"GUMUpTermUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"purchaseTypeGUMUP","type":"uint8"}],"name":"PurchaseTypeGUMUPUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"account","type":"address"}],"name":"PauserAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"account","type":"address"}],"name":"PauserRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

60806040526000600b60006101000a81548160ff021916908360ff1602179055503480156200002d57600080fd5b506040516040806200257c833981018060405260408110156200004f57600080fd5b810190808051906020019092919080519060200190929190505050336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3620001403362000350640100000000026401000000009004565b6000600260006101000a81548160ff021916908315150217905550600160038190555081600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601e60088190555060146009819055506002600b60016101000a81548160ff021916908360ff1602179055506001600a600066b1a2bc2ec50000815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600a600067016345785d8a0000815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600a60006706f05b59d3b20000815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600a6000670de0b6b3a7640000815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600a6000674563918244f40000815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600a6000678ac7230489e80000815260200190815260200160002060006101000a81548160ff021916908315150217905550505062000512565b62000374816001620003ba6401000000000262001f7e179091906401000000009004565b8073ffffffffffffffffffffffffffffffffffffffff167f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f860405160405180910390a250565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515620003f757600080fd5b6200041282826200047d640100000000026401000000009004565b1515156200041f57600080fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515620004bb57600080fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b61205a80620005226000396000f3fe6080604052600436106101f5576000357c0100000000000000000000000000000000000000000000000000000000900480636ef8d66d1161011f5780638da5cb5b116100b2578063c14e50ce11610081578063c14e50ce146108bc578063d95b18eb1461090d578063dba8f3f614610964578063f2fde38b146109bb576101f5565b80638da5cb5b146107ae5780638f32d59b14610805578063996bf1bd14610834578063a8665ac51461088b576101f5565b806376393f91116100ee57806376393f91146106ba57806382dc1ec4146106f55780638456cb5914610746578063894760691461075d576101f5565b80636ef8d66d1461062257806370f46b8214610639578063715018a61461068c5780637362377b146106a3576101f5565b80634a8f85701161019757806363e964f51161016657806363e964f5146104b257806365f892ad146104e357806365fe6fd414610534578063662fa38f146105db576101f5565b80634a8f8570146103ee5780634cdb312d146104195780635282f59a146104545780635c975abb14610483576101f5565b80632d09986f116101d35780632d09986f146102df5780633f4ba83a1461033057806346fbf68e1461034757806348098db3146103b0576101f5565b806316fceb39146101fa5780631dfe189814610237578063254ed4641461028e575b600080fd5b34801561020657600080fd5b506102356004803603602081101561021d57600080fd5b81019080803515159060200190929190505050610a0c565b005b34801561024357600080fd5b5061024c610a86565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561029a57600080fd5b506102dd600480360360208110156102b157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aac565b005b3480156102eb57600080fd5b5061032e6004803603602081101561030257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b03565b005b34801561033c57600080fd5b50610345610b5a565b005b34801561035357600080fd5b506103966004803603602081101561036a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c09565b604051808215151515815260200191505060405180910390f35b3480156103bc57600080fd5b506103ec600480360360208110156103d357600080fd5b81019080803560ff169060200190929190505050610c26565b005b3480156103fa57600080fd5b50610403610cd4565b6040518082815260200191505060405180910390f35b34801561042557600080fd5b506104526004803603602081101561043c57600080fd5b8101908080359060200190929190505050610cda565b005b34801561046057600080fd5b50610469610cf7565b604051808215151515815260200191505060405180910390f35b34801561048f57600080fd5b50610498610d0a565b604051808215151515815260200191505060405180910390f35b3480156104be57600080fd5b506104c7610d21565b604051808260ff1660ff16815260200191505060405180910390f35b3480156104ef57600080fd5b506105326004803603602081101561050657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d34565b005b6105d96004803603606081101561054a57600080fd5b81019080803561ffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561059557600080fd5b8201836020820111156105a757600080fd5b803590602001918460018302840111640100000000831117156105c957600080fd5b9091929391929390505050610d8b565b005b3480156105e757600080fd5b50610620600480360360408110156105fe57600080fd5b81019080803590602001909291908035151590602001909291905050506113a4565b005b34801561062e57600080fd5b506106376113e6565b005b34801561064557600080fd5b506106726004803603602081101561065c57600080fd5b81019080803590602001909291905050506113f1565b604051808215151515815260200191505060405180910390f35b34801561069857600080fd5b506106a161141b565b005b3480156106af57600080fd5b506106b86114ed565b005b3480156106c657600080fd5b506106f3600480360360208110156106dd57600080fd5b8101908080359060200190929190505050611560565b005b34801561070157600080fd5b506107446004803603602081101561071857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115b6565b005b34801561075257600080fd5b5061075b6115d6565b005b34801561076957600080fd5b506107ac6004803603602081101561078057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611686565b005b3480156107ba57600080fd5b506107c3611858565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561081157600080fd5b5061081a611881565b604051808215151515815260200191505060405180910390f35b34801561084057600080fd5b506108496118d8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561089757600080fd5b506108a06118fe565b604051808260ff1660ff16815260200191505060405180910390f35b3480156108c857600080fd5b5061090b600480360360208110156108df57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611911565b005b34801561091957600080fd5b50610922611968565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561097057600080fd5b5061097961198e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109c757600080fd5b50610a0a600480360360208110156109de57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119b4565b005b610a14611881565b1515610a1f57600080fd5b80600760146101000a81548160ff0219169083151502179055507f696c2128f1b9ca517e923edc65f98c83987dd96560e2777228237a513369df77600760149054906101000a900460ff16604051808215151515815260200191505060405180910390a150565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610ab4611881565b1515610abf57600080fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610b0b611881565b1515610b1657600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610b6333610c09565b1515610b6e57600080fd5b600260009054906101000a900460ff161515610b8957600080fd5b6000600260006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000610c1f8260016119d390919063ffffffff16565b9050919050565b610c2e611881565b1515610c3957600080fd5b60008160ff16141580610c50575060018160ff1614155b80610c5f575060038160ff1614155b1515610c6a57600080fd5b80600b60016101000a81548160ff021916908360ff1602179055507f272c3173ed2f8b8d74e44ea332f8d0a80a403b586c1582852173f161d1f14a37600b60019054906101000a900460ff16604051808260ff1660ff16815260200191505060405180910390a150565b60085481565b610ce2611881565b1515610ced57600080fd5b8060098190555050565b600760149054906101000a900460ff1681565b6000600260009054906101000a900460ff16905090565b600b60019054906101000a900460ff1681565b610d3c611881565b1515610d4757600080fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260009054906101000a900460ff16151515610da757600080fd5b600160036000828254019250508190555060006003549050600a600034815260200190815260200160002060009054906101000a900460ff161515610deb57600080fd5b610e3983838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505086611a67565b1515610ead576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f696e76616c6964207369676e617475726500000000000000000000000000000081525060200191505060405180910390fd5b60003373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415610eec5760009050610ef0565b8490505b6000349050600080600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16141580156110275750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d64d6968896040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610feb57600080fd5b505afa158015610fff573d6000803e3d6000fd5b505050506040513d602081101561101557600080fd5b81019080805190602001909291905050505b156110b357611054606461104660095434611b5b90919063ffffffff16565b611b9990919063ffffffff16565b91506110698284611bc390919063ffffffff16565b92508773ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156110b1573d6000803e3d6000fd5b505b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fbba7b628b6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808261ffff1661ffff16815260200191505060206040518083038186803b15801561114c57600080fd5b505afa158015611160573d6000803e3d6000fd5b505050506040513d602081101561117657600080fd5b81019080805190602001909291905050501415156112b4576111b660646111a860085434611b5b90919063ffffffff16565b611b9990919063ffffffff16565b90506111cb8184611bc390919063ffffffff16565b9250600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e274e18e828b336040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808361ffff1661ffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001925050506000604051808303818588803b15801561129a57600080fd5b505af11580156112ae573d6000803e3d6000fd5b50505050505b6000600b60009054906101000a900460ff169050600760149054906101000a900460ff16156112f057600b60019054906101000a900460ff1690505b8961ffff168573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f829afbf78fd129ecca411b07d8372debb48568a03428e9ed42080e724cb87287843488888b42604051808760ff1660ff168152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390a450505050506003548114151561139d57600080fd5b5050505050565b6113ac611881565b15156113b757600080fd5b80600a600084815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6113ef33611be5565b565b6000600a600083815260200190815260200160002060009054906101000a900460ff169050919050565b611423611881565b151561142e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6114f5611881565b151561150057600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f1935050505015801561155d573d6000803e3d6000fd5b50565b611568611881565b151561157357600080fd5b806008819055507f91b44a7a4ce6e4f9b48fdbde6dac3ab5a404e28ba7b2c91414156c5f7c8e62ed6008546040518082815260200191505060405180910390a150565b6115bf33610c09565b15156115ca57600080fd5b6115d381611c3f565b50565b6115df33610c09565b15156115ea57600080fd5b600260009054906101000a900460ff1615151561160657600080fd5b6001600260006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b61168e611881565b151561169957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb338373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561174f57600080fd5b505afa158015611763573d6000803e3d6000fd5b505050506040513d602081101561177957600080fd5b81019080805190602001909291905050506040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561180f57600080fd5b505af1158015611823573d6000803e3d6000fd5b505050506040513d602081101561183957600080fd5b8101908080519060200190929190505050151561185557600080fd5b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b60009054906101000a900460ff1681565b611919611881565b151561192457600080fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6119bc611881565b15156119c757600080fd5b6119d081611c99565b50565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611a1057600080fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515611ac657600080fd5b60008261ffff163373ffffffffffffffffffffffffffffffffffffffff160190506000611afe611af883600102611d93565b86611deb565b9050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16149250505092915050565b600080831415611b6e5760009050611b93565b60008284029050828482811515611b8157fe5b04141515611b8e57600080fd5b809150505b92915050565b60008082111515611ba957600080fd5b60008284811515611bb657fe5b0490508091505092915050565b6000828211151515611bd457600080fd5b600082840390508091505092915050565b611bf9816001611ecf90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e60405160405180910390a250565b611c53816001611f7e90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f860405160405180910390a250565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611cd557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008160405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001209050919050565b60008060008060418551141515611e085760009350505050611ec9565b6020850151925060408501519150606085015160001a9050601b8160ff161015611e3357601b810190505b601b8160ff1614158015611e4b5750601c8160ff1614155b15611e5c5760009350505050611ec9565b60018682858560405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611eb9573d6000803e3d6000fd5b5050506020604051035193505050505b92915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611f0b57600080fd5b611f1582826119d3565b1515611f2057600080fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611fba57600080fd5b611fc482826119d3565b151515611fd057600080fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505056fea165627a7a723058202c5718017c23211751d0d6c81288f8f5e2b4cd423048da733de284f0858990ca0029000000000000000000000000984e7b0f2cb06b847dd465eec65a3a41c1e27c06000000000000000000000000a3baa9cd4f5c0f75541e7c78462a6f36ed62049a

Deployed Bytecode

0x6080604052600436106101f5576000357c0100000000000000000000000000000000000000000000000000000000900480636ef8d66d1161011f5780638da5cb5b116100b2578063c14e50ce11610081578063c14e50ce146108bc578063d95b18eb1461090d578063dba8f3f614610964578063f2fde38b146109bb576101f5565b80638da5cb5b146107ae5780638f32d59b14610805578063996bf1bd14610834578063a8665ac51461088b576101f5565b806376393f91116100ee57806376393f91146106ba57806382dc1ec4146106f55780638456cb5914610746578063894760691461075d576101f5565b80636ef8d66d1461062257806370f46b8214610639578063715018a61461068c5780637362377b146106a3576101f5565b80634a8f85701161019757806363e964f51161016657806363e964f5146104b257806365f892ad146104e357806365fe6fd414610534578063662fa38f146105db576101f5565b80634a8f8570146103ee5780634cdb312d146104195780635282f59a146104545780635c975abb14610483576101f5565b80632d09986f116101d35780632d09986f146102df5780633f4ba83a1461033057806346fbf68e1461034757806348098db3146103b0576101f5565b806316fceb39146101fa5780631dfe189814610237578063254ed4641461028e575b600080fd5b34801561020657600080fd5b506102356004803603602081101561021d57600080fd5b81019080803515159060200190929190505050610a0c565b005b34801561024357600080fd5b5061024c610a86565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561029a57600080fd5b506102dd600480360360208110156102b157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aac565b005b3480156102eb57600080fd5b5061032e6004803603602081101561030257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b03565b005b34801561033c57600080fd5b50610345610b5a565b005b34801561035357600080fd5b506103966004803603602081101561036a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c09565b604051808215151515815260200191505060405180910390f35b3480156103bc57600080fd5b506103ec600480360360208110156103d357600080fd5b81019080803560ff169060200190929190505050610c26565b005b3480156103fa57600080fd5b50610403610cd4565b6040518082815260200191505060405180910390f35b34801561042557600080fd5b506104526004803603602081101561043c57600080fd5b8101908080359060200190929190505050610cda565b005b34801561046057600080fd5b50610469610cf7565b604051808215151515815260200191505060405180910390f35b34801561048f57600080fd5b50610498610d0a565b604051808215151515815260200191505060405180910390f35b3480156104be57600080fd5b506104c7610d21565b604051808260ff1660ff16815260200191505060405180910390f35b3480156104ef57600080fd5b506105326004803603602081101561050657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d34565b005b6105d96004803603606081101561054a57600080fd5b81019080803561ffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561059557600080fd5b8201836020820111156105a757600080fd5b803590602001918460018302840111640100000000831117156105c957600080fd5b9091929391929390505050610d8b565b005b3480156105e757600080fd5b50610620600480360360408110156105fe57600080fd5b81019080803590602001909291908035151590602001909291905050506113a4565b005b34801561062e57600080fd5b506106376113e6565b005b34801561064557600080fd5b506106726004803603602081101561065c57600080fd5b81019080803590602001909291905050506113f1565b604051808215151515815260200191505060405180910390f35b34801561069857600080fd5b506106a161141b565b005b3480156106af57600080fd5b506106b86114ed565b005b3480156106c657600080fd5b506106f3600480360360208110156106dd57600080fd5b8101908080359060200190929190505050611560565b005b34801561070157600080fd5b506107446004803603602081101561071857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115b6565b005b34801561075257600080fd5b5061075b6115d6565b005b34801561076957600080fd5b506107ac6004803603602081101561078057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611686565b005b3480156107ba57600080fd5b506107c3611858565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561081157600080fd5b5061081a611881565b604051808215151515815260200191505060405180910390f35b34801561084057600080fd5b506108496118d8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561089757600080fd5b506108a06118fe565b604051808260ff1660ff16815260200191505060405180910390f35b3480156108c857600080fd5b5061090b600480360360208110156108df57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611911565b005b34801561091957600080fd5b50610922611968565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561097057600080fd5b5061097961198e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109c757600080fd5b50610a0a600480360360208110156109de57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119b4565b005b610a14611881565b1515610a1f57600080fd5b80600760146101000a81548160ff0219169083151502179055507f696c2128f1b9ca517e923edc65f98c83987dd96560e2777228237a513369df77600760149054906101000a900460ff16604051808215151515815260200191505060405180910390a150565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610ab4611881565b1515610abf57600080fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610b0b611881565b1515610b1657600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610b6333610c09565b1515610b6e57600080fd5b600260009054906101000a900460ff161515610b8957600080fd5b6000600260006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000610c1f8260016119d390919063ffffffff16565b9050919050565b610c2e611881565b1515610c3957600080fd5b60008160ff16141580610c50575060018160ff1614155b80610c5f575060038160ff1614155b1515610c6a57600080fd5b80600b60016101000a81548160ff021916908360ff1602179055507f272c3173ed2f8b8d74e44ea332f8d0a80a403b586c1582852173f161d1f14a37600b60019054906101000a900460ff16604051808260ff1660ff16815260200191505060405180910390a150565b60085481565b610ce2611881565b1515610ced57600080fd5b8060098190555050565b600760149054906101000a900460ff1681565b6000600260009054906101000a900460ff16905090565b600b60019054906101000a900460ff1681565b610d3c611881565b1515610d4757600080fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260009054906101000a900460ff16151515610da757600080fd5b600160036000828254019250508190555060006003549050600a600034815260200190815260200160002060009054906101000a900460ff161515610deb57600080fd5b610e3983838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505086611a67565b1515610ead576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f696e76616c6964207369676e617475726500000000000000000000000000000081525060200191505060405180910390fd5b60003373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415610eec5760009050610ef0565b8490505b6000349050600080600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16141580156110275750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d64d6968896040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610feb57600080fd5b505afa158015610fff573d6000803e3d6000fd5b505050506040513d602081101561101557600080fd5b81019080805190602001909291905050505b156110b357611054606461104660095434611b5b90919063ffffffff16565b611b9990919063ffffffff16565b91506110698284611bc390919063ffffffff16565b92508773ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156110b1573d6000803e3d6000fd5b505b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fbba7b628b6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808261ffff1661ffff16815260200191505060206040518083038186803b15801561114c57600080fd5b505afa158015611160573d6000803e3d6000fd5b505050506040513d602081101561117657600080fd5b81019080805190602001909291905050501415156112b4576111b660646111a860085434611b5b90919063ffffffff16565b611b9990919063ffffffff16565b90506111cb8184611bc390919063ffffffff16565b9250600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e274e18e828b336040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808361ffff1661ffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001925050506000604051808303818588803b15801561129a57600080fd5b505af11580156112ae573d6000803e3d6000fd5b50505050505b6000600b60009054906101000a900460ff169050600760149054906101000a900460ff16156112f057600b60019054906101000a900460ff1690505b8961ffff168573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f829afbf78fd129ecca411b07d8372debb48568a03428e9ed42080e724cb87287843488888b42604051808760ff1660ff168152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390a450505050506003548114151561139d57600080fd5b5050505050565b6113ac611881565b15156113b757600080fd5b80600a600084815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6113ef33611be5565b565b6000600a600083815260200190815260200160002060009054906101000a900460ff169050919050565b611423611881565b151561142e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6114f5611881565b151561150057600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f1935050505015801561155d573d6000803e3d6000fd5b50565b611568611881565b151561157357600080fd5b806008819055507f91b44a7a4ce6e4f9b48fdbde6dac3ab5a404e28ba7b2c91414156c5f7c8e62ed6008546040518082815260200191505060405180910390a150565b6115bf33610c09565b15156115ca57600080fd5b6115d381611c3f565b50565b6115df33610c09565b15156115ea57600080fd5b600260009054906101000a900460ff1615151561160657600080fd5b6001600260006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b61168e611881565b151561169957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb338373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561174f57600080fd5b505afa158015611763573d6000803e3d6000fd5b505050506040513d602081101561177957600080fd5b81019080805190602001909291905050506040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561180f57600080fd5b505af1158015611823573d6000803e3d6000fd5b505050506040513d602081101561183957600080fd5b8101908080519060200190929190505050151561185557600080fd5b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b60009054906101000a900460ff1681565b611919611881565b151561192457600080fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6119bc611881565b15156119c757600080fd5b6119d081611c99565b50565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611a1057600080fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515611ac657600080fd5b60008261ffff163373ffffffffffffffffffffffffffffffffffffffff160190506000611afe611af883600102611d93565b86611deb565b9050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16149250505092915050565b600080831415611b6e5760009050611b93565b60008284029050828482811515611b8157fe5b04141515611b8e57600080fd5b809150505b92915050565b60008082111515611ba957600080fd5b60008284811515611bb657fe5b0490508091505092915050565b6000828211151515611bd457600080fd5b600082840390508091505092915050565b611bf9816001611ecf90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e60405160405180910390a250565b611c53816001611f7e90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f860405160405180910390a250565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611cd557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008160405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c01828152602001915050604051602081830303815290604052805190602001209050919050565b60008060008060418551141515611e085760009350505050611ec9565b6020850151925060408501519150606085015160001a9050601b8160ff161015611e3357601b810190505b601b8160ff1614158015611e4b5750601c8160ff1614155b15611e5c5760009350505050611ec9565b60018682858560405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611eb9573d6000803e3d6000fd5b5050506020604051035193505050505b92915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611f0b57600080fd5b611f1582826119d3565b1515611f2057600080fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611fba57600080fd5b611fc482826119d3565b151515611fd057600080fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505056fea165627a7a723058202c5718017c23211751d0d6c81288f8f5e2b4cd423048da733de284f0858990ca0029

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000984e7b0f2cb06b847dd465eec65a3a41c1e27c06000000000000000000000000a3baa9cd4f5c0f75541e7c78462a6f36ed62049a

-----Decoded View---------------
Arg [0] : _validater (address): 0x984E7B0f2cB06B847dd465EEc65a3A41C1E27c06
Arg [1] : _referrersAddress (address): 0xA3baa9cd4F5C0f75541e7C78462a6F36ED62049a

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000984e7b0f2cb06b847dd465eec65a3a41c1e27c06
Arg [1] : 000000000000000000000000a3baa9cd4f5c0f75541e7c78462a6f36ed62049a


Swarm Source

bzzr://2c5718017c23211751d0d6c81288f8f5e2b4cd423048da733de284f0858990ca

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.