Contract 0x0178287DfECA2F13F342512282bc8B59e774aE43

Contract Overview

Balance:
0 MATIC
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x2b5bfbaf7ed9ee3a1ed08ab175d5e2daa9596427362d01ae39d8831b07b8c0600x60c06040257299782022-03-30 12:36:3589 days 2 hrs ago0x8d86bc475bedcb08179c5e6a4d494ebd3b44ea8b IN  Create: WitnetRandomness0 MATIC0.0742317298322.653636271
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0x2b5bfbaf7ed9ee3a1ed08ab175d5e2daa9596427362d01ae39d8831b07b8c060257299782022-03-30 12:36:3589 days 2 hrs ago 0x0178287dfeca2f13f342512282bc8b59e774ae43  Contract Creation0 MATIC
[ Download CSV Export 
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
WitnetRandomness

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity)

/**
 *Submitted for verification at polygonscan.com on 2022-03-30
*/

// SPDX-License-Identifier: MIT

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

// File: contracts\interfaces\IWitnetRequestBoardEvents.sol
/// @title Witnet Request Board emitting events interface.
/// @author The Witnet Foundation.
interface IWitnetRequestBoardEvents {
    /// Emitted when a Witnet Data Request is posted to the WRB.
    event PostedRequest(uint256 queryId, address from);

    /// Emitted when a Witnet-solved result is reported to the WRB.
    event PostedResult(uint256 queryId, address from);

    /// Emitted when all data related to given query is deleted from the WRB.
    event DeletedQuery(uint256 queryId, address from);
}
// File: contracts\interfaces\IWitnetRequestBoardReporter.sol
/// @title The Witnet Request Board Reporter interface.
/// @author The Witnet Foundation.
interface IWitnetRequestBoardReporter {
    /// Reports the Witnet-provided result to a previously posted request. 
    /// @dev Will assume `block.timestamp` as the timestamp at which the request was solved.
    /// @dev Fails if:
    /// @dev - the `_queryId` is not in 'Posted' status.
    /// @dev - provided `_drTxHash` is zero;
    /// @dev - length of provided `_result` is zero.
    /// @param _queryId The unique identifier of the data request.
    /// @param _drTxHash The hash of the corresponding data request transaction in Witnet.
    /// @param _result The result itself as bytes.
    function reportResult(
            uint256 _queryId,
            bytes32 _drTxHash,
            bytes calldata _result
        ) external;

    /// Reports the Witnet-provided result to a previously posted request.
    /// @dev Fails if:
    /// @dev - called from unauthorized address;
    /// @dev - the `_queryId` is not in 'Posted' status.
    /// @dev - provided `_drTxHash` is zero;
    /// @dev - length of provided `_result` is zero.
    /// @param _queryId The unique query identifier
    /// @param _timestamp The timestamp of the solving tally transaction in Witnet.
    /// @param _drTxHash The hash of the corresponding data request transaction in Witnet.
    /// @param _result The result itself as bytes.
    function reportResult(
            uint256 _queryId,
            uint256 _timestamp,
            bytes32 _drTxHash,
            bytes calldata _result
        ) external;

    /// Reports Witnet-provided results to multiple requests within a single EVM tx.
    /// @dev Must emit a PostedResult event for every succesfully reported result.
    /// @param _batchResults Array of BatchResult structs, every one containing:
    ///         - unique query identifier;
    ///         - timestamp of the solving tally txs in Witnet. If zero is provided, EVM-timestamp will be used instead;
    ///         - hash of the corresponding data request tx at the Witnet side-chain level;
    ///         - data request result in raw bytes.
    /// @param _verbose If true, must emit a BatchReportError event for every failing report, if any. 
    function reportResultBatch(BatchResult[] calldata _batchResults, bool _verbose) external;
        
        struct BatchResult {
            uint256 queryId;
            uint256 timestamp;
            bytes32 drTxHash;
            bytes   cborBytes;
        }

        event BatchReportError(uint256 queryId, string reason);
}
// File: contracts\interfaces\IWitnetRequest.sol
/// @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: contracts\libs\Witnet.sol
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: contracts\interfaces\IWitnetRequestBoardRequestor.sol
/// @title Witnet Requestor Interface
/// @notice It defines how to interact with the Witnet Request Board in order to:
///   - request the execution of Witnet Radon scripts (data request);
///   - upgrade the resolution reward of any previously posted request, in case gas price raises in mainnet;
///   - read the result of any previously posted request, eventually reported by the Witnet DON.
///   - remove from storage all data related to past and solved data requests, and results.
/// @author The Witnet Foundation.
interface IWitnetRequestBoardRequestor {
    /// Retrieves a copy of all Witnet-provided data related to a previously posted request, removing the whole query from the WRB storage.
    /// @dev Fails if the `_queryId` is not in 'Reported' status, or called from an address different to
    /// @dev the one that actually posted the given request.
    /// @param _queryId The unique query identifier.
    function deleteQuery(uint256 _queryId) external returns (Witnet.Response memory);

    /// Requests the execution of the given Witnet Data Request in expectation that it will be relayed and solved by the Witnet DON.
    /// A reward amount is escrowed by the Witnet Request Board that will be transferred to the reporter who relays back the Witnet-provided 
    /// result to this request.
    /// @dev Fails if:
    /// @dev - provided reward is too low.
    /// @dev - provided script is zero address.
    /// @dev - provided script bytecode is empty.
    /// @param _addr The address of the IWitnetRequest contract that can provide the actual Data Request bytecode.
    /// @return _queryId An unique query identifier.
    function postRequest(IWitnetRequest _addr) external payable returns (uint256 _queryId);

    /// Increments the reward of a previously posted request by adding the transaction value to it.
    /// @dev Updates request `gasPrice` in case this method is called with a higher 
    /// @dev gas price value than the one used in previous calls to `postRequest` or
    /// @dev `upgradeReward`. 
    /// @dev Fails if the `_queryId` is not in 'Posted' status.
    /// @dev Fails also in case the request `gasPrice` is increased, and the new 
    /// @dev reward value gets below new recalculated threshold. 
    /// @param _queryId The unique query identifier.
    function upgradeReward(uint256 _queryId) external payable;
}
// File: contracts\interfaces\IWitnetRequestBoardView.sol
/// @title Witnet Request Board info interface.
/// @author The Witnet Foundation.
interface IWitnetRequestBoardView {
    /// Estimates the amount of reward we need to insert for a given gas price.
    /// @param _gasPrice The gas price for which we need to calculate the rewards.
    function estimateReward(uint256 _gasPrice) external view returns (uint256);

    /// Returns next query id to be generated by the Witnet Request Board.
    function getNextQueryId() external view returns (uint256);

    /// Gets the whole Query data contents, if any, no matter its current status.
    function getQueryData(uint256 _queryId) external view returns (Witnet.Query memory);

    /// Gets current status of given query.
    function getQueryStatus(uint256 _queryId) external view returns (Witnet.QueryStatus);

    /// Retrieves the whole Request record posted to the Witnet Request Board.
    /// @dev Fails if the `_queryId` is not valid or, if it has already been reported
    /// @dev or deleted.
    /// @param _queryId The unique identifier of a previously posted query.
    function readRequest(uint256 _queryId) external view returns (Witnet.Request memory);

    /// Retrieves the serialized bytecode of a previously posted Witnet Data Request.
    /// @dev Fails if the `_queryId` is not valid, or if the related script bytecode 
    /// @dev got changed after being posted. Returns empty array once it gets reported, 
    /// @dev or deleted.
    /// @param _queryId The unique query identifier.
    function readRequestBytecode(uint256 _queryId) external view returns (bytes memory);

    /// Retrieves the gas price that any assigned reporter will have to pay when reporting 
    /// result to a previously posted Witnet data request.
    /// @dev Fails if the `_queryId` is not valid or, if it has already been 
    /// @dev reported, or deleted. 
    /// @param _queryId The unique query identifie
    function readRequestGasPrice(uint256 _queryId) external view returns (uint256);

    /// Retrieves the reward currently set for the referred query.
    /// @dev Fails if the `_queryId` is not valid or, if it has already been 
    /// @dev reported, or deleted. 
    /// @param _queryId The unique query identifier.
    function readRequestReward(uint256 _queryId) external view returns (uint256);

    /// Retrieves the whole `Witnet.Response` record referred to a previously posted Witnet Data Request.
    /// @dev Fails if the `_queryId` is not in 'Reported' status.
    /// @param _queryId The unique query identifier.
    function readResponse(uint256 _queryId) external view returns (Witnet.Response memory);

    /// Retrieves the hash of the Witnet transaction hash that actually solved the referred query.
    /// @dev Fails if the `_queryId` is not in 'Reported' status.
    /// @param _queryId The unique query identifier.
    function readResponseDrTxHash(uint256 _queryId) external view returns (bytes32);    

    /// Retrieves the address that reported the result to a previously-posted request.
    /// @dev Fails if the `_queryId` is not in 'Reported' status.
    /// @param _queryId The unique query identifier.
    function readResponseReporter(uint256 _queryId) external view returns (address);

    /// Retrieves the Witnet-provided CBOR-bytes result of a previously posted request.
    /// @dev Fails if the `_queryId` is not in 'Reported' status.
    /// @param _queryId The unique query identifier.
    function readResponseResult(uint256 _queryId) external view returns (Witnet.Result memory);

    /// Retrieves the timestamp in which the result to the referred query was solved by the Witnet DON.
    /// @dev Fails if the `_queryId` is not in 'Reported' status.
    /// @param _queryId The unique query identifier.
    function readResponseTimestamp(uint256 _queryId) external view returns (uint256);
}
// File: contracts\interfaces\IWitnetRequestParser.sol
/// @title The Witnet interface for decoding Witnet-provided request to Data Requests.
/// This interface exposes functions to check for the success/failure of
/// a Witnet-provided result, as well as to parse and convert result into
/// Solidity types suitable to the application level. 
/// @author The Witnet Foundation.
interface IWitnetRequestParser {

    /// Decode raw CBOR bytes into a Witnet.Result instance.
    /// @param _cborBytes Raw bytes representing a CBOR-encoded value.
    /// @return A `Witnet.Result` instance.
    function resultFromCborBytes(bytes memory _cborBytes) external pure returns (Witnet.Result memory);

    /// Decode a CBOR value into a Witnet.Result instance.
    /// @param _cborValue An instance of `Witnet.CBOR`.
    /// @return A `Witnet.Result` instance.
    function resultFromCborValue(Witnet.CBOR memory _cborValue) external pure returns (Witnet.Result memory);

    /// Tell if a Witnet.Result is successful.
    /// @param _result An instance of Witnet.Result.
    /// @return `true` if successful, `false` if errored.
    function isOk(Witnet.Result memory _result) external pure returns (bool);

    /// Tell if a Witnet.Result is errored.
    /// @param _result An instance of Witnet.Result.
    /// @return `true` if errored, `false` if successful.
    function isError(Witnet.Result memory _result) external pure returns (bool);

    /// Decode a bytes value from a Witnet.Result as a `bytes` value.
    /// @param _result An instance of Witnet.Result.
    /// @return The `bytes` decoded from the Witnet.Result.
    function asBytes(Witnet.Result memory _result) external pure returns (bytes memory);

    /// Decode a bytes value from a Witnet.Result as a `bytes32` value.
    /// @param _result An instance of Witnet.Result.
    /// @return The `bytes32` decoded from the Witnet.Result.
    function asBytes32(Witnet.Result memory _result) external pure returns (bytes32);

    /// Decode an error code from a Witnet.Result as a member of `Witnet.ErrorCodes`.
    /// @param _result An instance of `Witnet.Result`.
    /// @return The `CBORValue.Error memory` decoded from the Witnet.Result.
    function asErrorCode(Witnet.Result memory _result) external pure returns (Witnet.ErrorCodes);


    /// Generate a suitable error message for a member of `Witnet.ErrorCodes` and its corresponding arguments.
    /// @dev WARN: Note that client contracts should wrap this function into a try-catch foreseing potential errors generated in this function
    /// @param _result An instance of `Witnet.Result`.
    /// @return A tuple containing the `CBORValue.Error memory` decoded from the `Witnet.Result`, plus a loggable error message.
    function asErrorMessage(Witnet.Result memory _result) external pure returns (Witnet.ErrorCodes, string memory);

    /// Decode a raw error from a `Witnet.Result` as a `uint64[]`.
    /// @param _result An instance of `Witnet.Result`.
    /// @return The `uint64[]` raw error as decoded from the `Witnet.Result`.
    function asRawError(Witnet.Result memory _result) external pure returns(uint64[] memory);

    /// Decode a boolean value from a Witnet.Result as an `bool` value.
    /// @param _result An instance of Witnet.Result.
    /// @return The `bool` decoded from the Witnet.Result.
    function asBool(Witnet.Result memory _result) external pure returns (bool);

    /// Decode a fixed16 (half-precision) numeric value from a Witnet.Result as an `int32` value.
    /// @dev Due to the lack of support for floating or fixed point arithmetic in the EVM, this method offsets all values.
    /// by 5 decimal orders so as to get a fixed precision of 5 decimal positions, which should be OK for most `fixed16`.
    /// use cases. In other words, the output of this method is 10,000 times the actual value, encoded into an `int32`.
    /// @param _result An instance of Witnet.Result.
    /// @return The `int128` decoded from the Witnet.Result.
    function asFixed16(Witnet.Result memory _result) external pure returns (int32);

    /// Decode an array of fixed16 values from a Witnet.Result as an `int128[]` value.
    /// @param _result An instance of Witnet.Result.
    /// @return The `int128[]` decoded from the Witnet.Result.
    function asFixed16Array(Witnet.Result memory _result) external pure returns (int32[] memory);

    /// Decode a integer numeric value from a Witnet.Result as an `int128` value.
    /// @param _result An instance of Witnet.Result.
    /// @return The `int128` decoded from the Witnet.Result.
    function asInt128(Witnet.Result memory _result) external pure returns (int128);

    /// Decode an array of integer numeric values from a Witnet.Result as an `int128[]` value.
    /// @param _result An instance of Witnet.Result.
    /// @return The `int128[]` decoded from the Witnet.Result.
    function asInt128Array(Witnet.Result memory _result) external pure returns (int128[] memory);

    /// Decode a string value from a Witnet.Result as a `string` value.
    /// @param _result An instance of Witnet.Result.
    /// @return The `string` decoded from the Witnet.Result.
    function asString(Witnet.Result memory _result) external pure returns (string memory);

    /// Decode an array of string values from a Witnet.Result as a `string[]` value.
    /// @param _result An instance of Witnet.Result.
    /// @return The `string[]` decoded from the Witnet.Result.
    function asStringArray(Witnet.Result memory _result) external pure returns (string[] memory);

    /// Decode a natural numeric value from a Witnet.Result as a `uint64` value.
    /// @param _result An instance of Witnet.Result.
    /// @return The `uint64` decoded from the Witnet.Result.
    function asUint64(Witnet.Result memory _result) external pure returns(uint64);

    /// Decode an array of natural numeric values from a Witnet.Result as a `uint64[]` value.
    /// @param _result An instance of Witnet.Result.
    /// @return The `uint64[]` decoded from the Witnet.Result.
    function asUint64Array(Witnet.Result memory _result) external pure returns (uint64[] memory);

}
// File: contracts\WitnetRequestBoard.sol
/// @title Witnet Request Board functionality base contract.
/// @author The Witnet Foundation.
abstract contract WitnetRequestBoard is
    IWitnetRequestBoardEvents,
    IWitnetRequestBoardReporter,
    IWitnetRequestBoardRequestor,
    IWitnetRequestBoardView,
    IWitnetRequestParser
{
    receive() external payable {
        revert("WitnetRequestBoard: no transfers accepted");
    }
}
// File: contracts\UsingWitnet.sol
/// @title The UsingWitnet contract
/// @dev Witnet-aware contracts can inherit from this contract in order to interact with Witnet.
/// @author The Witnet Foundation.
abstract contract UsingWitnet {

    WitnetRequestBoard public immutable witnet;

    /// Include an address to specify the WitnetRequestBoard entry point address.
    /// @param _wrb The WitnetRequestBoard entry point address.
    constructor(WitnetRequestBoard _wrb)
    {
        require(address(_wrb) != address(0), "UsingWitnet: zero address");
        witnet = _wrb;
    }

    /// Provides a convenient way for client contracts extending this to block the execution of the main logic of the
    /// contract until a particular request has been successfully solved and reported by Witnet.
    modifier witnetRequestSolved(uint256 _id) {
        require(
                _witnetCheckResultAvailability(_id),
                "UsingWitnet: request not solved"
            );
        _;
    }

    /// Check if a data request has been solved and reported by Witnet.
    /// @dev Contracts depending on Witnet should not start their main business logic (e.g. receiving value from third.
    /// parties) before this method returns `true`.
    /// @param _id The unique identifier of a previously posted data request.
    /// @return A boolean telling if the request has been already resolved or not. Returns `false` also, if the result was deleted.
    function _witnetCheckResultAvailability(uint256 _id)
        internal view
        virtual
        returns (bool)
    {
        return witnet.getQueryStatus(_id) == Witnet.QueryStatus.Reported;
    }

    /// Estimate the reward amount.
    /// @param _gasPrice The gas price for which we want to retrieve the estimation.
    /// @return The reward to be included when either posting a new request, or upgrading the reward of a previously posted one.
    function _witnetEstimateReward(uint256 _gasPrice)
        internal view
        virtual
        returns (uint256)
    {
        return witnet.estimateReward(_gasPrice);
    }

    /// Estimates the reward amount, considering current transaction gas price.
    /// @return The reward to be included when either posting a new request, or upgrading the reward of a previously posted one.
    function _witnetEstimateReward()
        internal view
        virtual
        returns (uint256)
    {
        return witnet.estimateReward(tx.gasprice);
    }

    /// Send a new request to the Witnet network with transaction value as a reward.
    /// @param _request An instance of `IWitnetRequest` contract.
    /// @return _id Sequential identifier for the request included in the WitnetRequestBoard.
    /// @return _reward Current reward amount escrowed by the WRB until a result gets reported.
    function _witnetPostRequest(IWitnetRequest _request)
        internal
        virtual
        returns (uint256 _id, uint256 _reward)
    {
        _reward = _witnetEstimateReward();
        require(
            _reward <= msg.value,
            "UsingWitnet: reward too low"
        );
        _id = witnet.postRequest{value: _reward}(_request);
    }

    /// Upgrade the reward for a previously posted request.
    /// @dev Call to `upgradeReward` function in the WitnetRequestBoard contract.
    /// @param _id The unique identifier of a request that has been previously sent to the WitnetRequestBoard.
    /// @return Amount in which the reward has been increased.
    function _witnetUpgradeReward(uint256 _id)
        internal
        virtual
        returns (uint256)
    {
        uint256 _currentReward = witnet.readRequestReward(_id);        
        uint256 _newReward = _witnetEstimateReward();
        uint256 _fundsToAdd = 0;
        if (_newReward > _currentReward) {
            _fundsToAdd = (_newReward - _currentReward);
        }
        witnet.upgradeReward{value: _fundsToAdd}(_id); // Let Request.gasPrice be updated
        return _fundsToAdd;
    }

    /// Read the Witnet-provided result to a previously posted request.
    /// @param _id The unique identifier of a request that was posted to Witnet.
    /// @return The result of the request as an instance of `Witnet.Result`.
    function _witnetReadResult(uint256 _id)
        internal view
        virtual
        returns (Witnet.Result memory)
    {
        return witnet.readResponseResult(_id);
    }

    /// Retrieves copy of all response data related to a previously posted request, removing the whole query from storage.
    /// @param _id The unique identifier of a previously posted request.
    /// @return The Witnet-provided result to the request.
    function _witnetDeleteQuery(uint256 _id)
        internal
        virtual
        returns (Witnet.Response memory)
    {
        return witnet.deleteQuery(_id);
    }

}
// File: contracts\interfaces\IWitnetRandomness.sol
/// @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 _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 _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\patterns\Initializable.sol
interface Initializable {
    /// @dev Initialize contract's storage context.
    function initialize(bytes calldata) external;
}
// File: contracts\patterns\Clonable.sol
abstract contract Clonable is Initializable {
    /// Immutable contract address that actually attends all calls to this contract.
    /// @dev Differs from `address(this)` when reached within a DELEGATECALL.
    address immutable public self = address(this);

    event Cloned(address indexed by, Clonable indexed self, Clonable indexed clone);

    /// Tells whether this contract is a clone of another (i.e. `self()`)
    function cloned()
        public view
        returns (bool)
    {
        return (
            address(this) != self
        );
    }

    /// Deploys and returns the address of a minimal proxy clone that replicates contract
    /// behaviour while using its own EVM storage.
    /// @dev This function should always provide a new address, no matter how many times 
    /// @dev is actually called from the same `msg.sender`.
    /// @dev See https://eips.ethereum.org/EIPS/eip-1167.
    /// @dev See https://blog.openzeppelin.com/deep-dive-into-the-minimal-proxy-contract/.
    function clone()
        public virtual
        returns (Clonable _instance)
    {
        address _self = self;
        assembly {
            // ptr to free mem:
            let ptr := mload(0x40)
            // begin minimal proxy construction bytecode:
            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
            // make minimal proxy delegate all calls to `self()`:
            mstore(add(ptr, 0x14), shl(0x60, _self))
            // end minimal proxy construction bytecode:
            mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
            // CREATE new instance:
            _instance := create(0, ptr, 0x37)
        }        
        require(address(_instance) != address(0), "Clonable: CREATE failed");
        emit Cloned(msg.sender, Clonable(self), _instance);
    }

    /// Deploys and returns the address of a minimal proxy clone that replicates contract 
    /// behaviour while using its own EVM storage.
    /// @dev This function uses the CREATE2 opcode and a `_salt` to deterministically deploy
    /// @dev the clone. Using the same `_salt` multiple times will revert, since
    /// @dev no contract can be deployed more than once at the same address.
    /// @dev See https://eips.ethereum.org/EIPS/eip-1167.
    /// @dev See https://blog.openzeppelin.com/deep-dive-into-the-minimal-proxy-contract/.
    function cloneDeterministic(bytes32 _salt)
        public virtual
        returns (Clonable _instance)
    {
        address _self = self;
        assembly {
            // ptr to free mem:
            let ptr := mload(0x40)
            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
            // make minimal proxy delegate all calls to `self()`:
            mstore(add(ptr, 0x14), shl(0x60, _self))
            // end minimal proxy construction bytecode:
            mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
            // CREATE2 new instance:
            _instance := create2(0, ptr, 0x37, _salt)
        }
        require(address(_instance) != address(0), "Clonable: CREATE2 failed");
        emit Cloned(msg.sender, Clonable(self), _instance);
    }
}
// File: contracts\patterns\Context.sol
/// @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).
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

    function _msgValue() internal view virtual returns (uint256) {
        return msg.value;
    }
}
// File: contracts\patterns\Ownable.sol
// OpenZeppelin Contracts v4.3.2 (access/Ownable.sol)



/// @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: contracts\patterns\Proxiable.sol
interface Proxiable {
    /// @dev Complying with EIP-1822: Universal Upgradable Proxy Standard (UUPS)
    /// @dev See https://eips.ethereum.org/EIPS/eip-1822.
    function proxiableUUID() external pure returns (bytes32);
}
// File: contracts\requests\WitnetRequestMalleableBase.sol
abstract contract WitnetRequestMalleableBase
    is
        IWitnetRequest,
        Clonable,
        Ownable,
        Proxiable
{   
    using Witnet for *;

    event WitnessingParamsChanged(
        address indexed by,
        uint8 numWitnesses,
        uint8 minWitnessingConsensus,
        uint64 witnssingCollateral,
        uint64 witnessingReward,
        uint64 witnessingUnitaryFee
    );

    struct WitnetRequestMalleableBaseContext {
        /// Contract owner address.
        address owner;
        /// Immutable bytecode template.
        bytes template;
        /// Current request bytecode.
        bytes bytecode;
        /// Current request hash.
        bytes32 hash;
        /// Current request witnessing params.
        WitnetRequestWitnessingParams params;
    }

    struct WitnetRequestWitnessingParams {
        /// Number of witnesses required to be involved for solving this Witnet Data Request.
        uint8 numWitnesses;

        /// Threshold percentage for aborting resolution of a request if the witnessing nodes did not arrive to a broad consensus.
        uint8 minWitnessingConsensus;

        /// Amount of nanowits that a witness solving the request will be required to collateralize in the commitment transaction.
        uint64 witnessingCollateral;

        /// Amount of nanowits that every request-solving witness will be rewarded with.
        uint64 witnessingReward;

        /// Amount of nanowits that will be earned by Witnet miners for each each valid commit/reveal transaction they include in a block.
        uint64 witnessingUnitaryFee;
    }

    /// Returns current Witnet Data Request bytecode, encoded using Protocol Buffers.
    function bytecode() external view override returns (bytes memory) {
        return _request().bytecode;
    }

    /// Returns SHA256 hash of current Witnet Data Request bytecode.
    function hash() external view override returns (bytes32) {
        return _request().hash;
    }

    /// Sets amount of nanowits that a witness solving the request will be required to collateralize in the commitment transaction.
    function setWitnessingCollateral(uint64 _witnessingCollateral)
        public
        virtual
        onlyOwner
    {
        WitnetRequestWitnessingParams storage _params = _request().params;
        _params.witnessingCollateral = _witnessingCollateral;
        _malleateBytecode(
            _params.numWitnesses,
            _params.minWitnessingConsensus,
            _witnessingCollateral,
            _params.witnessingReward,
            _params.witnessingUnitaryFee
        );
    }

    /// Specifies how much you want to pay for rewarding each of the Witnet nodes.
    /// @param _witnessingReward Amount of nanowits that every request-solving witness will be rewarded with.
    /// @param _witnessingUnitaryFee Amount of nanowits that will be earned by Witnet miners for each each valid 
    /// commit/reveal transaction they include in a block.
    function setWitnessingFees(uint64 _witnessingReward, uint64 _witnessingUnitaryFee)
        public
        virtual
        onlyOwner
    {
        WitnetRequestWitnessingParams storage _params = _request().params;
        _params.witnessingReward = _witnessingReward;
        _params.witnessingUnitaryFee = _witnessingUnitaryFee;
        _malleateBytecode(
            _params.numWitnesses,
            _params.minWitnessingConsensus,
            _params.witnessingCollateral,
            _witnessingReward,
            _witnessingUnitaryFee
        );
    }

    /// Sets how many Witnet nodes will be "hired" for resolving the request.
    /// @param _numWitnesses Number of witnesses required to be involved for solving this Witnet Data Request.
    /// @param _minWitnessingConsensus Threshold percentage for aborting resolution of a request if the witnessing 
    /// nodes did not arrive to a broad consensus.
    function setWitnessingQuorum(uint8 _numWitnesses, uint8 _minWitnessingConsensus)
        public
        virtual
        onlyOwner
    {
        WitnetRequestWitnessingParams storage _params = _request().params;
        _params.numWitnesses = _numWitnesses;
        _params.minWitnessingConsensus = _minWitnessingConsensus;
        _malleateBytecode(
            _numWitnesses,
            _minWitnessingConsensus,
            _params.witnessingCollateral,
            _params.witnessingReward,
            _params.witnessingUnitaryFee
        );
    }

    /// Returns immutable template bytecode: actual CBOR-encoded data request at the Witnet protocol
    /// level, including no witnessing parameters at all.
    function template()
        external view
        returns (bytes memory)
    {
        return _request().template;
    }

    /// Returns total amount of nanowits that witnessing nodes will need to collateralize all together.
    function totalWitnessingCollateral()
        external view
        returns (uint128)
    {
        WitnetRequestWitnessingParams storage _params = _request().params;
        return _params.numWitnesses * _params.witnessingCollateral;
    }

    /// Returns total amount of nanowits that will have to be paid in total for this request to be solved.
    function totalWitnessingFee()
        external view
        returns (uint128)
    {
        WitnetRequestWitnessingParams storage _params = _request().params;
        return _params.numWitnesses * (2 * _params.witnessingUnitaryFee + _params.witnessingReward);
    }

    /// Returns witnessing parameters of current Witnet Data Request.
    function witnessingParams()
        external view
        returns (WitnetRequestWitnessingParams memory)
    {
        return _request().params;
    }


    // ================================================================================================================
    // --- 'Clonable' overriden functions -----------------------------------------------------------------------------

    /// Deploys and returns the address of a minimal proxy clone that replicates contract
    /// behaviour while using its own EVM storage.
    /// @dev This function should always provide a new address, no matter how many times 
    /// @dev is actually called from the same `msg.sender`.
    function clone()
        public
        virtual override
        returns (Clonable _instance)
    {
        _instance = super.clone();
        _instance.initialize(_request().template);
        Ownable(address(_instance)).transferOwnership(msg.sender);
    }

    /// Deploys and returns the address of a minimal proxy clone that replicates contract 
    /// behaviour while using its own EVM storage.
    /// @dev This function uses the CREATE2 opcode and a `_salt` to deterministically deploy
    /// @dev the clone. Using the same `_salt` multiple time will revert, since
    /// @dev no contract can be deployed more than once at the same address.
    function cloneDeterministic(bytes32 _salt)
        public
        virtual override
        returns (Clonable _instance)
    {
        _instance = super.cloneDeterministic(_salt);
        _instance.initialize(_request().template);
        Ownable(address(_instance)).transferOwnership(msg.sender);
    }


    // ================================================================================================================
    // --- 'Initializable' overriden functions ------------------------------------------------------------------------

    /// @dev Initializes contract's storage context.
    function initialize(bytes memory _template)
        public
        virtual override
    {
        require(_request().template.length == 0, "WitnetRequestMalleableBase: already initialized");
        _initialize(_template);
        _transferOwnership(_msgSender());
    }

    // ================================================================================================================
    // --- 'Ownable' overriden functions ------------------------------------------------------------------------------

    /// Returns the address of the current owner.
    function owner()
        public view
        virtual override
        returns (address)
    {
        return _request().owner;
    }

    /// @dev Transfers ownership of the contract to a new account (`newOwner`).
    function _transferOwnership(address newOwner)
        internal
        virtual override
    {
        address oldOwner = _request().owner;
        _request().owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }

    // ================================================================================================================
    // --- 'Proxiable 'overriden functions ----------------------------------------------------------------------------

    /// @dev Complying with EIP-1822: Universal Upgradable Proxy Standard (UUPS)
    /// @dev See https://eips.ethereum.org/EIPS/eip-1822.
    function proxiableUUID()
        external pure
        virtual override
        returns (bytes32)
    {
        return (
            /* keccak256("io.witnet.requests.malleable") */
            0x851d0a92a3ad30295bef33afc69d6874779826b7789386b336e22621365ed2c2
        );
    }


    // ================================================================================================================
    // --- INTERNAL FUNCTIONS -----------------------------------------------------------------------------------------    

    /// @dev Initializes witnessing params and template bytecode.
    function _initialize(bytes memory _template)
        internal
    {
        assert(_template.length > 0);
        _request().template = _template;

        WitnetRequestWitnessingParams storage _params = _request().params;
        _params.numWitnesses = 2;
        _params.minWitnessingConsensus = 51;
        _params.witnessingCollateral = 10 ** 9;      // 1 WIT
        _params.witnessingReward = 5 * 10 ** 5;      // 0.5 milliWITs
        _params.witnessingUnitaryFee = 25 * 10 ** 4; // 0.25 milliWITs
        
        _malleateBytecode(
            _params.numWitnesses,
            _params.minWitnessingConsensus,
            _params.witnessingCollateral,
            _params.witnessingReward,
            _params.witnessingUnitaryFee
        );
    }

    /// @dev Serializes new `bytecode` by combining immutable template with given parameters.
    function _malleateBytecode(
            uint8 _numWitnesses,
            uint8 _minWitnessingConsensus,
            uint64 _witnessingCollateral,
            uint64 _witnessingReward,
            uint64 _witnessingUnitaryFee
        )
        internal
        virtual
    {
        require(
            _witnessingReward > 0,
            "WitnetRequestMalleableBase: no reward"
        );
        require(
            _numWitnesses >= 1 && _numWitnesses <= 127,
            "WitnetRequestMalleableBase: number of witnesses out of range"
        );
        require(
            _minWitnessingConsensus >= 51 && _minWitnessingConsensus <= 99,
            "WitnetRequestMalleableBase: witnessing consensus out of range"
        );
        require(
            _witnessingCollateral >= 10 ** 9,
            "WitnetRequestMalleableBase: witnessing collateral below 1 WIT"
        );

        _request().bytecode = abi.encodePacked(
            _request().template,
            _uint64varint(bytes1(0x10), _witnessingReward),
            _uint8varint(bytes1(0x18), _numWitnesses),
            _uint64varint(0x20, _witnessingUnitaryFee),
            _uint8varint(0x28, _minWitnessingConsensus),
            _uint64varint(0x30, _witnessingCollateral)
        );
        _request().hash = _request().bytecode.hash();
        emit WitnessingParamsChanged(
            msg.sender,
            _numWitnesses,
            _minWitnessingConsensus,
            _witnessingCollateral,
            _witnessingReward,
            _witnessingUnitaryFee
        );
    }

    /// @dev Returns pointer to storage slot where State struct is located.
    function _request()
        internal pure
        virtual
        returns (WitnetRequestMalleableBaseContext storage _ptr)
    {
        assembly {
            _ptr.slot :=
                /* keccak256("io.witnet.requests.malleable.context") */
                0x375930152e1d0d102998be6e496b0cee86c9ecd0efef01014ecff169b17dfba7
        }
    }

    /// @dev Encode uint64 into tagged varint.
    /// @dev See https://developers.google.com/protocol-buffers/docs/encoding#varints.
    /// @param t Tag
    /// @param n Number
    /// @return Marshaled bytes
    function _uint64varint(bytes1 t, uint64 n)
        internal pure
        returns (bytes memory)
    {
        // Count the number of groups of 7 bits
        // We need this pre-processing step since Solidity doesn't allow dynamic memory resizing
        uint64 tmp = n;
        uint64 numBytes = 2;
        while (tmp > 0x7F) {
            tmp = tmp >> 7;
            numBytes += 1;
        }
        bytes memory buf = new bytes(numBytes);
        tmp = n;
        buf[0] = t;
        for (uint64 i = 1; i < numBytes; i++) {
            // Set the first bit in the byte for each group of 7 bits
            buf[i] = bytes1(0x80 | uint8(tmp & 0x7F));
            tmp = tmp >> 7;
        }
        // Unset the first bit of the last byte
        buf[numBytes - 1] &= 0x7F;
        return buf;
    }

    /// @dev Encode uint8 into tagged varint.
    /// @param t Tag
    /// @param n Number
    /// @return Marshaled bytes
    function _uint8varint(bytes1 t, uint8 n)
        internal pure
        returns (bytes memory)
    {
        return _uint64varint(t, uint64(n));
    }
}
// File: contracts\requests\WitnetRequestRandomness.sol
contract WitnetRequestRandomness is WitnetRequestMalleableBase {
    bytes internal constant _WITNET_RANDOMNESS_BYTECODE_TEMPLATE = hex"0a0f120508021a01801a0210022202100b";

    constructor() {
        initialize(bytes(""));
    }

    function initialize(bytes memory)
        public
        virtual override
    {
        super.initialize(_WITNET_RANDOMNESS_BYTECODE_TEMPLATE);
    }
}
// File: contracts\apps\WitnetRandomness.sol
/// @title WitnetRandomness: A trustless randomness generator and registry, based on the Witnet oracle. 
/// @author Witnet Foundation.
contract WitnetRandomness
    is
        IWitnetRandomness,
        UsingWitnet,
        Clonable
{
    WitnetRequestRandomness public witnetRandomnessRequest;
    uint256 public override latestRandomizeBlock;

    mapping (uint256 => RandomizeData) internal __randomize_;
    struct RandomizeData {
        address from;
        uint256 prevBlock;
        uint256 nextBlock;
        uint256 witnetQueryId;
    }

    /// Include an address to specify the immutable WitnetRequestBoard entrypoint address.
    /// @param _wrb The WitnetRequestBoard immutable entrypoint address.
    constructor(WitnetRequestBoard _wrb)
        UsingWitnet(_wrb)
    {
        witnetRandomnessRequest = new WitnetRequestRandomness();
        witnetRandomnessRequest.transferOwnership(msg.sender);
    }

    /// 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)
        public view
        virtual override
        returns (uint256)
    {
        return _witnetEstimateReward(_gasPrice);
    }

    /// 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 _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
        virtual override
        returns (
            address _from,
            uint256 _id,
            uint256 _prevBlock,
            uint256 _nextBlock
        )
    {
        RandomizeData storage _data = __randomize_[_block];
        _id = _data.witnetQueryId;
        _from = _data.from;
        _prevBlock = _data.prevBlock;
        _nextBlock = _data.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)
        public view
        virtual override
        returns (bytes32)
    {
        if (__randomize_[_block].from == address(0)) {
            _block = getRandomnessNextBlock(_block);
        }
        uint256 _queryId = __randomize_[_block].witnetQueryId;
        require(_queryId != 0, "WitnetRandomness: not randomized");
        require(_witnetCheckResultAvailability(_queryId), "WitnetRandomness: pending randomize");
        Witnet.Result memory _witnetResult = _witnetReadResult(_queryId);
        if (witnet.isOk(_witnetResult)) {
            return witnet.asBytes32(_witnetResult);
        } else {
            uint256 _nextRandomizeBlock = __randomize_[_block].nextBlock;
            require(_nextRandomizeBlock != 0, "WitnetRandomness: faulty randomize");
            return getRandomnessAfter(_nextRandomizeBlock);
        }
    }

    /// 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)
        public view
        virtual override
        returns (uint256)
    {
        return ((__randomize_[_block].from != address(0))
            ? __randomize_[_block].nextBlock
            // start search from the latest block
            : _searchNextBlock(_block, latestRandomizeBlock)
        );
    }

    /// Gets previous block in which a randomness request was posted before the given one.
    /// @param _block Block number from which the search will start. Cannot be zero.
    /// @return First block found before the given one, or `0` otherwise.
    function getRandomnessPrevBlock(uint256 _block)
        public view
        virtual override
        returns (uint256)
    {
        assert(_block > 0);
        uint256 _latest = latestRandomizeBlock;
        return ((_block > _latest)
            ? _latest
            // start search from the latest block
            : _searchPrevBlock(_block, __randomize_[_latest].prevBlock)
        );
    }

    /// 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)
        public view
        virtual override
        returns (bool)
    {
        RandomizeData storage _data = __randomize_[_block];
        return (
            _data.witnetQueryId != 0 
                && _witnetCheckResultAvailability(_data.witnetQueryId)
        );
    }

    /// 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
        virtual override
        returns (uint32)
    {
        return random(
            _range,
            _nonce,
            keccak256(
                abi.encode(
                    msg.sender,
                    getRandomnessAfter(_block)
                )
            )
        );
    }

    /// 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)
        public pure
        virtual override
        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);
    }

    /// 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
        virtual override
        returns (uint256 _usedFunds)
    {
        if (latestRandomizeBlock < block.number) {
            // Post the Witnet Randomness request:
            uint _queryId;
            (_queryId, _usedFunds) = _witnetPostRequest(witnetRandomnessRequest);
            // Keep Randomize data in storage:
            RandomizeData storage _data = __randomize_[block.number];
            _data.witnetQueryId = _queryId;
            _data.from = msg.sender;
            // Update block links:
            uint256 _prevBlock = latestRandomizeBlock;
            _data.prevBlock = _prevBlock;
            __randomize_[_prevBlock].nextBlock = block.number;
            latestRandomizeBlock = block.number;
            // Throw event:
            emit Randomized(
                msg.sender,
                _prevBlock,
                _queryId,
                witnetRandomnessRequest.hash()
            );
            // Transfer back unused tx value:
            if (_usedFunds < msg.value) {
                payable(msg.sender).transfer(msg.value - _usedFunds);
            }
        } else {
            return upgradeRandomizeFee(block.number);
        }
    }

    /// 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)
        public payable
        virtual override
        returns (uint256 _usedFunds)
    {
        RandomizeData storage _data = __randomize_[_block];
        if (_data.witnetQueryId != 0) {
            _usedFunds = _witnetUpgradeReward(_data.witnetQueryId);
        }
        if (_usedFunds < msg.value) {
            payable(msg.sender).transfer(msg.value - _usedFunds);
        }
    }


    // ================================================================================================================
    // --- 'Clonable' overriden functions -----------------------------------------------------------------------------

    /// Deploys and returns the address of a minimal proxy clone that replicates contract
    /// behaviour while using its own EVM storage.
    /// @dev This function should always provide a new address, no matter how many times 
    /// @dev is actually called from the same `msg.sender`.
    function clone()
        public
        virtual override
        returns (Clonable _newInstance)
    {
        _newInstance = super.clone();
        _clone(_newInstance);
    }

    /// Deploys and returns the address of a minimal proxy clone that replicates contract 
    /// behaviour while using its own EVM storage.
    /// @dev This function uses the CREATE2 opcode and a `_salt` to deterministically deploy
    /// @dev the clone. Using the same `_salt` multiple time will revert, since
    /// @dev no contract can be deployed more than once at the same address.
    function cloneDeterministic(bytes32 _salt)
        public
        virtual override
        returns (Clonable _newInstance)
    {
        _newInstance = super.cloneDeterministic(_salt);
        _clone(_newInstance);
    }


    // ================================================================================================================
    // --- 'Initializable' overriden functions ------------------------------------------------------------------------

    /// @dev Initializes contract's storage context.
    function initialize(bytes memory _initData)
        public
        virtual override
    {
        require(address(witnetRandomnessRequest) == address(0), "WitnetRandomness: already initialized");
        witnetRandomnessRequest = WitnetRequestRandomness(
            abi.decode(
                _initData,
                (address)
            )
        );
    }


    // ================================================================================================================
    // --- INTERNAL FUNCTIONS -----------------------------------------------------------------------------------------

    /// @dev Common steps for both deterministic and non-deterministic cloning.
    function _clone(Clonable _instance) internal {
        address _request = address(witnetRandomnessRequest.clone());
        Ownable(_request).transferOwnership(msg.sender);
        _instance.initialize(abi.encode(_request));
    }

    /// @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
        ];
    }

    /// @dev Recursively searches for the number of the first block after the given one in which a Witnet randomization request was posted.
    /// @dev Returns 0 if none found.
    function _searchNextBlock(uint256 _target, uint256 _latest) internal view returns (uint256) {
        return ((_target >= _latest) 
            ? __randomize_[_latest].nextBlock
            : _searchNextBlock(_target, __randomize_[_latest].prevBlock)
        );
    }

    /// @dev Recursively searches for the number of the first block before the given one in which a Witnet randomization request was posted.
    /// @dev Returns 0 if none found.

    function _searchPrevBlock(uint256 _target, uint256 _latest) internal view returns (uint256) {
        return ((_target > _latest)
            ? _latest
            : _searchPrevBlock(_target, __randomize_[_latest].prevBlock)
        );
    }
}

Contract ABI

[{"inputs":[{"internalType":"contract WitnetRequestBoard","name":"_wrb","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"},{"indexed":true,"internalType":"contract Clonable","name":"self","type":"address"},{"indexed":true,"internalType":"contract Clonable","name":"clone","type":"address"}],"name":"Cloned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"uint256","name":"prevBlock","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"witnetQueryId","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"witnetRequestHash","type":"bytes32"}],"name":"Randomized","type":"event"},{"inputs":[],"name":"clone","outputs":[{"internalType":"contract Clonable","name":"_newInstance","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_salt","type":"bytes32"}],"name":"cloneDeterministic","outputs":[{"internalType":"contract Clonable","name":"_newInstance","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cloned","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_gasPrice","type":"uint256"}],"name":"estimateRandomizeFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_block","type":"uint256"}],"name":"getRandomizeData","outputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_prevBlock","type":"uint256"},{"internalType":"uint256","name":"_nextBlock","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_block","type":"uint256"}],"name":"getRandomnessAfter","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_block","type":"uint256"}],"name":"getRandomnessNextBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_block","type":"uint256"}],"name":"getRandomnessPrevBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_initData","type":"bytes"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_block","type":"uint256"}],"name":"isRandomized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestRandomizeBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_range","type":"uint32"},{"internalType":"uint256","name":"_nonce","type":"uint256"},{"internalType":"uint256","name":"_block","type":"uint256"}],"name":"random","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_range","type":"uint32"},{"internalType":"uint256","name":"_nonce","type":"uint256"},{"internalType":"bytes32","name":"_seed","type":"bytes32"}],"name":"random","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"randomize","outputs":[{"internalType":"uint256","name":"_usedFunds","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"self","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_block","type":"uint256"}],"name":"upgradeRandomizeFee","outputs":[{"internalType":"uint256","name":"_usedFunds","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"witnet","outputs":[{"internalType":"contract WitnetRequestBoard","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"witnetRandomnessRequest","outputs":[{"internalType":"contract WitnetRequestRandomness","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60c06040523060a0523480156200001557600080fd5b506040516200433f3803806200433f833981016040819052620000389162000150565b806001600160a01b038116620000945760405162461bcd60e51b815260206004820152601960248201527f5573696e675769746e65743a207a65726f206164647265737300000000000000604482015260640160405180910390fd5b6001600160a01b0316608052604051620000ae9062000142565b604051809103906000f080158015620000cb573d6000803e3d6000fd5b50600080546001600160a01b0319166001600160a01b0392909216918217905560405163f2fde38b60e01b815233600482015263f2fde38b90602401600060405180830381600087803b1580156200012257600080fd5b505af115801562000137573d6000803e3d6000fd5b505050505062000182565b6125128062001e2d83390190565b6000602082840312156200016357600080fd5b81516001600160a01b03811681146200017b57600080fd5b9392505050565b60805160a051611c236200020a60003960008181610253015281816102ca01528181610afa01528181610ba80152818161100701526110b601526000818161021701528181610954015281816109e601528181610e4101528181610ed101528181610f750152818161113d015281816111e30152818161144d01526114dc0152611c236000f3fe6080604052600436106101095760003560e01c80639938fd0c11610095578063a60ee26811610064578063a60ee26814610372578063daaa360c14610392578063e35329f8146103b2578063e7d4a016146103c5578063fb476cad146103e557600080fd5b80639938fd0c146102755780639bc86fec1461028b578063a04daef0146102bb578063a3252f68146102fa57600080fd5b806340b41daa116100dc57806340b41daa146101c3578063439fab91146101e357806346d1d21a14610205578063699b328a146102395780637104ddb21461024157600080fd5b806309ed46071461010e57806324cbbfc11461014057806336b651bb146101755780633b13e76e146101a3575b600080fd5b34801561011a57600080fd5b50610123610405565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561014c57600080fd5b5061016061015b366004611564565b61041d565b60405163ffffffff9091168152602001610137565b34801561018157600080fd5b50610195610190366004611599565b61046b565b604051908152602001610137565b3480156101af57600080fd5b50600054610123906001600160a01b031681565b3480156101cf57600080fd5b506101956101de366004611599565b6104b1565b3480156101ef57600080fd5b506102036101fe36600461166d565b6104f8565b005b34801561021157600080fd5b506101237f000000000000000000000000000000000000000000000000000000000000000081565b61019561059b565b34801561024d57600080fd5b506101237f000000000000000000000000000000000000000000000000000000000000000081565b34801561028157600080fd5b5061019560015481565b34801561029757600080fd5b506102ab6102a6366004611599565b610706565b6040519015158152602001610137565b3480156102c757600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163014156102ab565b34801561030657600080fd5b50610348610315366004611599565b600090815260026020819052604090912060038101548154600183015492909301546001600160a01b0390931693909290565b604080516001600160a01b0390951685526020850193909352918301526060820152608001610137565b34801561037e57600080fd5b5061019561038d366004611599565b61072f565b34801561039e57600080fd5b506101236103ad366004611599565b61073a565b6101956103c0366004611599565b610755565b3480156103d157600080fd5b506101606103e0366004611564565b6107c3565b3480156103f157600080fd5b50610195610400366004611599565b610844565b600061040f610adb565b905061041a81610c0a565b90565b600061046384843361042e86610844565b604080516001600160a01b039093166020840152820152606001604051602081830303815290604052805190602001206107c3565b949350505050565b600080821161047c5761047c6116ed565b6001548083116104a8576000818152600260205260409020600101546104a3908490610d5f565b6104aa565b805b9392505050565b6000818152600260205260408120546001600160a01b03166104de576104d982600154610d85565b6104f2565b600082815260026020819052604090912001545b92915050565b6000546001600160a01b0316156105645760405162461bcd60e51b815260206004820152602560248201527f5769746e657452616e646f6d6e6573733a20616c726561647920696e697469616044820152641b1a5e995960da1b60648201526084015b60405180910390fd5b808060200190518101906105789190611718565b600080546001600160a01b0319166001600160a01b039290921691909117905550565b60004360015410156106f857600080546105bd906001600160a01b0316610dc5565b4360008181526002602081815260408084206003810188905580546001600160a01b031916339081178255600180548184018190558088528488209096018890559690965593548151624dead360e51b81529151969950969750929591948594937faf291bb4e1767569c77502edb6ad1009e856f57c09f214886c6becc9836c20c09389936001600160a01b0391909116926309bd5a609260048082019392918290030181865afa158015610676573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069a9190611735565b6040805192835260208301919091520160405180910390a3348410156106f257336108fc6106c88634611764565b6040518115909202916000818181858888f193505050501580156106f0573d6000803e3d6000fd5b505b50505090565b61070143610755565b905090565b60008181526002602052604081206003810154158015906104aa57506104aa8160030154610eb7565b60006104f282610f5c565b600061074582610fe8565b905061075081610c0a565b919050565b600081815260026020526040812060038101541561077d5761077a816003015461111a565b91505b348210156107bd57336108fc6107938434611764565b6040518115909202916000818181858888f193505050501580156107bb573d6000803e3d6000fd5b505b50919050565b6000806107cf85611252565b6107da9060ff61177b565b9050600060016107eb836002611882565b6107f59190611764565b604080516020810187905290810187905260600160408051601f19818403018152919052805160209091012016905060ff821661083863ffffffff881683611891565b901c9695505050505050565b6000818152600260205260408120546001600160a01b031661086c57610869826104b1565b91505b600082815260026020526040812060030154908190036108ce5760405162461bcd60e51b815260206004820181905260248201527f5769746e657452616e646f6d6e6573733a206e6f742072616e646f6d697a6564604482015260640161055b565b6108d781610eb7565b61092f5760405162461bcd60e51b815260206004820152602360248201527f5769746e657452616e646f6d6e6573733a2070656e64696e672072616e646f6d604482015262697a6560e81b606482015260840161055b565b600061093a826113e1565b604051635430260d60e11b81529091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063a8604c1a9061098990849060040161190c565b602060405180830381865afa1580156109a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ca91906119ce565b15610a5c5760405163cf62d11560e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063cf62d11590610a1b90849060040161190c565b602060405180830381865afa158015610a38573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104639190611735565b60008481526002602081905260408220015490819003610ac95760405162461bcd60e51b815260206004820152602260248201527f5769746e657452616e646f6d6e6573733a206661756c74792072616e646f6d696044820152617a6560f01b606482015260840161055b565b610ad281610844565b95945050505050565b604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81527f0000000000000000000000000000000000000000000000000000000000000000606081901b60148301526e5af43d82803e903d91602b57fd5bf360881b602883015260009160378184f09250506001600160a01b038216610b9c5760405162461bcd60e51b815260206004820152601760248201527f436c6f6e61626c653a20435245415445206661696c6564000000000000000000604482015260640161055b565b816001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316336001600160a01b03167ff376596be5039d6b2fb36fead4c8a370eae426e790a869be8db074ab608cc24860405160405180910390a45090565b60008060009054906101000a90046001600160a01b03166001600160a01b03166309ed46076040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610c60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c849190611718565b60405163f2fde38b60e01b81523360048201529091506001600160a01b0382169063f2fde38b90602401600060405180830381600087803b158015610cc857600080fd5b505af1158015610cdc573d6000803e3d6000fd5b5050604080516001600160a01b0385811660208301528616935063439fab919250016040516020818303038152906040526040518263ffffffff1660e01b8152600401610d2991906119e9565b600060405180830381600087803b158015610d4357600080fd5b505af1158015610d57573d6000803e3d6000fd5b505050505050565b60008183116107bd576000828152600260205260409020600101546104a3908490610d5f565b600081831015610dac576000828152600260205260409020600101546104a3908490610d85565b5060009081526002602081905260409091200154919050565b600080610dd06114c4565b905034811115610e225760405162461bcd60e51b815260206004820152601b60248201527f5573696e675769746e65743a2072657761726420746f6f206c6f770000000000604482015260640161055b565b60405163b281a7bd60e01b81526001600160a01b0384811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063b281a7bd90839060240160206040518083038185885af1158015610e8b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610eb09190611735565b9150915091565b60006002604051631bc1eaf360e21b8152600481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636f07abcc90602401602060405180830381865afa158015610f20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f449190611a12565b6003811115610f5557610f556119fc565b1492915050565b60405163d2e8756160e01b8152600481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d2e8756190602401602060405180830381865afa158015610fc4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f29190611735565b604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81527f0000000000000000000000000000000000000000000000000000000000000000606081901b60148301526e5af43d82803e903d91602b57fd5bf360881b60288301526000918360378285f59250506001600160a01b0382166110aa5760405162461bcd60e51b815260206004820152601860248201527f436c6f6e61626c653a2043524541544532206661696c65640000000000000000604482015260640161055b565b816001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316336001600160a01b03167ff376596be5039d6b2fb36fead4c8a370eae426e790a869be8db074ab608cc24860405160405180910390a450919050565b604051631dd27daf60e01b81526004810182905260009081906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631dd27daf90602401602060405180830381865afa158015611184573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a89190611735565b905060006111b46114c4565b90506000828211156111cd576111ca8383611764565b90505b6040516366bfdc7560e01b8152600481018690527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906366bfdc759083906024016000604051808303818588803b15801561123057600080fd5b505af1158015611244573d6000803e3d6000fd5b509398975050505050505050565b60408051610400810182526000808252600960208301526001928201839052600a6060830152600d6080830152601560a0830152600260c08301819052601d60e0840152600b610100840152600e610120840152601061014084018190526012610160850152601661018085015260196101a085015260036101c0850152601e6101e085015260086102008501819052600c6102208601526014610240860152601c610260860152600f61028086015260116102a086015260186102c086015260076102e08601526013610300860152601b610320860181905260176103408701526006610360870152601a61038087015260056103a087015260046103c08701819052601f6103e08801529688901c637fffffff1680891763ffffffff998a1690911790941c939093179586901c630fffffff1680871796881617901c949094179384901c61ffff1680851795929484936113b7926307c4acdd9290911617611891565b63ffffffff16901c63ffffffff16602081106113d5576113d5611a33565b60200201519392505050565b6114376040805180820182526000808252825161010081018452606060c0820181815260e083018490528252602082810184905294820183905281018290526080810182905260a0810191909152909182015290565b6040516335369a6b60e21b8152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d4da69ac90602401600060405180830381865afa15801561149c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104f29190810190611a72565b60405163d2e8756160e01b81523a60048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d2e8756190602401602060405180830381865afa15801561152b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107019190611735565b63ffffffff8116811461156157600080fd5b50565b60008060006060848603121561157957600080fd5b83356115848161154f565b95602085013595506040909401359392505050565b6000602082840312156115ab57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156115eb576115eb6115b2565b60405290565b60405160c0810167ffffffffffffffff811182821017156115eb576115eb6115b2565b604051601f8201601f1916810167ffffffffffffffff8111828210171561163d5761163d6115b2565b604052919050565b600067ffffffffffffffff82111561165f5761165f6115b2565b50601f01601f191660200190565b60006020828403121561167f57600080fd5b813567ffffffffffffffff81111561169657600080fd5b8201601f810184136116a757600080fd5b80356116ba6116b582611645565b611614565b8181528560208385010111156116cf57600080fd5b81602084016020830137600091810160200191909152949350505050565b634e487b7160e01b600052600160045260246000fd5b6001600160a01b038116811461156157600080fd5b60006020828403121561172a57600080fd5b81516104aa81611703565b60006020828403121561174757600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156117765761177661174e565b500390565b600060ff821660ff8416808210156117955761179561174e565b90039392505050565b600181815b808511156117d95781600019048211156117bf576117bf61174e565b808516156117cc57918102915b93841c93908002906117a3565b509250929050565b6000826117f0575060016104f2565b816117fd575060006104f2565b8160018114611813576002811461181d57611839565b60019150506104f2565b60ff84111561182e5761182e61174e565b50506001821b6104f2565b5060208310610133831016604e8410600b841016171561185c575081810a6104f2565b611866838361179e565b806000190482111561187a5761187a61174e565b029392505050565b60006104aa60ff8416836117e1565b60008160001904831182151516156118ab576118ab61174e565b500290565b60005b838110156118cb5781810151838201526020016118b3565b838111156118da576000848401525b50505050565b600081518084526118f88160208601602086016118b0565b601f01601f19169290920160200192915050565b6020815281511515602082015260006020830151604080840152805160c06060850152805160406101208601526119476101608601826118e0565b60209283015163ffffffff166101408701529183015160ff81166080870152919050604083015160ff811660a08701529150606083015160ff811660c08701529150608083015167ffffffffffffffff811660e0870152915060a08301519250610ad261010086018467ffffffffffffffff169052565b8051801515811461075057600080fd5b6000602082840312156119e057600080fd5b6104aa826119be565b6020815260006104aa60208301846118e0565b634e487b7160e01b600052602160045260246000fd5b600060208284031215611a2457600080fd5b8151600481106104aa57600080fd5b634e487b7160e01b600052603260045260246000fd5b805160ff8116811461075057600080fd5b805167ffffffffffffffff8116811461075057600080fd5b60006020808385031215611a8557600080fd5b825167ffffffffffffffff80821115611a9d57600080fd5b9084019060408287031215611ab157600080fd5b611ab96115c8565b611ac2836119be565b81528383015182811115611ad557600080fd5b929092019160c08388031215611aea57600080fd5b611af26115f1565b835183811115611b0157600080fd5b84016040818a031215611b1357600080fd5b611b1b6115c8565b815185811115611b2a57600080fd5b82019450601f85018a13611b3d57600080fd5b8451611b4b6116b582611645565b8181528b89838901011115611b5f57600080fd5b611b6e828a83018b8a016118b0565b825250818701519450611b808561154f565b808701859052825250611b94848601611a49565b85820152611ba460408501611a49565b6040820152611bb560608501611a49565b6060820152611bc660808501611a5a565b6080820152611bd760a08501611a5a565b60a082015293810193909352509094935050505056fea2646970667358221220fd4e7d6a695b0e9d32b1687fde473adb5609700cbfd77e53074c2093a89bc78c64736f6c634300080d003360a0604052306080523480156200001557600080fd5b50620000213362000041565b6040805160208101909152600081526200003b90620000a1565b62000b52565b600080516020620024d283398151915280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620000e0604051806040016040528060118152602001700a0f120508021a01801a0210022202100b60781b815250620000e360201b6200099b1760201c565b50565b600080516020620024f283398151915280546200010090620008ee565b1590506200016d5760405162461bcd60e51b815260206004820152602f60248201527f5769746e6574526571756573744d616c6c6561626c65426173653a20616c726560448201526e18591e481a5b9a5d1a585b1a5e9959608a1b60648201526084015b60405180910390fd5b620001788162000183565b620000e03362000041565b60008151116200019757620001976200092a565b8051620001ba90600080516020620024f283398151915290602084019062000848565b507f375930152e1d0d102998be6e496b0cee86c9ecd0efef01014ecff169b17dfbab80546001600160d01b0319167403d090000000000007a120000000003b9aca00330217808255620002449060029060ff610100820416906001600160401b036201000082048116916a01000000000000000000008104821691600160901b9091041662000248565b5050565b6000826001600160401b031611620002b15760405162461bcd60e51b815260206004820152602560248201527f5769746e6574526571756573744d616c6c6561626c65426173653a206e6f2072604482015264195dd85c9960da1b606482015260840162000164565b60018560ff1610158015620002ca5750607f8560ff1611155b6200033e5760405162461bcd60e51b815260206004820152603c60248201527f5769746e6574526571756573744d616c6c6561626c65426173653a206e756d6260448201527f6572206f66207769746e6573736573206f7574206f662072616e676500000000606482015260840162000164565b60338460ff161015801562000357575060638460ff1611155b620003ba5760405162461bcd60e51b815260206004820152603d6024820152600080516020620024b283398151915260448201527f657373696e6720636f6e73656e737573206f7574206f662072616e6765000000606482015260840162000164565b633b9aca00836001600160401b031610156200042e5760405162461bcd60e51b815260206004820152603d6024820152600080516020620024b283398151915260448201527f657373696e6720636f6c6c61746572616c2062656c6f77203120574954000000606482015260840162000164565b600080516020620024f28339815191526200044e600160fc1b846200061e565b6200045e600360fb1b88620007d3565b6200046e600160fd1b856200061e565b6200047e600560fb1b89620007d3565b6200048e600360fc1b896200061e565b604051602001620004a5969594939291906200097e565b60408051601f198184030181529190528051620004ea917f375930152e1d0d102998be6e496b0cee86c9ecd0efef01014ecff169b17dfba99160209091019062000848565b50620005a4600080516020620024d283398151915260020180546200050f90620008ee565b80601f01602080910402602001604051908101604052809291908181526020018280546200053d90620008ee565b80156200058e5780601f1062000562576101008083540402835291602001916200058e565b820191906000526020600020905b8154815290600101906020018083116200057057829003601f168201915b5050505050620007eb60201b62000a2a1760201c565b600080516020620024d2833981519152600301556040805160ff8781168252861660208201526001600160401b0385811682840152848116606083015283166080820152905133917f897a395aeb2699d9730b6377870654a5c371d6bb6dc4486cfc5c80eeafd095b0919081900360a00190a25050505050565b60608160025b607f826001600160401b031611156200065e576007826001600160401b0316901c915060018162000656919062000a74565b905062000624565b6000816001600160401b03166001600160401b0381111562000684576200068462000aa2565b6040519080825280601f01601f191660200182016040528015620006af576020820181803683370190505b5090508492508581600081518110620006cc57620006cc62000ab8565b60200101906001600160f81b031916908160001a90535060015b826001600160401b0316816001600160401b03161015620007665783607f1660801760f81b82826001600160401b03168151811062000729576200072962000ab8565b60200101906001600160f81b031916908160001a9053506007846001600160401b0316901c935080806200075d9062000ace565b915050620006e6565b50607f60f81b816200077a60018562000aff565b6001600160401b03168151811062000796576200079662000ab8565b0160200180519091167fff000000000000000000000000000000000000000000000000000000000000001690600082901a90535095945050505050565b6060620007e48360ff84166200061e565b9392505050565b6000600282604051620007ff919062000b2a565b602060405180830381855afa1580156200081d573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525081019062000842919062000b38565b92915050565b8280546200085690620008ee565b90600052602060002090601f0160209004810192826200087a5760008555620008c5565b82601f106200089557805160ff1916838001178555620008c5565b82800160010185558215620008c5579182015b82811115620008c5578251825591602001919060010190620008a8565b50620008d3929150620008d7565b5090565b5b80821115620008d35760008155600101620008d8565b600181811c908216806200090357607f821691505b6020821081036200092457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052600160045260246000fd5b6000815160005b8181101562000963576020818501810151868301520162000947565b8181111562000973576000828601525b509290920192915050565b600080885481600182811c9150808316806200099b57607f831692505b60208084108203620009bb57634e487b7160e01b86526022600452602486fd5b818015620009d25760018114620009e45762000a13565b60ff1986168952848901965062000a13565b60008f81526020902060005b8681101562000a0b5781548b820152908501908301620009f0565b505084890196505b50505050505062000a5162000a4a62000a4362000a3c62000a35858d62000940565b8b62000940565b8962000940565b8762000940565b8562000940565b9998505050505050505050565b634e487b7160e01b600052601160045260246000fd5b60006001600160401b0382811684821680830382111562000a995762000a9962000a5e565b01949350505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60006001600160401b038281166002600160401b0319810162000af55762000af562000a5e565b6001019392505050565b60006001600160401b038381169083168181101562000b225762000b2262000a5e565b039392505050565b6000620007e4828462000940565b60006020828403121562000b4b57600080fd5b5051919050565b60805161192162000b916000396000818161020c0152818161027501528181610ac501528181610b730152818161100101526110b001526119216000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c80638da5cb5b116100a2578063daaa360c11610071578063daaa360c146102c7578063ef53d97a146102da578063f0940002146102e2578063f2fde38b146102ea578063ff21c3ba146102fd57600080fd5b80638da5cb5b1461025f578063a04daef014610267578063d196c2e3146102a1578063d9b9a961146102b457600080fd5b806352d1902d116100e957806352d1902d146101cc5780636f2ddd93146101f25780637104ddb214610207578063715018a61461022e5780638a481dad1461023657600080fd5b806309bd5a601461011b57806309ed460714610136578063439fab911461015657806348f9b8311461016b575b600080fd5b610123610310565b6040519081526020015b60405180910390f35b61013e610323565b6040516001600160a01b03909116815260200161012d565b6101696101643660046113ff565b6103f3565b005b610173610428565b60405161012d9190600060a08201905060ff835116825260ff602084015116602083015260408301516001600160401b038082166040850152806060860151166060850152806080860151166080850152505092915050565b7f851d0a92a3ad30295bef33afc69d6874779826b7789386b336e22621365ed2c2610123565b6101fa6104b5565b60405161012d91906114df565b61013e7f000000000000000000000000000000000000000000000000000000000000000081565b610169610550565b61023e610594565b6040516fffffffffffffffffffffffffffffffff909116815260200161012d565b61013e6105f5565b604051306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415815260200161012d565b6101696102af366004611528565b61060e565b6101696102c2366004611572565b61069d565b61013e6102d536600461158d565b610739565b61023e61080c565b6101fa61083b565b6101696102f83660046115a6565b610853565b61016961030b3660046115cf565b6108f0565b600061031a610a82565b60030154905090565b600061032d610aa6565b9050806001600160a01b031663439fab91610346610a82565b6001016040518263ffffffff1660e01b81526004016103659190611633565b600060405180830381600087803b15801561037f57600080fd5b505af1158015610393573d6000803e3d6000fd5b505060405163f2fde38b60e01b81523360048201526001600160a01b038416925063f2fde38b9150602401600060405180830381600087803b1580156103d857600080fd5b505af11580156103ec573d6000803e3d6000fd5b5050505090565b610425604051806040016040528060118152602001700a0f120508021a01801a0210022202100b60781b81525061099b565b50565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915261045b610a82565b6040805160a0810182526004929092015460ff808216845261010082041660208401526001600160401b03620100008204811692840192909252600160501b810482166060840152600160901b9004166080820152919050565b60606104bf610a82565b60010180546104cd906115f9565b80601f01602080910402602001604051908101604052809291908181526020018280546104f9906115f9565b80156105465780601f1061051b57610100808354040283529160200191610546565b820191906000526020600020905b81548152906001019060200180831161052957829003601f168201915b5050505050905090565b336105596105f5565b6001600160a01b0316146105885760405162461bcd60e51b815260040161057f906116b8565b60405180910390fd5b6105926000610bd5565b565b60008061059f610a82565b60040180549091506001600160401b03600160501b82048116916105cd91600160901b909104166002611703565b6105d79190611732565b81546105e6919060ff16611703565b6001600160401b031691505090565b60006105ff610a82565b546001600160a01b0316919050565b336106176105f5565b6001600160a01b03161461063d5760405162461bcd60e51b815260040161057f906116b8565b6000610647610a82565b600401805460ff8481166101000261ffff19909216908616171780825590915061069890849084906001600160401b03620100008204811691600160501b8104821691600160901b90910416610c42565b505050565b336106a66105f5565b6001600160a01b0316146106cc5760405162461bcd60e51b815260040161057f906116b8565b60006106d6610a82565b60040180546001600160401b03808516620100000269ffffffffffffffff000019831681178085559394506107359360ff91821693821693909317926101008104909116918691600160501b8104821691600160901b90910416610c42565b5050565b600061074482610fe2565b9050806001600160a01b031663439fab9161075d610a82565b6001016040518263ffffffff1660e01b815260040161077c9190611633565b600060405180830381600087803b15801561079657600080fd5b505af11580156107aa573d6000803e3d6000fd5b505060405163f2fde38b60e01b81523360048201526001600160a01b038416925063f2fde38b9150602401600060405180830381600087803b1580156107ef57600080fd5b505af1158015610803573d6000803e3d6000fd5b50505050919050565b600080610817610a82565b60040180549091506105e6906001600160401b03620100008204169060ff16611703565b6060610845610a82565b60020180546104cd906115f9565b3361085c6105f5565b6001600160a01b0316146108825760405162461bcd60e51b815260040161057f906116b8565b6001600160a01b0381166108e75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161057f565b61042581610bd5565b336108f96105f5565b6001600160a01b03161461091f5760405162461bcd60e51b815260040161057f906116b8565b6000610929610a82565b60040180546fffffffffffffffffffffffffffffffff60501b1916600160501b6001600160401b038681169190910267ffffffffffffffff60901b191691909117600160901b85831602178083559192506106989160ff80821692610100830490911691620100009004168686610c42565b6109a3610a82565b60010180546109b1906115f9565b159050610a185760405162461bcd60e51b815260206004820152602f60248201527f5769746e6574526571756573744d616c6c6561626c65426173653a20616c726560448201526e18591e481a5b9a5d1a585b1a5e9959608a1b606482015260840161057f565b610a2181611114565b61042533610bd5565b6000600282604051610a3c9190611779565b602060405180830381855afa158015610a59573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610a7c9190611795565b92915050565b7f375930152e1d0d102998be6e496b0cee86c9ecd0efef01014ecff169b17dfba790565b604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81527f0000000000000000000000000000000000000000000000000000000000000000606081901b60148301526e5af43d82803e903d91602b57fd5bf360881b602883015260009160378184f09250506001600160a01b038216610b675760405162461bcd60e51b815260206004820152601760248201527f436c6f6e61626c653a20435245415445206661696c6564000000000000000000604482015260640161057f565b816001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316336001600160a01b03167ff376596be5039d6b2fb36fead4c8a370eae426e790a869be8db074ab608cc24860405160405180910390a45090565b6000610bdf610a82565b546001600160a01b0316905081610bf4610a82565b80546001600160a01b0319166001600160a01b03928316179055604051838216918316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000826001600160401b031611610ca95760405162461bcd60e51b815260206004820152602560248201527f5769746e6574526571756573744d616c6c6561626c65426173653a206e6f2072604482015264195dd85c9960da1b606482015260840161057f565b60018560ff1610158015610cc15750607f8560ff1611155b610d335760405162461bcd60e51b815260206004820152603c60248201527f5769746e6574526571756573744d616c6c6561626c65426173653a206e756d6260448201527f6572206f66207769746e6573736573206f7574206f662072616e676500000000606482015260840161057f565b60338460ff1610158015610d4b575060638460ff1611155b610dbd5760405162461bcd60e51b815260206004820152603d60248201527f5769746e6574526571756573744d616c6c6561626c65426173653a207769746e60448201527f657373696e6720636f6e73656e737573206f7574206f662072616e6765000000606482015260840161057f565b633b9aca00836001600160401b03161015610e405760405162461bcd60e51b815260206004820152603d60248201527f5769746e6574526571756573744d616c6c6561626c65426173653a207769746e60448201527f657373696e6720636f6c6c61746572616c2062656c6f77203120574954000000606482015260840161057f565b610e48610a82565b600101610e59600160fc1b846111b4565b610e67600360fb1b8861133a565b610e75600160fd1b856111b4565b610e83600560fb1b8961133a565b610e91600360fc1b896111b4565b604051602001610ea6969594939291906117ae565b604051602081830303815290604052610ebd610a82565b6002019080519060200190610ed3929190611350565b50610f70610edf610a82565b6002018054610eed906115f9565b80601f0160208091040260200160405190810160405280929190818152602001828054610f19906115f9565b8015610f665780601f10610f3b57610100808354040283529160200191610f66565b820191906000526020600020905b815481529060010190602001808311610f4957829003601f168201915b5050505050610a2a565b610f78610a82565b600301556040805160ff8781168252861660208201526001600160401b0385811682840152848116606083015283166080820152905133917f897a395aeb2699d9730b6377870654a5c371d6bb6dc4486cfc5c80eeafd095b0919081900360a00190a25050505050565b604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81527f0000000000000000000000000000000000000000000000000000000000000000606081901b60148301526e5af43d82803e903d91602b57fd5bf360881b60288301526000918360378285f59250506001600160a01b0382166110a45760405162461bcd60e51b815260206004820152601860248201527f436c6f6e61626c653a2043524541544532206661696c65640000000000000000604482015260640161057f565b816001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316336001600160a01b03167ff376596be5039d6b2fb36fead4c8a370eae426e790a869be8db074ab608cc24860405160405180910390a450919050565b600081511161112557611125611871565b8061112e610a82565b6001019080519060200190611144929190611350565b50600061114f610a82565b60040180546001600160d01b0319167403d090000000000007a120000000003b9aca003302178082559091506107359060029060ff610100820416906001600160401b03620100008204811691600160501b8104821691600160901b90910416610c42565b60608160025b607f826001600160401b031611156111f0576007826001600160401b0316901c91506001816111e99190611732565b90506111ba565b6000816001600160401b03166001600160401b03811115611213576112136113e9565b6040519080825280601f01601f19166020018201604052801561123d576020820181803683370190505b509050849250858160008151811061125757611257611887565b60200101906001600160f81b031916908160001a90535060015b826001600160401b0316816001600160401b031610156112ea5783607f1660801760f81b82826001600160401b0316815181106112b0576112b0611887565b60200101906001600160f81b031916908160001a9053506007846001600160401b0316901c935080806112e29061189d565b915050611271565b50607f60f81b816112fc6001856118c3565b6001600160401b03168151811061131557611315611887565b0160200180519091166001600160f81b03191690600082901a90535095945050505050565b6060611349838360ff166111b4565b9392505050565b82805461135c906115f9565b90600052602060002090601f01602090048101928261137e57600085556113c4565b82601f1061139757805160ff19168380011785556113c4565b828001600101855582156113c4579182015b828111156113c45782518255916020019190600101906113a9565b506113d09291506113d4565b5090565b5b808211156113d057600081556001016113d5565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561141157600080fd5b81356001600160401b038082111561142857600080fd5b818401915084601f83011261143c57600080fd5b81358181111561144e5761144e6113e9565b604051601f8201601f19908116603f01168101908382118183101715611476576114766113e9565b8160405282815287602084870101111561148f57600080fd5b826020860160208301376000928101602001929092525095945050505050565b60005b838110156114ca5781810151838201526020016114b2565b838111156114d9576000848401525b50505050565b60208152600082518060208401526114fe8160408501602087016114af565b601f01601f19169190910160400192915050565b803560ff8116811461152357600080fd5b919050565b6000806040838503121561153b57600080fd5b61154483611512565b915061155260208401611512565b90509250929050565b80356001600160401b038116811461152357600080fd5b60006020828403121561158457600080fd5b6113498261155b565b60006020828403121561159f57600080fd5b5035919050565b6000602082840312156115b857600080fd5b81356001600160a01b038116811461134957600080fd5b600080604083850312156115e257600080fd5b6115eb8361155b565b91506115526020840161155b565b600181811c9082168061160d57607f821691505b60208210810361162d57634e487b7160e01b600052602260045260246000fd5b50919050565b6000602080835260008454611647816115f9565b80848701526040600180841660008114611668576001811461167c576116aa565b60ff198516898401526060890195506116aa565b896000528660002060005b858110156116a25781548b8201860152908301908801611687565b8a0184019650505b509398975050505050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60006001600160401b0380831681851681830481118215151615611729576117296116ed565b02949350505050565b60006001600160401b03808316818516808303821115611754576117546116ed565b01949350505050565b6000815161176f8185602086016114af565b9290920192915050565b6000825161178b8184602087016114af565b9190910192915050565b6000602082840312156117a757600080fd5b5051919050565b60008088546117bc816115f9565b600182811680156117d457600181146117e557611814565b60ff19841687528287019450611814565b8c60005260208060002060005b8581101561180b5781548a8201529084019082016117f2565b50505082870194505b505050508751611828818360208c016114af565b875191019061183b818360208b016114af565b865191019061184e818360208a016114af565b61186361185d8284018861175d565b8661175d565b9a9950505050505050505050565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60006001600160401b038083168181036118b9576118b96116ed565b6001019392505050565b60006001600160401b03838116908316818110156118e3576118e36116ed565b03939250505056fea26469706673582212205943fda928d9797a57fbfeb2fbe394b9effb985c8d15fd786027603b66eb768164736f6c634300080d00335769746e6574526571756573744d616c6c6561626c65426173653a207769746e375930152e1d0d102998be6e496b0cee86c9ecd0efef01014ecff169b17dfba7375930152e1d0d102998be6e496b0cee86c9ecd0efef01014ecff169b17dfba800000000000000000000000058d8ece142c60f5707594a7c1d90e46eae5af431

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

00000000000000000000000058d8ece142c60f5707594a7c1d90e46eae5af431

-----Decoded View---------------
Arg [0] : _wrb (address): 0x58d8ece142c60f5707594a7c1d90e46eae5af431

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000058d8ece142c60f5707594a7c1d90e46eae5af431


Deployed ByteCode Sourcemap

61384:14693:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;72437:183;;;;;;;;;;;;;:::i;:::-;;;-1:-1:-1;;;;;195:32:1;;;177:51;;165:2;150:18;72437:183:0;;;;;;;;67831:397;;;;;;;;;;-1:-1:-1;67831:397:0;;;;;:::i;:::-;;:::i;:::-;;;925:10:1;913:23;;;895:42;;883:2;868:18;67831:397:0;751:192:1;66326:408:0;;;;;;;;;;-1:-1:-1;66326:408:0;;;;;:::i;:::-;;:::i;:::-;;;1279:25:1;;;1267:2;1252:18;66326:408:0;1133:177:1;61494:54:0;;;;;;;;;;-1:-1:-1;61494:54:0;;;;-1:-1:-1;;;;;61494:54:0;;;65700:365;;;;;;;;;;-1:-1:-1;65700:365:0;;;;;:::i;:::-;;:::i;73560:373::-;;;;;;;;;;-1:-1:-1;73560:373:0;;;;;:::i;:::-;;:::i;:::-;;28617:42;;;;;;;;;;;;;;;69685:1258;;;:::i;40121:45::-;;;;;;;;;;;;;;;61555:44;;;;;;;;;;;;;;;;66943:324;;;;;;;;;;-1:-1:-1;66943:324:0;;;;;:::i;:::-;;:::i;:::-;;;3969:14:1;;3962:22;3944:41;;3932:2;3917:18;66943:324:0;3804:187:1;40338:141:0;;;;;;;;;;-1:-1:-1;40456:4:0;-1:-1:-1;;;;;40439:21:0;40447:4;40439:21;;40338:141;;63222:457;;;;;;;;;;-1:-1:-1;63222:457:0;;;;;:::i;:::-;63345:13;63508:20;;;:12;:20;;;;;;;;63545:19;;;;63583:10;;;63617:15;;;63656;;;;;-1:-1:-1;;;;;63583:10:0;;;;63545:19;;63656:15;63222:457;;;;;-1:-1:-1;;;;;4245:32:1;;;4227:51;;4309:2;4294:18;;4287:34;;;;4337:18;;;4330:34;4395:2;4380:18;;4373:34;4214:3;4199:19;63222:457:0;3996:417:1;62347:186:0;;;;;;;;;;-1:-1:-1;62347:186:0;;;;;:::i;:::-;;:::i;73025:227::-;;;;;;;;;;-1:-1:-1;73025:227:0;;;;;:::i;:::-;;:::i;71443:445::-;;;;;;:::i;:::-;;:::i;68680:::-;;;;;;;;;;-1:-1:-1;68680:445:0;;;;;:::i;:::-;;:::i;64510:906::-;;;;;;;;;;-1:-1:-1;64510:906:0;;;;;:::i;:::-;;:::i;72437:183::-;72514:21;72568:13;:11;:13::i;:::-;72553:28;;72592:20;72599:12;72592:6;:20::i;:::-;72437:183;:::o;67831:397::-;67961:6;67992:228;68013:6;68034;68116:10;68149:26;68168:6;68149:18;:26::i;:::-;68083:111;;;-1:-1:-1;;;;;5363:32:1;;;68083:111:0;;;5345:51:1;5412:18;;5405:34;5318:18;;68083:111:0;;;;;;;;;;;;68055:154;;;;;;67992:6;:228::i;:::-;67985:235;67831:397;-1:-1:-1;;;;67831:397:0:o;66326:408::-;66439:7;66480:1;66471:6;:10;66464:18;;;;:::i;:::-;66511:20;;66551:16;;;66550:165;;66683:21;;;;:12;:21;;;;;:31;;;66658:57;;66675:6;;66658:16;:57::i;:::-;66550:165;;;66584:7;66550:165;66542:184;66326:408;-1:-1:-1;;;66326:408:0:o;65700:365::-;65813:7;65847:20;;;:12;:20;;;;;:25;-1:-1:-1;;;;;65847:25:0;65846:200;;66000:46;66017:6;66025:20;;66000:16;:46::i;:::-;65846:200;;;65903:20;;;;:12;:20;;;;;;;;:30;;65846:200;65838:219;65700:365;-1:-1:-1;;65700:365:0:o;73560:373::-;73714:1;73678:23;-1:-1:-1;;;;;73678:23:0;73670:46;73662:96;;;;-1:-1:-1;;;73662:96:0;;5784:2:1;73662:96:0;;;5766:21:1;5823:2;5803:18;;;5796:30;5862:34;5842:18;;;5835:62;-1:-1:-1;;;5913:18:1;;;5906:35;5958:19;;73662:96:0;;;;;;;;;73862:9;73833:81;;;;;;;;;;;;:::i;:::-;73769:23;:156;;-1:-1:-1;;;;;;73769:156:0;-1:-1:-1;;;;;73769:156:0;;;;;;;;;;-1:-1:-1;73560:373:0:o;69685:1258::-;69776:18;69839:12;69816:20;;:35;69812:1124;;;69920:13;69992:23;;69973:43;;-1:-1:-1;;;;;69992:23:0;69973:18;:43::i;:::-;70122:12;70079:27;70109:26;;;:12;:26;;;;;;;;70150:19;;;:30;;;70195:23;;-1:-1:-1;;;;;;70195:23:0;70208:10;70195:23;;;;;;70290:20;;70325:15;;;:28;;;70368:24;;;;;;:34;;;:49;;;70432:35;;;;70630:23;;:30;;-1:-1:-1;;;70630:30:0;;;;69948:68;;-1:-1:-1;69948:68:0;;-1:-1:-1;70109:26:0;;70290:20;;;;70208:10;70516:159;;69948:68;;-1:-1:-1;;;;;70630:23:0;;;;;:28;;:30;;;;;70109:26;70630:30;;;;;;:23;:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;70516:159;;;6767:25:1;;;6823:2;6808:18;;6801:34;;;;6740:18;70516:159:0;;;;;;;70754:9;70741:10;:22;70737:115;;;70792:10;70784:52;70813:22;70825:10;70813:9;:22;:::i;:::-;70784:52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;70737:115;69853:1010;;;72437:183;:::o;69812:1124::-;70891:33;70911:12;70891:19;:33::i;:::-;70884:40;;69685:1258;:::o;66943:324::-;67046:4;67098:20;;;:12;:20;;;;;67151:19;;;;:24;;;;:97;;;67197:51;67228:5;:19;;;67197:30;:51::i;62347:186::-;62461:7;62493:32;62515:9;62493:21;:32::i;73025:227::-;73128:21;73182:31;73207:5;73182:24;:31::i;:::-;73167:46;;73224:20;73231:12;73224:6;:20::i;:::-;73025:227;;;:::o;71443:445::-;71556:18;71622:20;;;:12;:20;;;;;71657:19;;;;:24;71653:111;;71711:41;71732:5;:19;;;71711:20;:41::i;:::-;71698:54;;71653:111;71791:9;71778:10;:22;71774:107;;;71825:10;71817:52;71846:22;71858:10;71846:9;:22;:::i;:::-;71817:52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;71774:107;71581:307;71443:445;;;:::o;68680:::-;68807:6;68831:15;68861:22;68876:6;68861:14;:22::i;:::-;68855:28;;:3;:28;:::i;:::-;68831:53;-1:-1:-1;68895:15:0;69058:1;69041:14;68831:53;69041:1;:14;:::i;:::-;:18;;;;:::i;:::-;68971:25;;;;;;6767::1;;;6808:18;;;6801:34;;;6740:18;;68971:25:0;;;-1:-1:-1;;68971:25:0;;;;;;;;;68939:76;;68971:25;68939:76;;;;68913:147;;-1:-1:-1;69085:31:0;;;69086:16;;;;68913:147;69086:16;:::i;:::-;69085:31;;;68680:445;-1:-1:-1;;;;;;68680:445:0:o;64510:906::-;64619:7;64648:20;;;:12;:20;;;;;:25;-1:-1:-1;;;;;64648:25:0;64644:111;;64713:30;64736:6;64713:22;:30::i;:::-;64704:39;;64644:111;64765:16;64784:20;;;:12;:20;;;;;:34;;;;64837:13;;;64829:58;;;;-1:-1:-1;;;64829:58:0;;9319:2:1;64829:58:0;;;9301:21:1;;;9338:18;;;9331:30;9397:34;9377:18;;;9370:62;9449:18;;64829:58:0;9117:356:1;64829:58:0;64906:40;64937:8;64906:30;:40::i;:::-;64898:88;;;;-1:-1:-1;;;64898:88:0;;9680:2:1;64898:88:0;;;9662:21:1;9719:2;9699:18;;;9692:30;9758:34;9738:18;;;9731:62;-1:-1:-1;;;9809:18:1;;;9802:33;9852:19;;64898:88:0;9478:399:1;64898:88:0;64997:34;65034:27;65052:8;65034:17;:27::i;:::-;65076:26;;-1:-1:-1;;;65076:26:0;;64997:64;;-1:-1:-1;;;;;;65076:6:0;:11;;;;:26;;64997:64;;65076:26;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;65072:337;;;65126:31;;-1:-1:-1;;;65126:31:0;;-1:-1:-1;;;;;65126:6:0;:16;;;;:31;;65143:13;;65126:31;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;65072:337::-;65190:27;65220:20;;;:12;:20;;;;;;;:30;;;65273:24;;;65265:71;;;;-1:-1:-1;;;65265:71:0;;12502:2:1;65265:71:0;;;12484:21:1;12541:2;12521:18;;;12514:30;12580:34;12560:18;;;12553:62;-1:-1:-1;;;12631:18:1;;;12624:32;12673:19;;65265:71:0;12300:398:1;65265:71:0;65358:39;65377:19;65358:18;:39::i;:::-;65351:46;64510:906;-1:-1:-1;;;;;64510:906:0:o;40933:889::-;41133:4;41127:11;-1:-1:-1;;;41211:79:0;;41044:4;41398;41394:16;;;41387:4;41378:14;;41371:40;-1:-1:-1;;;41498:4:0;41489:14;;41482:90;40992:18;;41651:4;41127:11;40992:18;41636:20;41623:33;-1:-1:-1;;;;;;;41693:32:0;;41685:68;;;;-1:-1:-1;;;41685:68:0;;12905:2:1;41685:68:0;;;12887:21:1;12944:2;12924:18;;;12917:30;12983:25;12963:18;;;12956:53;13026:18;;41685:68:0;12703:347:1;41685:68:0;41804:9;-1:-1:-1;;;;;41769:45:0;41797:4;-1:-1:-1;;;;;41769:45:0;41776:10;-1:-1:-1;;;;;41769:45:0;;;;;;;;;;;41017:805;40933:889;:::o;74268:234::-;74324:16;74351:23;;;;;;;;;-1:-1:-1;;;;;74351:23:0;-1:-1:-1;;;;;74351:29:0;;:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;74394:47;;-1:-1:-1;;;74394:47:0;;74430:10;74394:47;;;177:51:1;74324:59:0;;-1:-1:-1;;;;;;74394:35:0;;;;;150:18:1;;74394:47:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;74473:20:0;;;-1:-1:-1;;;;;195:32:1;;;74473:20:0;;;177:51:1;74452:20:0;;;-1:-1:-1;74452:20:0;;-1:-1:-1;150:18:1;74473:20:0;;;;;;;;;;;;74452:42;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;74313:189;74268:234;:::o;75828:246::-;75911:7;75950;75940;:17;75939:116;;76023:21;;;;:12;:21;;;;;:31;;;75997:58;;76014:7;;75997:16;:58::i;75365:272::-;75448:7;75488;75477;:18;;75476:142;;75586:21;;;;:12;:21;;;;;:31;;;75560:58;;75577:7;;75560:16;:58::i;75476:142::-;-1:-1:-1;75513:21:0;;;;:12;:21;;;;;;;;:31;;;75365:272;-1:-1:-1;75365:272:0:o;31242:362::-;31348:11;31361:15;31404:23;:21;:23::i;:::-;31394:33;;31471:9;31460:7;:20;;31438:97;;;;-1:-1:-1;;;31438:97:0;;13760:2:1;31438:97:0;;;13742:21:1;13799:2;13779:18;;;13772:30;13838:29;13818:18;;;13811:57;13885:18;;31438:97:0;13558:351:1;31438:97:0;31552:44;;-1:-1:-1;;;31552:44:0;;-1:-1:-1;;;;;195:32:1;;;31552:44:0;;;177:51:1;31552:6:0;:18;;;;31578:7;;150:18:1;;31552:44:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;31546:50;;31242:362;;;:::o;29859:205::-;29970:4;30029:27;29999:26;;-1:-1:-1;;;29999:26:0;;;;;1279:25:1;;;29999:6:0;-1:-1:-1;;;;;29999:21:0;;;;1252:18:1;;29999:26:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:57;;;;;;;;:::i;:::-;;;29859:205;-1:-1:-1;;29859:205:0:o;30325:180::-;30465:32;;-1:-1:-1;;;30465:32:0;;;;;1279:25:1;;;30433:7:0;;30465:6;-1:-1:-1;;;;;30465:21:0;;;;1252:18:1;;30465:32:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;42379:858::-;42605:4;42599:11;-1:-1:-1;;;42624:79:0;;42516:4;42811;42807:16;;;42800:4;42791:14;;42784:40;-1:-1:-1;;;42911:4:0;42902:14;;42895:90;42464:18;;43072:5;43066:4;42599:11;42464:18;43050:28;43037:41;-1:-1:-1;;;;;;;43107:32:0;;43099:69;;;;-1:-1:-1;;;43099:69:0;;14946:2:1;43099:69:0;;;14928:21:1;14985:2;14965:18;;;14958:30;15024:26;15004:18;;;14997:54;15068:18;;43099:69:0;14744:348:1;43099:69:0;43219:9;-1:-1:-1;;;;;43184:45:0;43212:4;-1:-1:-1;;;;;43184:45:0;43191:10;-1:-1:-1;;;;;43184:45:0;;;;;;;;;;;42489:748;42379:858;;;:::o;31932:513::-;32078:29;;-1:-1:-1;;;32078:29:0;;;;;1279:25:1;;;32028:7:0;;;;-1:-1:-1;;;;;32078:6:0;:24;;;;1252:18:1;;32078:29:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;32053:54;;32126:18;32147:23;:21;:23::i;:::-;32126:44;;32181:19;32232:14;32219:10;:27;32215:103;;;32278:27;32291:14;32278:10;:27;:::i;:::-;32263:43;;32215:103;32328:45;;-1:-1:-1;;;32328:45:0;;;;;1279:25:1;;;32328:6:0;-1:-1:-1;;;;;32328:20:0;;;;32356:11;;1252:18:1;;32328:45:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;32426:11:0;;31932:513;-1:-1:-1;;;;;;;;31932:513:0:o;74622:555::-;74721:233;;;;;;;;-1:-1:-1;74721:233:0;;;74775:1;74721:233;;;;74778:1;74721:233;;;;;;74781:2;74721:233;;;;74785:2;74721:233;;;;74789:2;74721:233;;;;74793:1;74721:233;;;;;;74796:2;74721:233;;;;74817:2;74721:233;;;;74821:2;74721:233;;;;74825:2;74721:233;;;;;;74829:2;74721:233;;;;74833:2;74721:233;;;;74837:2;74721:233;;;;74841:1;74721:233;;;;74844:2;74721:233;;;;74865:1;74721:233;;;;;;74868:2;74721:233;;;;74872:2;74721:233;;;;74876:2;74721:233;;;;74880:2;74721:233;;;;74884:2;74721:233;;;;74888:2;74721:233;;;;74892:1;74721:233;;;;74912:2;74721:233;;;;74916:2;74721:233;;;;;;74920:2;74721:233;;;;74924:1;74721:233;;;;74927:2;74721:233;;;;74931:1;74721:233;;;;74934:1;74721:233;;;;;;74937:2;74721:233;;;;74971:7;;;;;;74965:13;;;74971:7;;;;74995;;;;;;74989:13;;;;75019:7;;;;;;75013:13;;;75019:7;;;75043;;;75037:13;;;;75067:8;;;;;;75061:14;;;;-1:-1:-1;;74721:233:0;;75127:24;;75140:10;;75067:8;;;75127:24;;:::i;:::-;75120:38;;;;75093:76;;;;;;;;;:::i;:::-;;;;;;74622:555;-1:-1:-1;;;74622:555:0:o;32686:181::-;32784:20;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;32784:20:0;32829:30;;-1:-1:-1;;;32829:30:0;;;;;1279:25:1;;;32829:6:0;-1:-1:-1;;;;;32829:25:0;;;;1252:18:1;;32829:30:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;32829:30:0;;;;;;;;;;;;:::i;30724:165::-;30847:34;;-1:-1:-1;;;30847:34:0;;30869:11;30847:34;;;1279:25:1;30815:7:0;;30847:6;-1:-1:-1;;;;;30847:21:0;;;;1252:18:1;;30847:34:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;239:121:1:-;324:10;317:5;313:22;306:5;303:33;293:61;;350:1;347;340:12;293:61;239:121;:::o;365:381::-;441:6;449;457;510:2;498:9;489:7;485:23;481:32;478:52;;;526:1;523;516:12;478:52;565:9;552:23;584:30;608:5;584:30;:::i;:::-;633:5;685:2;670:18;;657:32;;-1:-1:-1;736:2:1;721:18;;;708:32;;365:381;-1:-1:-1;;;365:381:1:o;948:180::-;1007:6;1060:2;1048:9;1039:7;1035:23;1031:32;1028:52;;;1076:1;1073;1066:12;1028:52;-1:-1:-1;1099:23:1;;948:180;-1:-1:-1;948:180:1:o;1555:127::-;1616:10;1611:3;1607:20;1604:1;1597:31;1647:4;1644:1;1637:15;1671:4;1668:1;1661:15;1687:257;1759:4;1753:11;;;1791:17;;1838:18;1823:34;;1859:22;;;1820:62;1817:88;;;1885:18;;:::i;:::-;1921:4;1914:24;1687:257;:::o;1949:253::-;2021:2;2015:9;2063:4;2051:17;;2098:18;2083:34;;2119:22;;;2080:62;2077:88;;;2145:18;;:::i;2207:275::-;2278:2;2272:9;2343:2;2324:13;;-1:-1:-1;;2320:27:1;2308:40;;2378:18;2363:34;;2399:22;;;2360:62;2357:88;;;2425:18;;:::i;:::-;2461:2;2454:22;2207:275;;-1:-1:-1;2207:275:1:o;2487:186::-;2535:4;2568:18;2560:6;2557:30;2554:56;;;2590:18;;:::i;:::-;-1:-1:-1;2656:2:1;2635:15;-1:-1:-1;;2631:29:1;2662:4;2627:40;;2487:186::o;2678:671::-;2746:6;2799:2;2787:9;2778:7;2774:23;2770:32;2767:52;;;2815:1;2812;2805:12;2767:52;2855:9;2842:23;2888:18;2880:6;2877:30;2874:50;;;2920:1;2917;2910:12;2874:50;2943:22;;2996:4;2988:13;;2984:27;-1:-1:-1;2974:55:1;;3025:1;3022;3015:12;2974:55;3061:2;3048:16;3086:48;3102:31;3130:2;3102:31;:::i;:::-;3086:48;:::i;:::-;3157:2;3150:5;3143:17;3197:7;3192:2;3187;3183;3179:11;3175:20;3172:33;3169:53;;;3218:1;3215;3208:12;3169:53;3273:2;3268;3264;3260:11;3255:2;3248:5;3244:14;3231:45;3317:1;3296:14;;;3312:2;3292:23;3285:34;;;;3300:5;2678:671;-1:-1:-1;;;;2678:671:1:o;5450:127::-;5511:10;5506:3;5502:20;5499:1;5492:31;5542:4;5539:1;5532:15;5566:4;5563:1;5556:15;5988:139;-1:-1:-1;;;;;6071:31:1;;6061:42;;6051:70;;6117:1;6114;6107:12;6132:267;6210:6;6263:2;6251:9;6242:7;6238:23;6234:32;6231:52;;;6279:1;6276;6269:12;6231:52;6311:9;6305:16;6330:39;6363:5;6330:39;:::i;6404:184::-;6474:6;6527:2;6515:9;6506:7;6502:23;6498:32;6495:52;;;6543:1;6540;6533:12;6495:52;-1:-1:-1;6566:16:1;;6404:184;-1:-1:-1;6404:184:1:o;6846:127::-;6907:10;6902:3;6898:20;6895:1;6888:31;6938:4;6935:1;6928:15;6962:4;6959:1;6952:15;6978:125;7018:4;7046:1;7043;7040:8;7037:34;;;7051:18;;:::i;:::-;-1:-1:-1;7088:9:1;;6978:125::o;7108:195::-;7146:4;7183;7180:1;7176:12;7215:4;7212:1;7208:12;7240:3;7235;7232:12;7229:38;;;7247:18;;:::i;:::-;7284:13;;;7108:195;-1:-1:-1;;;7108:195:1:o;7308:422::-;7397:1;7440:5;7397:1;7454:270;7475:7;7465:8;7462:21;7454:270;;;7534:4;7530:1;7526:6;7522:17;7516:4;7513:27;7510:53;;;7543:18;;:::i;:::-;7593:7;7583:8;7579:22;7576:55;;;7613:16;;;;7576:55;7692:22;;;;7652:15;;;;7454:270;;;7458:3;7308:422;;;;;:::o;7735:806::-;7784:5;7814:8;7804:80;;-1:-1:-1;7855:1:1;7869:5;;7804:80;7903:4;7893:76;;-1:-1:-1;7940:1:1;7954:5;;7893:76;7985:4;8003:1;7998:59;;;;8071:1;8066:130;;;;7978:218;;7998:59;8028:1;8019:10;;8042:5;;;8066:130;8103:3;8093:8;8090:17;8087:43;;;8110:18;;:::i;:::-;-1:-1:-1;;8166:1:1;8152:16;;8181:5;;7978:218;;8280:2;8270:8;8267:16;8261:3;8255:4;8252:13;8248:36;8242:2;8232:8;8229:16;8224:2;8218:4;8215:12;8211:35;8208:77;8205:159;;;-1:-1:-1;8317:19:1;;;8349:5;;8205:159;8396:34;8421:8;8415:4;8396:34;:::i;:::-;8466:6;8462:1;8458:6;8454:19;8445:7;8442:32;8439:58;;;8477:18;;:::i;:::-;8515:20;;7735:806;-1:-1:-1;;;7735:806:1:o;8546:140::-;8604:5;8633:47;8674:4;8664:8;8660:19;8654:4;8633:47;:::i;8944:168::-;8984:7;9050:1;9046;9042:6;9038:14;9035:1;9032:21;9027:1;9020:9;9013:17;9009:45;9006:71;;;9057:18;;:::i;:::-;-1:-1:-1;9097:9:1;;8944:168::o;9882:258::-;9954:1;9964:113;9978:6;9975:1;9972:13;9964:113;;;10054:11;;;10048:18;10035:11;;;10028:39;10000:2;9993:10;9964:113;;;10095:6;10092:1;10089:13;10086:48;;;10130:1;10121:6;10116:3;10112:16;10105:27;10086:48;;9882:258;;;:::o;10145:257::-;10186:3;10224:5;10218:12;10251:6;10246:3;10239:19;10267:63;10323:6;10316:4;10311:3;10307:14;10300:4;10293:5;10289:16;10267:63;:::i;:::-;10384:2;10363:15;-1:-1:-1;;10359:29:1;10350:39;;;;10391:4;10346:50;;10145:257;-1:-1:-1;;10145:257:1:o;10594:1325::-;10769:2;10758:9;10751:21;10828:6;10822:13;10815:21;10808:29;10803:2;10792:9;10788:18;10781:57;10732:4;10885:2;10877:6;10873:15;10867:22;10927:4;10920;10909:9;10905:20;10898:34;10969:12;10963:19;11018:4;11013:2;11002:9;10998:18;10991:32;11060:14;11054:21;11112:4;11106:3;11095:9;11091:19;11084:33;11140:53;11188:3;11177:9;11173:19;11157:14;11140:53;:::i;:::-;11260:2;11240:23;;;11234:30;11266:10;11230:47;11224:3;11209:19;;11202:76;11315:21;;;11309:28;10474:4;10463:16;;11394:3;11379:19;;10451:29;11309:28;11126:67;-1:-1:-1;11454:4:1;11436:23;;11430:30;10474:4;10463:16;;11517:3;11502:19;;10451:29;11430:30;-1:-1:-1;11577:2:1;11559:21;;11553:28;10474:4;10463:16;;11638:4;11623:20;;10451:29;11553:28;-1:-1:-1;11699:3:1;11681:22;;11675:29;10563:18;10552:30;;11762:3;11747:19;;10540:43;11675:29;-1:-1:-1;11822:3:1;11808:12;11804:22;11798:29;11776:51;;11836:54;11885:3;11874:9;11870:19;11854:14;10563:18;10552:30;10540:43;;10487:102;11924:164;12000:13;;12049;;12042:21;12032:32;;12022:60;;12078:1;12075;12068:12;12093:202;12160:6;12213:2;12201:9;12192:7;12188:23;12184:32;12181:52;;;12229:1;12226;12219:12;12181:52;12252:37;12279:9;12252:37;:::i;13336:217::-;13483:2;13472:9;13465:21;13446:4;13503:44;13543:2;13532:9;13528:18;13520:6;13503:44;:::i;14332:127::-;14393:10;14388:3;14384:20;14381:1;14374:31;14424:4;14421:1;14414:15;14448:4;14445:1;14438:15;14464:275;14549:6;14602:2;14590:9;14581:7;14577:23;14573:32;14570:52;;;14618:1;14615;14608:12;14570:52;14650:9;14644:16;14689:1;14682:5;14679:12;14669:40;;14705:1;14702;14695:12;15097:127;15158:10;15153:3;15149:20;15146:1;15139:31;15189:4;15186:1;15179:15;15213:4;15210:1;15203:15;15229:160;15306:13;;15359:4;15348:16;;15338:27;;15328:55;;15379:1;15376;15369:12;15394:175;15472:13;;15525:18;15514:30;;15504:41;;15494:69;;15559:1;15556;15549:12;15574:2016;15667:6;15698:2;15741;15729:9;15720:7;15716:23;15712:32;15709:52;;;15757:1;15754;15747:12;15709:52;15790:9;15784:16;15819:18;15860:2;15852:6;15849:14;15846:34;;;15876:1;15873;15866:12;15846:34;15899:22;;;;15955:4;15937:16;;;15933:27;15930:47;;;15973:1;15970;15963:12;15930:47;15999:22;;:::i;:::-;16044:30;16071:2;16044:30;:::i;:::-;16037:5;16030:45;16114:2;16110;16106:11;16100:18;16143:2;16133:8;16130:16;16127:36;;;16159:1;16156;16149:12;16127:36;16182:17;;;;;16233:4;16215:16;;;16211:27;16208:47;;;16251:1;16248;16241:12;16208:47;16279:22;;:::i;:::-;16332:2;16326:9;16360:2;16350:8;16347:16;16344:36;;;16376:1;16373;16366:12;16344:36;16399:17;;16450:4;16432:16;;;16428:27;16425:47;;;16468:1;16465;16458:12;16425:47;16496:22;;:::i;:::-;16549:2;16543:9;16577:2;16567:8;16564:16;16561:36;;;16593:1;16590;16583:12;16561:36;16616:17;;;-1:-1:-1;16664:4:1;16656:13;;16652:27;-1:-1:-1;16642:55:1;;16693:1;16690;16683:12;16642:55;16722:2;16716:9;16747:48;16763:31;16791:2;16763:31;:::i;16747:48::-;16818:2;16811:5;16804:17;16858:7;16853:2;16848;16844;16840:11;16836:20;16833:33;16830:53;;;16879:1;16876;16869:12;16830:53;16892:54;16943:2;16938;16931:5;16927:14;16922:2;16918;16914:11;16892:54;:::i;:::-;16955:22;;-1:-1:-1;17007:11:1;;;17001:18;;-1:-1:-1;17028:32:1;17001:18;17028:32;:::i;:::-;17076:16;;;17069:33;;;17111:24;;-1:-1:-1;17169:40:1;17197:11;;;17169:40;:::i;:::-;17164:2;17155:7;17151:16;17144:66;17246:42;17282:4;17278:2;17274:13;17246:42;:::i;:::-;17239:4;17230:7;17226:18;17219:70;17323:40;17359:2;17355;17351:11;17323:40;:::i;:::-;17318:2;17309:7;17305:16;17298:66;17399:42;17436:3;17432:2;17428:12;17399:42;:::i;:::-;17393:3;17384:7;17380:17;17373:69;17477:42;17514:3;17510:2;17506:12;17477:42;:::i;:::-;17471:3;17458:17;;17451:69;17536:14;;;17529:31;;;;-1:-1:-1;17540:5:1;;15574:2016;-1:-1:-1;;;;15574:2016:1:o

Swarm Source

ipfs://5943fda928d9797a57fbfeb2fbe394b9effb985c8d15fd786027603b66eb7681
Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading