Contract Address Details

0xB1C52075b276f87b1834919167312221d50c9D16

Token
iExec Application Registry (V5) (iExecAppsV5)
Creator
0xfac000–958db1 at 0x48950f–74fb99
Balance
0 xRLC
Tokens
Fetching tokens...
Transactions
10,584 Transactions
Transfers
0 Transfers
Gas Used
7,245,032,351
Last Balance Update
30184819
Contract name:
AppRegistry




Optimization enabled
true
Compiler version
v0.6.6+commit.6c089d02




Optimization runs
200
EVM Version
default




Verified at
2024-03-21T13:38:44.331400Z

Contract source code

Sol2uml
new
/**
 *Submitted for verification at Etherscan.io on 2020-06-03
*/

pragma solidity ^0.6.0;


interface IENS {
	event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);
	event Transfer(bytes32 indexed node, address owner);
	event NewResolver(bytes32 indexed node, address resolver);
	event NewTTL(bytes32 indexed node, uint64 ttl);
	event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

	function setRecord(bytes32, address, address, uint64) external;
	function setSubnodeRecord(bytes32, bytes32, address, address, uint64) external;
	function setSubnodeOwner(bytes32, bytes32, address) external returns(bytes32);
	function setResolver(bytes32, address) external;
	function setOwner(bytes32, address) external;
	function setTTL(bytes32, uint64) external;
	function setApprovalForAll(address, bool) external;
	function owner(bytes32) external view returns (address);
	function resolver(bytes32) external view returns (address);
	function ttl(bytes32) external view returns (uint64);
	function recordExists(bytes32) external view returns (bool);
	function isApprovedForAll(address, address) external view returns (bool);
}

interface IReverseRegistrar {
	function ADDR_REVERSE_NODE() external view returns (bytes32);
	function ens() external view returns (IENS);
	function defaultResolver() external view returns (address);
	function claim(address) external returns (bytes32);
	function claimWithResolver(address, address) external returns (bytes32);
	function setName(string calldata) external returns (bytes32);
	function node(address) external pure returns (bytes32);
}

// import "@ensdomains/ens/contracts/ENS.sol"; // ENS packages are dependency heavy
contract ENSReverseRegistration {
	bytes32 internal constant ADDR_REVERSE_NODE = 0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2;

	function _setName(IENS ens, string memory name)
	internal
	{
		IReverseRegistrar(ens.owner(ADDR_REVERSE_NODE)).setName(name);
	}
}

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != accountHash && codehash != 0x0);
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }
}

/**
 * @title Proxy
 * @dev Implements delegation of calls to other contracts, with proper
 * forwarding of return values and bubbling of failures.
 * It defines a fallback function that delegates all calls to the address
 * returned by the abstract _implementation() internal function.
 */
abstract contract Proxy {
  /**
   * @dev Receive function.
   * Implemented entirely in `_fallback`.
   */
  receive() external payable virtual {
    _fallback();
  }

  /**
   * @dev Fallback function.
   * Implemented entirely in `_fallback`.
   */
  fallback() external payable {
    _fallback();
  }

  /**
   * @return impl The Address of the implementation.
   */
  function _implementation() internal virtual view returns (address impl);

  /**
   * @dev Delegates execution to an implementation contract.
   * This is a low level function that doesn't return to its internal call site.
   * It will return to the external caller whatever the implementation returns.
   * @param implementation Address to delegate.
   */
  function _delegate(address implementation) internal {
    assembly {
      // Copy msg.data. We take full control of memory in this inline assembly
      // block because it will not return to Solidity code. We overwrite the
      // Solidity scratch pad at memory position 0.
      calldatacopy(0, 0, calldatasize())

      // Call the implementation.
      // out and outsize are 0 because we don't know the size yet.
      let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)

      // Copy the returned data.
      returndatacopy(0, 0, returndatasize())

      switch result
      // delegatecall returns 0 on error.
      case 0 { revert(0, returndatasize()) }
      default { return(0, returndatasize()) }
    }
  }

  /**
   * @dev Function that is run as the first thing in the fallback function.
   * Can be redefined in derived contracts to add functionality.
   * Redefinitions must call super._willFallback().
   */
  function _willFallback() internal virtual {
  }

  /**
   * @dev fallback implementation.
   * Extracted to enable manual triggering.
   */
  function _fallback() internal {
    _willFallback();
    _delegate(_implementation());
  }
}

/**
 * @title BaseUpgradeabilityProxy
 * @dev This contract implements a proxy that allows to change the
 * implementation address to which it will delegate.
 * Such a change is called an implementation upgrade.
 */
contract BaseUpgradeabilityProxy is Proxy {
  /**
   * @dev Emitted when the implementation is upgraded.
   * @param implementation Address of the new implementation.
   */
  event Upgraded(address indexed implementation);

  /**
   * @dev Storage slot with the address of the current implementation.
   * This is the keccak-256 hash of "org.zeppelinos.proxy.implementation", and is
   * validated in the constructor.
   */
  bytes32 internal constant IMPLEMENTATION_SLOT = 0x7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3;

  /**
   * @dev Returns the current implementation.
   * @return impl Address of the current implementation
   */
  function _implementation() internal override view returns (address impl) {
    bytes32 slot = IMPLEMENTATION_SLOT;
    assembly {
      impl := sload(slot)
    }
  }

  /**
   * @dev Upgrades the proxy to a new implementation.
   * @param newImplementation Address of the new implementation.
   */
  function _upgradeTo(address newImplementation) internal {
    _setImplementation(newImplementation);
    emit Upgraded(newImplementation);
  }

  /**
   * @dev Sets the implementation address of the proxy.
   * @param newImplementation Address of the new implementation.
   */
  function _setImplementation(address newImplementation) internal {
    require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");

    bytes32 slot = IMPLEMENTATION_SLOT;

    assembly {
      sstore(slot, newImplementation)
    }
  }
}

/**
 * @title InitializableUpgradeabilityProxy
 * @dev Extends BaseUpgradeabilityProxy with an initializer for initializing
 * implementation and init data.
 */
contract InitializableUpgradeabilityProxy is BaseUpgradeabilityProxy {
  /**
   * @dev Contract initializer.
   * @param _logic Address of the initial implementation.
   * @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
   * It should include the signature and the parameters of the function to be called, as described in
   * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
   * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
   */
  function initialize(address _logic, bytes memory _data) public payable {
    require(_implementation() == address(0));
    assert(IMPLEMENTATION_SLOT == keccak256("org.zeppelinos.proxy.implementation"));
    _setImplementation(_logic);
    if(_data.length > 0) {
      (bool success,) = _logic.delegatecall(_data);
      require(success);
    }
  }
}

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
contract Context {
    // Empty internal constructor, to prevent people from mistakenly deploying
    // an instance of this contract, which should be used via inheritance.
    constructor () internal { }

    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
contract Ownable is Context {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(_owner == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transfered from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from`, `to` cannot be zero.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from`, `to` cannot be zero.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    /**
      * @dev Safely transfers `tokenId` token from `from` to `to`.
      *
      * Requirements:
      *
      * - `from`, `to` cannot be zero.
      * - `tokenId` token must exist and be owned by `from`.
      * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
      * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
      *
      * Emits a {Transfer} event.
      */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {

    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {

    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
abstract contract IERC721Receiver {
    /**
     * @notice Handle the receipt of an NFT
     * @dev The ERC721 smart contract calls this function on the recipient
     * after a {IERC721-safeTransferFrom}. 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 `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
     */
    function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data)
    public virtual returns (bytes4);
}

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts may inherit from this and call {_registerInterface} to declare
 * their support of an interface.
 */
contract ERC165 is IERC165 {
    /*
     * bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7
     */
    bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;

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

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

    /**
     * @dev See {IERC165-supportsInterface}.
     *
     * Time complexity O(1), guaranteed to always use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) public view override returns (bool) {
        return _supportedInterfaces[interfaceId];
    }

    /**
     * @dev Registers the contract as an implementer of the interface defined by
     * `interfaceId`. Support of the actual ERC165 interface is automatic and
     * registering its interface id is not required.
     *
     * See {IERC165-supportsInterface}.
     *
     * Requirements:
     *
     * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
     */
    function _registerInterface(bytes4 interfaceId) internal virtual {
        require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
        _supportedInterfaces[interfaceId] = true;
    }
}

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     * - Multiplication cannot 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-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
 * (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;

        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) { // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        require(set._values.length > index, "EnumerableSet: index out of bounds");
        return set._values[index];
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(value)));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(value)));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(value)));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint256(_at(set._inner, index)));
    }


    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }
}

/**
 * @dev Library for managing an enumerable variant of Solidity's
 * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]
 * type.
 *
 * Maps have the following properties:
 *
 * - Entries are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Entries are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableMap for EnumerableMap.UintToAddressMap;
 *
 *     // Declare a set state variable
 *     EnumerableMap.UintToAddressMap private myMap;
 * }
 * ```
 *
 * As of v3.0.0, only maps of type `uint256 -> address` (`UintToAddressMap`) are
 * supported.
 */
library EnumerableMap {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Map type with
    // bytes32 keys and values.
    // The Map implementation uses private functions, and user-facing
    // implementations (such as Uint256ToAddressMap) are just wrappers around
    // the underlying Map.
    // This means that we can only create new EnumerableMaps for types that fit
    // in bytes32.

    struct MapEntry {
        bytes32 _key;
        bytes32 _value;
    }

    struct Map {
        // Storage of map keys and values
        MapEntry[] _entries;

        // Position of the entry defined by a key in the `entries` array, plus 1
        // because index 0 means a key is not in the map.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function _set(Map storage map, bytes32 key, bytes32 value) private returns (bool) {
        // We read and store the key's index to prevent multiple reads from the same storage slot
        uint256 keyIndex = map._indexes[key];

        if (keyIndex == 0) { // Equivalent to !contains(map, key)
            map._entries.push(MapEntry({ _key: key, _value: value }));
            // The entry is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            map._indexes[key] = map._entries.length;
            return true;
        } else {
            map._entries[keyIndex - 1]._value = value;
            return false;
        }
    }

    /**
     * @dev Removes a key-value pair from a map. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function _remove(Map storage map, bytes32 key) private returns (bool) {
        // We read and store the key's index to prevent multiple reads from the same storage slot
        uint256 keyIndex = map._indexes[key];

        if (keyIndex != 0) { // Equivalent to contains(map, key)
            // To delete a key-value pair from the _entries array in O(1), we swap the entry to delete with the last one
            // in the array, and then remove the last entry (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = keyIndex - 1;
            uint256 lastIndex = map._entries.length - 1;

            // When the entry to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            MapEntry storage lastEntry = map._entries[lastIndex];

            // Move the last entry to the index where the entry to delete is
            map._entries[toDeleteIndex] = lastEntry;
            // Update the index for the moved entry
            map._indexes[lastEntry._key] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved entry was stored
            map._entries.pop();

            // Delete the index for the deleted slot
            delete map._indexes[key];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function _contains(Map storage map, bytes32 key) private view returns (bool) {
        return map._indexes[key] != 0;
    }

    /**
     * @dev Returns the number of key-value pairs in the map. O(1).
     */
    function _length(Map storage map) private view returns (uint256) {
        return map._entries.length;
    }

   /**
    * @dev Returns the key-value pair stored at position `index` in the map. O(1).
    *
    * Note that there are no guarantees on the ordering of entries inside the
    * array, and it may change when more entries are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Map storage map, uint256 index) private view returns (bytes32, bytes32) {
        require(map._entries.length > index, "EnumerableMap: index out of bounds");

        MapEntry storage entry = map._entries[index];
        return (entry._key, entry._value);
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function _get(Map storage map, bytes32 key) private view returns (bytes32) {
        return _get(map, key, "EnumerableMap: nonexistent key");
    }

    /**
     * @dev Same as {_get}, with a custom error message when `key` is not in the map.
     */
    function _get(Map storage map, bytes32 key, string memory errorMessage) private view returns (bytes32) {
        uint256 keyIndex = map._indexes[key];
        require(keyIndex != 0, errorMessage); // Equivalent to contains(map, key)
        return map._entries[keyIndex - 1]._value; // All indexes are 1-based
    }

    // UintToAddressMap

    struct UintToAddressMap {
        Map _inner;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) {
        return _set(map._inner, bytes32(key), bytes32(uint256(value)));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) {
        return _remove(map._inner, bytes32(key));
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) {
        return _contains(map._inner, bytes32(key));
    }

    /**
     * @dev Returns the number of elements in the map. O(1).
     */
    function length(UintToAddressMap storage map) internal view returns (uint256) {
        return _length(map._inner);
    }

   /**
    * @dev Returns the element stored at position `index` in the set. O(1).
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) {
        (bytes32 key, bytes32 value) = _at(map._inner, index);
        return (uint256(key), address(uint256(value)));
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {
        return address(uint256(_get(map._inner, bytes32(key))));
    }

    /**
     * @dev Same as {get}, with a custom error message when `key` is not in the map.
     */
    function get(UintToAddressMap storage map, uint256 key, string memory errorMessage) internal view returns (address) {
        return address(uint256(_get(map._inner, bytes32(key), errorMessage)));
    }
}

/**
 * @dev String operations.
 */
library Strings {
    /**
     * @dev Converts a `uint256` to its ASCII `string` representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        uint256 index = digits - 1;
        temp = value;
        while (temp != 0) {
            buffer[index--] = byte(uint8(48 + temp % 10));
            temp /= 10;
        }
        return string(buffer);
    }
}

/**
 * @title ERC721 Non-Fungible Token Standard basic implementation
 * @dev see https://eips.ethereum.org/EIPS/eip-721
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
    using SafeMath for uint256;
    using Address for address;
    using EnumerableSet for EnumerableSet.UintSet;
    using EnumerableMap for EnumerableMap.UintToAddressMap;
    using Strings for uint256;

    // 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 holder address to their (enumerable) set of owned tokens
    mapping (address => EnumerableSet.UintSet) private _holderTokens;

    // Enumerable mapping from token ids to their owners
    EnumerableMap.UintToAddressMap private _tokenOwners;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

    // Base URI
    string private _baseURI;

    /*
     *     bytes4(keccak256('balanceOf(address)')) == 0x70a08231
     *     bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e
     *     bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3
     *     bytes4(keccak256('getApproved(uint256)')) == 0x081812fc
     *     bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465
     *     bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5
     *     bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde
     *
     *     => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^
     *        0xa22cb465 ^ 0xe985e9c ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd
     */
    bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;

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

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

    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);
        _registerInterface(_INTERFACE_ID_ERC721_METADATA);
        _registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
    }

    /**
     * @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 override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");

        return _holderTokens[owner].length();
    }

    /**
     * @dev Gets the owner of the specified token ID.
     * @param tokenId uint256 ID of the token to query the owner of
     * @return address currently marked as the owner of the given token ID
     */
    function ownerOf(uint256 tokenId) public view override returns (address) {
        return _tokenOwners.get(tokenId, "ERC721: owner query for nonexistent token");
    }

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

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

    /**
     * @dev Returns the URI for a given token ID. May return an empty string.
     *
     * If a base URI is set (via {_setBaseURI}), it is added as a prefix to the
     * token's own URI (via {_setTokenURI}).
     *
     * If there is a base URI but no token URI, the token's ID will be used as
     * its URI when appending it to the base URI. This pattern for autogenerated
     * token URIs can lead to large gas savings.
     *
     * .Examples
     * |===
     * |`_setBaseURI()` |`_setTokenURI()` |`tokenURI()`
     * | ""
     * | ""
     * | ""
     * | ""
     * | "token.uri/123"
     * | "token.uri/123"
     * | "token.uri/"
     * | "123"
     * | "token.uri/123"
     * | "token.uri/"
     * | ""
     * | "token.uri/<tokenId>"
     * |===
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        string memory _tokenURI = _tokenURIs[tokenId];

        // If there is no base URI, return the token URI.
        if (bytes(_baseURI).length == 0) {
            return _tokenURI;
        }
        // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
        if (bytes(_tokenURI).length > 0) {
            return string(abi.encodePacked(_baseURI, _tokenURI));
        }
        // If there is a baseURI but no tokenURI, concatenate the tokenID to the baseURI.
        return string(abi.encodePacked(_baseURI, tokenId.toString()));
    }

    /**
    * @dev Returns the base URI set via {_setBaseURI}. This will be
    * automatically added as a prefix in {tokenURI} to each token's URI, or
    * to the token ID if no specific URI is set for that token ID.
    */
    function baseURI() public view returns (string memory) {
        return _baseURI;
    }

    /**
     * @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 override returns (uint256) {
        return _holderTokens[owner].at(index);
    }

    /**
     * @dev Gets the total amount of tokens stored by the contract.
     * @return uint256 representing the total amount of tokens
     */
    function totalSupply() public view override returns (uint256) {
        // _tokenOwners are indexed by tokenIds, so .length() returns the number of tokenIds
        return _tokenOwners.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 override returns (uint256) {
        (uint256 tokenId, ) = _tokenOwners.at(index);
        return tokenId;
    }

    /**
     * @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 virtual override {
        address owner = ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _approve(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 override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        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 operator operator address to set the approval
     * @param approved representing the status of the approval to be set
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(operator != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, 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 override 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 virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transfer(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 {IERC721Receiver-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 virtual override {
        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 {IERC721Receiver-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 _msgSender() 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 virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @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 _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether the specified token exists.
     * @param tokenId uint256 ID of the token to query the existence of
     * @return bool whether the token exists
     */
    function _exists(uint256 tokenId) internal view returns (bool) {
        return _tokenOwners.contains(tokenId);
    }

    /**
     * @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) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Internal function to safely mint a new token.
     * Reverts if the given token ID already exists.
     * 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.
     * @param to The address that will own the minted token
     * @param tokenId uint256 ID of the token to be minted
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Internal function to safely mint a new token.
     * Reverts if the given token ID already exists.
     * 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.
     * @param to The address that will own the minted token
     * @param tokenId uint256 ID of the token to be minted
     * @param _data bytes data to send along with a safe transfer check
     */
    function _safeMint(address to, uint256 tokenId, bytes memory _data) internal virtual {
        _mint(to, tokenId);
        require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @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 virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _holderTokens[to].add(tokenId);

        _tokenOwners.set(tokenId, to);

        emit Transfer(address(0), to, 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 virtual {
        address owner = ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

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

        _holderTokens[owner].remove(tokenId);

        _tokenOwners.remove(tokenId);

        emit Transfer(owner, address(0), 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 _transfer(address from, address to, uint256 tokenId) internal virtual {
        require(ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _holderTokens[from].remove(tokenId);
        _holderTokens[to].add(tokenId);

        _tokenOwners.set(tokenId, to);

        emit Transfer(from, to, tokenId);
    }

    /**
     * @dev Internal function to set the token URI for a given token.
     *
     * Reverts if the token ID does not exist.
     *
     * TIP: If all token IDs share a prefix (for example, if your URIs look like
     * `https://api.myproject.com/token/<id>`), use {_setBaseURI} to store
     * it and save gas.
     */
    function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {
        require(_exists(tokenId), "ERC721Metadata: URI set of nonexistent token");
        _tokenURIs[tokenId] = _tokenURI;
    }

    /**
     * @dev Internal function to set the base URI for all token IDs. It is
     * automatically added as a prefix to the value returned in {tokenURI},
     * or to the token ID if {tokenURI} is empty.
     */
    function _setBaseURI(string memory baseURI_) internal virtual {
        _baseURI = baseURI_;
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-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 bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
        private returns (bool)
    {
        if (!to.isContract()) {
            return true;
        }
        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = to.call(abi.encodeWithSelector(
            IERC721Receiver(to).onERC721Received.selector,
            _msgSender(),
            from,
            tokenId,
            _data
        ));
        if (!success) {
            if (returndata.length > 0) {
                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert("ERC721: transfer to non ERC721Receiver implementer");
            }
        } else {
            bytes4 retval = abi.decode(returndata, (bytes4));
            return (retval == _ERC721_RECEIVED);
        }
    }

    function _approve(address to, uint256 tokenId) private {
        _tokenApprovals[tokenId] = to;
        emit Approval(ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - when `from` is zero, `tokenId` will be minted for `to`.
     * - when `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual { }
}

/**
 * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.
 * `CREATE2` can be used to compute in advance the address where a smart
 * contract will be deployed, which allows for interesting new mechanisms known
 * as 'counterfactual interactions'.
 *
 * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more
 * information.
 */
library Create2 {
    /**
     * @dev Deploys a contract using `CREATE2`. The address where the contract
     * will be deployed can be known in advance via {computeAddress}.
     *
     * The bytecode for a contract can be obtained from Solidity with
     * `type(contractName).creationCode`.
     *
     * Requirements:
     *
     * - `bytecode` must not be empty.
     * - `salt` must have not been used for `bytecode` already.
     * - the factory must have a balance of at least `amount`.
     * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.
     */
    function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address) {
        address addr;
        require(address(this).balance >= amount, "Create2: insufficient balance");
        require(bytecode.length != 0, "Create2: bytecode length is zero");
        // solhint-disable-next-line no-inline-assembly
        assembly {
            addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)
        }
        require(addr != address(0), "Create2: Failed on deploy");
        return addr;
    }

    /**
     * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the
     * `bytecodeHash` or `salt` will result in a new destination address.
     */
    function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {
        return computeAddress(salt, bytecodeHash, address(this));
    }

    /**
     * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at
     * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.
     */
    function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address) {
        bytes32 _data = keccak256(
            abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)
        );
        return address(bytes20(_data << 96));
    }
}

abstract contract IRegistry is IERC721Enumerable
{
	function isRegistered(address _entry) external virtual view returns (bool);
}

abstract contract Registry is IRegistry, ERC721, ENSReverseRegistration, Ownable
{
	address   public master;
	bytes     public proxyCode;
	bytes32   public proxyCodeHash;
	IRegistry public previous;
	bool      public initialized;

	constructor(address _master, string memory _name, string memory _symbol)
	public ERC721(_name, _symbol)
	{
		master        = _master;
		proxyCode     = type(InitializableUpgradeabilityProxy).creationCode;
		proxyCodeHash = keccak256(proxyCode);
	}

	function initialize(address _previous)
	external onlyOwner()
	{
		require(!initialized);
		initialized = true;
		previous    = IRegistry(_previous);
	}

	/* Factory */
	function _mintCreate(address _owner, bytes memory _args)
	internal returns (uint256)
	{
		// Create entry (proxy)
		address entry = Create2.deploy(0, keccak256(abi.encodePacked(_args, _owner)), proxyCode);
		// Initialize entry (casting to address payable is a pain in ^0.5.0)
		InitializableUpgradeabilityProxy(payable(entry)).initialize(master, _args);
		// Mint corresponding token
		_mint(_owner, uint256(entry));
		return uint256(entry);
	}

	function _mintPredict(address _owner, bytes memory _args)
	internal view returns (uint256)
	{
		address entry = Create2.computeAddress(keccak256(abi.encodePacked(_args, _owner)), proxyCodeHash);
		return uint256(entry);
	}

	/* Administration */
	function setName(address _ens, string calldata _name)
	external onlyOwner()
	{
		_setName(IENS(_ens), _name);
	}

	function setBaseURI(string calldata _baseURI)
	external onlyOwner()
	{
		_setBaseURI(_baseURI);
	}

	/* Interface */
	function isRegistered(address _entry)
	external view override returns (bool)
	{
		return _exists(uint256(_entry)) || (address(previous) != address(0) && previous.isRegistered(_entry));
	}
}

abstract contract RegistryEntry is ENSReverseRegistration
{
	IRegistry public registry;

	function _initialize(address _registry) internal
	{
		require(address(registry) == address(0), 'already initialized');
		registry = IRegistry(_registry);
	}

	function owner() public view returns (address)
	{
		return registry.ownerOf(uint256(address(this)));
	}

	modifier onlyOwner()
	{
		require(owner() == msg.sender, 'caller is not the owner');
		_;
	}

	function setName(address _ens, string calldata _name)
	external onlyOwner()
	{
		_setName(IENS(_ens), _name);
	}
}

contract App is RegistryEntry
{
	/**
	 * Members
	 */
	string  public  m_appName;
	string  public  m_appType;
	bytes   public  m_appMultiaddr;
	bytes32 public  m_appChecksum;
	bytes   public  m_appMREnclave;

	/**
	 * Constructor
	 */
	function initialize(
		string  memory _appName,
		string  memory _appType,
		bytes   memory _appMultiaddr,
		bytes32        _appChecksum,
		bytes   memory _appMREnclave)
	public
	{
		_initialize(msg.sender);
		m_appName      = _appName;
		m_appType      = _appType;
		m_appMultiaddr = _appMultiaddr;
		m_appChecksum  = _appChecksum;
		m_appMREnclave = _appMREnclave;
	}
}

contract AppRegistry is Registry
{
	/**
	 * Constructor
	 */
	constructor()
	public Registry(
		address(new App()),
		'iExec Application Registry (V5)',
		'iExecAppsV5')
	{
	}

	/**
	 * App creation
	 */
	function encodeInitializer(
		string  memory _appName,
		string  memory _appType,
		bytes   memory _appMultiaddr,
		bytes32        _appChecksum,
		bytes   memory _appMREnclave)
	internal pure returns (bytes memory)
	{
		return abi.encodeWithSignature(
			'initialize(string,string,bytes,bytes32,bytes)'
		,	_appName
		,	_appType
		,	_appMultiaddr
		,	_appChecksum
		,	_appMREnclave
		);
	}

	function createApp(
		address          _appOwner,
		string  calldata _appName,
		string  calldata _appType,
		bytes   calldata _appMultiaddr,
		bytes32          _appChecksum,
		bytes   calldata _appMREnclave)
	external returns (App)
	{
		return App(_mintCreate(_appOwner, encodeInitializer(_appName, _appType, _appMultiaddr, _appChecksum, _appMREnclave)));
	}

	function predictApp(
		address          _appOwner,
		string  calldata _appName,
		string  calldata _appType,
		bytes   calldata _appMultiaddr,
		bytes32          _appChecksum,
		bytes   calldata _appMREnclave)
	external view returns (App)
	{
		return App(_mintPredict(_appOwner, encodeInitializer(_appName, _appType, _appMultiaddr, _appChecksum, _appMREnclave)));
	}
}
        

Contract ABI

[{"type":"constructor","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"approve","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"baseURI","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"address","name":"","internalType":"contract App"}],"name":"createApp","inputs":[{"type":"address","name":"_appOwner","internalType":"address"},{"type":"string","name":"_appName","internalType":"string"},{"type":"string","name":"_appType","internalType":"string"},{"type":"bytes","name":"_appMultiaddr","internalType":"bytes"},{"type":"bytes32","name":"_appChecksum","internalType":"bytes32"},{"type":"bytes","name":"_appMREnclave","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getApproved","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_previous","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"initialized","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isApprovedForAll","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"operator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isRegistered","inputs":[{"type":"address","name":"_entry","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"master","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"ownerOf","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract App"}],"name":"predictApp","inputs":[{"type":"address","name":"_appOwner","internalType":"address"},{"type":"string","name":"_appName","internalType":"string"},{"type":"string","name":"_appType","internalType":"string"},{"type":"bytes","name":"_appMultiaddr","internalType":"bytes"},{"type":"bytes32","name":"_appChecksum","internalType":"bytes32"},{"type":"bytes","name":"_appMREnclave","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IRegistry"}],"name":"previous","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes","name":"","internalType":"bytes"}],"name":"proxyCode","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"proxyCodeHash","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"bytes","name":"_data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setApprovalForAll","inputs":[{"type":"address","name":"operator","internalType":"address"},{"type":"bool","name":"approved","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setBaseURI","inputs":[{"type":"string","name":"_baseURI","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setName","inputs":[{"type":"address","name":"_ens","internalType":"address"},{"type":"string","name":"_name","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"tokenByIndex","inputs":[{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"tokenOfOwnerByIndex","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"tokenURI","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"address","name":"approved","indexed":true},{"type":"uint256","name":"tokenId","indexed":true}],"anonymous":false},{"type":"event","name":"ApprovalForAll","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"address","name":"operator","indexed":true},{"type":"bool","name":"approved","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","indexed":true},{"type":"address","name":"newOwner","indexed":true}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","indexed":true},{"type":"address","name":"to","indexed":true},{"type":"uint256","name":"tokenId","indexed":true}],"anonymous":false}]
              

Contract Creation Code

0x60806040523480156200001157600080fd5b506040516200002090620002f1565b604051809103906000f0801580156200003d573d6000803e3d6000fd5b50604080518082018252601f81527f6945786563204170706c69636174696f6e2052656769737472792028563529006020808301919091528251808401909352600b83526a694578656341707073563560a81b90830152908181620000b26301ffc9a760e01b6001600160e01b036200026716565b8151620000c7906006906020850190620002ff565b508051620000dd906007906020840190620002ff565b50620000f96380ac58cd60e01b6001600160e01b036200026716565b62000114635b5e139f60e01b6001600160e01b036200026716565b6200012f63780e9d6360e01b6001600160e01b036200026716565b5060009050620001476001600160e01b03620002ec16565b600a80546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600b80546001600160a01b0319166001600160a01b038516179055604051620001c16020820162000384565b601f1982820381018352601f909101166040528051620001eb91600c9160209190910190620002ff565b50600c60405180828054600181600116156101000203166002900480156200024d5780601f106200022a5761010080835404028352918201916200024d565b820191906000526020600020905b81548152906001019060200180831162000238575b5050604051908190039020600d5550620003af9350505050565b6001600160e01b03198082161415620002c7576040805162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e7465726661636520696400000000604482015290519081900360640190fd5b6001600160e01b0319166000908152602081905260409020805460ff19166001179055565b335b90565b610a39806200332783390190565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200034257805160ff191683800117855562000372565b8280016001018555821562000372579182015b828111156200037257825182559160200191906001019062000355565b506200038092915062000392565b5090565b6103cd8062003d6083390190565b620002ee91905b8082111562000380576000815560010162000399565b612f6880620003bf6000396000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c80636fa59bbc1161010f578063c3c5a547116100a2578063e985e9c511610071578063e985e9c51461097e578063ee97f7f3146109ac578063eee39111146109b4578063f2fde38b146109bc576101e5565b8063c3c5a547146107a3578063c4d66de8146107c9578063c87b56dd146107ef578063e92118ed1461080c576101e5565b80638da5cb5b116100de5780638da5cb5b146106a157806395d89b41146106a9578063a22cb465146106b1578063b88d4fde146106df576101e5565b80636fa59bbc1461066357806370a082311461066b578063715018a6146106915780637c2b2e7114610699576101e5565b80632f745c59116101875780634f6ccce7116101565780634f6ccce7146105b357806355f804b3146105d05780636352211e1461063e5780636c0360eb1461065b576101e5565b80632f745c59146103615780633121db1c1461038d5780633f7868ff1461040b57806342842e0e1461057d576101e5565b8063095ea7b3116101c3578063095ea7b3146102db578063158ef93e1461030957806318160ddd1461031157806323b872dd1461032b576101e5565b806301ffc9a7146101ea57806306fdde0314610225578063081812fc146102a2575b600080fd5b6102116004803603602081101561020057600080fd5b50356001600160e01b0319166109e2565b604080519115158252519081900360200190f35b61022d610a05565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561026757818101518382015260200161024f565b50505050905090810190601f1680156102945780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102bf600480360360208110156102b857600080fd5b5035610a9c565b604080516001600160a01b039092168252519081900360200190f35b610307600480360360408110156102f157600080fd5b506001600160a01b038135169060200135610afe565b005b610211610bd9565b610319610be9565b60408051918252519081900360200190f35b6103076004803603606081101561034157600080fd5b506001600160a01b03813581169160208101359091169060400135610bfa565b6103196004803603604081101561037757600080fd5b506001600160a01b038135169060200135610c51565b610307600480360360408110156103a357600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156103cd57600080fd5b8201836020820111156103df57600080fd5b803590602001918460018302840111600160201b8311171561040057600080fd5b509092509050610c82565b6102bf600480360360c081101561042157600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561044b57600080fd5b82018360208201111561045d57600080fd5b803590602001918460018302840111600160201b8311171561047e57600080fd5b919390929091602081019035600160201b81111561049b57600080fd5b8201836020820111156104ad57600080fd5b803590602001918460018302840111600160201b831117156104ce57600080fd5b919390929091602081019035600160201b8111156104eb57600080fd5b8201836020820111156104fd57600080fd5b803590602001918460018302840111600160201b8311171561051e57600080fd5b91939092823592604081019060200135600160201b81111561053f57600080fd5b82018360208201111561055157600080fd5b803590602001918460018302840111600160201b8311171561057257600080fd5b509092509050610d1a565b6103076004803603606081101561059357600080fd5b506001600160a01b03813581169160208101359091169060400135610e22565b610319600480360360208110156105c957600080fd5b5035610e3d565b610307600480360360208110156105e657600080fd5b810190602081018135600160201b81111561060057600080fd5b82018360208201111561061257600080fd5b803590602001918460018302840111600160201b8311171561063357600080fd5b509092509050610e59565b6102bf6004803603602081101561065457600080fd5b5035610ef4565b61022d610f22565b61022d610f83565b6103196004803603602081101561068157600080fd5b50356001600160a01b0316611011565b610307611079565b6102bf61111b565b6102bf61112a565b61022d611139565b610307600480360360408110156106c757600080fd5b506001600160a01b038135169060200135151561119a565b610307600480360360808110156106f557600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561072f57600080fd5b82018360208201111561074157600080fd5b803590602001918460018302840111600160201b8311171561076257600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061129f945050505050565b610211600480360360208110156107b957600080fd5b50356001600160a01b03166112fd565b610307600480360360208110156107df57600080fd5b50356001600160a01b03166113ab565b61022d6004803603602081101561080557600080fd5b503561144b565b6102bf600480360360c081101561082257600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561084c57600080fd5b82018360208201111561085e57600080fd5b803590602001918460018302840111600160201b8311171561087f57600080fd5b919390929091602081019035600160201b81111561089c57600080fd5b8201836020820111156108ae57600080fd5b803590602001918460018302840111600160201b831117156108cf57600080fd5b919390929091602081019035600160201b8111156108ec57600080fd5b8201836020820111156108fe57600080fd5b803590602001918460018302840111600160201b8311171561091f57600080fd5b91939092823592604081019060200135600160201b81111561094057600080fd5b82018360208201111561095257600080fd5b803590602001918460018302840111600160201b8311171561097357600080fd5b5090925090506116f2565b6102116004803603604081101561099457600080fd5b506001600160a01b03813581169160200135166117eb565b6102bf611819565b610319611828565b610307600480360360208110156109d257600080fd5b50356001600160a01b031661182e565b6001600160e01b0319811660009081526020819052604090205460ff165b919050565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610a915780601f10610a6657610100808354040283529160200191610a91565b820191906000526020600020905b815481529060010190602001808311610a7457829003601f168201915b505050505090505b90565b6000610aa782611927565b610ae25760405162461bcd60e51b815260040180806020018281038252602c815260200180612e3d602c913960400191505060405180910390fd5b506000908152600460205260409020546001600160a01b031690565b6000610b0982610ef4565b9050806001600160a01b0316836001600160a01b03161415610b5c5760405162461bcd60e51b8152600401808060200182810382526021815260200180612ee16021913960400191505060405180910390fd5b806001600160a01b0316610b6e61193a565b6001600160a01b03161480610b8f5750610b8f81610b8a61193a565b6117eb565b610bca5760405162461bcd60e51b8152600401808060200182810382526038815260200180612d906038913960400191505060405180910390fd5b610bd4838361193e565b505050565b600e54600160a01b900460ff1681565b6000610bf560026119ac565b905090565b610c0b610c0561193a565b826119b7565b610c465760405162461bcd60e51b8152600401808060200182810382526031815260200180612f026031913960400191505060405180910390fd5b610bd4838383611a5b565b6001600160a01b0382166000908152600160205260408120610c79908363ffffffff611bb916565b90505b92915050565b610c8a61193a565b600a546001600160a01b03908116911614610cda576040805162461bcd60e51b81526020600482018190526024820152600080516020612e69833981519152604482015290519081900360640190fd5b610bd48383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611bc592505050565b6000610e138b610e0e8c8c8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8f018190048102820181019092528d815292508d91508c908190840183828082843760009201919091525050604080516020601f8d018190048102820181019092528b81528d935091508b908b9081908401838280828437600092019190915250611d2a92505050565b611f10565b9b9a5050505050505050505050565b610bd48383836040518060200160405280600081525061129f565b600080610e5160028463ffffffff61213a16565b509392505050565b610e6161193a565b600a546001600160a01b03908116911614610eb1576040805162461bcd60e51b81526020600482018190526024820152600080516020612e69833981519152604482015290519081900360640190fd5b610ef082828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061215692505050565b5050565b6000610c7c82604051806060016040528060298152602001612df2602991396002919063ffffffff61216916565b60098054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610a915780601f10610a6657610100808354040283529160200191610a91565b600c805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156110095780601f10610fde57610100808354040283529160200191611009565b820191906000526020600020905b815481529060010190602001808311610fec57829003601f168201915b505050505081565b60006001600160a01b0382166110585760405162461bcd60e51b815260040180806020018281038252602a815260200180612dc8602a913960400191505060405180910390fd5b6001600160a01b0382166000908152600160205260409020610c7c906119ac565b61108161193a565b600a546001600160a01b039081169116146110d1576040805162461bcd60e51b81526020600482018190526024820152600080516020612e69833981519152604482015290519081900360640190fd5b600a546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600a80546001600160a01b0319169055565b600e546001600160a01b031681565b600a546001600160a01b031690565b60078054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610a915780601f10610a6657610100808354040283529160200191610a91565b6111a261193a565b6001600160a01b0316826001600160a01b03161415611208576040805162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015290519081900360640190fd5b806005600061121561193a565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff19169215159290921790915561125961193a565b60408051841515815290516001600160a01b0392909216917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319181900360200190a35050565b6112b06112aa61193a565b836119b7565b6112eb5760405162461bcd60e51b8152600401808060200182810382526031815260200180612f026031913960400191505060405180910390fd5b6112f784848484612180565b50505050565b6000611311826001600160a01b0316611927565b80610c7c5750600e546001600160a01b031615801590610c7c5750600e546040805163c3c5a54760e01b81526001600160a01b0385811660048301529151919092169163c3c5a547916024808301926020929190829003018186803b15801561137957600080fd5b505afa15801561138d573d6000803e3d6000fd5b505050506040513d60208110156113a357600080fd5b505192915050565b6113b361193a565b600a546001600160a01b03908116911614611403576040805162461bcd60e51b81526020600482018190526024820152600080516020612e69833981519152604482015290519081900360640190fd5b600e54600160a01b900460ff161561141a57600080fd5b600e8054600160a01b60ff60a01b19909116176001600160a01b0319166001600160a01b0392909216919091179055565b606061145682611927565b6114915760405162461bcd60e51b815260040180806020018281038252602f815260200180612eb2602f913960400191505060405180910390fd5b60008281526008602090815260409182902080548351601f60026000196101006001861615020190931692909204918201849004840281018401909452808452606093928301828280156115265780601f106114fb57610100808354040283529160200191611526565b820191906000526020600020905b81548152906001019060200180831161150957829003601f168201915b50506009549394505050506002600019610100600184161502019091160461154f579050610a00565b8051156116205760098160405160200180838054600181600116156101000203166002900480156115b75780601f106115955761010080835404028352918201916115b7565b820191906000526020600020905b8154815290600101906020018083116115a3575b5050825160208401908083835b602083106115e35780518252601f1990920191602091820191016115c4565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052915050610a00565b600961162b846121d2565b60405160200180838054600181600116156101000203166002900480156116895780601f10611667576101008083540402835291820191611689565b820191906000526020600020905b815481529060010190602001808311611675575b5050825160208401908083835b602083106116b55780518252601f199092019160209182019101611696565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052915050919050565b6000610e138b6117e68c8c8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8f018190048102820181019092528d815292508d91508c908190840183828082843760009201919091525050604080516020601f8d018190048102820181019092528b81528d935091508b908b9081908401838280828437600092019190915250611d2a92505050565b6122ad565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b600b546001600160a01b031681565b600d5481565b61183661193a565b600a546001600160a01b03908116911614611886576040805162461bcd60e51b81526020600482018190526024820152600080516020612e69833981519152604482015290519081900360640190fd5b6001600160a01b0381166118cb5760405162461bcd60e51b8152600401808060200182810382526026815260200180612d1a6026913960400191505060405180910390fd5b600a546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600a80546001600160a01b0319166001600160a01b0392909216919091179055565b6000610c7c60028363ffffffff61235716565b3390565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061197382610ef4565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000610c7c82612363565b60006119c282611927565b6119fd5760405162461bcd60e51b815260040180806020018281038252602c815260200180612d64602c913960400191505060405180910390fd5b6000611a0883610ef4565b9050806001600160a01b0316846001600160a01b03161480611a435750836001600160a01b0316611a3884610a9c565b6001600160a01b0316145b80611a535750611a5381856117eb565b949350505050565b826001600160a01b0316611a6e82610ef4565b6001600160a01b031614611ab35760405162461bcd60e51b8152600401808060200182810382526029815260200180612e896029913960400191505060405180910390fd5b6001600160a01b038216611af85760405162461bcd60e51b8152600401808060200182810382526024815260200180612d406024913960400191505060405180910390fd5b611b03838383610bd4565b611b0e60008261193e565b6001600160a01b0383166000908152600160205260409020611b36908263ffffffff61236716565b506001600160a01b0382166000908152600160205260409020611b5f908263ffffffff61237316565b50611b726002828463ffffffff61237f16565b5080826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000610c798383612395565b604080516302571be360e01b81527f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2600482015290516001600160a01b038416916302571be3916024808301926020929190829003018186803b158015611c2b57600080fd5b505afa158015611c3f573d6000803e3d6000fd5b505050506040513d6020811015611c5557600080fd5b505160405163c47f002760e01b81526020600482018181528451602484015284516001600160a01b039094169363c47f002793869383926044909201919085019080838360005b83811015611cb4578181015183820152602001611c9c565b50505050905090810190601f168015611ce15780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b158015611d0057600080fd5b505af1158015611d14573d6000803e3d6000fd5b505050506040513d60208110156112f757600080fd5b60608585858585604051602401808060200180602001806020018681526020018060200185810385528a818151815260200191508051906020019080838360005b83811015611d83578181015183820152602001611d6b565b50505050905090810190601f168015611db05780820380516001836020036101000a031916815260200191505b5085810384528951815289516020918201918b019080838360005b83811015611de3578181015183820152602001611dcb565b50505050905090810190601f168015611e105780820380516001836020036101000a031916815260200191505b5085810383528851815288516020918201918a019080838360005b83811015611e43578181015183820152602001611e2b565b50505050905090810190601f168015611e705780820380516001836020036101000a031916815260200191505b50858103825286518152865160209182019188019080838360005b83811015611ea3578181015183820152602001611e8b565b50505050905090810190601f168015611ed05780820380516001836020036101000a031916815260200191505b5060408051601f198184030181529190526020810180516001600160e01b03166386c02c8f60e01b1790529a505050505050505050505095945050505050565b600080612043600084866040516020018083805190602001908083835b60208310611f4c5780518252601f199092019160209182019101611f2d565b6001836020036101000a038019825116818451168082178552505050505050905001826001600160a01b03166001600160a01b031660601b81526014019250505060405160208183030381529060405280519060200120600c8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156120395780601f1061200e57610100808354040283529160200191612039565b820191906000526020600020905b81548152906001019060200180831161201c57829003601f168201915b50505050506123f9565b600b546040805163347d5e2560e21b81526001600160a01b0392831660048201818152602483019384528851604484015288519596509386169463d1f5789494919389939091606490910190602085019080838360005b838110156120b257818101518382015260200161209a565b50505050905090810190601f1680156120df5780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b1580156120ff57600080fd5b505af1158015612113573d6000803e3d6000fd5b5050505061212a84826001600160a01b031661250a565b6001600160a01b03169392505050565b60008080806121498686612644565b9097909650945050505050565b8051610ef0906009906020840190612c2d565b60006121768484846126bf565b90505b9392505050565b61218b848484611a5b565b61219784848484612789565b6112f75760405162461bcd60e51b8152600401808060200182810382526032815260200180612ce86032913960400191505060405180910390fd5b6060816121f757506040805180820190915260018152600360fc1b6020820152610a00565b8160005b811561220f57600101600a820491506121fb565b60608167ffffffffffffffff8111801561222857600080fd5b506040519080825280601f01601f191660200182016040528015612253576020820181803683370190505b50859350905060001982015b83156122a457600a840660300160f81b8282806001900393508151811061228257fe5b60200101906001600160f81b031916908160001a905350600a8404935061225f565b50949350505050565b60008061234683856040516020018083805190602001908083835b602083106122e75780518252601f1990920191602091820191016122c8565b6001836020036101000a038019825116818451168082178552505050505050905001826001600160a01b03166001600160a01b031660601b81526014019250505060405160208183030381529060405280519060200120600d546129c4565b6001600160a01b0316949350505050565b6000610c7983836129d1565b5490565b6000610c7983836129e9565b6000610c798383612aaf565b600061217684846001600160a01b038516612af9565b815460009082106123d75760405162461bcd60e51b8152600401808060200182810382526022815260200180612cc66022913960400191505060405180910390fd5b8260000182815481106123e657fe5b9060005260206000200154905092915050565b60008084471015612451576040805162461bcd60e51b815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e6365000000604482015290519081900360640190fd5b82516124a4576040805162461bcd60e51b815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f604482015290519081900360640190fd5b8383516020850187f590506001600160a01b038116612176576040805162461bcd60e51b815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f7900000000000000604482015290519081900360640190fd5b6001600160a01b038216612565576040805162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015290519081900360640190fd5b61256e81611927565b156125c0576040805162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015290519081900360640190fd5b6125cc60008383610bd4565b6001600160a01b03821660009081526001602052604090206125f4908263ffffffff61237316565b506126076002828463ffffffff61237f16565b5060405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b8154600090819083106126885760405162461bcd60e51b8152600401808060200182810382526022815260200180612e1b6022913960400191505060405180910390fd5b600084600001848154811061269957fe5b906000526020600020906002020190508060000154816001015492509250509250929050565b6000828152600184016020526040812054828161275a5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561271f578181015183820152602001612707565b50505050905090810190601f16801561274c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5084600001600182038154811061276d57fe5b9060005260206000209060020201600101549150509392505050565b600061279d846001600160a01b0316612b90565b6127a957506001611a53565b600060606001600160a01b038616630a85bd0160e11b6127c761193a565b89888860405160240180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612840578181015183820152602001612828565b50505050905090810190601f16801561286d5780820380516001836020036101000a031916815260200191505b5060408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909a16999099178952518151919890975087965094509250829150849050835b602083106128d55780518252601f1990920191602091820191016128b6565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612937576040519150601f19603f3d011682016040523d82523d6000602084013e61293c565b606091505b50915091508161298d578051156129565780518082602001fd5b60405162461bcd60e51b8152600401808060200182810382526032815260200180612ce86032913960400191505060405180910390fd5b60008180602001905160208110156129a457600080fd5b50516001600160e01b031916630a85bd0160e11b149350611a5392505050565b6000610c79838330612bc9565b60009081526001919091016020526040902054151590565b60008181526001830160205260408120548015612aa55783546000198083019190810190600090879083908110612a1c57fe5b9060005260206000200154905080876000018481548110612a3957fe5b600091825260208083209091019290925582815260018981019092526040902090840190558654879080612a6957fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610c7c565b6000915050610c7c565b6000612abb83836129d1565b612af157508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610c7c565b506000610c7c565b600082815260018401602052604081205480612b5e575050604080518082018252838152602080820184815286546001818101895560008981528481209551600290930290950191825591519082015586548684528188019092529290912055612179565b82856000016001830381548110612b7157fe5b9060005260206000209060020201600101819055506000915050612179565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590611a53575050151592915050565b604080516001600160f81b031960208083019190915260609390931b6bffffffffffffffffffffffff19166021820152603581019490945260558085019390935280518085039093018352607590930190925280519101206001600160a01b031690565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612c6e57805160ff1916838001178555612c9b565b82800160010185558215612c9b579182015b82811115612c9b578251825591602001919060010190612c80565b50612ca7929150612cab565b5090565b610a9991905b80821115612ca75760008155600101612cb156fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e64734552433732313a207472616e7366657220746f206e6f6e20455243373231526563656976657220696d706c656d656e7465724f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734552433732313a207472616e7366657220746f20746865207a65726f20616464726573734552433732313a206f70657261746f7220717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f76656420666f7220616c6c4552433732313a2062616c616e636520717565727920666f7220746865207a65726f20616464726573734552433732313a206f776e657220717565727920666f72206e6f6e6578697374656e7420746f6b656e456e756d657261626c654d61703a20696e646578206f7574206f6620626f756e64734552433732313a20617070726f76656420717565727920666f72206e6f6e6578697374656e7420746f6b656e4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65724552433732313a207472616e73666572206f6620746f6b656e2074686174206973206e6f74206f776e4552433732314d657461646174613a2055524920717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732313a20617070726f76616c20746f2063757272656e74206f776e65724552433732313a207472616e736665722063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f766564a2646970667358221220c1653ab82e6cef6ae9d77bd7dfa83dccf4da05e62989863fcced7b8344f4783264736f6c63430006060033608060405234801561001057600080fd5b50610a19806100206000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c806384aaf12e1161006657806384aaf12e146101c157806386c02c8f146101db5780638da5cb5b14610416578063e30d26a81461041e578063f8c2ceb31461042657610093565b80633121db1c14610098578063358982a31461011857806339e75d45146101955780637b1039991461019d575b600080fd5b610116600480360360408110156100ae57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156100d857600080fd5b8201836020820111156100ea57600080fd5b803590602001918460018302840111600160201b8311171561010b57600080fd5b50909250905061042e565b005b6101206104d7565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015a578181015183820152602001610142565b50505050905090810190601f1680156101875780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610120610564565b6101a56105bf565b604080516001600160a01b039092168252519081900360200190f35b6101c96105ce565b60408051918252519081900360200190f35b610116600480360360a08110156101f157600080fd5b810190602081018135600160201b81111561020b57600080fd5b82018360208201111561021d57600080fd5b803590602001918460018302840111600160201b8311171561023e57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561029057600080fd5b8201836020820111156102a257600080fd5b803590602001918460018302840111600160201b831117156102c357600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561031557600080fd5b82018360208201111561032757600080fd5b803590602001918460018302840111600160201b8311171561034857600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092958435959094909350604081019250602001359050600160201b8111156103a257600080fd5b8201836020820111156103b457600080fd5b803590602001918460018302840111600160201b831117156103d557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506105d4945050505050565b6101a5610639565b6101206106b7565b610120610712565b33610437610639565b6001600160a01b031614610492576040805162461bcd60e51b815260206004820152601760248201527f63616c6c6572206973206e6f7420746865206f776e6572000000000000000000604482015290519081900360640190fd5b6104d28383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061076a92505050565b505050565b60018054604080516020600284861615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561055c5780601f106105315761010080835404028352916020019161055c565b820191906000526020600020905b81548152906001019060200180831161053f57829003601f168201915b505050505081565b6003805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561055c5780601f106105315761010080835404028352916020019161055c565b6000546001600160a01b031681565b60045481565b6105dd336108d5565b84516105f090600190602088019061094b565b50835161060490600290602087019061094b565b50825161061890600390602086019061094b565b506004829055805161063190600590602084019061094b565b505050505050565b60008054604080516331a9108f60e11b815230600482015290516001600160a01b0390921691636352211e91602480820192602092909190829003018186803b15801561068557600080fd5b505afa158015610699573d6000803e3d6000fd5b505050506040513d60208110156106af57600080fd5b505190505b90565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561055c5780601f106105315761010080835404028352916020019161055c565b6002805460408051602060018416156101000260001901909316849004601f8101849004840282018401909252818152929183018282801561055c5780601f106105315761010080835404028352916020019161055c565b604080516302571be360e01b81527f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2600482015290516001600160a01b038416916302571be3916024808301926020929190829003018186803b1580156107d057600080fd5b505afa1580156107e4573d6000803e3d6000fd5b505050506040513d60208110156107fa57600080fd5b505160405163c47f002760e01b81526020600482018181528451602484015284516001600160a01b039094169363c47f002793869383926044909201919085019080838360005b83811015610859578181015183820152602001610841565b50505050905090810190601f1680156108865780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b1580156108a557600080fd5b505af11580156108b9573d6000803e3d6000fd5b505050506040513d60208110156108cf57600080fd5b50505050565b6000546001600160a01b031615610929576040805162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061098c57805160ff19168380011785556109b9565b828001600101855582156109b9579182015b828111156109b957825182559160200191906001019061099e565b506109c59291506109c9565b5090565b6106b491905b808211156109c557600081556001016109cf56fea26469706673582212203d0203c56bb2a99cb7fe14c1429f24e4f40c5db8e4c1ba9b54b5669a7c12249264736f6c63430006060033608060405234801561001057600080fd5b506103ad806100206000396000f3fe6080604052600436106100225760003560e01c8063d1f578941461003957610031565b366100315761002f6100ef565b005b61002f6100ef565b61002f6004803603604081101561004f57600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561007a57600080fd5b82018360208201111561008c57600080fd5b803590602001918460018302840111640100000000831117156100ae57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610109945050505050565b6100f7610107565b61010761010261022c565b610251565b565b600061011361022c565b6001600160a01b03161461012657600080fd5b60405180602361031a82396040519081900360230190207f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c314905061016757fe5b61017082610275565b805115610228576000826001600160a01b0316826040518082805190602001908083835b602083106101b35780518252601f199092019160209182019101610194565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610213576040519150601f19603f3d011682016040523d82523d6000602084013e610218565b606091505b505090508061022657600080fd5b505b5050565b7f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c35490565b3660008037600080366000845af43d6000803e808015610270573d6000f35b3d6000fd5b61027e816102dd565b6102b95760405162461bcd60e51b815260040180806020018281038252603b81526020018061033d603b913960400191505060405180910390fd5b7f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c355565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061031157508115155b94935050505056fe6f72672e7a657070656c696e6f732e70726f78792e696d706c656d656e746174696f6e43616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220f4af5f38b16e1ce890fd14497bea12d47bed23b9e542d8461f60b0d5a7952a1e64736f6c63430006060033

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106101e55760003560e01c80636fa59bbc1161010f578063c3c5a547116100a2578063e985e9c511610071578063e985e9c51461097e578063ee97f7f3146109ac578063eee39111146109b4578063f2fde38b146109bc576101e5565b8063c3c5a547146107a3578063c4d66de8146107c9578063c87b56dd146107ef578063e92118ed1461080c576101e5565b80638da5cb5b116100de5780638da5cb5b146106a157806395d89b41146106a9578063a22cb465146106b1578063b88d4fde146106df576101e5565b80636fa59bbc1461066357806370a082311461066b578063715018a6146106915780637c2b2e7114610699576101e5565b80632f745c59116101875780634f6ccce7116101565780634f6ccce7146105b357806355f804b3146105d05780636352211e1461063e5780636c0360eb1461065b576101e5565b80632f745c59146103615780633121db1c1461038d5780633f7868ff1461040b57806342842e0e1461057d576101e5565b8063095ea7b3116101c3578063095ea7b3146102db578063158ef93e1461030957806318160ddd1461031157806323b872dd1461032b576101e5565b806301ffc9a7146101ea57806306fdde0314610225578063081812fc146102a2575b600080fd5b6102116004803603602081101561020057600080fd5b50356001600160e01b0319166109e2565b604080519115158252519081900360200190f35b61022d610a05565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561026757818101518382015260200161024f565b50505050905090810190601f1680156102945780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102bf600480360360208110156102b857600080fd5b5035610a9c565b604080516001600160a01b039092168252519081900360200190f35b610307600480360360408110156102f157600080fd5b506001600160a01b038135169060200135610afe565b005b610211610bd9565b610319610be9565b60408051918252519081900360200190f35b6103076004803603606081101561034157600080fd5b506001600160a01b03813581169160208101359091169060400135610bfa565b6103196004803603604081101561037757600080fd5b506001600160a01b038135169060200135610c51565b610307600480360360408110156103a357600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156103cd57600080fd5b8201836020820111156103df57600080fd5b803590602001918460018302840111600160201b8311171561040057600080fd5b509092509050610c82565b6102bf600480360360c081101561042157600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561044b57600080fd5b82018360208201111561045d57600080fd5b803590602001918460018302840111600160201b8311171561047e57600080fd5b919390929091602081019035600160201b81111561049b57600080fd5b8201836020820111156104ad57600080fd5b803590602001918460018302840111600160201b831117156104ce57600080fd5b919390929091602081019035600160201b8111156104eb57600080fd5b8201836020820111156104fd57600080fd5b803590602001918460018302840111600160201b8311171561051e57600080fd5b91939092823592604081019060200135600160201b81111561053f57600080fd5b82018360208201111561055157600080fd5b803590602001918460018302840111600160201b8311171561057257600080fd5b509092509050610d1a565b6103076004803603606081101561059357600080fd5b506001600160a01b03813581169160208101359091169060400135610e22565b610319600480360360208110156105c957600080fd5b5035610e3d565b610307600480360360208110156105e657600080fd5b810190602081018135600160201b81111561060057600080fd5b82018360208201111561061257600080fd5b803590602001918460018302840111600160201b8311171561063357600080fd5b509092509050610e59565b6102bf6004803603602081101561065457600080fd5b5035610ef4565b61022d610f22565b61022d610f83565b6103196004803603602081101561068157600080fd5b50356001600160a01b0316611011565b610307611079565b6102bf61111b565b6102bf61112a565b61022d611139565b610307600480360360408110156106c757600080fd5b506001600160a01b038135169060200135151561119a565b610307600480360360808110156106f557600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561072f57600080fd5b82018360208201111561074157600080fd5b803590602001918460018302840111600160201b8311171561076257600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061129f945050505050565b610211600480360360208110156107b957600080fd5b50356001600160a01b03166112fd565b610307600480360360208110156107df57600080fd5b50356001600160a01b03166113ab565b61022d6004803603602081101561080557600080fd5b503561144b565b6102bf600480360360c081101561082257600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561084c57600080fd5b82018360208201111561085e57600080fd5b803590602001918460018302840111600160201b8311171561087f57600080fd5b919390929091602081019035600160201b81111561089c57600080fd5b8201836020820111156108ae57600080fd5b803590602001918460018302840111600160201b831117156108cf57600080fd5b919390929091602081019035600160201b8111156108ec57600080fd5b8201836020820111156108fe57600080fd5b803590602001918460018302840111600160201b8311171561091f57600080fd5b91939092823592604081019060200135600160201b81111561094057600080fd5b82018360208201111561095257600080fd5b803590602001918460018302840111600160201b8311171561097357600080fd5b5090925090506116f2565b6102116004803603604081101561099457600080fd5b506001600160a01b03813581169160200135166117eb565b6102bf611819565b610319611828565b610307600480360360208110156109d257600080fd5b50356001600160a01b031661182e565b6001600160e01b0319811660009081526020819052604090205460ff165b919050565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610a915780601f10610a6657610100808354040283529160200191610a91565b820191906000526020600020905b815481529060010190602001808311610a7457829003601f168201915b505050505090505b90565b6000610aa782611927565b610ae25760405162461bcd60e51b815260040180806020018281038252602c815260200180612e3d602c913960400191505060405180910390fd5b506000908152600460205260409020546001600160a01b031690565b6000610b0982610ef4565b9050806001600160a01b0316836001600160a01b03161415610b5c5760405162461bcd60e51b8152600401808060200182810382526021815260200180612ee16021913960400191505060405180910390fd5b806001600160a01b0316610b6e61193a565b6001600160a01b03161480610b8f5750610b8f81610b8a61193a565b6117eb565b610bca5760405162461bcd60e51b8152600401808060200182810382526038815260200180612d906038913960400191505060405180910390fd5b610bd4838361193e565b505050565b600e54600160a01b900460ff1681565b6000610bf560026119ac565b905090565b610c0b610c0561193a565b826119b7565b610c465760405162461bcd60e51b8152600401808060200182810382526031815260200180612f026031913960400191505060405180910390fd5b610bd4838383611a5b565b6001600160a01b0382166000908152600160205260408120610c79908363ffffffff611bb916565b90505b92915050565b610c8a61193a565b600a546001600160a01b03908116911614610cda576040805162461bcd60e51b81526020600482018190526024820152600080516020612e69833981519152604482015290519081900360640190fd5b610bd48383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611bc592505050565b6000610e138b610e0e8c8c8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8f018190048102820181019092528d815292508d91508c908190840183828082843760009201919091525050604080516020601f8d018190048102820181019092528b81528d935091508b908b9081908401838280828437600092019190915250611d2a92505050565b611f10565b9b9a5050505050505050505050565b610bd48383836040518060200160405280600081525061129f565b600080610e5160028463ffffffff61213a16565b509392505050565b610e6161193a565b600a546001600160a01b03908116911614610eb1576040805162461bcd60e51b81526020600482018190526024820152600080516020612e69833981519152604482015290519081900360640190fd5b610ef082828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061215692505050565b5050565b6000610c7c82604051806060016040528060298152602001612df2602991396002919063ffffffff61216916565b60098054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610a915780601f10610a6657610100808354040283529160200191610a91565b600c805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156110095780601f10610fde57610100808354040283529160200191611009565b820191906000526020600020905b815481529060010190602001808311610fec57829003601f168201915b505050505081565b60006001600160a01b0382166110585760405162461bcd60e51b815260040180806020018281038252602a815260200180612dc8602a913960400191505060405180910390fd5b6001600160a01b0382166000908152600160205260409020610c7c906119ac565b61108161193a565b600a546001600160a01b039081169116146110d1576040805162461bcd60e51b81526020600482018190526024820152600080516020612e69833981519152604482015290519081900360640190fd5b600a546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600a80546001600160a01b0319169055565b600e546001600160a01b031681565b600a546001600160a01b031690565b60078054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610a915780601f10610a6657610100808354040283529160200191610a91565b6111a261193a565b6001600160a01b0316826001600160a01b03161415611208576040805162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015290519081900360640190fd5b806005600061121561193a565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff19169215159290921790915561125961193a565b60408051841515815290516001600160a01b0392909216917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319181900360200190a35050565b6112b06112aa61193a565b836119b7565b6112eb5760405162461bcd60e51b8152600401808060200182810382526031815260200180612f026031913960400191505060405180910390fd5b6112f784848484612180565b50505050565b6000611311826001600160a01b0316611927565b80610c7c5750600e546001600160a01b031615801590610c7c5750600e546040805163c3c5a54760e01b81526001600160a01b0385811660048301529151919092169163c3c5a547916024808301926020929190829003018186803b15801561137957600080fd5b505afa15801561138d573d6000803e3d6000fd5b505050506040513d60208110156113a357600080fd5b505192915050565b6113b361193a565b600a546001600160a01b03908116911614611403576040805162461bcd60e51b81526020600482018190526024820152600080516020612e69833981519152604482015290519081900360640190fd5b600e54600160a01b900460ff161561141a57600080fd5b600e8054600160a01b60ff60a01b19909116176001600160a01b0319166001600160a01b0392909216919091179055565b606061145682611927565b6114915760405162461bcd60e51b815260040180806020018281038252602f815260200180612eb2602f913960400191505060405180910390fd5b60008281526008602090815260409182902080548351601f60026000196101006001861615020190931692909204918201849004840281018401909452808452606093928301828280156115265780601f106114fb57610100808354040283529160200191611526565b820191906000526020600020905b81548152906001019060200180831161150957829003601f168201915b50506009549394505050506002600019610100600184161502019091160461154f579050610a00565b8051156116205760098160405160200180838054600181600116156101000203166002900480156115b75780601f106115955761010080835404028352918201916115b7565b820191906000526020600020905b8154815290600101906020018083116115a3575b5050825160208401908083835b602083106115e35780518252601f1990920191602091820191016115c4565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052915050610a00565b600961162b846121d2565b60405160200180838054600181600116156101000203166002900480156116895780601f10611667576101008083540402835291820191611689565b820191906000526020600020905b815481529060010190602001808311611675575b5050825160208401908083835b602083106116b55780518252601f199092019160209182019101611696565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052915050919050565b6000610e138b6117e68c8c8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8f018190048102820181019092528d815292508d91508c908190840183828082843760009201919091525050604080516020601f8d018190048102820181019092528b81528d935091508b908b9081908401838280828437600092019190915250611d2a92505050565b6122ad565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b600b546001600160a01b031681565b600d5481565b61183661193a565b600a546001600160a01b03908116911614611886576040805162461bcd60e51b81526020600482018190526024820152600080516020612e69833981519152604482015290519081900360640190fd5b6001600160a01b0381166118cb5760405162461bcd60e51b8152600401808060200182810382526026815260200180612d1a6026913960400191505060405180910390fd5b600a546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600a80546001600160a01b0319166001600160a01b0392909216919091179055565b6000610c7c60028363ffffffff61235716565b3390565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061197382610ef4565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000610c7c82612363565b60006119c282611927565b6119fd5760405162461bcd60e51b815260040180806020018281038252602c815260200180612d64602c913960400191505060405180910390fd5b6000611a0883610ef4565b9050806001600160a01b0316846001600160a01b03161480611a435750836001600160a01b0316611a3884610a9c565b6001600160a01b0316145b80611a535750611a5381856117eb565b949350505050565b826001600160a01b0316611a6e82610ef4565b6001600160a01b031614611ab35760405162461bcd60e51b8152600401808060200182810382526029815260200180612e896029913960400191505060405180910390fd5b6001600160a01b038216611af85760405162461bcd60e51b8152600401808060200182810382526024815260200180612d406024913960400191505060405180910390fd5b611b03838383610bd4565b611b0e60008261193e565b6001600160a01b0383166000908152600160205260409020611b36908263ffffffff61236716565b506001600160a01b0382166000908152600160205260409020611b5f908263ffffffff61237316565b50611b726002828463ffffffff61237f16565b5080826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000610c798383612395565b604080516302571be360e01b81527f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2600482015290516001600160a01b038416916302571be3916024808301926020929190829003018186803b158015611c2b57600080fd5b505afa158015611c3f573d6000803e3d6000fd5b505050506040513d6020811015611c5557600080fd5b505160405163c47f002760e01b81526020600482018181528451602484015284516001600160a01b039094169363c47f002793869383926044909201919085019080838360005b83811015611cb4578181015183820152602001611c9c565b50505050905090810190601f168015611ce15780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b158015611d0057600080fd5b505af1158015611d14573d6000803e3d6000fd5b505050506040513d60208110156112f757600080fd5b60608585858585604051602401808060200180602001806020018681526020018060200185810385528a818151815260200191508051906020019080838360005b83811015611d83578181015183820152602001611d6b565b50505050905090810190601f168015611db05780820380516001836020036101000a031916815260200191505b5085810384528951815289516020918201918b019080838360005b83811015611de3578181015183820152602001611dcb565b50505050905090810190601f168015611e105780820380516001836020036101000a031916815260200191505b5085810383528851815288516020918201918a019080838360005b83811015611e43578181015183820152602001611e2b565b50505050905090810190601f168015611e705780820380516001836020036101000a031916815260200191505b50858103825286518152865160209182019188019080838360005b83811015611ea3578181015183820152602001611e8b565b50505050905090810190601f168015611ed05780820380516001836020036101000a031916815260200191505b5060408051601f198184030181529190526020810180516001600160e01b03166386c02c8f60e01b1790529a505050505050505050505095945050505050565b600080612043600084866040516020018083805190602001908083835b60208310611f4c5780518252601f199092019160209182019101611f2d565b6001836020036101000a038019825116818451168082178552505050505050905001826001600160a01b03166001600160a01b031660601b81526014019250505060405160208183030381529060405280519060200120600c8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156120395780601f1061200e57610100808354040283529160200191612039565b820191906000526020600020905b81548152906001019060200180831161201c57829003601f168201915b50505050506123f9565b600b546040805163347d5e2560e21b81526001600160a01b0392831660048201818152602483019384528851604484015288519596509386169463d1f5789494919389939091606490910190602085019080838360005b838110156120b257818101518382015260200161209a565b50505050905090810190601f1680156120df5780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b1580156120ff57600080fd5b505af1158015612113573d6000803e3d6000fd5b5050505061212a84826001600160a01b031661250a565b6001600160a01b03169392505050565b60008080806121498686612644565b9097909650945050505050565b8051610ef0906009906020840190612c2d565b60006121768484846126bf565b90505b9392505050565b61218b848484611a5b565b61219784848484612789565b6112f75760405162461bcd60e51b8152600401808060200182810382526032815260200180612ce86032913960400191505060405180910390fd5b6060816121f757506040805180820190915260018152600360fc1b6020820152610a00565b8160005b811561220f57600101600a820491506121fb565b60608167ffffffffffffffff8111801561222857600080fd5b506040519080825280601f01601f191660200182016040528015612253576020820181803683370190505b50859350905060001982015b83156122a457600a840660300160f81b8282806001900393508151811061228257fe5b60200101906001600160f81b031916908160001a905350600a8404935061225f565b50949350505050565b60008061234683856040516020018083805190602001908083835b602083106122e75780518252601f1990920191602091820191016122c8565b6001836020036101000a038019825116818451168082178552505050505050905001826001600160a01b03166001600160a01b031660601b81526014019250505060405160208183030381529060405280519060200120600d546129c4565b6001600160a01b0316949350505050565b6000610c7983836129d1565b5490565b6000610c7983836129e9565b6000610c798383612aaf565b600061217684846001600160a01b038516612af9565b815460009082106123d75760405162461bcd60e51b8152600401808060200182810382526022815260200180612cc66022913960400191505060405180910390fd5b8260000182815481106123e657fe5b9060005260206000200154905092915050565b60008084471015612451576040805162461bcd60e51b815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e6365000000604482015290519081900360640190fd5b82516124a4576040805162461bcd60e51b815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f604482015290519081900360640190fd5b8383516020850187f590506001600160a01b038116612176576040805162461bcd60e51b815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f7900000000000000604482015290519081900360640190fd5b6001600160a01b038216612565576040805162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015290519081900360640190fd5b61256e81611927565b156125c0576040805162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015290519081900360640190fd5b6125cc60008383610bd4565b6001600160a01b03821660009081526001602052604090206125f4908263ffffffff61237316565b506126076002828463ffffffff61237f16565b5060405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b8154600090819083106126885760405162461bcd60e51b8152600401808060200182810382526022815260200180612e1b6022913960400191505060405180910390fd5b600084600001848154811061269957fe5b906000526020600020906002020190508060000154816001015492509250509250929050565b6000828152600184016020526040812054828161275a5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561271f578181015183820152602001612707565b50505050905090810190601f16801561274c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5084600001600182038154811061276d57fe5b9060005260206000209060020201600101549150509392505050565b600061279d846001600160a01b0316612b90565b6127a957506001611a53565b600060606001600160a01b038616630a85bd0160e11b6127c761193a565b89888860405160240180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612840578181015183820152602001612828565b50505050905090810190601f16801561286d5780820380516001836020036101000a031916815260200191505b5060408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909a16999099178952518151919890975087965094509250829150849050835b602083106128d55780518252601f1990920191602091820191016128b6565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612937576040519150601f19603f3d011682016040523d82523d6000602084013e61293c565b606091505b50915091508161298d578051156129565780518082602001fd5b60405162461bcd60e51b8152600401808060200182810382526032815260200180612ce86032913960400191505060405180910390fd5b60008180602001905160208110156129a457600080fd5b50516001600160e01b031916630a85bd0160e11b149350611a5392505050565b6000610c79838330612bc9565b60009081526001919091016020526040902054151590565b60008181526001830160205260408120548015612aa55783546000198083019190810190600090879083908110612a1c57fe5b9060005260206000200154905080876000018481548110612a3957fe5b600091825260208083209091019290925582815260018981019092526040902090840190558654879080612a6957fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610c7c565b6000915050610c7c565b6000612abb83836129d1565b612af157508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610c7c565b506000610c7c565b600082815260018401602052604081205480612b5e575050604080518082018252838152602080820184815286546001818101895560008981528481209551600290930290950191825591519082015586548684528188019092529290912055612179565b82856000016001830381548110612b7157fe5b9060005260206000209060020201600101819055506000915050612179565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590611a53575050151592915050565b604080516001600160f81b031960208083019190915260609390931b6bffffffffffffffffffffffff19166021820152603581019490945260558085019390935280518085039093018352607590930190925280519101206001600160a01b031690565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612c6e57805160ff1916838001178555612c9b565b82800160010185558215612c9b579182015b82811115612c9b578251825591602001919060010190612c80565b50612ca7929150612cab565b5090565b610a9991905b80821115612ca75760008155600101612cb156fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e64734552433732313a207472616e7366657220746f206e6f6e20455243373231526563656976657220696d706c656d656e7465724f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734552433732313a207472616e7366657220746f20746865207a65726f20616464726573734552433732313a206f70657261746f7220717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f76656420666f7220616c6c4552433732313a2062616c616e636520717565727920666f7220746865207a65726f20616464726573734552433732313a206f776e657220717565727920666f72206e6f6e6578697374656e7420746f6b656e456e756d657261626c654d61703a20696e646578206f7574206f6620626f756e64734552433732313a20617070726f76656420717565727920666f72206e6f6e6578697374656e7420746f6b656e4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65724552433732313a207472616e73666572206f6620746f6b656e2074686174206973206e6f74206f776e4552433732314d657461646174613a2055524920717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732313a20617070726f76616c20746f2063757272656e74206f776e65724552433732313a207472616e736665722063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f766564a2646970667358221220c1653ab82e6cef6ae9d77bd7dfa83dccf4da05e62989863fcced7b8344f4783264736f6c63430006060033