false
false

Contract Address Details

0xfe445ad4b9F6cED1BBce57222487aBa67a7CEfE3

Contract Name
LuckyDraw
Creator
0x1c81d6–306791 at 0x03b668–349221
Balance
0 KCS
Tokens
Fetching tokens...
Transactions
31 Transactions
Transfers
0 Transfers
Gas Used
69,229,085
Last Balance Update
36589154
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
LuckyDraw




Optimization enabled
true
Compiler version
v0.8.0+commit.c7dfd78e




Optimization runs
200
EVM Version
default




Verified at
2022-04-04T08:37:53.503414Z

Constructor Arguments

0000000000000000000000001ebd93231a7fe551e1d6405404df34909eff4c2c

Arg [0] (address) : 0x1ebd93231a7fe551e1d6405404df34909eff4c2c

              

Contract source code

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/**
 * @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 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.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}


// File @openzeppelin/contracts/access/[email protected]


// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

/**
 * @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.
 */
abstract 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() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual 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 {
        _transferOwnership(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");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}


// File witnet-solidity-bridge/contracts/interfaces/[email protected]



pragma solidity >=0.7.0 <0.9.0;

/// @title The Witnet Data Request basic interface.
/// @author The Witnet Foundation.
interface IWitnetRequest {
    /// A `IWitnetRequest` is constructed around a `bytes` value containing 
    /// a well-formed Witnet Data Request using Protocol Buffers.
    function bytecode() external view returns (bytes memory);

    /// Returns SHA256 hash of Witnet Data Request as CBOR-encoded bytes.
    function hash() external view returns (bytes32);
}


// File witnet-solidity-bridge/contracts/libs/[email protected]



pragma solidity >=0.7.0 <0.9.0;
pragma experimental ABIEncoderV2;

library Witnet {

    /// @notice Witnet function that computes the hash of a CBOR-encoded Data Request.
    /// @param _bytecode CBOR-encoded RADON.
    function hash(bytes memory _bytecode) internal pure returns (bytes32) {
        return sha256(_bytecode);
    }

    /// Struct containing both request and response data related to every query posted to the Witnet Request Board
    struct Query {
        Request request;
        Response response;
        address from;      // Address from which the request was posted.
    }

    /// Possible status of a Witnet query.
    enum QueryStatus {
        Unknown,
        Posted,
        Reported,
        Deleted
    }

    /// Data kept in EVM-storage for every Request posted to the Witnet Request Board.
    struct Request {
        IWitnetRequest addr;    // The contract containing the Data Request which execution has been requested.
        address requester;      // Address from which the request was posted.
        bytes32 hash;           // Hash of the Data Request whose execution has been requested.
        uint256 gasprice;       // Minimum gas price the DR resolver should pay on the solving tx.
        uint256 reward;         // Escrowed reward to be paid to the DR resolver.
    }

    /// Data kept in EVM-storage containing Witnet-provided response metadata and result.
    struct Response {
        address reporter;       // Address from which the result was reported.
        uint256 timestamp;      // Timestamp of the Witnet-provided result.
        bytes32 drTxHash;       // Hash of the Witnet transaction that solved the queried Data Request.
        bytes   cborBytes;      // Witnet-provided result CBOR-bytes to the queried Data Request.
    }

    /// Data struct containing the Witnet-provided result to a Data Request.
    struct Result {
        bool success;           // Flag stating whether the request could get solved successfully, or not.
        CBOR value;             // Resulting value, in CBOR-serialized bytes.
    }

    /// Data struct following the RFC-7049 standard: Concise Binary Object Representation.
    struct CBOR {
        Buffer buffer;
        uint8 initialByte;
        uint8 majorType;
        uint8 additionalInformation;
        uint64 len;
        uint64 tag;
    }

    /// Iterable bytes buffer.
    struct Buffer {
        bytes data;
        uint32 cursor;
    }

    /// Witnet error codes table.
    enum ErrorCodes {
        // 0x00: Unknown error. Something went really bad!
        Unknown,
        // Script format errors
        /// 0x01: At least one of the source scripts is not a valid CBOR-encoded value.
        SourceScriptNotCBOR,
        /// 0x02: The CBOR value decoded from a source script is not an Array.
        SourceScriptNotArray,
        /// 0x03: The Array value decoded form a source script is not a valid Data Request.
        SourceScriptNotRADON,
        /// Unallocated
        ScriptFormat0x04,
        ScriptFormat0x05,
        ScriptFormat0x06,
        ScriptFormat0x07,
        ScriptFormat0x08,
        ScriptFormat0x09,
        ScriptFormat0x0A,
        ScriptFormat0x0B,
        ScriptFormat0x0C,
        ScriptFormat0x0D,
        ScriptFormat0x0E,
        ScriptFormat0x0F,
        // Complexity errors
        /// 0x10: The request contains too many sources.
        RequestTooManySources,
        /// 0x11: The script contains too many calls.
        ScriptTooManyCalls,
        /// Unallocated
        Complexity0x12,
        Complexity0x13,
        Complexity0x14,
        Complexity0x15,
        Complexity0x16,
        Complexity0x17,
        Complexity0x18,
        Complexity0x19,
        Complexity0x1A,
        Complexity0x1B,
        Complexity0x1C,
        Complexity0x1D,
        Complexity0x1E,
        Complexity0x1F,
        // Operator errors
        /// 0x20: The operator does not exist.
        UnsupportedOperator,
        /// Unallocated
        Operator0x21,
        Operator0x22,
        Operator0x23,
        Operator0x24,
        Operator0x25,
        Operator0x26,
        Operator0x27,
        Operator0x28,
        Operator0x29,
        Operator0x2A,
        Operator0x2B,
        Operator0x2C,
        Operator0x2D,
        Operator0x2E,
        Operator0x2F,
        // Retrieval-specific errors
        /// 0x30: At least one of the sources could not be retrieved, but returned HTTP error.
        HTTP,
        /// 0x31: Retrieval of at least one of the sources timed out.
        RetrievalTimeout,
        /// Unallocated
        Retrieval0x32,
        Retrieval0x33,
        Retrieval0x34,
        Retrieval0x35,
        Retrieval0x36,
        Retrieval0x37,
        Retrieval0x38,
        Retrieval0x39,
        Retrieval0x3A,
        Retrieval0x3B,
        Retrieval0x3C,
        Retrieval0x3D,
        Retrieval0x3E,
        Retrieval0x3F,
        // Math errors
        /// 0x40: Math operator caused an underflow.
        Underflow,
        /// 0x41: Math operator caused an overflow.
        Overflow,
        /// 0x42: Tried to divide by zero.
        DivisionByZero,
        /// Unallocated
        Math0x43,
        Math0x44,
        Math0x45,
        Math0x46,
        Math0x47,
        Math0x48,
        Math0x49,
        Math0x4A,
        Math0x4B,
        Math0x4C,
        Math0x4D,
        Math0x4E,
        Math0x4F,
        // Other errors
        /// 0x50: Received zero reveals
        NoReveals,
        /// 0x51: Insufficient consensus in tally precondition clause
        InsufficientConsensus,
        /// 0x52: Received zero commits
        InsufficientCommits,
        /// 0x53: Generic error during tally execution
        TallyExecution,
        /// Unallocated
        OtherError0x54,
        OtherError0x55,
        OtherError0x56,
        OtherError0x57,
        OtherError0x58,
        OtherError0x59,
        OtherError0x5A,
        OtherError0x5B,
        OtherError0x5C,
        OtherError0x5D,
        OtherError0x5E,
        OtherError0x5F,
        /// 0x60: Invalid reveal serialization (malformed reveals are converted to this value)
        MalformedReveal,
        /// Unallocated
        OtherError0x61,
        OtherError0x62,
        OtherError0x63,
        OtherError0x64,
        OtherError0x65,
        OtherError0x66,
        OtherError0x67,
        OtherError0x68,
        OtherError0x69,
        OtherError0x6A,
        OtherError0x6B,
        OtherError0x6C,
        OtherError0x6D,
        OtherError0x6E,
        OtherError0x6F,
        // Access errors
        /// 0x70: Tried to access a value from an index using an index that is out of bounds
        ArrayIndexOutOfBounds,
        /// 0x71: Tried to access a value from a map using a key that does not exist
        MapKeyNotFound,
        /// Unallocated
        OtherError0x72,
        OtherError0x73,
        OtherError0x74,
        OtherError0x75,
        OtherError0x76,
        OtherError0x77,
        OtherError0x78,
        OtherError0x79,
        OtherError0x7A,
        OtherError0x7B,
        OtherError0x7C,
        OtherError0x7D,
        OtherError0x7E,
        OtherError0x7F,
        OtherError0x80,
        OtherError0x81,
        OtherError0x82,
        OtherError0x83,
        OtherError0x84,
        OtherError0x85,
        OtherError0x86,
        OtherError0x87,
        OtherError0x88,
        OtherError0x89,
        OtherError0x8A,
        OtherError0x8B,
        OtherError0x8C,
        OtherError0x8D,
        OtherError0x8E,
        OtherError0x8F,
        OtherError0x90,
        OtherError0x91,
        OtherError0x92,
        OtherError0x93,
        OtherError0x94,
        OtherError0x95,
        OtherError0x96,
        OtherError0x97,
        OtherError0x98,
        OtherError0x99,
        OtherError0x9A,
        OtherError0x9B,
        OtherError0x9C,
        OtherError0x9D,
        OtherError0x9E,
        OtherError0x9F,
        OtherError0xA0,
        OtherError0xA1,
        OtherError0xA2,
        OtherError0xA3,
        OtherError0xA4,
        OtherError0xA5,
        OtherError0xA6,
        OtherError0xA7,
        OtherError0xA8,
        OtherError0xA9,
        OtherError0xAA,
        OtherError0xAB,
        OtherError0xAC,
        OtherError0xAD,
        OtherError0xAE,
        OtherError0xAF,
        OtherError0xB0,
        OtherError0xB1,
        OtherError0xB2,
        OtherError0xB3,
        OtherError0xB4,
        OtherError0xB5,
        OtherError0xB6,
        OtherError0xB7,
        OtherError0xB8,
        OtherError0xB9,
        OtherError0xBA,
        OtherError0xBB,
        OtherError0xBC,
        OtherError0xBD,
        OtherError0xBE,
        OtherError0xBF,
        OtherError0xC0,
        OtherError0xC1,
        OtherError0xC2,
        OtherError0xC3,
        OtherError0xC4,
        OtherError0xC5,
        OtherError0xC6,
        OtherError0xC7,
        OtherError0xC8,
        OtherError0xC9,
        OtherError0xCA,
        OtherError0xCB,
        OtherError0xCC,
        OtherError0xCD,
        OtherError0xCE,
        OtherError0xCF,
        OtherError0xD0,
        OtherError0xD1,
        OtherError0xD2,
        OtherError0xD3,
        OtherError0xD4,
        OtherError0xD5,
        OtherError0xD6,
        OtherError0xD7,
        OtherError0xD8,
        OtherError0xD9,
        OtherError0xDA,
        OtherError0xDB,
        OtherError0xDC,
        OtherError0xDD,
        OtherError0xDE,
        OtherError0xDF,
        // Bridge errors: errors that only belong in inter-client communication
        /// 0xE0: Requests that cannot be parsed must always get this error as their result.
        /// However, this is not a valid result in a Tally transaction, because invalid requests
        /// are never included into blocks and therefore never get a Tally in response.
        BridgeMalformedRequest,
        /// 0xE1: Witnesses exceeds 100
        BridgePoorIncentives,
        /// 0xE2: The request is rejected on the grounds that it may cause the submitter to spend or stake an
        /// amount of value that is unjustifiably high when compared with the reward they will be getting
        BridgeOversizedResult,
        /// Unallocated
        OtherError0xE3,
        OtherError0xE4,
        OtherError0xE5,
        OtherError0xE6,
        OtherError0xE7,
        OtherError0xE8,
        OtherError0xE9,
        OtherError0xEA,
        OtherError0xEB,
        OtherError0xEC,
        OtherError0xED,
        OtherError0xEE,
        OtherError0xEF,
        OtherError0xF0,
        OtherError0xF1,
        OtherError0xF2,
        OtherError0xF3,
        OtherError0xF4,
        OtherError0xF5,
        OtherError0xF6,
        OtherError0xF7,
        OtherError0xF8,
        OtherError0xF9,
        OtherError0xFA,
        OtherError0xFB,
        OtherError0xFC,
        OtherError0xFD,
        OtherError0xFE,
        // This should not exist:
        /// 0xFF: Some tally error is not intercepted but should
        UnhandledIntercept
    }
}


// File witnet-solidity-bridge/contracts/interfaces/[email protected]



pragma solidity >=0.7.0 <0.9.0;

/// @title The Witnet Randomness generator interface.
/// @author Witnet Foundation.
interface IWitnetRandomness {

    /// Thrown every time a new WitnetRandomnessRequest gets succesfully posted to the WitnetRequestBoard.
    /// @param from Address from which the randomize() function was called. 
    /// @param prevBlock Block number in which a randomness request got posted just before this one. 0 if none.
    /// @param witnetQueryId Unique query id assigned to this request by the WRB.
    /// @param witnetRequestHash SHA-256 hash of the WitnetRandomnessRequest actual bytecode just posted to the WRB.
    event Randomized(
        address indexed from,
        uint256 indexed prevBlock,
        uint256 witnetQueryId,
        bytes32 witnetRequestHash
    );

    /// Returns amount of wei required to be paid as a fee when requesting randomization with a 
    /// transaction gas price as the one given.
    function estimateRandomizeFee(uint256 _gasPrice) external view returns (uint256);

    /// Retrieves data of a randomization request that got successfully posted to the WRB within a given block.
    /// @dev Returns zero values if no randomness request was actually posted within a given block.
    /// @param _block Block number whose randomness request is being queried for.
    /// @return _from Address from which the latest randomness request was posted.
    /// @return _id Unique request identifier as provided by the WRB.
    /// @return _fee Request's total paid fee.
    /// @return _prevBlock Block number in which a randomness request got posted just before this one. 0 if none.
    /// @return _nextBlock Block number in which a randomness request got posted just after this one, 0 if none.
    function getRandomizeData(uint256 _block)
        external view returns (address _from, uint256 _id, uint256 _fee, uint256 _prevBlock, uint256 _nextBlock);

    /// Retrieves the randomness generated upon solving a request that was posted within a given block,
    /// if any, or to the _first_ request posted after that block, otherwise. Should the intended 
    /// request happen to be finalized with errors on the Witnet oracle network side, this function 
    /// will recursively try to return randomness from the next non-faulty randomization request found 
    /// in storage, if any. 
    /// @dev Fails if:
    /// @dev   i.   no `randomize()` was not called in either the given block, or afterwards.
    /// @dev   ii.  a request posted in/after given block does exist, but no result has been provided yet.
    /// @dev   iii. all requests in/after the given block were solved with errors.
    /// @param _block Block number from which the search will start.
    function getRandomnessAfter(uint256 _block) external view returns (bytes32); 

    /// Tells what is the number of the next block in which a randomization request was posted after the given one. 
    /// @param _block Block number from which the search will start.
    /// @return Number of the first block found after the given one, or `0` otherwise.
    function getRandomnessNextBlock(uint256 _block) external view returns (uint256); 

    /// Gets previous block in which a randomness request was posted before the given one.
    /// @param _block Block number from which the search will start.
    /// @return First block found before the given one, or `0` otherwise.
    function getRandomnessPrevBlock(uint256 _block) external view returns (uint256);

    /// Returns `true` only when the randomness request that got posted within given block was already
    /// reported back from the Witnet oracle, either successfully or with an error of any kind.
    function isRandomized(uint256 _block) external view returns (bool);

    /// Returns latest block in which a randomness request got sucessfully posted to the WRB.
    function latestRandomizeBlock() external view returns (uint256);

    /// Generates a pseudo-random number uniformly distributed within the range [0 .. _range), by using 
    /// the given `_nonce` value and the randomness returned by `getRandomnessAfter(_block)`. 
    /// @dev Fails under same conditions as `getRandomnessAfter(uint256)` may do.
    /// @param _range Range within which the uniformly-distributed random number will be generated.
    /// @param _nonce Nonce value enabling multiple random numbers from the same randomness value.
    /// @param _block Block number from which the search will start.
    function random(uint32 _range, uint256 _nonce, uint256 _block) external view returns (uint32);

    /// Generates a pseudo-random number uniformly distributed within the range [0 .. _range), by using 
    /// the given `_nonce` value and the given `_seed` as a source of entropy.
    /// @param _range Range within which the uniformly-distributed random number will be generated.
    /// @param _nonce Nonce value enabling multiple random numbers from the same randomness value.
    /// @param _seed Seed value used as entropy source.
    function random(uint32 _range, uint256 _nonce, bytes32 _seed) external pure returns (uint32);

    /// Requests the Witnet oracle to generate an EVM-agnostic and trustless source of randomness. 
    /// Only one randomness request per block will be actually posted to the WRB. Should there 
    /// already be a posted request within current block, it will try to upgrade Witnet fee of current's 
    /// block randomness request according to current gas price. In both cases, all unused funds shall 
    /// be transfered back to the tx sender.
    /// @return _usedFunds Amount of funds actually used from those provided by the tx sender.
    function randomize() external payable returns (uint256 _usedFunds);

    /// Increases Witnet fee related to a pending-to-be-solved randomness request, as much as it
    /// may be required in proportion to how much bigger the current tx gas price is with respect the 
    /// highest gas price that was paid in either previous fee upgrades, or when the given randomness 
    /// request was posted. All unused funds shall be transferred back to the tx sender.
    /// @return _usedFunds Amount of dunds actually used from those provided by the tx sender.
    function upgradeRandomizeFee(uint256 _block) external payable returns (uint256 _usedFunds);
}


// File contracts/LuckyDraw.sol


pragma solidity ^0.8.0;

contract LuckyDraw is Ownable {
  uint8 internal drawTimesForThirdPrize;
  uint8 internal drawTimesForFourthPrize;
  uint8 internal requestStatus;
  uint8 internal fetchStatus;

  uint32 internal constant TOTAL_GRAND_PRIZE = 1;
  uint32 internal constant TOTAL_FIRST_PRIZE = 4;
  uint32 internal constant TOTAL_SECOND_PRIZE = 15;
  uint32 internal constant TOTAL_THIRD_PRIZE = 200;
  uint32 internal constant TOTAL_FOURTH_PRIZE = 1000;
  uint32 internal constant TOTAL_PARTICIPATION = 180000;

  bytes32 public randomnessForGrandPrize;
  bytes32 public randomnessForFirstPrize;
  bytes32 public randomnessForSecondPrize;
  bytes32 public randomnessForThirdPrize;
  bytes32 public randomnessForFourthPrize;

  uint256 internal thirdIndex;
  uint256 internal fourthIndex;

  uint256 public blockForLatestRandomizing;
  uint256 public blockForGrandPrize;
  uint256 public blockForFirstPrize;
  uint256 public blockForSecondPrize;
  uint256 public blockForThirdPrize;
  uint256 public blockForFourthPrize;

  IWitnetRandomness public immutable witnet;
  // winner info: 5->grand prize,1->first prize,2->second prize,3->third prize,4->fourth prize,0->No win
  mapping(uint256 => uint256) public winnerInfo;
  uint256[] internal listForGrandPrize;
  uint256[] internal listForFirstPrize;
  uint256[] internal listForSecondPrize;
  uint256[] internal listForThirdPrize;
  uint256[] internal listForFourthPrize;
  uint256[] internal lists;

  event RandomnessRequested(uint256 prizeType, uint256 blockNumber);

  event RandomnessUpdated(uint256 prizeType, uint256 blockNumber, bytes32 randomness);

  event WinnerListUpdate(
    uint256 prizeType,
    uint256 executionTimes,
    uint256 loopIndex,
    uint256 winnersLength,
    uint256[] winners
  );

  /**
   * @notice Constructor
   * @param _witnet: address of witnet randomness generator
   */
  constructor(IWitnetRandomness _witnet) {
    require(address(_witnet) != address(0), "Lottery: the witnet is the zero address");
    witnet = _witnet;
  }

  receive() external payable {}

  /**
   * @notice Request a random number for each prize
   * @dev Only callable by owner
   */
  function requestRandomNumber(uint256 prizeType) external payable onlyOwner {
    require(blockForLatestRandomizing < block.number, "Lottery: the block has been used");
    require(msg.value > 0, "Lottery: the value must be greater than zero");
    if (prizeType == 0) {
      require(
        requestStatus == 1,
        "Lottery: it is not yet the turn of the grand prize operation or the grand prize has been operated"
      );
      requestStatus = 5;
      blockForGrandPrize = block.number;
    } else if (prizeType == 1) {
      require(
        requestStatus == 2,
        "Lottery: it is not yet the turn of the first prize operation or the first prize has been operated"
      );
      requestStatus = 1;
      blockForFirstPrize = block.number;
    } else if (prizeType == 2) {
      require(
        requestStatus == 3,
        "Lottery: it is not yet the turn of the second prize operation or the second prize has been operated"
      );
      requestStatus = 2;
      blockForSecondPrize = block.number;
    } else if (prizeType == 3) {
      require(
        requestStatus == 4,
        "Lottery: it is not yet the turn of the third prize operation or the third prize has been operated"
      );
      requestStatus = 3;
      blockForThirdPrize = block.number;
    } else if (prizeType == 4) {
      require(
        requestStatus == 0,
        "Lottery: it is not yet the turn of the fourth prize operation or the fourth prize has been operated"
      );
      requestStatus = 4;
      blockForFourthPrize = block.number;
    } else {
      revert("Lottery: the prize does not exist");
    }
    blockForLatestRandomizing = block.number;
    uint256 _usedFunds = witnet.randomize{value: msg.value}();
    if (_usedFunds < msg.value) {
      payable(msg.sender).transfer(msg.value - _usedFunds);
    }
    emit RandomnessRequested(prizeType, block.number);
  }

  /**
   * @notice Update the random number for each prize based on the randomResult generated by Witnet's fallback
   * @dev Only callable by owner
   */
  function fetchRandomNumber(uint256 prizeType) external onlyOwner {
    uint256 blockNumber;
    if (prizeType == 1) {
      require(
        fetchStatus == 2,
        "Lottery: it is not yet the turn of the first prize operation or the first prize has been operated"
      );
      fetchStatus = 1;
      blockNumber = blockForFirstPrize;
    } else if (prizeType == 2) {
      require(
        fetchStatus == 3,
        "Lottery: it is not yet the turn of the second prize operation or the second prize has been operated"
      );
      fetchStatus = 2;
      blockNumber = blockForSecondPrize;
    } else if (prizeType == 3) {
      require(
        fetchStatus == 4,
        "Lottery: it is not yet the turn of the third prize operation or the third prize has been operated"
      );
      fetchStatus = 3;
      blockNumber = blockForThirdPrize;
    } else if (prizeType == 4) {
      require(
        fetchStatus == 0,
        "Lottery: it is not yet the turn of the fourth prize operation or the fourth prize has been operated"
      );
      fetchStatus = 4;
      blockNumber = blockForFourthPrize;
    } else if (prizeType == 0) {
      require(
        fetchStatus == 1,
        "Lottery: it is not yet the turn of the grand prize operation or the grand prize has been operated"
      );
      fetchStatus = 5;
      blockNumber = blockForGrandPrize;
    } else {
      revert("Lottery: the prize does not exist");
    }
    require(blockNumber > 0, "Lottery: pending randomize");
    bytes32 randomValue = witnet.getRandomnessAfter(blockNumber);
    if (prizeType == 1) {
      randomnessForFirstPrize = randomValue;
    } else if (prizeType == 2) {
      randomnessForSecondPrize = randomValue;
    } else if (prizeType == 3) {
      randomnessForThirdPrize = randomValue;
    } else if (prizeType == 4) {
      randomnessForFourthPrize = randomValue;
    } else {
      randomnessForGrandPrize = randomValue;
    }
    emit RandomnessUpdated(prizeType, blockNumber, randomValue);
  }

  /**
   * @notice View random number for each prize based on the randomResult generated by Witnet's fallback
   * @param prizeType: prize type
   * @return randomNumber: generated by Witnet's fallback
   */
  function getRandomNumber(uint256 prizeType) external view returns (bytes32) {
    uint256 blockNumber;
    if (prizeType == 1) {
      blockNumber = blockForFirstPrize;
    } else if (prizeType == 2) {
      blockNumber = blockForSecondPrize;
    } else if (prizeType == 3) {
      blockNumber = blockForThirdPrize;
    } else if (prizeType == 4) {
      blockNumber = blockForFourthPrize;
    } else {
      blockNumber = blockForGrandPrize;
    }
    require(blockNumber > 0, "Lottery: pending randomize");
    return witnet.getRandomnessAfter(blockNumber);
  }

  /**
   * @notice View all winner for each prize
   * @param prizeType: prize type
   */
  function getWinnerList(uint256 prizeType) public view returns (uint256[] memory) {
    if (prizeType == 1) {
      return listForFirstPrize;
    } else if (prizeType == 2) {
      return listForSecondPrize;
    } else if (prizeType == 3) {
      return listForThirdPrize;
    } else if (prizeType == 4) {
      return listForFourthPrize;
    } else {
      return listForGrandPrize;
    }
  }

  /**
   * @notice Which prize to draw next
   */
  function drawStatus() public view returns (uint256) {
    if (listForFourthPrize.length != TOTAL_FOURTH_PRIZE) {
      return 4;
    } else if (listForThirdPrize.length != TOTAL_THIRD_PRIZE) {
      return 3;
    } else if (listForSecondPrize.length != TOTAL_SECOND_PRIZE) {
      return 2;
    } else if (listForFirstPrize.length != TOTAL_FIRST_PRIZE) {
      return 1;
    } else if (listForGrandPrize.length != TOTAL_GRAND_PRIZE) {
      return 0;
    } else {
      return 5;
    }
  }

  /**
   * @notice Check if each prize has finished
   * @param prizeType: prize type
   * @return true: finished
   */
  function isFinished(uint256 prizeType) public view returns (bool) {
    if (prizeType == 1) {
      return listForFirstPrize.length == TOTAL_FIRST_PRIZE;
    } else if (prizeType == 2) {
      return listForSecondPrize.length == TOTAL_SECOND_PRIZE;
    } else if (prizeType == 3) {
      return listForThirdPrize.length == TOTAL_THIRD_PRIZE;
    } else if (prizeType == 4) {
      return listForFourthPrize.length == TOTAL_FOURTH_PRIZE;
    } else {
      return listForGrandPrize.length == TOTAL_GRAND_PRIZE;
    }
  }

  /**
   * @notice Start the lottery
   * @dev Only callable by owner
   * @param prizeType: 0->grand prize,1->first prize,2->second prize,3->third prize,4->fourth prize
   */
  function pickWinner(uint256 prizeType) public onlyOwner {
    if (prizeType == 0) {
      require(listForFirstPrize.length == TOTAL_FIRST_PRIZE, "Lottery: the first prize has not been drawn");
      require(listForGrandPrize.length < TOTAL_GRAND_PRIZE, "Lottery: the prize has been drawn out");
      pickWinnerForGrand(prizeType);
    } else if (prizeType == 1) {
      require(listForSecondPrize.length == TOTAL_SECOND_PRIZE, "Lottery: the second prize has not been drawn");
      require(listForFirstPrize.length < TOTAL_FIRST_PRIZE, "Lottery: the prize has been drawn out");
      pickWinnerForFirst(prizeType);
    } else if (prizeType == 2) {
      require(listForThirdPrize.length == TOTAL_THIRD_PRIZE, "Lottery: the third prize has not been drawn");
      require(listForSecondPrize.length < TOTAL_SECOND_PRIZE, "Lottery: the prize has been drawn out");
      pickWinnerForSecond(prizeType);
    } else if (prizeType == 3) {
      require(listForFourthPrize.length == TOTAL_FOURTH_PRIZE, "Lottery: the fourth prize has not been drawn");
      require(listForThirdPrize.length < TOTAL_THIRD_PRIZE, "Lottery: the prize has been drawn out");
      pickWinnerForThird(prizeType);
    } else if (prizeType == 4) {
      require(listForFourthPrize.length < TOTAL_FOURTH_PRIZE, "Lottery: the prize has been drawn out");
      pickWinnerForFourth(prizeType);
    } else {
      revert("Lottery: the prize does not exist");
    }
  }

  /// @dev Returns index of the Most Significant Bit of the given number, applying De Bruijn O(1) algorithm.
  function _msbDeBruijn32(uint32 _v) internal pure returns (uint8) {
    uint8[32] memory _bitPosition = [
      0,
      9,
      1,
      10,
      13,
      21,
      2,
      29,
      11,
      14,
      16,
      18,
      22,
      25,
      3,
      30,
      8,
      12,
      20,
      28,
      15,
      17,
      24,
      7,
      19,
      27,
      23,
      6,
      26,
      5,
      4,
      31
    ];
    _v |= _v >> 1;
    _v |= _v >> 2;
    _v |= _v >> 4;
    _v |= _v >> 8;
    _v |= _v >> 16;
    return _bitPosition[uint32(_v * uint256(0x07c4acdd)) >> 27];
  }

  /**
   * @notice Wrapping into a 256-bit random value
   * @param randomValue: generated by Witnet's fallback
   * @param i: loop index
   */
  function random(bytes32 randomValue, uint256 i) internal view returns (uint256) {
    bytes32 randomSeed = keccak256(abi.encodePacked(randomValue, i, block.number, block.timestamp));
    return uint256(random(TOTAL_PARTICIPATION, i, randomSeed));
  }

  /**
   * @notice Generates a pseudo-random number uniformly distributed within the range [0 .. _range), by using
   * the given `_nonce` value and the given `_seed` as a source of entropy.
   * @param _range Range within which the uniformly-distributed random number will be generated.
   * @param _nonce Nonce value enabling multiple random numbers from the same randomness value.
   * @param _seed Seed value used as entropy source.
   */
  function random(
    uint32 _range,
    uint256 _nonce,
    bytes32 _seed
  ) internal pure virtual returns (uint32) {
    uint8 _flagBits = uint8(255 - _msbDeBruijn32(_range));
    uint256 _number = uint256(keccak256(abi.encode(_seed, _nonce))) & uint256(2**_flagBits - 1);
    return uint32((_number * _range) >> _flagBits);
  }

  function pickWinnerForGrand(uint256 prizeType) internal {
    uint256 loopIndex;
    bytes32 randomValue = randomnessForGrandPrize;
    require(randomValue != "", "Lottery: pending randomize");
    for (uint256 i = 0; i < TOTAL_PARTICIPATION; i++) {
      uint256 randomNumber = 1 + random(randomValue, i);
      if (winnerInfo[randomNumber] == 0) {
        winnerInfo[randomNumber] = 5;
        listForGrandPrize.push(randomNumber);
      }
      if (listForGrandPrize.length == TOTAL_GRAND_PRIZE) {
        loopIndex = i;
        break;
      }
    }
    emit WinnerListUpdate(prizeType, 1, loopIndex, listForGrandPrize.length, listForGrandPrize);
  }

  function pickWinnerForFirst(uint256 prizeType) internal {
    uint256 loopIndex;
    bytes32 randomValue = randomnessForFirstPrize;
    require(randomValue != "", "Lottery: pending randomize");
    for (uint256 i = 0; i < TOTAL_PARTICIPATION; i++) {
      uint256 randomNumber = 1 + random(randomValue, i);
      if (winnerInfo[randomNumber] == 0) {
        winnerInfo[randomNumber] = 1;
        listForFirstPrize.push(randomNumber);
      }
      if (listForFirstPrize.length == TOTAL_FIRST_PRIZE) {
        loopIndex = i;
        break;
      }
    }
    emit WinnerListUpdate(prizeType, 1, loopIndex, listForFirstPrize.length, listForFirstPrize);
  }

  function pickWinnerForSecond(uint256 prizeType) internal {
    uint256 loopIndex;
    bytes32 randomValue = randomnessForSecondPrize;
    require(randomValue != "", "Lottery: pending randomize");
    for (uint256 i = 0; i < TOTAL_PARTICIPATION; i++) {
      uint256 randomNumber = 1 + random(randomValue, i);
      if (winnerInfo[randomNumber] == 0) {
        winnerInfo[randomNumber] = 2;
        listForSecondPrize.push(randomNumber);
      }
      if (listForSecondPrize.length == TOTAL_SECOND_PRIZE) {
        loopIndex = i;
        break;
      }
    }
    emit WinnerListUpdate(prizeType, 1, loopIndex, listForSecondPrize.length, listForSecondPrize);
  }

  function pickWinnerForThird(uint256 prizeType) internal {
    uint256 loopIndex;
    bytes32 randomValue = randomnessForThirdPrize;
    require(randomValue != "", "Lottery: pending randomize");
    if (lists.length > 0) {
      delete (lists);
    }
    for (uint256 i = thirdIndex; i < TOTAL_PARTICIPATION; i++) {
      uint256 randomNumber = 1 + random(randomValue, i);
      if (winnerInfo[randomNumber] == 0) {
        winnerInfo[randomNumber] = 3;
        lists.push(randomNumber);
        listForThirdPrize.push(randomNumber);
      }
      if (listForThirdPrize.length % 100 == 0) {
        loopIndex = i;
        break;
      }
    }
    thirdIndex = loopIndex + 1;
    drawTimesForThirdPrize++;
    emit WinnerListUpdate(prizeType, drawTimesForThirdPrize, loopIndex, listForThirdPrize.length, lists);
  }

  function pickWinnerForFourth(uint256 prizeType) internal {
    uint256 loopIndex;
    bytes32 randomValue = randomnessForFourthPrize;
    require(randomValue != "", "Lottery: pending randomize");
    if (lists.length > 0) {
      delete (lists);
    }
    for (uint256 i = fourthIndex; i < TOTAL_PARTICIPATION; i++) {
      uint256 randomNumber = 1 + random(randomValue, i);
      if (winnerInfo[randomNumber] == 0) {
        winnerInfo[randomNumber] = 4;
        lists.push(randomNumber);
        listForFourthPrize.push(randomNumber);
      }
      if (listForFourthPrize.length % 100 == 0) {
        loopIndex = i;
        break;
      }
    }
    fourthIndex = loopIndex + 1;
    drawTimesForFourthPrize++;
    emit WinnerListUpdate(prizeType, drawTimesForFourthPrize, loopIndex, listForFourthPrize.length, lists);
  }
}


        

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_witnet","internalType":"contract IWitnetRandomness"}]},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RandomnessRequested","inputs":[{"type":"uint256","name":"prizeType","internalType":"uint256","indexed":false},{"type":"uint256","name":"blockNumber","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RandomnessUpdated","inputs":[{"type":"uint256","name":"prizeType","internalType":"uint256","indexed":false},{"type":"uint256","name":"blockNumber","internalType":"uint256","indexed":false},{"type":"bytes32","name":"randomness","internalType":"bytes32","indexed":false}],"anonymous":false},{"type":"event","name":"WinnerListUpdate","inputs":[{"type":"uint256","name":"prizeType","internalType":"uint256","indexed":false},{"type":"uint256","name":"executionTimes","internalType":"uint256","indexed":false},{"type":"uint256","name":"loopIndex","internalType":"uint256","indexed":false},{"type":"uint256","name":"winnersLength","internalType":"uint256","indexed":false},{"type":"uint256[]","name":"winners","internalType":"uint256[]","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"blockForFirstPrize","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"blockForFourthPrize","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"blockForGrandPrize","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"blockForLatestRandomizing","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"blockForSecondPrize","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"blockForThirdPrize","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"drawStatus","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"fetchRandomNumber","inputs":[{"type":"uint256","name":"prizeType","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"getRandomNumber","inputs":[{"type":"uint256","name":"prizeType","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"getWinnerList","inputs":[{"type":"uint256","name":"prizeType","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isFinished","inputs":[{"type":"uint256","name":"prizeType","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pickWinner","inputs":[{"type":"uint256","name":"prizeType","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"randomnessForFirstPrize","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"randomnessForFourthPrize","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"randomnessForGrandPrize","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"randomnessForSecondPrize","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"randomnessForThirdPrize","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"requestRandomNumber","inputs":[{"type":"uint256","name":"prizeType","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"winnerInfo","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IWitnetRandomness"}],"name":"witnet","inputs":[]},{"type":"receive","stateMutability":"payable"}]
              

Contract Creation Code

0x60a06040523480156200001157600080fd5b50604051620024bb380380620024bb8339810160408190526200003491620000e4565b620000486200004262000090565b62000094565b6001600160a01b0381166200007a5760405162461bcd60e51b8152600401620000719062000114565b60405180910390fd5b60601b6001600160601b0319166080526200015b565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208284031215620000f6578081fd5b81516001600160a01b03811681146200010d578182fd5b9392505050565b60208082526027908201527f4c6f74746572793a20746865207769746e657420697320746865207a65726f206040820152666164647265737360c81b606082015260800190565b60805160601c61232c6200018f60003960008181610613015281816108b101528181610c0d0152610da5015261232c6000f3fe6080604052600436106101445760003560e01c8063a1422721116100b6578063e8ba65091161006f578063e8ba650914610311578063efaca7e11461033e578063f2fde38b14610353578063f737d21d14610373578063fbac934214610393578063fbc11efb146103a85761014b565b8063a14227211461027f578063a489e2e114610294578063ad1bbfaf146102b4578063b1eb96c9146102c9578063b37217a4146102dc578063c5c9fced146102fc5761014b565b806342a933991161010857806342a93399146101e757806346d1d21a146101fc578063715018a61461021e5780637c6424e61461023557806381dd7afe1461024a5780638da5cb5b1461026a5761014b565b80630b0705c8146101505780631678a6fd14610186578063190463c8146101a85780633da21b60146101bd5780634077e51a146101d25761014b565b3661014b57005b600080fd5b34801561015c57600080fd5b5061017061016b366004611a07565b6103bd565b60405161017d9190611a8b565b60405180910390f35b34801561019257600080fd5b5061019b610594565b60405161017d9190611ada565b3480156101b457600080fd5b5061019b61059a565b3480156101c957600080fd5b5061019b6105ff565b3480156101de57600080fd5b5061019b610605565b3480156101f357600080fd5b5061019b61060b565b34801561020857600080fd5b50610211610611565b60405161017d9190611a77565b34801561022a57600080fd5b50610233610635565b005b34801561024157600080fd5b5061019b610689565b34801561025657600080fd5b50610233610265366004611a07565b61068f565b34801561027657600080fd5b506102116109ca565b34801561028b57600080fd5b5061019b6109d9565b3480156102a057600080fd5b5061019b6102af366004611a07565b6109df565b3480156102c057600080fd5b5061019b6109f1565b6102336102d7366004611a07565b6109f7565b3480156102e857600080fd5b5061019b6102f7366004611a07565b610d1e565b34801561030857600080fd5b5061019b610e31565b34801561031d57600080fd5b5061033161032c366004611a07565b610e37565b60405161017d9190611acf565b34801561034a57600080fd5b5061019b610e9a565b34801561035f57600080fd5b5061023361036e3660046119c8565b610ea0565b34801561037f57600080fd5b5061023361038e366004611a07565b610f11565b34801561039f57600080fd5b5061019b6110df565b3480156103b457600080fd5b5061019b6110e5565b6060816001141561042057601080548060200260200160405190810160405280929190818152602001828054801561041457602002820191906000526020600020905b815481526020019060010190808311610400575b5050505050905061058f565b816002141561047f5760118054806020026020016040519081016040528092919081815260200182805480156104145760200282019190600052602060002090815481526020019060010190808311610400575050505050905061058f565b81600314156104de5760128054806020026020016040519081016040528092919081815260200182805480156104145760200282019190600052602060002090815481526020019060010190808311610400575050505050905061058f565b816004141561053d5760138054806020026020016040519081016040528092919081815260200182805480156104145760200282019190600052602060002090815481526020019060010190808311610400575050505050905061058f565b600f805480602002602001604051908101604052809291908181526020018280548015610414576020028201919060005260206000209081548152602001906001019080831161040057505050505090505b919050565b60045481565b6013546000906103e8146105b0575060046105fc565b60125460c8146105c2575060036105fc565b601154600f146105d4575060026105fc565b6010546004146105e6575060016105fc565b600f546001146105f8575060006105fc565b5060055b90565b600c5481565b60095481565b60025481565b7f000000000000000000000000000000000000000000000000000000000000000081565b61063d6110eb565b6001600160a01b031661064e6109ca565b6001600160a01b03161461067d5760405162461bcd60e51b815260040161067490611e10565b60405180910390fd5b61068760006110ef565b565b60055481565b6106976110eb565b6001600160a01b03166106a86109ca565b6001600160a01b0316146106ce5760405162461bcd60e51b815260040161067490611e10565b6000816001141561072157600054600160b81b900460ff166002146107055760405162461bcd60e51b815260040161067490611bce565b506000805460ff60b81b1916600160b81b179055600a54610877565b816002141561077257600054600160b81b900460ff166003146107565760405162461bcd60e51b815260040161067490611e45565b506000805460ff60b81b1916600160b91b179055600b54610877565b81600314156107c357600054600160b81b900460ff166004146107a75760405162461bcd60e51b815260040161067490611cfd565b506000805460ff60b81b1916600360b81b179055600c54610877565b816004141561081257600054600160b81b900460ff16156107f65760405162461bcd60e51b815260040161067490611c80565b506000805460ff60b81b1916600160ba1b179055600d54610877565b8161085f57600054600160b81b900460ff166001146108435760405162461bcd60e51b815260040161067490611f0d565b506000805460ff60b81b1916600560b81b179055600954610877565b60405162461bcd60e51b815260040161067490611fbd565b600081116108975760405162461bcd60e51b815260040161067490611c49565b60405163fb476cad60e01b81526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063fb476cad906108e6908590600401611ada565b60206040518083038186803b1580156108fe57600080fd5b505afa158015610912573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093691906119ef565b9050826001141561094b57600281905561098a565b826002141561095e57600381905561098a565b826003141561097157600481905561098a565b826004141561098457600581905561098a565b60018190555b7fccb231279896fc21a4cf412db797cc25430c732e763b79d40553060af298b9968383836040516109bd93929190612079565b60405180910390a1505050565b6000546001600160a01b031690565b60035481565b600e6020526000908152604090205481565b600d5481565b6109ff6110eb565b6001600160a01b0316610a106109ca565b6001600160a01b031614610a365760405162461bcd60e51b815260040161067490611e10565b4360085410610a575760405162461bcd60e51b815260040161067490611f88565b60003411610a775760405162461bcd60e51b815260040161067490611dc4565b80610ac457600054600160b01b900460ff16600114610aa85760405162461bcd60e51b815260040161067490611f0d565b6000805460ff60b01b1916600560b01b17905543600955610c02565b8060011415610b1557600054600160b01b900460ff16600214610af95760405162461bcd60e51b815260040161067490611bce565b6000805460ff60b01b1916600160b01b17905543600a55610c02565b8060021415610b6657600054600160b01b900460ff16600314610b4a5760405162461bcd60e51b815260040161067490611e45565b6000805460ff60b01b1916600160b11b17905543600b55610c02565b8060031415610bb757600054600160b01b900460ff16600414610b9b5760405162461bcd60e51b815260040161067490611cfd565b6000805460ff60b01b1916600360b01b17905543600c55610c02565b806004141561085f57600054600160b01b900460ff1615610bea5760405162461bcd60e51b815260040161067490611c80565b6000805460ff60b01b1916600160b21b17905543600d555b4360088190555060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663699b328a346040518263ffffffff1660e01b81526004016020604051808303818588803b158015610c6657600080fd5b505af1158015610c7a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c9f91906119ef565b905034811015610ce157336108fc610cb7833461220b565b6040518115909202916000818181858888f19350505050158015610cdf573d6000803e3d6000fd5b505b7f3d94fecedaa4f90b8bd459797adb95f5bb11426025c5541390d9ccc1ad1b60a18243604051610d12929190611ae3565b60405180910390a15050565b6000808260011415610d335750600a54610d6e565b8260021415610d455750600b54610d6e565b8260031415610d575750600c54610d6e565b8260041415610d695750600d54610d6e565b506009545b60008111610d8e5760405162461bcd60e51b815260040161067490611c49565b60405163fb476cad60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063fb476cad90610dda908490600401611ada565b60206040518083038186803b158015610df257600080fd5b505afa158015610e06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2a91906119ef565b9392505050565b60085481565b60008160011415610e4e575060105460041461058f565b8160021415610e635750601154600f1461058f565b8160031415610e78575060125460c81461058f565b8160041415610e8e57506013546103e81461058f565b50600f5460011461058f565b60015481565b610ea86110eb565b6001600160a01b0316610eb96109ca565b6001600160a01b031614610edf5760405162461bcd60e51b815260040161067490611e10565b6001600160a01b038116610f055760405162461bcd60e51b815260040161067490611b88565b610f0e816110ef565b50565b610f196110eb565b6001600160a01b0316610f2a6109ca565b6001600160a01b031614610f505760405162461bcd60e51b815260040161067490611e10565b80610fa757601054600414610f775760405162461bcd60e51b815260040161067490611ec2565b600f54600111610f995760405162461bcd60e51b815260040161067490611ffe565b610fa28161113f565b610f0e565b8060011415610ffd57601154600f14610fd25760405162461bcd60e51b815260040161067490611d78565b601054600411610ff45760405162461bcd60e51b815260040161067490611ffe565b610fa281611231565b80600214156110535760125460c8146110285760405162461bcd60e51b815260040161067490611af1565b601154600f1161104a5760405162461bcd60e51b815260040161067490611ffe565b610fa281611325565b80600314156110aa576013546103e81461107f5760405162461bcd60e51b815260040161067490611b3c565b60125460c8116110a15760405162461bcd60e51b815260040161067490611ffe565b610fa281611417565b806004141561085f576013546103e8116110d65760405162461bcd60e51b815260040161067490611ffe565b610fa2816115a4565b600a5481565b600b5481565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600154600090806111625760405162461bcd60e51b815260040161067490611c49565b60005b6202bf2081101561120857600061117c8383611731565b6111879060016120bd565b6000818152600e60205260409020549091506111e1576000818152600e6020526040812060059055600f805460018101825591527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802018190555b600f54600114156111f55781935050611208565b508061120081612245565b915050611165565b50600f80546040516000805160206122d7833981519152926109bd928792600192889291612043565b600254600090806112545760405162461bcd60e51b815260040161067490611c49565b60005b6202bf208110156112fc57600061126e8383611731565b6112799060016120bd565b6000818152600e60205260409020549091506112d5576000818152600e602052604081206001908190556010805491820181559091527f1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae672018190555b601054600414156112e957819350506112fc565b50806112f481612245565b915050611257565b50601080546040516000805160206122d7833981519152926109bd928792600192889291612043565b600354600090806113485760405162461bcd60e51b815260040161067490611c49565b60005b6202bf208110156113ee5760006113628383611731565b61136d9060016120bd565b6000818152600e60205260409020549091506113c7576000818152600e60205260408120600290556011805460018101825591527f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c68018190555b601154600f14156113db57819350506113ee565b50806113e681612245565b91505061134b565b50601180546040516000805160206122d7833981519152926109bd928792600192889291612043565b6004546000908061143a5760405162461bcd60e51b815260040161067490611c49565b6014541561144e5761144e60146000611996565b6006545b6202bf2081101561152e5760006114698383611731565b6114749060016120bd565b6000818152600e60205260409020549091506114ff576000818152600e60205260408120600390556014805460018181019092557fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec018390556012805491820181559091527fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec3444018190555b60125461150e90606490612280565b61151b578193505061152e565b508061152681612245565b915050611452565b5061153a8260016120bd565b60065560008054600160a01b900460ff1690601461155783612260565b82546101009290920a60ff8181021990931691831602179091556000546012546040516000805160206122d783398151915294506109bd938893600160a01b90041691879160149061208f565b600554600090806115c75760405162461bcd60e51b815260040161067490611c49565b601454156115db576115db60146000611996565b6007545b6202bf208110156116bb5760006115f68383611731565b6116019060016120bd565b6000818152600e602052604090205490915061168c576000818152600e60205260408120600490556014805460018181019092557fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec018390556013805491820181559091527f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a090018190555b60135461169b90606490612280565b6116a857819350506116bb565b50806116b381612245565b9150506115df565b506116c78260016120bd565b60075560008054600160a81b900460ff169060156116e483612260565b82546101009290920a60ff8181021990931691831602179091556000546013546040516000805160206122d783398151915294506109bd938893600160a81b90041691879160149061208f565b6000808383434260405160200161174b9493929190611a5c565b6040516020818303038152906040528051906020012090506117716202bf20848361177f565b63ffffffff16949350505050565b60008061178b856117ff565b6117969060ff612222565b9050600060016117a783600261211b565b6117b1919061220b565b84866040516020016117c4929190611ae3565b60408051601f19818403018152919052805160209091012016905060ff82166117f363ffffffff8816836121ec565b901c9695505050505050565b60408051610400810182526000808252600960208301526001928201839052600a6060830152600d6080830152601560a0830152600260c08301819052601d60e0840152600b610100840152600e610120840152601061014084018190526012610160850152601661018085015260196101a085015260036101c0850152601e6101e085015260086102008501819052600c6102208601526014610240860152601c610260860152600f61028086015260116102a086015260186102c086015260076102e08601526013610300860152601b610320860181905260176103408701526006610360870152601a61038087015260056103a087015260046103c08701819052601f6103e08801529688901c637fffffff169097179283901c633fffffff169092179485901c630fffffff169094179081901c62ffffff16179283901c61ffff1690921792819061195e6307c4acdd63ffffffff87166121ec565b63ffffffff16901c63ffffffff166020811061198a57634e487b7160e01b600052603260045260246000fd5b60200201519392505050565b5080546000825590600052602060002090810190610f0e91905b808211156119c457600081556001016119b0565b5090565b6000602082840312156119d9578081fd5b81356001600160a01b0381168114610e2a578182fd5b600060208284031215611a00578081fd5b5051919050565b600060208284031215611a18578081fd5b5035919050565b6000815480845260208085019450838352808320835b83811015611a5157815487529582019560019182019101611a35565b509495945050505050565b93845260208401929092526040830152606082015260800190565b6001600160a01b0391909116815260200190565b6020808252825182820181905260009190848201906040850190845b81811015611ac357835183529284019291840191600101611aa7565b50909695505050505050565b901515815260200190565b90815260200190565b918252602082015260400190565b6020808252602b908201527f4c6f74746572793a20746865207468697264207072697a6520686173206e6f7460408201526a103132b2b710323930bbb760a91b606082015260800190565b6020808252602c908201527f4c6f74746572793a2074686520666f75727468207072697a6520686173206e6f60408201526b3a103132b2b710323930bbb760a11b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526061908201526000805160206122b783398151915260408201527f6f6620746865206669727374207072697a65206f7065726174696f6e206f722060608201527f746865206669727374207072697a6520686173206265656e206f7065726174656080820152601960fa1b60a082015260c00190565b6020808252601a908201527f4c6f74746572793a2070656e64696e672072616e646f6d697a65000000000000604082015260600190565b60208082526063908201526000805160206122b783398151915260408201527f6f662074686520666f75727468207072697a65206f7065726174696f6e206f7260608201527f2074686520666f75727468207072697a6520686173206265656e206f706572616080820152621d195960ea1b60a082015260c00190565b60208082526061908201526000805160206122b783398151915260408201527f6f6620746865207468697264207072697a65206f7065726174696f6e206f722060608201527f746865207468697264207072697a6520686173206265656e206f7065726174656080820152601960fa1b60a082015260c00190565b6020808252602c908201527f4c6f74746572793a20746865207365636f6e64207072697a6520686173206e6f60408201526b3a103132b2b710323930bbb760a11b606082015260800190565b6020808252602c908201527f4c6f74746572793a207468652076616c7565206d75737420626520677265617460408201526b6572207468616e207a65726f60a01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526063908201526000805160206122b783398151915260408201527f6f6620746865207365636f6e64207072697a65206f7065726174696f6e206f7260608201527f20746865207365636f6e64207072697a6520686173206265656e206f706572616080820152621d195960ea1b60a082015260c00190565b6020808252602b908201527f4c6f74746572793a20746865206669727374207072697a6520686173206e6f7460408201526a103132b2b710323930bbb760a91b606082015260800190565b60208082526061908201526000805160206122b783398151915260408201527f6f6620746865206772616e64207072697a65206f7065726174696f6e206f722060608201527f746865206772616e64207072697a6520686173206265656e206f7065726174656080820152601960fa1b60a082015260c00190565b6020808252818101527f4c6f74746572793a2074686520626c6f636b20686173206265656e2075736564604082015260600190565b60208082526021908201527f4c6f74746572793a20746865207072697a6520646f6573206e6f7420657869736040820152601d60fa1b606082015260800190565b60208082526025908201527f4c6f74746572793a20746865207072697a6520686173206265656e20647261776040820152641b881bdd5d60da1b606082015260800190565b600086825285602083015284604083015283606083015260a0608083015261206e60a0830184611a1f565b979650505050505050565b9283526020830191909152604082015260600190565b600086825260ff8616602083015284604083015283606083015260a0608083015261206e60a0830184611a1f565b600082198211156120d0576120d06122a0565b500190565b80825b60018086116120e75750612112565b8187048211156120f9576120f96122a0565b8086161561210657918102915b9490941c9380026120d8565b94509492505050565b6000610e2a60001960ff85168460008261213757506001610e2a565b8161214457506000610e2a565b816001811461215a576002811461216457612191565b6001915050610e2a565b60ff841115612175576121756122a0565b6001841b91508482111561218b5761218b6122a0565b50610e2a565b5060208310610133831016604e8410600b84101617156121c4575081810a838111156121bf576121bf6122a0565b610e2a565b6121d184848460016120d5565b8086048211156121e3576121e36122a0565b02949350505050565b6000816000190483118215151615612206576122066122a0565b500290565b60008282101561221d5761221d6122a0565b500390565b600060ff821660ff84168082101561223c5761223c6122a0565b90039392505050565b6000600019821415612259576122596122a0565b5060010190565b600060ff821660ff811415612277576122776122a0565b60010192915050565b60008261229b57634e487b7160e01b81526012600452602481fd5b500690565b634e487b7160e01b600052601160045260246000fdfe4c6f74746572793a206974206973206e6f742079657420746865207475726e2011ebdf15de22d8aaead7b11e7c2d8ce2e1f4e063be977f0da1fd01e689c3b013a26469706673582212208d56c29d03e9df1ade16c5620892faa2581bf0e74b6a98b83f55a39a4d83424d64736f6c634300080000330000000000000000000000001ebd93231a7fe551e1d6405404df34909eff4c2c

Deployed ByteCode

0x6080604052600436106101445760003560e01c8063a1422721116100b6578063e8ba65091161006f578063e8ba650914610311578063efaca7e11461033e578063f2fde38b14610353578063f737d21d14610373578063fbac934214610393578063fbc11efb146103a85761014b565b8063a14227211461027f578063a489e2e114610294578063ad1bbfaf146102b4578063b1eb96c9146102c9578063b37217a4146102dc578063c5c9fced146102fc5761014b565b806342a933991161010857806342a93399146101e757806346d1d21a146101fc578063715018a61461021e5780637c6424e61461023557806381dd7afe1461024a5780638da5cb5b1461026a5761014b565b80630b0705c8146101505780631678a6fd14610186578063190463c8146101a85780633da21b60146101bd5780634077e51a146101d25761014b565b3661014b57005b600080fd5b34801561015c57600080fd5b5061017061016b366004611a07565b6103bd565b60405161017d9190611a8b565b60405180910390f35b34801561019257600080fd5b5061019b610594565b60405161017d9190611ada565b3480156101b457600080fd5b5061019b61059a565b3480156101c957600080fd5b5061019b6105ff565b3480156101de57600080fd5b5061019b610605565b3480156101f357600080fd5b5061019b61060b565b34801561020857600080fd5b50610211610611565b60405161017d9190611a77565b34801561022a57600080fd5b50610233610635565b005b34801561024157600080fd5b5061019b610689565b34801561025657600080fd5b50610233610265366004611a07565b61068f565b34801561027657600080fd5b506102116109ca565b34801561028b57600080fd5b5061019b6109d9565b3480156102a057600080fd5b5061019b6102af366004611a07565b6109df565b3480156102c057600080fd5b5061019b6109f1565b6102336102d7366004611a07565b6109f7565b3480156102e857600080fd5b5061019b6102f7366004611a07565b610d1e565b34801561030857600080fd5b5061019b610e31565b34801561031d57600080fd5b5061033161032c366004611a07565b610e37565b60405161017d9190611acf565b34801561034a57600080fd5b5061019b610e9a565b34801561035f57600080fd5b5061023361036e3660046119c8565b610ea0565b34801561037f57600080fd5b5061023361038e366004611a07565b610f11565b34801561039f57600080fd5b5061019b6110df565b3480156103b457600080fd5b5061019b6110e5565b6060816001141561042057601080548060200260200160405190810160405280929190818152602001828054801561041457602002820191906000526020600020905b815481526020019060010190808311610400575b5050505050905061058f565b816002141561047f5760118054806020026020016040519081016040528092919081815260200182805480156104145760200282019190600052602060002090815481526020019060010190808311610400575050505050905061058f565b81600314156104de5760128054806020026020016040519081016040528092919081815260200182805480156104145760200282019190600052602060002090815481526020019060010190808311610400575050505050905061058f565b816004141561053d5760138054806020026020016040519081016040528092919081815260200182805480156104145760200282019190600052602060002090815481526020019060010190808311610400575050505050905061058f565b600f805480602002602001604051908101604052809291908181526020018280548015610414576020028201919060005260206000209081548152602001906001019080831161040057505050505090505b919050565b60045481565b6013546000906103e8146105b0575060046105fc565b60125460c8146105c2575060036105fc565b601154600f146105d4575060026105fc565b6010546004146105e6575060016105fc565b600f546001146105f8575060006105fc565b5060055b90565b600c5481565b60095481565b60025481565b7f0000000000000000000000001ebd93231a7fe551e1d6405404df34909eff4c2c81565b61063d6110eb565b6001600160a01b031661064e6109ca565b6001600160a01b03161461067d5760405162461bcd60e51b815260040161067490611e10565b60405180910390fd5b61068760006110ef565b565b60055481565b6106976110eb565b6001600160a01b03166106a86109ca565b6001600160a01b0316146106ce5760405162461bcd60e51b815260040161067490611e10565b6000816001141561072157600054600160b81b900460ff166002146107055760405162461bcd60e51b815260040161067490611bce565b506000805460ff60b81b1916600160b81b179055600a54610877565b816002141561077257600054600160b81b900460ff166003146107565760405162461bcd60e51b815260040161067490611e45565b506000805460ff60b81b1916600160b91b179055600b54610877565b81600314156107c357600054600160b81b900460ff166004146107a75760405162461bcd60e51b815260040161067490611cfd565b506000805460ff60b81b1916600360b81b179055600c54610877565b816004141561081257600054600160b81b900460ff16156107f65760405162461bcd60e51b815260040161067490611c80565b506000805460ff60b81b1916600160ba1b179055600d54610877565b8161085f57600054600160b81b900460ff166001146108435760405162461bcd60e51b815260040161067490611f0d565b506000805460ff60b81b1916600560b81b179055600954610877565b60405162461bcd60e51b815260040161067490611fbd565b600081116108975760405162461bcd60e51b815260040161067490611c49565b60405163fb476cad60e01b81526000906001600160a01b037f0000000000000000000000001ebd93231a7fe551e1d6405404df34909eff4c2c169063fb476cad906108e6908590600401611ada565b60206040518083038186803b1580156108fe57600080fd5b505afa158015610912573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093691906119ef565b9050826001141561094b57600281905561098a565b826002141561095e57600381905561098a565b826003141561097157600481905561098a565b826004141561098457600581905561098a565b60018190555b7fccb231279896fc21a4cf412db797cc25430c732e763b79d40553060af298b9968383836040516109bd93929190612079565b60405180910390a1505050565b6000546001600160a01b031690565b60035481565b600e6020526000908152604090205481565b600d5481565b6109ff6110eb565b6001600160a01b0316610a106109ca565b6001600160a01b031614610a365760405162461bcd60e51b815260040161067490611e10565b4360085410610a575760405162461bcd60e51b815260040161067490611f88565b60003411610a775760405162461bcd60e51b815260040161067490611dc4565b80610ac457600054600160b01b900460ff16600114610aa85760405162461bcd60e51b815260040161067490611f0d565b6000805460ff60b01b1916600560b01b17905543600955610c02565b8060011415610b1557600054600160b01b900460ff16600214610af95760405162461bcd60e51b815260040161067490611bce565b6000805460ff60b01b1916600160b01b17905543600a55610c02565b8060021415610b6657600054600160b01b900460ff16600314610b4a5760405162461bcd60e51b815260040161067490611e45565b6000805460ff60b01b1916600160b11b17905543600b55610c02565b8060031415610bb757600054600160b01b900460ff16600414610b9b5760405162461bcd60e51b815260040161067490611cfd565b6000805460ff60b01b1916600360b01b17905543600c55610c02565b806004141561085f57600054600160b01b900460ff1615610bea5760405162461bcd60e51b815260040161067490611c80565b6000805460ff60b01b1916600160b21b17905543600d555b4360088190555060007f0000000000000000000000001ebd93231a7fe551e1d6405404df34909eff4c2c6001600160a01b031663699b328a346040518263ffffffff1660e01b81526004016020604051808303818588803b158015610c6657600080fd5b505af1158015610c7a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c9f91906119ef565b905034811015610ce157336108fc610cb7833461220b565b6040518115909202916000818181858888f19350505050158015610cdf573d6000803e3d6000fd5b505b7f3d94fecedaa4f90b8bd459797adb95f5bb11426025c5541390d9ccc1ad1b60a18243604051610d12929190611ae3565b60405180910390a15050565b6000808260011415610d335750600a54610d6e565b8260021415610d455750600b54610d6e565b8260031415610d575750600c54610d6e565b8260041415610d695750600d54610d6e565b506009545b60008111610d8e5760405162461bcd60e51b815260040161067490611c49565b60405163fb476cad60e01b81526001600160a01b037f0000000000000000000000001ebd93231a7fe551e1d6405404df34909eff4c2c169063fb476cad90610dda908490600401611ada565b60206040518083038186803b158015610df257600080fd5b505afa158015610e06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2a91906119ef565b9392505050565b60085481565b60008160011415610e4e575060105460041461058f565b8160021415610e635750601154600f1461058f565b8160031415610e78575060125460c81461058f565b8160041415610e8e57506013546103e81461058f565b50600f5460011461058f565b60015481565b610ea86110eb565b6001600160a01b0316610eb96109ca565b6001600160a01b031614610edf5760405162461bcd60e51b815260040161067490611e10565b6001600160a01b038116610f055760405162461bcd60e51b815260040161067490611b88565b610f0e816110ef565b50565b610f196110eb565b6001600160a01b0316610f2a6109ca565b6001600160a01b031614610f505760405162461bcd60e51b815260040161067490611e10565b80610fa757601054600414610f775760405162461bcd60e51b815260040161067490611ec2565b600f54600111610f995760405162461bcd60e51b815260040161067490611ffe565b610fa28161113f565b610f0e565b8060011415610ffd57601154600f14610fd25760405162461bcd60e51b815260040161067490611d78565b601054600411610ff45760405162461bcd60e51b815260040161067490611ffe565b610fa281611231565b80600214156110535760125460c8146110285760405162461bcd60e51b815260040161067490611af1565b601154600f1161104a5760405162461bcd60e51b815260040161067490611ffe565b610fa281611325565b80600314156110aa576013546103e81461107f5760405162461bcd60e51b815260040161067490611b3c565b60125460c8116110a15760405162461bcd60e51b815260040161067490611ffe565b610fa281611417565b806004141561085f576013546103e8116110d65760405162461bcd60e51b815260040161067490611ffe565b610fa2816115a4565b600a5481565b600b5481565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600154600090806111625760405162461bcd60e51b815260040161067490611c49565b60005b6202bf2081101561120857600061117c8383611731565b6111879060016120bd565b6000818152600e60205260409020549091506111e1576000818152600e6020526040812060059055600f805460018101825591527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802018190555b600f54600114156111f55781935050611208565b508061120081612245565b915050611165565b50600f80546040516000805160206122d7833981519152926109bd928792600192889291612043565b600254600090806112545760405162461bcd60e51b815260040161067490611c49565b60005b6202bf208110156112fc57600061126e8383611731565b6112799060016120bd565b6000818152600e60205260409020549091506112d5576000818152600e602052604081206001908190556010805491820181559091527f1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae672018190555b601054600414156112e957819350506112fc565b50806112f481612245565b915050611257565b50601080546040516000805160206122d7833981519152926109bd928792600192889291612043565b600354600090806113485760405162461bcd60e51b815260040161067490611c49565b60005b6202bf208110156113ee5760006113628383611731565b61136d9060016120bd565b6000818152600e60205260409020549091506113c7576000818152600e60205260408120600290556011805460018101825591527f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c68018190555b601154600f14156113db57819350506113ee565b50806113e681612245565b91505061134b565b50601180546040516000805160206122d7833981519152926109bd928792600192889291612043565b6004546000908061143a5760405162461bcd60e51b815260040161067490611c49565b6014541561144e5761144e60146000611996565b6006545b6202bf2081101561152e5760006114698383611731565b6114749060016120bd565b6000818152600e60205260409020549091506114ff576000818152600e60205260408120600390556014805460018181019092557fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec018390556012805491820181559091527fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec3444018190555b60125461150e90606490612280565b61151b578193505061152e565b508061152681612245565b915050611452565b5061153a8260016120bd565b60065560008054600160a01b900460ff1690601461155783612260565b82546101009290920a60ff8181021990931691831602179091556000546012546040516000805160206122d783398151915294506109bd938893600160a01b90041691879160149061208f565b600554600090806115c75760405162461bcd60e51b815260040161067490611c49565b601454156115db576115db60146000611996565b6007545b6202bf208110156116bb5760006115f68383611731565b6116019060016120bd565b6000818152600e602052604090205490915061168c576000818152600e60205260408120600490556014805460018181019092557fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec018390556013805491820181559091527f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a090018190555b60135461169b90606490612280565b6116a857819350506116bb565b50806116b381612245565b9150506115df565b506116c78260016120bd565b60075560008054600160a81b900460ff169060156116e483612260565b82546101009290920a60ff8181021990931691831602179091556000546013546040516000805160206122d783398151915294506109bd938893600160a81b90041691879160149061208f565b6000808383434260405160200161174b9493929190611a5c565b6040516020818303038152906040528051906020012090506117716202bf20848361177f565b63ffffffff16949350505050565b60008061178b856117ff565b6117969060ff612222565b9050600060016117a783600261211b565b6117b1919061220b565b84866040516020016117c4929190611ae3565b60408051601f19818403018152919052805160209091012016905060ff82166117f363ffffffff8816836121ec565b901c9695505050505050565b60408051610400810182526000808252600960208301526001928201839052600a6060830152600d6080830152601560a0830152600260c08301819052601d60e0840152600b610100840152600e610120840152601061014084018190526012610160850152601661018085015260196101a085015260036101c0850152601e6101e085015260086102008501819052600c6102208601526014610240860152601c610260860152600f61028086015260116102a086015260186102c086015260076102e08601526013610300860152601b610320860181905260176103408701526006610360870152601a61038087015260056103a087015260046103c08701819052601f6103e08801529688901c637fffffff169097179283901c633fffffff169092179485901c630fffffff169094179081901c62ffffff16179283901c61ffff1690921792819061195e6307c4acdd63ffffffff87166121ec565b63ffffffff16901c63ffffffff166020811061198a57634e487b7160e01b600052603260045260246000fd5b60200201519392505050565b5080546000825590600052602060002090810190610f0e91905b808211156119c457600081556001016119b0565b5090565b6000602082840312156119d9578081fd5b81356001600160a01b0381168114610e2a578182fd5b600060208284031215611a00578081fd5b5051919050565b600060208284031215611a18578081fd5b5035919050565b6000815480845260208085019450838352808320835b83811015611a5157815487529582019560019182019101611a35565b509495945050505050565b93845260208401929092526040830152606082015260800190565b6001600160a01b0391909116815260200190565b6020808252825182820181905260009190848201906040850190845b81811015611ac357835183529284019291840191600101611aa7565b50909695505050505050565b901515815260200190565b90815260200190565b918252602082015260400190565b6020808252602b908201527f4c6f74746572793a20746865207468697264207072697a6520686173206e6f7460408201526a103132b2b710323930bbb760a91b606082015260800190565b6020808252602c908201527f4c6f74746572793a2074686520666f75727468207072697a6520686173206e6f60408201526b3a103132b2b710323930bbb760a11b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526061908201526000805160206122b783398151915260408201527f6f6620746865206669727374207072697a65206f7065726174696f6e206f722060608201527f746865206669727374207072697a6520686173206265656e206f7065726174656080820152601960fa1b60a082015260c00190565b6020808252601a908201527f4c6f74746572793a2070656e64696e672072616e646f6d697a65000000000000604082015260600190565b60208082526063908201526000805160206122b783398151915260408201527f6f662074686520666f75727468207072697a65206f7065726174696f6e206f7260608201527f2074686520666f75727468207072697a6520686173206265656e206f706572616080820152621d195960ea1b60a082015260c00190565b60208082526061908201526000805160206122b783398151915260408201527f6f6620746865207468697264207072697a65206f7065726174696f6e206f722060608201527f746865207468697264207072697a6520686173206265656e206f7065726174656080820152601960fa1b60a082015260c00190565b6020808252602c908201527f4c6f74746572793a20746865207365636f6e64207072697a6520686173206e6f60408201526b3a103132b2b710323930bbb760a11b606082015260800190565b6020808252602c908201527f4c6f74746572793a207468652076616c7565206d75737420626520677265617460408201526b6572207468616e207a65726f60a01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526063908201526000805160206122b783398151915260408201527f6f6620746865207365636f6e64207072697a65206f7065726174696f6e206f7260608201527f20746865207365636f6e64207072697a6520686173206265656e206f706572616080820152621d195960ea1b60a082015260c00190565b6020808252602b908201527f4c6f74746572793a20746865206669727374207072697a6520686173206e6f7460408201526a103132b2b710323930bbb760a91b606082015260800190565b60208082526061908201526000805160206122b783398151915260408201527f6f6620746865206772616e64207072697a65206f7065726174696f6e206f722060608201527f746865206772616e64207072697a6520686173206265656e206f7065726174656080820152601960fa1b60a082015260c00190565b6020808252818101527f4c6f74746572793a2074686520626c6f636b20686173206265656e2075736564604082015260600190565b60208082526021908201527f4c6f74746572793a20746865207072697a6520646f6573206e6f7420657869736040820152601d60fa1b606082015260800190565b60208082526025908201527f4c6f74746572793a20746865207072697a6520686173206265656e20647261776040820152641b881bdd5d60da1b606082015260800190565b600086825285602083015284604083015283606083015260a0608083015261206e60a0830184611a1f565b979650505050505050565b9283526020830191909152604082015260600190565b600086825260ff8616602083015284604083015283606083015260a0608083015261206e60a0830184611a1f565b600082198211156120d0576120d06122a0565b500190565b80825b60018086116120e75750612112565b8187048211156120f9576120f96122a0565b8086161561210657918102915b9490941c9380026120d8565b94509492505050565b6000610e2a60001960ff85168460008261213757506001610e2a565b8161214457506000610e2a565b816001811461215a576002811461216457612191565b6001915050610e2a565b60ff841115612175576121756122a0565b6001841b91508482111561218b5761218b6122a0565b50610e2a565b5060208310610133831016604e8410600b84101617156121c4575081810a838111156121bf576121bf6122a0565b610e2a565b6121d184848460016120d5565b8086048211156121e3576121e36122a0565b02949350505050565b6000816000190483118215151615612206576122066122a0565b500290565b60008282101561221d5761221d6122a0565b500390565b600060ff821660ff84168082101561223c5761223c6122a0565b90039392505050565b6000600019821415612259576122596122a0565b5060010190565b600060ff821660ff811415612277576122776122a0565b60010192915050565b60008261229b57634e487b7160e01b81526012600452602481fd5b500690565b634e487b7160e01b600052601160045260246000fdfe4c6f74746572793a206974206973206e6f742079657420746865207475726e2011ebdf15de22d8aaead7b11e7c2d8ce2e1f4e063be977f0da1fd01e689c3b013a26469706673582212208d56c29d03e9df1ade16c5620892faa2581bf0e74b6a98b83f55a39a4d83424d64736f6c63430008000033