false
true
0

Contract Address Details

0x5110Db881eF213F401842385d7eB0aB64d47331d

Contract Name
Governance
Creator
0xdf24bc–bc15fb at 0x9b9f26–5de232
Balance
0 tPLS
Tokens
Fetching tokens...
Transactions
0 Transactions
Transfers
0 Transfers
Gas Used
Fetching gas used...
Last Balance Update
26048801
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
Governance




Optimization enabled
true
Compiler version
v0.8.20+commit.a1b79de6




Optimization runs
300
EVM Version
paris




Verified at
2025-03-11T13:38:56.447536Z

contracts/Governance.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

import "./interfaces/IOracle.sol";
import "./interfaces/IERC20.sol";
import "./usingfetch/UsingFetchUpgradeReady.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

/**
 @author Fetch Inc.
 @title Governance
 @dev This is a governance contract to be used with FetchFlex. It handles disputing
 * Fetch oracle data and voting on those disputes
*/
contract Governance is UsingFetchUpgradeReady, Initializable, OwnableUpgradeable, UUPSUpgradeable {
    // Storage
    IOracle public oracle; // Fetch oracle contract
    IERC20 public token; // token used for dispute fees, same as reporter staking token
    address public oracleAddress; //fetchFlex address
    address public teamMultisig; // address of team multisig wallet, one of four stakeholder groups
    uint256 public voteCount; // total number of votes initiated
    bytes32 public autopayAddrsQueryId; // query id for autopay addresses array
    mapping(uint256 => Dispute) private disputeInfo; // mapping of dispute IDs to the details of the dispute
    mapping(bytes32 => uint256) private openDisputesOnId; // mapping of a query ID to the number of disputes on that query ID
    mapping(uint256 => Vote) private voteInfo; // mapping of dispute IDs to the details of the vote
    mapping(bytes32 => uint256[]) private voteRounds; // mapping of vote identifier hashes to an array of dispute IDs
    mapping(address => uint256) private voteTallyByAddress; // mapping of addresses to the number of votes they have cast
    mapping(address => uint256[]) private disputeIdsByReporter; // mapping of reporter addresses to an array of dispute IDs

    enum VoteResult {
        FAILED,
        PASSED,
        INVALID
    } // status of a potential vote

    // Structs
    struct Dispute {
        bytes32 queryId; // query ID of disputed value
        uint256 timestamp; // timestamp of disputed value
        bytes value; // disputed value
        address disputedReporter; // reporter who submitted the disputed value
        uint256 slashedAmount; // amount of tokens slashed from reporter
    }

    struct Tally {
        uint256 doesSupport; // number of votes in favor
        uint256 against; // number of votes against
        uint256 invalidQuery; // number of votes for invalid
    }

    struct Vote {
        bytes32 identifierHash; // identifier hash of the vote
        uint256 voteRound; // the round of voting on a given dispute or proposal
        uint256 startDate; // timestamp of when vote was initiated
        uint256 blockNumber; // block number of when vote was initiated
        uint256 fee; // fee paid to initiate the vote round
        uint256 tallyDate; // timestamp of when the votes were tallied
        Tally tokenholders; // vote tally of tokenholders
        Tally users; // vote tally of users
        Tally reporters; // vote tally of reporters
        Tally teamMultisig; // vote tally of teamMultisig
        bool executed; // boolean of whether the vote was executed
        VoteResult result; // VoteResult after votes were tallied
        address initiator; // address which initiated dispute/proposal
        mapping(address => bool) voted; // mapping of address to whether or not they voted
    }

    // Events
    event NewDispute(
        uint256 _disputeId,
        bytes32 _queryId,
        uint256 _timestamp,
        address _reporter,
        address _initiator,
        uint256 _startDate,
        uint256 _voteRound,
        uint256 _fee,
        uint256 _voteRoundLength
    ); // Emitted when a new dispute is opened

    event Voted(
        uint256 _disputeId,
        bool _supports,
        address _voter,
        bool _invalidQuery
    ); // Emitted when an address casts their vote
    event VoteExecuted(uint256 _disputeId, VoteResult _result); // Emitted when a vote is executed
    event VoteTallied(
        uint256 _disputeId,
        VoteResult _result,
        address _initiator,
        address _reporter
    ); // Emitted when all casting for a vote is tallied


    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() {
        _disableInitializers();
    }

    /**
     * @dev Initializes contract parameters
     * @param _fetch address of fetch oracle contract to be governed
     * @param _teamMultisig address of fetch team multisig, one of four voting
     * stakeholder groups
     */
    function initialize(address payable _fetch, address _teamMultisig) public initializer {
        __Ownable_init();

        setFetchAddress(_fetch);
        autopayAddrsQueryId =
        keccak256(abi.encode("AutopayAddresses", abi.encode(bytes(""))));

        oracle = IOracle(_fetch);
        token = IERC20(oracle.getTokenAddress());
        oracleAddress = _fetch;
        teamMultisig = _teamMultisig;
    }

    function _authorizeUpgrade(address _newImplementation) internal virtual override onlyOwner {
    }

    /**
     * @dev Initializes a dispute/vote in the system
     * @param _queryId being disputed
     * @param _timestamp being disputed
     */
    function beginDispute(bytes32 _queryId, uint256 _timestamp) external {
        require(!oracle.isManagedQuery(_queryId), "managed queries cannot be disputed");
        // Ensure value actually exists
        require(
            oracle.getBlockNumberByTimestamp(_queryId, _timestamp) != 0,
            "no value exists at given timestamp"
        );
        bytes32 _hash = keccak256(abi.encodePacked(_queryId, _timestamp));
        // Push new vote round
        uint256 _disputeId = voteCount + 1;
        uint256[] storage _voteRounds = voteRounds[_hash];
        _voteRounds.push(_disputeId);

        // Create new vote and dispute
        Vote storage _thisVote = voteInfo[_disputeId];
        Dispute storage _thisDispute = disputeInfo[_disputeId];

        // Initialize dispute information - query ID, timestamp, value, etc.
        _thisDispute.queryId = _queryId;
        _thisDispute.timestamp = _timestamp;
        _thisDispute.disputedReporter = oracle.getReporterByTimestamp(
            _queryId,
            _timestamp
        );
        // Initialize vote information - hash, initiator, block number, etc.
        _thisVote.identifierHash = _hash;
        _thisVote.initiator = msg.sender;
        _thisVote.blockNumber = block.number;
        _thisVote.startDate = block.timestamp;
        _thisVote.voteRound = _voteRounds.length;
        disputeIdsByReporter[_thisDispute.disputedReporter].push(_disputeId);
        uint256 _disputeFee = getDisputeFee();
        if (_voteRounds.length == 1) {
            require(
                block.timestamp - _timestamp < 5 minutes,
                "Dispute must be started within reporting lock time"
            );
            openDisputesOnId[_queryId]++;
            // calculate dispute fee based on number of open disputes on query ID
            if(openDisputesOnId[_queryId] > 4) {
                _disputeFee = oracle.getStakeAmount();
            } else {
                _disputeFee = _disputeFee * 2**(openDisputesOnId[_queryId] - 1);
            }
            // slash a single stakeAmount from reporter
            _thisDispute.slashedAmount = oracle.slashReporter(_thisDispute.disputedReporter, address(this));
            _thisDispute.value = oracle.retrieveData(_queryId, _timestamp);
            oracle.removeValue(_queryId, _timestamp);
        } else {
            uint256 _prevId = _voteRounds[_voteRounds.length - 2];
            require(
                block.timestamp - voteInfo[_prevId].tallyDate < 5 minutes,
                "New dispute round must be started within 5 minutes"
            );
            if(_voteRounds.length > 4) {
                _disputeFee = oracle.getStakeAmount();
            } else {
                _disputeFee = _disputeFee * 2**(_voteRounds.length - 1);
            }
            _thisDispute.slashedAmount = disputeInfo[_voteRounds[0]].slashedAmount;
            _thisDispute.value = disputeInfo[_voteRounds[0]].value;
        }
        if (_disputeFee > oracle.getStakeAmount()) {
          _disputeFee = oracle.getStakeAmount();
        }
        _thisVote.fee = _disputeFee;
        voteCount++;
        require(
            token.transferFrom(msg.sender, address(this), _disputeFee),
            "Fee must be paid"
        ); // This is the dispute fee. Returned if dispute passes
        emit NewDispute(
            _disputeId,
            _queryId,
            _timestamp,
            _thisDispute.disputedReporter,
            _thisVote.initiator,
            _thisVote.startDate,
            _thisVote.voteRound,
            _disputeFee,
            voteRounds[_thisVote.identifierHash].length
        );
    }

    /**
     * @dev Executes vote and transfers corresponding balances to initiator/reporter
     * @param _disputeId is the ID of the vote being executed
     */
    function executeVote(uint256 _disputeId) external {
        // Ensure validity of vote ID, vote has been executed, and vote must be tallied
        Vote storage _thisVote = voteInfo[_disputeId];
        require(_disputeId <= voteCount && _disputeId > 0, "Dispute ID must be valid");
        require(!_thisVote.executed, "Vote has already been executed");
        require(_thisVote.tallyDate > 0, "Vote must be tallied");
        // Ensure vote must be final vote and that time has to be pass (86400 = 24 * 60 * 60 for seconds in a day)
        require(
            voteRounds[_thisVote.identifierHash].length == _thisVote.voteRound,
            "Must be the final vote"
        );
        //The time  has to pass after the vote is tallied
        require(
            block.timestamp - _thisVote.tallyDate >= 5 minutes,
            "5 minutes has to pass after tally to allow for disputes"
        );
        _thisVote.executed = true;
        Dispute storage _thisDispute = disputeInfo[_disputeId];
        openDisputesOnId[_thisDispute.queryId]--;
        uint256 _i;
        uint256 _voteID;
        if (_thisVote.result == VoteResult.PASSED) {
            // If vote is in dispute and passed, iterate through each vote round and transfer the dispute to initiator
            for (
                _i = voteRounds[_thisVote.identifierHash].length;
                _i > 0;
                _i--
            ) {
                _voteID = voteRounds[_thisVote.identifierHash][_i - 1];
                _thisVote = voteInfo[_voteID];
                // If the first vote round, also make sure to transfer the reporter's slashed stake to the initiator
                if (_i == 1) {
                    token.transfer(
                        _thisVote.initiator,
                        _thisDispute.slashedAmount
                    );
                }
                token.transfer(_thisVote.initiator, _thisVote.fee);
            }
        } else if (_thisVote.result == VoteResult.INVALID) {
            // If vote is in dispute and is invalid, iterate through each vote round and transfer the dispute fee to initiator
            for (
                _i = voteRounds[_thisVote.identifierHash].length;
                _i > 0;
                _i--
            ) {
                _voteID = voteRounds[_thisVote.identifierHash][_i - 1];
                _thisVote = voteInfo[_voteID];
                token.transfer(_thisVote.initiator, _thisVote.fee);
            }
            // Transfer slashed tokens back to disputed reporter
            token.transfer(
                _thisDispute.disputedReporter,
                _thisDispute.slashedAmount
            );
        } else if (_thisVote.result == VoteResult.FAILED) {
            // If vote is in dispute and fails, iterate through each vote round and transfer the dispute fee to disputed reporter
            uint256 _reporterReward = 0;
            for (
                _i = voteRounds[_thisVote.identifierHash].length;
                _i > 0;
                _i--
            ) {
                _voteID = voteRounds[_thisVote.identifierHash][_i - 1];
                _thisVote = voteInfo[_voteID];
                _reporterReward += _thisVote.fee;
            }
            _reporterReward += _thisDispute.slashedAmount;
            token.transfer(_thisDispute.disputedReporter, _reporterReward);
        }
        emit VoteExecuted(_disputeId, voteInfo[_disputeId].result);
    }

    /**
     * @dev Tallies the votes and begins the 1 day challenge period
     * @param _disputeId is the dispute id
     */
    function tallyVotes(uint256 _disputeId) external {
        // Ensure vote has not been executed and that vote has not been tallied
        Vote storage _thisVote = voteInfo[_disputeId];
        require(_thisVote.tallyDate == 0, "Vote has already been tallied");
        require(_disputeId <= voteCount && _disputeId > 0, "Vote does not exist");
        // Determine appropriate vote duration dispute round
        // Vote time increases as rounds increase but only up to 6 days (withdrawal period)
        require(
            block.timestamp - _thisVote.startDate >=
                120 * _thisVote.voteRound ||
                block.timestamp - _thisVote.startDate >= 120 * 6,
            "Time for voting has not elapsed"
        );
        // Get total votes from each separate stakeholder group.  This will allow
        // normalization so each group's votes can be combined and compared to
        // determine the vote outcome.
        uint256 _tokenVoteSum = _thisVote.tokenholders.doesSupport +
            _thisVote.tokenholders.against +
            _thisVote.tokenholders.invalidQuery;
        uint256 _reportersVoteSum = _thisVote.reporters.doesSupport +
            _thisVote.reporters.against +
            _thisVote.reporters.invalidQuery;
        uint256 _multisigVoteSum = _thisVote.teamMultisig.doesSupport +
            _thisVote.teamMultisig.against +
            _thisVote.teamMultisig.invalidQuery;
        uint256 _usersVoteSum = _thisVote.users.doesSupport +
            _thisVote.users.against +
            _thisVote.users.invalidQuery;
        // Cannot divide by zero
        if (_tokenVoteSum == 0) {
            _tokenVoteSum++;
        }
        if (_reportersVoteSum == 0) {
            _reportersVoteSum++;
        }
        if (_multisigVoteSum == 0) {
            _multisigVoteSum++;
        }
        if (_usersVoteSum == 0) {
            _usersVoteSum++;
        }
        // Normalize and combine each stakeholder group votes
        uint256 _scaledDoesSupport = ((_thisVote.tokenholders.doesSupport *
            1e18) / _tokenVoteSum) +
            ((_thisVote.reporters.doesSupport * 1e18) / _reportersVoteSum) +
            ((_thisVote.teamMultisig.doesSupport * 1e18) / _multisigVoteSum) +
            ((_thisVote.users.doesSupport * 1e18) / _usersVoteSum);
        uint256 _scaledAgainst = ((_thisVote.tokenholders.against * 1e18) /
            _tokenVoteSum) +
            ((_thisVote.reporters.against * 1e18) / _reportersVoteSum) +
            ((_thisVote.teamMultisig.against * 1e18) / _multisigVoteSum) +
            ((_thisVote.users.against * 1e18) / _usersVoteSum);
        uint256 _scaledInvalid = ((_thisVote.tokenholders.invalidQuery * 1e18) /
            _tokenVoteSum) +
            ((_thisVote.reporters.invalidQuery * 1e18) / _reportersVoteSum) +
            ((_thisVote.teamMultisig.invalidQuery * 1e18) / _multisigVoteSum) +
            ((_thisVote.users.invalidQuery * 1e18) / _usersVoteSum);

        // If votes in support outweight the sum of against and invalid, result is passed
        if (_scaledDoesSupport > _scaledAgainst + _scaledInvalid) {
            _thisVote.result = VoteResult.PASSED;
        // If votes in against outweight the sum of support and invalid, result is failed
        } else if (_scaledAgainst > _scaledDoesSupport + _scaledInvalid) {
            _thisVote.result = VoteResult.FAILED;
        // Otherwise, result is invalid
        } else {
            _thisVote.result = VoteResult.INVALID;
        }

        _thisVote.tallyDate = block.timestamp; // Update time vote was tallied
        emit VoteTallied(
            _disputeId,
            _thisVote.result,
            _thisVote.initiator,
            disputeInfo[_disputeId].disputedReporter
        );
    }

    /**
     * @dev Enables the sender address to cast a vote
     * @param _disputeId is the ID of the vote
     * @param _supports is the address's vote: whether or not they support or are against
     * @param _invalidQuery is whether or not the dispute is valid
     */
    function vote(
        uint256 _disputeId,
        bool _supports,
        bool _invalidQuery
    ) public {
        // Ensure that dispute has not been executed and that vote does not exist and is not tallied
        require(_disputeId <= voteCount && _disputeId > 0, "Vote does not exist");
        Vote storage _thisVote = voteInfo[_disputeId];
        require(_thisVote.tallyDate == 0, "Vote has already been tallied");
        require(!_thisVote.voted[msg.sender], "Sender has already voted");
        // Update voting status and increment total queries for support, invalid, or against based on vote
        _thisVote.voted[msg.sender] = true;
        uint256 _tokenBalance = token.balanceOf(msg.sender);
        (, uint256 _stakedBalance, uint256 _lockedBalance, , , , , ) = oracle.getStakerInfo(msg.sender);
        _tokenBalance += _stakedBalance + _lockedBalance;
        if (_invalidQuery) {
            _thisVote.tokenholders.invalidQuery += _tokenBalance;
            _thisVote.reporters.invalidQuery += oracle
                .getReportsSubmittedByAddress(msg.sender);
            _thisVote.users.invalidQuery += _getUserTips(msg.sender);
            if (msg.sender == teamMultisig) {
                _thisVote.teamMultisig.invalidQuery += 1;
            }
        } else if (_supports) {
            _thisVote.tokenholders.doesSupport += _tokenBalance;
            _thisVote.reporters.doesSupport += oracle.getReportsSubmittedByAddress(msg.sender);
            _thisVote.users.doesSupport += _getUserTips(msg.sender);
            if (msg.sender == teamMultisig) {
                _thisVote.teamMultisig.doesSupport += 1;
            }
        } else {
            _thisVote.tokenholders.against += _tokenBalance;
            _thisVote.reporters.against += oracle.getReportsSubmittedByAddress(
                msg.sender
            );
            _thisVote.users.against += _getUserTips(msg.sender);
            if (msg.sender == teamMultisig) {
                _thisVote.teamMultisig.against += 1;
            }
        }
        voteTallyByAddress[msg.sender]++;
        emit Voted(_disputeId, _supports, msg.sender, _invalidQuery);
    }

    /**
     * @dev Enables the sender address to cast votes for multiple disputes
     * @param _disputeIds is an array of vote IDs
     * @param _supports is an array of the address's votes: whether or not they support or are against
     * @param _invalidQuery is array of whether or not the dispute is valid
     */
    function voteOnMultipleDisputes(
        uint256[] memory _disputeIds, 
        bool[] memory _supports, 
        bool[] memory _invalidQuery
    ) external {
        for (uint256 _i = 0; _i < _disputeIds.length; _i++) {
            vote(_disputeIds[_i], _supports[_i], _invalidQuery[_i]);
        }
    }

    // *****************************************************************************
    // *                                                                           *
    // *                               Getters                                     *
    // *                                                                           *
    // *****************************************************************************

    /**
     * @dev Determines if an address voted for a specific vote
     * @param _disputeId is the ID of the vote
     * @param _voter is the address of the voter to check for
     * @return bool of whether or note the address voted for the specific vote
     */
    function didVote(uint256 _disputeId, address _voter)
        external
        view
        returns (bool)
    {
        return voteInfo[_disputeId].voted[_voter];
    }

    /**
     * @dev Get the latest dispute fee
     */
    function getDisputeFee() public view returns (uint256) {
        return (oracle.getStakeAmount() / 10);
    }


    function getDisputesByReporter(address _reporter) external view returns (uint256[] memory) {
        return disputeIdsByReporter[_reporter];
    }

    /**
     * @dev Returns info on a dispute for a given ID
     * @param _disputeId is the ID of a specific dispute
     * @return bytes32 of the data ID of the dispute
     * @return uint256 of the timestamp of the dispute
     * @return bytes memory of the value being disputed
     * @return address of the reporter being disputed
     */
    function getDisputeInfo(uint256 _disputeId)
        external
        view
        returns (
            bytes32,
            uint256,
            bytes memory,
            address
        )
    {
        Dispute storage _d = disputeInfo[_disputeId];
        return (_d.queryId, _d.timestamp, _d.value, _d.disputedReporter);
    }

    /**
     * @dev Returns the number of open disputes for a specific query ID
     * @param _queryId is the ID of a specific data feed
     * @return uint256 of the number of open disputes for the query ID
     */
    function getOpenDisputesOnId(bytes32 _queryId)
        external
        view
        returns (uint256)
    {
        return openDisputesOnId[_queryId];
    }

    /**
     * @dev Returns the total number of votes
     * @return uint256 of the total number of votes
     */
    function getVoteCount() external view returns (uint256) {
        return voteCount;
    }

    /**
     * @dev Returns info on a vote for a given vote ID
     * @param _disputeId is the ID of a specific vote
     * @return bytes32 identifier hash of the vote
     * @return uint256[17] memory of the pertinent round info (vote rounds, start date, fee, etc.)
     * @return bool memory of both whether or not the vote was executed
     * @return VoteResult result of the vote
     * @return address memory of the vote initiator
     */
    function getVoteInfo(uint256 _disputeId)
        external
        view
        returns (
            bytes32,
            uint256[17] memory,
            bool,
            VoteResult,
            address
        )
    {
        Vote storage _v = voteInfo[_disputeId];
        return (
            _v.identifierHash,
            [
                _v.voteRound,
                _v.startDate,
                _v.blockNumber,
                _v.fee,
                _v.tallyDate,
                _v.tokenholders.doesSupport,
                _v.tokenholders.against,
                _v.tokenholders.invalidQuery,
                _v.users.doesSupport,
                _v.users.against,
                _v.users.invalidQuery,
                _v.reporters.doesSupport,
                _v.reporters.against,
                _v.reporters.invalidQuery,
                _v.teamMultisig.doesSupport,
                _v.teamMultisig.against,
                _v.teamMultisig.invalidQuery
            ],
            _v.executed,
            _v.result,
            _v.initiator
        );
    }

    /**
     * @dev Returns an array of voting rounds for a given vote
     * @param _hash is the identifier hash for a vote
     * @return uint256[] memory dispute IDs of the vote rounds
     */
    function getVoteRounds(bytes32 _hash)
        external
        view
        returns (uint256[] memory)
    {
        return voteRounds[_hash];
    }

    /**
     * @dev Returns the total number of votes cast by an address
     * @param _voter is the address of the voter to check for
     * @return uint256 of the total number of votes cast by the voter
     */
    function getVoteTallyByAddress(address _voter)
        external
        view
        returns (uint256)
    {
        return voteTallyByAddress[_voter];
    }

    // Internal
    /**
     * @dev Retrieves total tips contributed to autopay by a given address
     * @param _user address of the user to check the tip count for
     * @return _userTipTally uint256 of total tips contributed to autopay by the address
     */
    function _getUserTips(address _user) internal returns (uint256 _userTipTally) {
        // get autopay addresses array from oracle
        (bytes memory _autopayAddrsBytes, uint256 _timestamp) = getDataBefore(
            autopayAddrsQueryId,
            block.timestamp - 30 minutes
        );
        if (_timestamp > 0) {
            address[] memory _autopayAddrs = abi.decode(
                _autopayAddrsBytes,
                (address[])
            );
            // iterate through autopay addresses retrieve tips by user address
            for (uint256 _i = 0; _i < _autopayAddrs.length; _i++) {
                (bool _success, bytes memory _returnData) = _autopayAddrs[_i]
                    .call(
                        abi.encodeWithSignature(
                            "getTipsByAddress(address)",
                            _user
                        )
                    );
                if (_success) {
                    _userTipTally += abi.decode(_returnData, (uint256));
                }
            }
        }
    }
}
        

@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)

pragma solidity ^0.8.0;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeaconUpgradeable {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {BeaconProxy} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}
          

@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized != type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}
          

@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/UUPSUpgradeable.sol)

pragma solidity ^0.8.0;

import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../ERC1967/ERC1967UpgradeUpgradeable.sol";
import {Initializable} from "./Initializable.sol";

/**
 * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
 * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
 *
 * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
 * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
 * `UUPSUpgradeable` with a custom implementation of upgrades.
 *
 * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
 *
 * _Available since v4.1._
 */
abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
    address private immutable __self = address(this);

    /**
     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is
     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
     * fail.
     */
    modifier onlyProxy() {
        require(address(this) != __self, "Function must be called through delegatecall");
        require(_getImplementation() == __self, "Function must be called through active proxy");
        _;
    }

    /**
     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be
     * callable on the implementing contract but not through proxies.
     */
    modifier notDelegated() {
        require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall");
        _;
    }

    function __UUPSUpgradeable_init() internal onlyInitializing {
    }

    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
     * implementation. It is used to validate the implementation's compatibility when performing an upgrade.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
     */
    function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
        return _IMPLEMENTATION_SLOT;
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     *
     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall
     */
    function upgradeTo(address newImplementation) public virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
     * encoded in `data`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     *
     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, data, true);
    }

    /**
     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
     * {upgradeTo} and {upgradeToAndCall}.
     *
     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
     *
     * ```solidity
     * function _authorizeUpgrade(address) internal override onlyOwner {}
     * ```
     */
    function _authorizeUpgrade(address newImplementation) internal virtual;

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}
          

@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}
          

@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling 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);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}
          

@openzeppelin/contracts-upgradeable/interfaces/IERC1967Upgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)

pragma solidity ^0.8.0;

/**
 * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.
 *
 * _Available since v4.8.3._
 */
interface IERC1967Upgradeable {
    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Emitted when the beacon is changed.
     */
    event BeaconUpgraded(address indexed beacon);
}
          

@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)

pragma solidity ^0.8.0;

/**
 * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
 * proxy whose upgrades are fully controlled by the current implementation.
 */
interface IERC1822ProxiableUpgradeable {
    /**
     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
     * address.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy.
     */
    function proxiableUUID() external view returns (bytes32);
}
          

@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)

pragma solidity ^0.8.2;

import "../beacon/IBeaconUpgradeable.sol";
import "../../interfaces/IERC1967Upgradeable.sol";
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/StorageSlotUpgradeable.sol";
import {Initializable} from "../utils/Initializable.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 *
 * _Available since v4.1._
 */
abstract contract ERC1967UpgradeUpgradeable is Initializable, IERC1967Upgradeable {
    // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    function __ERC1967Upgrade_init() internal onlyInitializing {
    }

    function __ERC1967Upgrade_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev Returns the current implementation address.
     */
    function _getImplementation() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract");
        StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Perform implementation upgrade
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeTo(address newImplementation) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Perform implementation upgrade with additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {
        _upgradeTo(newImplementation);
        if (data.length > 0 || forceCall) {
            AddressUpgradeable.functionDelegateCall(newImplementation, data);
        }
    }

    /**
     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {
        // Upgrades from old implementations will perform a rollback test. This test requires the new
        // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
        // this special case will break upgrade paths from old UUPS implementation to new ones.
        if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {
            _setImplementation(newImplementation);
        } else {
            try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {
                require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
            } catch {
                revert("ERC1967Upgrade: new implementation is not UUPS");
            }
            _upgradeToAndCall(newImplementation, data, forceCall);
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Returns the current admin.
     */
    function _getAdmin() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        require(newAdmin != address(0), "ERC1967: new admin is the zero address");
        StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {AdminChanged} event.
     */
    function _changeAdmin(address newAdmin) internal {
        emit AdminChanged(_getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
     */
    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Returns the current beacon.
     */
    function _getBeacon() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract");
        require(
            AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),
            "ERC1967: beacon implementation is not a contract"
        );
        StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;
    }

    /**
     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
     *
     * Emits a {BeaconUpgraded} event.
     */
    function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);
        if (data.length > 0 || forceCall) {
            AddressUpgradeable.functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);
        }
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}
          

@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)

pragma solidity ^0.8.0;
import {Initializable} from "../proxy/utils/Initializable.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).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }

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

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

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}
          

@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```solidity
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._
 * _Available since v4.9 for `string`, `bytes`._
 */
library StorageSlotUpgradeable {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}
          

contracts/interfaces/IERC20.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

interface IERC20 {
    function balanceOf(address account) external view returns (uint256);

    function transfer(address recipient, uint256 amount)
        external
        returns (bool);

    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);
}
          

contracts/interfaces/IERC2362.sol

// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

/**
    * @dev EIP2362 Interface for pull oracles
    * https://github.com/fetchoracle/EIP-2362
*/
interface IERC2362
{
	/**
	 * @dev Exposed function pertaining to EIP standards
	 * @param _id bytes32 ID of the query
	 * @return int,uint,uint returns the value, timestamp, and status code of query
	 */
	function valueFor(bytes32 _id) external view returns(int256,uint256,uint256);
}
          

contracts/interfaces/IFetch.sol

// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

interface IFetch {
    //Controller
    function addresses(bytes32) external view returns (address);

    function uints(bytes32) external view returns (uint256);

    function burn(uint256 _amount) external;

    function changeDeity(address _newDeity) external;

    function changeOwner(address _newOwner) external;
    function changeUint(bytes32 _target, uint256 _amount) external;

    function migrate() external;

    function mint(address _reciever, uint256 _amount) external;

    function init() external;

    function getAllDisputeVars(uint256 _disputeId)
        external
        view
        returns (
            bytes32,
            bool,
            bool,
            bool,
            address,
            address,
            address,
            uint256[9] memory,
            int256
        );

    function getDisputeIdByDisputeHash(bytes32 _hash)
        external
        view
        returns (uint256);

    function getDisputeUintVars(uint256 _disputeId, bytes32 _data)
        external
        view
        returns (uint256);

    function getLastNewValueById(uint256 _requestId)
        external
        view
        returns (uint256, bool);

    function retrieveData(uint256 _requestId, uint256 _timestamp)
        external
        view
        returns (uint256);

    function getNewValueCountbyRequestId(uint256 _requestId)
        external
        view
        returns (uint256);

    function getAddressVars(bytes32 _data) external view returns (address);

    function getUintVar(bytes32 _data) external view returns (uint256);

    function totalSupply() external view returns (uint256);

    function name() external pure returns (string memory);

    function symbol() external pure returns (string memory);

    function decimals() external pure returns (uint8);

    function isMigrated(address _addy) external view returns (bool);

    function allowance(address _user, address _spender)
        external
        view
        returns (uint256);

    function allowedToTrade(address _user, uint256 _amount)
        external
        view
        returns (bool);

    function approve(address _spender, uint256 _amount) external returns (bool);

    function approveAndTransferFrom(
        address _from,
        address _to,
        uint256 _amount
    ) external returns (bool);

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

    function balanceOfAt(address _user, uint256 _blockNumber)
        external
        view
        returns (uint256);

    function transfer(address _to, uint256 _amount)
        external
        returns (bool success);

    function transferFrom(
        address _from,
        address _to,
        uint256 _amount
    ) external returns (bool success);

    function depositStake() external;

    function requestStakingWithdraw() external;

    function withdrawStake() external;

    function changeStakingStatus(address _reporter, uint256 _status) external;

    function slashReporter(address _reporter, address _disputer) external;

    function getStakerInfo(address _staker)
        external
        view
        returns (uint256, uint256);

    function getTimestampbyRequestIDandIndex(uint256 _requestId, uint256 _index)
        external
        view
        returns (uint256);

    function getNewCurrentVariables()
        external
        view
        returns (
            bytes32 _c,
            uint256[5] memory _r,
            uint256 _d,
            uint256 _t
        );

    function getNewValueCountbyQueryId(bytes32 _queryId)
        external
        view
        returns (uint256);

    function getTimestampbyQueryIdandIndex(bytes32 _queryId, uint256 _index)
        external
        view
        returns (uint256);

    function retrieveData(bytes32 _queryId, uint256 _timestamp)
        external
        view
        returns (bytes memory);

    //Governance
    enum VoteResult {
        FAILED,
        PASSED,
        INVALID
    }

    function setApprovedFunction(bytes4 _func, bool _val) external;

    function beginDispute(bytes32 _queryId, uint256 _timestamp) external;

    function delegate(address _delegate) external;

    function delegateOfAt(address _user, uint256 _blockNumber)
        external
        view
        returns (address);

    function executeVote(uint256 _disputeId) external;

    function proposeVote(
        address _contract,
        bytes4 _function,
        bytes calldata _data,
        uint256 _timestamp
    ) external;

    function tallyVotes(uint256 _disputeId) external;

    function governance() external view returns (address);

    function updateMinDisputeFee() external;

    function verify() external pure returns (uint256);

    function vote(
        uint256 _disputeId,
        bool _supports,
        bool _invalidQuery
    ) external;

    function voteFor(
        address[] calldata _addys,
        uint256 _disputeId,
        bool _supports,
        bool _invalidQuery
    ) external;

    function getDelegateInfo(address _holder)
        external
        view
        returns (address, uint256);

    function isFunctionApproved(bytes4 _func) external view returns (bool);

    function isApprovedGovernanceContract(address _contract)
        external
        returns (bool);

    function getVoteRounds(bytes32 _hash)
        external
        view
        returns (uint256[] memory);

    function getVoteCount() external view returns (uint256);

    function getVoteInfo(uint256 _disputeId)
        external
        view
        returns (
            bytes32,
            uint256[9] memory,
            bool[2] memory,
            VoteResult,
            bytes memory,
            bytes4,
            address[2] memory
        );

    function getDisputeInfo(uint256 _disputeId)
        external
        view
        returns (
            uint256,
            uint256,
            bytes memory,
            address
        );

    function getOpenDisputesOnId(bytes32 _queryId)
        external
        view
        returns (uint256);

    function didVote(uint256 _disputeId, address _voter)
        external
        view
        returns (bool);

    //Oracle
    function getReportTimestampByIndex(bytes32 _queryId, uint256 _index)
        external
        view
        returns (uint256);

    function getValueByTimestamp(bytes32 _queryId, uint256 _timestamp)
        external
        view
        returns (bytes memory);

    function getBlockNumberByTimestamp(bytes32 _queryId, uint256 _timestamp)
        external
        view
        returns (uint256);

    function getReportingLock() external view returns (uint256);

    function getReporterByTimestamp(bytes32 _queryId, uint256 _timestamp)
        external
        view
        returns (address);

    function reportingLock() external view returns (uint256);

    function removeValue(bytes32 _queryId, uint256 _timestamp) external;
    function getTipsByUser(address _user) external view returns(uint256);
    function tipQuery(bytes32 _queryId, uint256 _tip, bytes memory _queryData) external;
    function submitValue(bytes32 _queryId, bytes calldata _value, uint256 _nonce, bytes memory _queryData) external;
    function burnTips() external;

    function changeReportingLock(uint256 _newReportingLock) external;
    function getReportsSubmittedByAddress(address _reporter) external view returns(uint256);
    function changeTimeBasedReward(uint256 _newTimeBasedReward) external;
    function getReporterLastTimestamp(address _reporter) external view returns(uint256);
    function getTipsById(bytes32 _queryId) external view returns(uint256);
    function getTimeBasedReward() external view returns(uint256);
    function getTimestampCountById(bytes32 _queryId) external view returns(uint256);
    function getTimestampIndexByTimestamp(bytes32 _queryId, uint256 _timestamp) external view returns(uint256);
    function getCurrentReward(bytes32 _queryId) external view returns(uint256, uint256);
    function getCurrentValue(bytes32 _queryId) external view returns(bytes memory);
    function getDataBefore(bytes32 _queryId, uint256 _timestamp) external view returns(bool _ifRetrieve, bytes memory _value, uint256 _timestampRetrieved);
    function getTimeOfLastNewValue() external view returns(uint256);
    function depositStake(uint256 _amount) external;
    function requestStakingWithdraw(uint256 _amount) external;

    //Test functions
    function changeAddressVar(bytes32 _id, address _addy) external;

    //parachute functions
    function killContract() external;

    function migrateFor(address _destination, uint256 _amount) external;

    function rescue51PercentAttack(address _tokenHolder) external;

    function rescueBrokenDataReporting() external;

    function rescueFailedUpdate() external;

    //Fetch 360
    function addStakingRewards(uint256 _amount) external;

    function _sliceUint(bytes memory _b)
        external
        pure
        returns (uint256 _number);

    function claimOneTimeTip(bytes32 _queryId, uint256[] memory _timestamps)
        external;

    function claimTip(
        bytes32 _feedId,
        bytes32 _queryId,
        uint256[] memory _timestamps
    ) external;

    function fee() external view returns (uint256);

    function feedsWithFunding(uint256) external view returns (bytes32);

    function fundFeed(
        bytes32 _feedId,
        bytes32 _queryId,
        uint256 _amount
    ) external;

    function getCurrentFeeds(bytes32 _queryId)
        external
        view
        returns (bytes32[] memory);

    function getCurrentTip(bytes32 _queryId) external view returns (uint256);

    function getDataAfter(bytes32 _queryId, uint256 _timestamp)
        external
        view
        returns (bytes memory _value, uint256 _timestampRetrieved);

    function getDataFeed(bytes32 _feedId)
        external
        view
        returns (Autopay.FeedDetails memory);

    function getFundedFeeds() external view returns (bytes32[] memory);

    function getFundedQueryIds() external view returns (bytes32[] memory);

    function getIndexForDataAfter(bytes32 _queryId, uint256 _timestamp)
        external
        view
        returns (bool _found, uint256 _index);

    function getIndexForDataBefore(bytes32 _queryId, uint256 _timestamp)
        external
        view
        returns (bool _found, uint256 _index);

    function getMultipleValuesBefore(
        bytes32 _queryId,
        uint256 _timestamp,
        uint256 _maxAge,
        uint256 _maxCount
    )
        external
        view
        returns (uint256[] memory _values, uint256[] memory _timestamps);

    function getPastTipByIndex(bytes32 _queryId, uint256 _index)
        external
        view
        returns (Autopay.Tip memory);

    function getPastTipCount(bytes32 _queryId) external view returns (uint256);

    function getPastTips(bytes32 _queryId)
        external
        view
        returns (Autopay.Tip[] memory);

    function getQueryIdFromFeedId(bytes32 _feedId)
        external
        view
        returns (bytes32);

    function getRewardAmount(
        bytes32 _feedId,
        bytes32 _queryId,
        uint256[] memory _timestamps
    ) external view returns (uint256 _cumulativeReward);

    function getRewardClaimedStatus(
        bytes32 _feedId,
        bytes32 _queryId,
        uint256 _timestamp
    ) external view returns (bool);

    function getTipsByAddress(address _user) external view returns (uint256);

    function isInDispute(bytes32 _queryId, uint256 _timestamp)
        external
        view
        returns (bool);

    function queryIdFromDataFeedId(bytes32) external view returns (bytes32);

    function queryIdsWithFunding(uint256) external view returns (bytes32);

    function queryIdsWithFundingIndex(bytes32) external view returns (uint256);

    function setupDataFeed(
        bytes32 _queryId,
        uint256 _reward,
        uint256 _startTime,
        uint256 _interval,
        uint256 _window,
        uint256 _priceThreshold,
        uint256 _rewardIncreasePerSecond,
        bytes memory _queryData,
        uint256 _amount
    ) external;

    function fetch() external view returns (address);

    function tip(
        bytes32 _queryId,
        uint256 _amount,
        bytes memory _queryData
    ) external;

    function tips(bytes32, uint256)
        external
        view
        returns (uint256 amount, uint256 timestamp);

    function token() external view returns (address);

    function userTipsTotal(address) external view returns (uint256);

    function valueFor(bytes32 _id)
        external
        view
        returns (
            int256 _value,
            uint256 _timestamp,
            uint256 _statusCode
        );
}

interface Autopay {
    struct FeedDetails {
        uint256 reward;
        uint256 balance;
        uint256 startTime;
        uint256 interval;
        uint256 window;
        uint256 priceThreshold;
        uint256 rewardIncreasePerSecond;
        uint256 feedsWithFundingIndex;
    }

    struct Tip {
        uint256 amount;
        uint256 timestamp;
    }
    function getStakeAmount() external view returns(uint256);
    function stakeAmount() external view returns(uint256);
    function token() external view returns(address);
}
          

contracts/interfaces/IMappingContract.sol

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

interface IMappingContract{
    function getFetchID(bytes32 _id) external view returns(bytes32);
}
          

contracts/interfaces/IOracle.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

/**
 @author Fetch Inc.
 @title FetchFlex
 @dev This is a streamlined Fetch oracle system which handles staking, reporting,
 * slashing, and user data getters in one contract. This contract is controlled
 * by a single address known as 'governance', which could be an externally owned
 * account or a contract, allowing for a flexible, modular design.
*/
interface IOracle {

    /**
     * @dev Returns whether the specified query is a managed query or not
     * @param _queryId is ID of the specific data feed
     */
    function isManagedQuery(bytes32 _queryId) external view returns (bool);

    /**
     * @dev Removes a value from the oracle.
     * Note: this function is only callable by the Governance contract.
     * @param _queryId is ID of the specific data feed
     * @param _timestamp is the timestamp of the data value to remove
     */
    function removeValue(bytes32 _queryId, uint256 _timestamp) external;

    /**
     * @dev Slashes a reporter and transfers their stake amount to the given recipient
     * Note: this function is only callable by the governance address.
     * @param _reporter is the address of the reporter being slashed
     * @param _recipient is the address receiving the reporter's stake
     * @return uint256 amount of token slashed and sent to recipient address
     */
    function slashReporter(address _reporter, address _recipient)
        external
        returns (uint256);

    // *****************************************************************************
    // *                                                                           *
    // *                               Getters                                     *
    // *                                                                           *
    // *****************************************************************************

    /**
     * @dev Returns the block number at a given timestamp
     * @param _queryId is ID of the specific data feed
     * @param _timestamp is the timestamp to find the corresponding block number for
     * @return uint256 block number of the timestamp for the given data ID
     */
    function getBlockNumberByTimestamp(bytes32 _queryId, uint256 _timestamp)
        external
        view
        returns (uint256);

    /**
     * @dev Returns the address of the reporter who submitted a value for a data ID at a specific time
     * @param _queryId is ID of the specific data feed
     * @param _timestamp is the timestamp to find a corresponding reporter for
     * @return address of the reporter who reported the value for the data ID at the given timestamp
     */
    function getReporterByTimestamp(bytes32 _queryId, uint256 _timestamp)
        external
        view
        returns (address);

    /**
     * @dev Returns the number of values submitted by a specific reporter address
     * @param _reporter is the address of a reporter
     * @return uint256 of the number of values submitted by the given reporter
     */
    function getReportsSubmittedByAddress(address _reporter)
        external
        view
        returns (uint256);

    /**
     * @dev Returns amount required to report oracle values
     * @return uint256 stake amount
     */
    function getStakeAmount() external view returns (uint256);

    /**
     * @dev Allows users to retrieve all information about a staker
     * @param _stakerAddress address of staker inquiring about
     * @return uint startDate of staking
     * @return uint current amount staked
     * @return uint current amount locked for withdrawal
     * @return uint reward debt used to calculate staking rewards
     * @return uint reporter's last reported timestamp
     * @return uint total number of reports submitted by reporter
     * @return uint governance vote count when first staked
     * @return uint number of votes cast by staker when first staked
     */
    function getStakerInfo(address _stakerAddress)
        external
        view
        returns (
            uint256,
            uint256,
            uint256,
            uint256,
            uint256,
            uint256,
            uint256,
            uint256
        );

    /**
     * @dev Retrieves the latest value for the queryId before the specified timestamp
     * @param _queryId is the queryId to look up the value for
     * @param _timestamp before which to search for latest value
     * @return _ifRetrieve bool true if able to retrieve a non-zero value
     * @return _value the value retrieved
     * @return _timestampRetrieved the value's timestamp
     */
    function getDataBefore(bytes32 _queryId, uint256 _timestamp)
        external
        view
        returns (
            bool _ifRetrieve,
            bytes memory _value,
            uint256 _timestampRetrieved
        );

    /**
     * @dev Returns the address of the token used for staking
     * @return address of the token used for staking
     */
    function getTokenAddress() external view returns (address);

    /**
     * @dev Retrieve value from oracle based on timestamp
     * @param _queryId being requested
     * @param _timestamp to retrieve data/value from
     * @return bytes value for timestamp submitted
     */
    function retrieveData(bytes32 _queryId, uint256 _timestamp)
        external
        view
        returns (bytes memory);
}
          

contracts/usingfetch/UsingFetchUpgradeReady.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

import "../interfaces/IFetch.sol";
import "../interfaces/IERC2362.sol";
import "../interfaces/IMappingContract.sol";

/**
 @author Fetch Inc
 @title UsingFetchUpgradeReady
 @dev This contract helps smart contracts read data from Fetch
 */
contract UsingFetchUpgradeReady is IERC2362 {
    IFetch public fetch;
    IMappingContract public idMappingContract;
    uint256[50] private __gap;

    function setFetchAddress(address payable _fetch) internal {
        fetch = IFetch(_fetch);
    }

    /*Getters*/
    /**
     * @dev Retrieves the next value for the queryId after the specified timestamp
     * @param _queryId is the queryId to look up the value for
     * @param _timestamp after which to search for next value
     * @return _value the value retrieved
     * @return _timestampRetrieved the value's timestamp
     */
    function getDataAfter(bytes32 _queryId, uint256 _timestamp)
        public
        view
        returns (bytes memory _value, uint256 _timestampRetrieved)
    {
        (bool _found, uint256 _index) = getIndexForDataAfter(
            _queryId,
            _timestamp
        );
        if (!_found) {
            return ("", 0);
        }
        _timestampRetrieved = getTimestampbyQueryIdandIndex(_queryId, _index);
        _value = retrieveData(_queryId, _timestampRetrieved);
        return (_value, _timestampRetrieved);
    }

    /**
     * @dev Retrieves the latest value for the queryId before the specified timestamp
     * @param _queryId is the queryId to look up the value for
     * @param _timestamp before which to search for latest value
     * @return _value the value retrieved
     * @return _timestampRetrieved the value's timestamp
     */
    function getDataBefore(bytes32 _queryId, uint256 _timestamp)
        public
        view
        returns (bytes memory _value, uint256 _timestampRetrieved)
    {
        (, _value, _timestampRetrieved) = fetch.getDataBefore(
            _queryId,
            _timestamp
        );
    }

    /**
     * @dev Retrieves latest array index of data before the specified timestamp for the queryId
     * @param _queryId is the queryId to look up the index for
     * @param _timestamp is the timestamp before which to search for the latest index
     * @return _found whether the index was found
     * @return _index the latest index found before the specified timestamp
     */
    // slither-disable-next-line calls-loop
    function getIndexForDataAfter(bytes32 _queryId, uint256 _timestamp)
        public
        view
        returns (bool _found, uint256 _index)
    {
        uint256 _count = getNewValueCountbyQueryId(_queryId);
        if (_count == 0) return (false, 0);
        _count--;
        bool _search = true; // perform binary search
        uint256 _middle = 0;
        uint256 _start = 0;
        uint256 _end = _count;
        uint256 _timestampRetrieved;
        // checking boundaries to short-circuit the algorithm
        _timestampRetrieved = getTimestampbyQueryIdandIndex(_queryId, _end);
        if (_timestampRetrieved <= _timestamp) return (false, 0);
        _timestampRetrieved = getTimestampbyQueryIdandIndex(_queryId, _start);
        if (_timestampRetrieved > _timestamp) {
            // candidate found, check for disputes
            _search = false;
        }
        // since the value is within our boundaries, do a binary search
        while (_search) {
            _middle = (_end + _start) / 2;
            _timestampRetrieved = getTimestampbyQueryIdandIndex(
                _queryId,
                _middle
            );
            if (_timestampRetrieved > _timestamp) {
                // get immediate previous value
                uint256 _prevTime = getTimestampbyQueryIdandIndex(
                    _queryId,
                    _middle - 1
                );
                if (_prevTime <= _timestamp) {
                    // candidate found, check for disputes
                    _search = false;
                } else {
                    // look from start to middle -1(prev value)
                    _end = _middle - 1;
                }
            } else {
                // get immediate next value
                uint256 _nextTime = getTimestampbyQueryIdandIndex(
                    _queryId,
                    _middle + 1
                );
                if (_nextTime > _timestamp) {
                    // candidate found, check for disputes
                    _search = false;
                    _middle++;
                    _timestampRetrieved = _nextTime;
                } else {
                    // look from middle + 1(next value) to end
                    _start = _middle + 1;
                }
            }
        }
        // candidate found, check for disputed values
        if (!isInDispute(_queryId, _timestampRetrieved)) {
            // _timestampRetrieved is correct
            return (true, _middle);
        } else {
            // iterate forward until we find a non-disputed value
            while (
                isInDispute(_queryId, _timestampRetrieved) && _middle < _count
            ) {
                _middle++;
                _timestampRetrieved = getTimestampbyQueryIdandIndex(
                    _queryId,
                    _middle
                );
            }
            if (
                _middle == _count && isInDispute(_queryId, _timestampRetrieved)
            ) {
                return (false, 0);
            }
            // _timestampRetrieved is correct
            return (true, _middle);
        }
    }

    /**
     * @dev Retrieves latest array index of data before the specified timestamp for the queryId
     * @param _queryId is the queryId to look up the index for
     * @param _timestamp is the timestamp before which to search for the latest index
     * @return _found whether the index was found
     * @return _index the latest index found before the specified timestamp
     */
    // slither-disable-next-line calls-loop
    function getIndexForDataBefore(bytes32 _queryId, uint256 _timestamp)
        public
        view
        returns (bool _found, uint256 _index)
    {
        return fetch.getIndexForDataBefore(_queryId, _timestamp);
    }

    /**
     * @dev Retrieves multiple uint256 values before the specified timestamp
     * @param _queryId the unique id of the data query
     * @param _timestamp the timestamp before which to search for values
     * @param _maxAge the maximum number of seconds before the _timestamp to search for values
     * @param _maxCount the maximum number of values to return
     * @return _values the values retrieved, ordered from oldest to newest
     * @return _timestamps the timestamps of the values retrieved
     */
    function getMultipleValuesBefore(
        bytes32 _queryId,
        uint256 _timestamp,
        uint256 _maxAge,
        uint256 _maxCount
    )
        public
        view
        returns (bytes[] memory _values, uint256[] memory _timestamps)
    {
        // get index of first possible value
        (bool _ifRetrieve, uint256 _startIndex) = getIndexForDataAfter(
            _queryId,
            _timestamp - _maxAge
        );
        // no value within range
        if (!_ifRetrieve) {
            return (new bytes[](0), new uint256[](0));
        }
        uint256 _endIndex;
        // get index of last possible value
        (_ifRetrieve, _endIndex) = getIndexForDataBefore(_queryId, _timestamp);
        // no value before _timestamp
        if (!_ifRetrieve) {
            return (new bytes[](0), new uint256[](0));
        }
        uint256 _valCount = 0;
        uint256 _index = 0;
        uint256[] memory _timestampsArrayTemp = new uint256[](_maxCount);
        // generate array of non-disputed timestamps within range
        while (_valCount < _maxCount && _endIndex + 1 - _index > _startIndex) {
            uint256 _timestampRetrieved = getTimestampbyQueryIdandIndex(
                _queryId,
                _endIndex - _index
            );
            if (!isInDispute(_queryId, _timestampRetrieved)) {
                _timestampsArrayTemp[_valCount] = _timestampRetrieved;
                _valCount++;
            }
            _index++;
        }

        bytes[] memory _valuesArray = new bytes[](_valCount);
        uint256[] memory _timestampsArray = new uint256[](_valCount);
        // retrieve values and reverse timestamps order
        for (uint256 _i = 0; _i < _valCount; _i++) {
            _timestampsArray[_i] = _timestampsArrayTemp[_valCount - 1 - _i];
            _valuesArray[_i] = retrieveData(_queryId, _timestampsArray[_i]);
        }
        return (_valuesArray, _timestampsArray);
    }

    /**
     * @dev Counts the number of values that have been submitted for the queryId
     * @param _queryId the id to look up
     * @return uint256 count of the number of values received for the queryId
     */
    function getNewValueCountbyQueryId(bytes32 _queryId)
        public
        view
        returns (uint256)
    {
        return fetch.getNewValueCountbyQueryId(_queryId);
    }

    /**
     * @dev Returns the address of the reporter who submitted a value for a data ID at a specific time
     * @param _queryId is ID of the specific data feed
     * @param _timestamp is the timestamp to find a corresponding reporter for
     * @return address of the reporter who reported the value for the data ID at the given timestamp
     */
    function getReporterByTimestamp(bytes32 _queryId, uint256 _timestamp)
        public
        view
        returns (address)
    {
        return fetch.getReporterByTimestamp(_queryId, _timestamp);
    }

    /**
     * @dev Gets the timestamp for the value based on their index
     * @param _queryId is the id to look up
     * @param _index is the value index to look up
     * @return uint256 timestamp
     */
    function getTimestampbyQueryIdandIndex(bytes32 _queryId, uint256 _index)
        public
        view
        returns (uint256)
    {
        return fetch.getTimestampbyQueryIdandIndex(_queryId, _index);
    }

    /**
     * @dev Determines whether a value with a given queryId and timestamp has been disputed
     * @param _queryId is the value id to look up
     * @param _timestamp is the timestamp of the value to look up
     * @return bool true if queryId/timestamp is under dispute
     */
    function isInDispute(bytes32 _queryId, uint256 _timestamp)
        public
        view
        returns (bool)
    {
        return fetch.isInDispute(_queryId, _timestamp);
    }

    /**
     * @dev Retrieve value from oracle based on queryId/timestamp
     * @param _queryId being requested
     * @param _timestamp to retrieve data/value from
     * @return bytes value for query/timestamp submitted
     */
    function retrieveData(bytes32 _queryId, uint256 _timestamp)
        public
        view
        returns (bytes memory)
    {
        return fetch.retrieveData(_queryId, _timestamp);
    }

    /**
     * @dev allows dev to set mapping contract for valueFor (EIP2362)
     * @param _addy address of mapping contract
     */
    function setIdMappingContract(address _addy) external {
        require(address(idMappingContract) == address(0));
        idMappingContract = IMappingContract(_addy);
    }

    /**
     * @dev Retrieve most recent int256 value from oracle based on queryId
     * @param _id being requested
     * @return _value most recent value submitted
     * @return _timestamp timestamp of most recent value
     * @return _statusCode 200 if value found, 404 if not found
     */
    function valueFor(bytes32 _id)
        external
        view
        override
        returns (
            int256 _value,
            uint256 _timestamp,
            uint256 _statusCode
        )
    {
        bytes32 _queryId = idMappingContract.getFetchID(_id);
        bytes memory _valueBytes;
        (_valueBytes, _timestamp) = getDataBefore(
            _queryId,
            block.timestamp + 1
        );
        if (_timestamp == 0) {
            return (0, 0, 404);
        }
        uint256 _valueUint = _sliceUint(_valueBytes);
        _value = int256(_valueUint);
        return (_value, _timestamp, 200);
    }

    // Internal functions
    /**
     * @dev Convert bytes to uint256
     * @param _b bytes value to convert to uint256
     * @return _number uint256 converted from bytes
     */
    function _sliceUint(bytes memory _b)
        internal
        pure
        returns (uint256 _number)
    {
        for (uint256 _i = 0; _i < _b.length; _i++) {
            _number = _number * 256 + uint8(_b[_i]);
        }
    }
}
          

Compiler Settings

{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata","storageLayout"],"":["ast"]}},"optimizer":{"runs":300,"enabled":true},"libraries":{},"evmVersion":"paris"}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"event","name":"AdminChanged","inputs":[{"type":"address","name":"previousAdmin","internalType":"address","indexed":false},{"type":"address","name":"newAdmin","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"BeaconUpgraded","inputs":[{"type":"address","name":"beacon","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"type":"uint8","name":"version","internalType":"uint8","indexed":false}],"anonymous":false},{"type":"event","name":"NewDispute","inputs":[{"type":"uint256","name":"_disputeId","internalType":"uint256","indexed":false},{"type":"bytes32","name":"_queryId","internalType":"bytes32","indexed":false},{"type":"uint256","name":"_timestamp","internalType":"uint256","indexed":false},{"type":"address","name":"_reporter","internalType":"address","indexed":false},{"type":"address","name":"_initiator","internalType":"address","indexed":false},{"type":"uint256","name":"_startDate","internalType":"uint256","indexed":false},{"type":"uint256","name":"_voteRound","internalType":"uint256","indexed":false},{"type":"uint256","name":"_fee","internalType":"uint256","indexed":false},{"type":"uint256","name":"_voteRoundLength","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Upgraded","inputs":[{"type":"address","name":"implementation","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"VoteExecuted","inputs":[{"type":"uint256","name":"_disputeId","internalType":"uint256","indexed":false},{"type":"uint8","name":"_result","internalType":"enum Governance.VoteResult","indexed":false}],"anonymous":false},{"type":"event","name":"VoteTallied","inputs":[{"type":"uint256","name":"_disputeId","internalType":"uint256","indexed":false},{"type":"uint8","name":"_result","internalType":"enum Governance.VoteResult","indexed":false},{"type":"address","name":"_initiator","internalType":"address","indexed":false},{"type":"address","name":"_reporter","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Voted","inputs":[{"type":"uint256","name":"_disputeId","internalType":"uint256","indexed":false},{"type":"bool","name":"_supports","internalType":"bool","indexed":false},{"type":"address","name":"_voter","internalType":"address","indexed":false},{"type":"bool","name":"_invalidQuery","internalType":"bool","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"autopayAddrsQueryId","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"beginDispute","inputs":[{"type":"bytes32","name":"_queryId","internalType":"bytes32"},{"type":"uint256","name":"_timestamp","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"didVote","inputs":[{"type":"uint256","name":"_disputeId","internalType":"uint256"},{"type":"address","name":"_voter","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"executeVote","inputs":[{"type":"uint256","name":"_disputeId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IFetch"}],"name":"fetch","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes","name":"_value","internalType":"bytes"},{"type":"uint256","name":"_timestampRetrieved","internalType":"uint256"}],"name":"getDataAfter","inputs":[{"type":"bytes32","name":"_queryId","internalType":"bytes32"},{"type":"uint256","name":"_timestamp","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes","name":"_value","internalType":"bytes"},{"type":"uint256","name":"_timestampRetrieved","internalType":"uint256"}],"name":"getDataBefore","inputs":[{"type":"bytes32","name":"_queryId","internalType":"bytes32"},{"type":"uint256","name":"_timestamp","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getDisputeFee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"bytes","name":"","internalType":"bytes"},{"type":"address","name":"","internalType":"address"}],"name":"getDisputeInfo","inputs":[{"type":"uint256","name":"_disputeId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"getDisputesByReporter","inputs":[{"type":"address","name":"_reporter","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"_found","internalType":"bool"},{"type":"uint256","name":"_index","internalType":"uint256"}],"name":"getIndexForDataAfter","inputs":[{"type":"bytes32","name":"_queryId","internalType":"bytes32"},{"type":"uint256","name":"_timestamp","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"_found","internalType":"bool"},{"type":"uint256","name":"_index","internalType":"uint256"}],"name":"getIndexForDataBefore","inputs":[{"type":"bytes32","name":"_queryId","internalType":"bytes32"},{"type":"uint256","name":"_timestamp","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes[]","name":"_values","internalType":"bytes[]"},{"type":"uint256[]","name":"_timestamps","internalType":"uint256[]"}],"name":"getMultipleValuesBefore","inputs":[{"type":"bytes32","name":"_queryId","internalType":"bytes32"},{"type":"uint256","name":"_timestamp","internalType":"uint256"},{"type":"uint256","name":"_maxAge","internalType":"uint256"},{"type":"uint256","name":"_maxCount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getNewValueCountbyQueryId","inputs":[{"type":"bytes32","name":"_queryId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getOpenDisputesOnId","inputs":[{"type":"bytes32","name":"_queryId","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getReporterByTimestamp","inputs":[{"type":"bytes32","name":"_queryId","internalType":"bytes32"},{"type":"uint256","name":"_timestamp","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getTimestampbyQueryIdandIndex","inputs":[{"type":"bytes32","name":"_queryId","internalType":"bytes32"},{"type":"uint256","name":"_index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getVoteCount","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"},{"type":"uint256[17]","name":"","internalType":"uint256[17]"},{"type":"bool","name":"","internalType":"bool"},{"type":"uint8","name":"","internalType":"enum Governance.VoteResult"},{"type":"address","name":"","internalType":"address"}],"name":"getVoteInfo","inputs":[{"type":"uint256","name":"_disputeId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"getVoteRounds","inputs":[{"type":"bytes32","name":"_hash","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getVoteTallyByAddress","inputs":[{"type":"address","name":"_voter","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IMappingContract"}],"name":"idMappingContract","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_fetch","internalType":"address payable"},{"type":"address","name":"_teamMultisig","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isInDispute","inputs":[{"type":"bytes32","name":"_queryId","internalType":"bytes32"},{"type":"uint256","name":"_timestamp","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IOracle"}],"name":"oracle","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"oracleAddress","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"proxiableUUID","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes","name":"","internalType":"bytes"}],"name":"retrieveData","inputs":[{"type":"bytes32","name":"_queryId","internalType":"bytes32"},{"type":"uint256","name":"_timestamp","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setIdMappingContract","inputs":[{"type":"address","name":"_addy","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"tallyVotes","inputs":[{"type":"uint256","name":"_disputeId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"teamMultisig","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"token","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"upgradeTo","inputs":[{"type":"address","name":"newImplementation","internalType":"address"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"upgradeToAndCall","inputs":[{"type":"address","name":"newImplementation","internalType":"address"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"int256","name":"_value","internalType":"int256"},{"type":"uint256","name":"_timestamp","internalType":"uint256"},{"type":"uint256","name":"_statusCode","internalType":"uint256"}],"name":"valueFor","inputs":[{"type":"bytes32","name":"_id","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"vote","inputs":[{"type":"uint256","name":"_disputeId","internalType":"uint256"},{"type":"bool","name":"_supports","internalType":"bool"},{"type":"bool","name":"_invalidQuery","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"voteCount","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"voteOnMultipleDisputes","inputs":[{"type":"uint256[]","name":"_disputeIds","internalType":"uint256[]"},{"type":"bool[]","name":"_supports","internalType":"bool[]"},{"type":"bool[]","name":"_invalidQuery","internalType":"bool[]"}]}]
              

Contract Creation Code

0x60a0604052306080523480156200001557600080fd5b506200002062000026565b620000e7565b603454610100900460ff1615620000935760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60345460ff90811614620000e5576034805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b608051614b726200011f600039600081816114500152818161149001528181611d8001528181611dc00152611e530152614b726000f3fe6080604052600436106102555760003560e01c80638da5cb5b11610149578063d8add0f6116100c6578063f2fde38b1161008a578063f98a4eca11610064578063f98a4eca146107d7578063fc0c546a146107f7578063fcd4a5461461081757600080fd5b8063f2fde38b1461075c578063f66f49c31461077c578063f78eea831461079c57600080fd5b8063d8add0f6146106ce578063dbc0c085146106e5578063df133bca14610706578063e07c548614610726578063e7b3387c1461074657600080fd5b8063bbf3e10b1161010d578063bbf3e10b1461061e578063bdc7d9d814610633578063c5958af91461066a578063c638407114610697578063ce5e11bf146106ae57600080fd5b80638da5cb5b14610555578063a792765f14610573578063a7c438bc14610593578063a89ae4ba146105de578063a95c372d146105fe57600080fd5b80634d318b0e116101d757806364ee3c6d1161019b57806364ee3c6d146104a1578063715018a6146104cf57806377b03e0d146104e45780637dc0d1d0146105045780638d8242731461052457600080fd5b80634d318b0e146104095780634e9fe708146104295780634f1ef2861461044957806352d1902d1461045c5780636169c3081461047157600080fd5b8063294490851161021e578063294490851461032a5780632af8aae0146103615780633659cfe61461039957806344e87f91146103b9578063485cc955146103e957600080fd5b8062b121901461025a5780630e1596ef1461027c578063193b505b146102bd5780631f379acc146102dd578063248638e5146102fd575b600080fd5b34801561026657600080fd5b5061027a610275366004613e6f565b610845565b005b34801561028857600080fd5b506102aa610297366004613f4c565b6000908152610104602052604090205490565b6040519081526020015b60405180910390f35b3480156102c957600080fd5b5061027a6102d8366004613f7a565b6108bf565b3480156102e957600080fd5b5061027a6102f8366004613f97565b6108f7565b34801561030957600080fd5b5061031d610318366004613f4c565b611363565b6040516102b49190613ff4565b34801561033657600080fd5b5061034a610345366004613f97565b6113c6565b6040805192151583526020830191909152016102b4565b34801561036d57600080fd5b50600154610381906001600160a01b031681565b6040516001600160a01b0390911681526020016102b4565b3480156103a557600080fd5b5061027a6103b4366004613f7a565b611446565b3480156103c557600080fd5b506103d96103d4366004613f97565b611525565b60405190151581526020016102b4565b3480156103f557600080fd5b5061027a610404366004614007565b6115a3565b34801561041557600080fd5b5061027a610424366004613f4c565b6117d7565b34801561043557600080fd5b5061031d610444366004613f7a565b611d0b565b61027a610457366004614068565b611d76565b34801561046857600080fd5b506102aa611e46565b34801561047d57600080fd5b5061049161048c366004613f4c565b611ef9565b6040516102b49493929190614146565b3480156104ad57600080fd5b506104c16104bc366004613f97565b611fce565b6040516102b492919061417f565b3480156104db57600080fd5b5061027a612027565b3480156104f057600080fd5b506102aa6104ff366004613f4c565b61203b565b34801561051057600080fd5b5060fd54610381906001600160a01b031681565b34801561053057600080fd5b5061054461053f366004613f4c565b6120a9565b6040516102b49594939291906141d9565b34801561056157600080fd5b506067546001600160a01b0316610381565b34801561057f57600080fd5b506104c161058e366004613f97565b6121b3565b34801561059f57600080fd5b506103d96105ae36600461423c565b6000828152610105602090815260408083206001600160a01b038516845260130190915290205460ff1692915050565b3480156105ea57600080fd5b5060ff54610381906001600160a01b031681565b34801561060a57600080fd5b50600054610381906001600160a01b031681565b34801561062a57600080fd5b506102aa61223a565b34801561063f57600080fd5b506102aa61064e366004613f7a565b6001600160a01b03166000908152610107602052604090205490565b34801561067657600080fd5b5061068a610685366004613f97565b6122c4565b6040516102b49190614261565b3480156106a357600080fd5b506102aa6101015481565b3480156106ba57600080fd5b506102aa6106c9366004613f97565b61233d565b3480156106da57600080fd5b506102aa6101025481565b3480156106f157600080fd5b5061010054610381906001600160a01b031681565b34801561071257600080fd5b5061027a610721366004614274565b6123b2565b34801561073257600080fd5b50610381610741366004613f97565b612947565b34801561075257600080fd5b50610101546102aa565b34801561076857600080fd5b5061027a610777366004613f7a565b6129bc565b34801561078857600080fd5b5061034a610797366004613f97565b612a32565b3480156107a857600080fd5b506107bc6107b7366004613f4c565b612bef565b604080519384526020840192909252908201526060016102b4565b3480156107e357600080fd5b5061027a6107f2366004613f4c565b612cb4565b34801561080357600080fd5b5060fe54610381906001600160a01b031681565b34801561082357600080fd5b506108376108323660046142b6565b613408565b6040516102b49291906142e8565b60005b83518110156108b9576108a78482815181106108665761086661435e565b60200260200101518483815181106108805761088061435e565b602002602001015184848151811061089a5761089a61435e565b60200260200101516123b2565b806108b18161438a565b915050610848565b50505050565b6001546001600160a01b0316156108d557600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60fd5460405163fd0b69af60e01b8152600481018490526001600160a01b039091169063fd0b69af90602401602060405180830381865afa158015610940573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096491906143a3565b156109c15760405162461bcd60e51b815260206004820152602260248201527f6d616e6167656420717565726965732063616e6e6f7420626520646973707574604482015261195960f21b60648201526084015b60405180910390fd5b60fd54604051630935408d60e41b815260048101849052602481018390526001600160a01b039091169063935408d090604401602060405180830381865afa158015610a11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3591906143c0565b600003610a8f5760405162461bcd60e51b815260206004820152602260248201527f6e6f2076616c75652065786973747320617420676976656e2074696d6573746160448201526106d760f41b60648201526084016109b8565b6040805160208082018590528183018490528251808303840181526060909201909252805191012061010154600090610ac99060016143d9565b60008381526101066020908152604080832080546001808201835582865284862090910186905585855261010584528285206101039094529382902089815593840188905560fd54915163703e2a4360e11b8152600481018a905260248101899052949550939192916001600160a01b039091169063e07c548690604401602060405180830381865afa158015610b64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8891906143ec565b600382810180546001600160a01b0319166001600160a01b0393841617815587855560128501805475ffffffffffffffffffffffffffffffffffffffff0000191633620100000217905543918501919091554260028501558454600185810191909155905490911660009081526101086020908152604082208054938401815582528120909101859055610c1a61223a565b8454909150600103610ef75761012c610c338842614409565b10610c9b5760405162461bcd60e51b815260206004820152603260248201527f44697370757465206d75737420626520737461727465642077697468696e207260448201527165706f7274696e67206c6f636b2074696d6560701b60648201526084016109b8565b600088815261010460205260408120805491610cb68361438a565b90915550506000888152610104602052604090205460041015610d515760fd60009054906101000a90046001600160a01b03166001600160a01b031663722580b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4a91906143c0565b9050610d85565b60008881526101046020526040902054610d6d90600190614409565b610d78906002614500565b610d82908261450c565b90505b60fd54600383015460405163137f0a8d60e21b81526001600160a01b039182166004820152306024820152911690634dfc2a34906044016020604051808303816000875af1158015610ddb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dff91906143c0565b60048381019190915560fd5460405163c5958af960e01b81529182018a9052602482018990526001600160a01b03169063c5958af990604401600060405180830381865afa158015610e55573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610e7d9190810190614568565b6002830190610e8c908261461f565b5060fd546040516316d7b73f60e21b8152600481018a9052602481018990526001600160a01b0390911690635b5edcfc90604401600060405180830381600087803b158015610eda57600080fd5b505af1158015610eee573d6000803e3d6000fd5b505050506110e7565b83546000908590610f0a90600290614409565b81548110610f1a57610f1a61435e565b9060005260206000200154905061012c61010560008381526020019081526020016000206005015442610f4d9190614409565b10610fb55760405162461bcd60e51b815260206004820152603260248201527f4e6577206469737075746520726f756e64206d75737420626520737461727465604482015271642077697468696e2035206d696e7574657360701b60648201526084016109b8565b84546004101561103d5760fd60009054906101000a90046001600160a01b03166001600160a01b031663722580b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015611012573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103691906143c0565b9150611063565b845461104b90600190614409565b611056906002614500565b611060908361450c565b91505b61010360008660008154811061107b5761107b61435e565b906000526020600020015481526020019081526020016000206004015483600401819055506101036000866000815481106110b8576110b861435e565b906000526020600020015481526020019081526020016000206002018360020190816110e491906146df565b50505b60fd60009054906101000a90046001600160a01b03166001600160a01b031663722580b66040518163ffffffff1660e01b8152600401602060405180830381865afa15801561113a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115e91906143c0565b8111156111df5760fd60009054906101000a90046001600160a01b03166001600160a01b031663722580b66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111dc91906143c0565b90505b6004830181905561010180549060006111f78361438a565b909155505060fe546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015611253573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061127791906143a3565b6112b65760405162461bcd60e51b815260206004820152601060248201526f119959481b5d5cdd081899481c185a5960821b60448201526064016109b8565b60038201546012840154600285015460018601548654600090815261010660209081526040918290205482518c81529182018f90528183018e90526001600160a01b03968716606083015262010000909504909516608086015260a085019290925260c084015260e08301849052610100830191909152517ffbfeca72a80efb0d1aabf7f937aaec719fa5c81548a4ade65b40ecdec0afca4e918190036101200190a15050505050505050565b600081815261010660209081526040918290208054835181840281018401909452808452606093928301828280156113ba57602002820191906000526020600020905b8154815260200190600101908083116113a6575b50505050509050919050565b60008054604051632944908560e01b8152600481018590526024810184905282916001600160a01b0316906329449085906044016040805180830381865afa158015611416573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143a91906147ba565b915091505b9250929050565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361148e5760405162461bcd60e51b81526004016109b8906147e8565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166114d7600080516020614af6833981519152546001600160a01b031690565b6001600160a01b0316146114fd5760405162461bcd60e51b81526004016109b890614834565b611506816136f7565b60408051600080825260208201909252611522918391906136ff565b50565b600080546040516344e87f9160e01b815260048101859052602481018490526001600160a01b03909116906344e87f9190604401602060405180830381865afa158015611576573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159a91906143a3565b90505b92915050565b603454610100900460ff16158080156115c35750603454600160ff909116105b806115dd5750303b1580156115dd575060345460ff166001145b6116405760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016109b8565b6034805460ff191660011790558015611663576034805461ff0019166101001790555b61166b61386a565b600080546001600160a01b0319166001600160a01b03851617905560408051602080820183526000825291516116a19201614261565b60408051601f19818403018152908290526116be91602001614880565b60408051808303601f1901815282825280516020918201206101025560fd80546001600160a01b0319166001600160a01b03881690811790915563021fd35d60e31b8452915191926310fe9ae892600480830193928290030181865afa15801561172c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061175091906143ec565b60fe80546001600160a01b03199081166001600160a01b039384161790915560ff80548216868416179055610100805490911691841691909117905580156117d2576034805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6000818152610105602052604090206005810154156118385760405162461bcd60e51b815260206004820152601d60248201527f566f74652068617320616c7265616479206265656e2074616c6c69656400000060448201526064016109b8565b61010154821115801561184b5750600082115b61188d5760405162461bcd60e51b8152602060048201526013602482015272159bdd1948191bd95cc81b9bdd08195e1a5cdd606a1b60448201526064016109b8565b600181015461189d90607861450c565b60028201546118ac9042614409565b1015806118ca57506102d08160020154426118c79190614409565b10155b6119165760405162461bcd60e51b815260206004820152601f60248201527f54696d6520666f7220766f74696e6720686173206e6f7420656c61707365640060448201526064016109b8565b60088101546007820154600683015460009291611932916143d9565b61193c91906143d9565b600e830154600d840154600c85015492935060009261195b91906143d9565b61196591906143d9565b60118401546010850154600f86015492935060009261198491906143d9565b61198e91906143d9565b600b850154600a86015460098701549293506000926119ad91906143d9565b6119b791906143d9565b9050836000036119cf57836119cb8161438a565b9450505b826000036119e557826119e18161438a565b9350505b816000036119fb57816119f78161438a565b9250505b80600003611a115780611a0d8161438a565b9150505b60098501546000908290611a2d90670de0b6b3a764000061450c565b611a3791906148ba565b600f8701548490611a5090670de0b6b3a764000061450c565b611a5a91906148ba565b600c8801548690611a7390670de0b6b3a764000061450c565b611a7d91906148ba565b60068901548890611a9690670de0b6b3a764000061450c565b611aa091906148ba565b611aaa91906143d9565b611ab491906143d9565b611abe91906143d9565b90506000828760090160010154670de0b6b3a7640000611ade919061450c565b611ae891906148ba565b60108801548590611b0190670de0b6b3a764000061450c565b611b0b91906148ba565b600d8901548790611b2490670de0b6b3a764000061450c565b611b2e91906148ba565b60078a01548990611b4790670de0b6b3a764000061450c565b611b5191906148ba565b611b5b91906143d9565b611b6591906143d9565b611b6f91906143d9565b90506000838860090160020154670de0b6b3a7640000611b8f919061450c565b611b9991906148ba565b60118901548690611bb290670de0b6b3a764000061450c565b611bbc91906148ba565b600e8a01548890611bd590670de0b6b3a764000061450c565b611bdf91906148ba565b60088b01548a90611bf890670de0b6b3a764000061450c565b611c0291906148ba565b611c0c91906143d9565b611c1691906143d9565b611c2091906143d9565b9050611c2c81836143d9565b831115611c51576012880180546001919061ff001916610100835b0217905550611c8c565b611c5b81846143d9565b821115611c7a576012880180546000919061ff00191661010083611c47565b60128801805461ff0019166102001790555b426005890155601288015460008a81526101036020526040908190206003015490517fa2d4e500801849d40ad00f0f12ba92a5263f83ec68946e647be95cfbe581c7b692611cf8928d9260ff610100840416926001600160a01b036201000090910481169216906148dc565b60405180910390a1505050505050505050565b6001600160a01b038116600090815261010860209081526040918290208054835181840281018401909452808452606093928301828280156113ba57602002820191906000526020600020908154815260200190600101908083116113a65750505050509050919050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003611dbe5760405162461bcd60e51b81526004016109b8906147e8565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611e07600080516020614af6833981519152546001600160a01b031690565b6001600160a01b031614611e2d5760405162461bcd60e51b81526004016109b890614834565b611e36826136f7565b611e42828260016136ff565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611ee65760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016109b8565b50600080516020614af683398151915290565b600081815261010360205260408120805460018201546003830154600284018054869560609587959194909391926001600160a01b03909116908290611f3e9061459d565b80601f0160208091040260200160405190810160405280929190818152602001828054611f6a9061459d565b8015611fb75780601f10611f8c57610100808354040283529160200191611fb7565b820191906000526020600020905b815481529060010190602001808311611f9a57829003601f168201915b505050505091509450945094509450509193509193565b60606000806000611fdf8686612a32565b9150915081612006576000604051806020016040528060008152509093509350505061143f565b612010868261233d565b925061201c86846122c4565b935050509250929050565b61202f613899565b61203960006138f3565b565b600080546040516377b03e0d60e01b8152600481018490526001600160a01b03909116906377b03e0d90602401602060405180830381865afa158015612085573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159d91906143c0565b60006120b3613d63565b5050600090815261010560209081526040918290208054835161022081018552600183015481526002830154938101939093526003820154938301939093526004810154606083015260058101546080830152600681015460a0830152600781015460c0830152600881015460e0830152600981015461010080840191909152600a820154610120840152600b820154610140840152600c820154610160840152600d820154610180840152600e8201546101a0840152600f8201546101c084015260108201546101e084015260118201546102008401526012909101549293919260ff808216939282041691620100009091046001600160a01b031690565b6000805460405163a792765f60e01b81526004810185905260248101849052606092916001600160a01b03169063a792765f90604401600060405180830381865afa158015612206573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261222e9190810190614912565b90969095509350505050565b6000600a60fd60009054906101000a90046001600160a01b03166001600160a01b031663722580b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015612291573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122b591906143c0565b6122bf91906148ba565b905090565b60005460405163c5958af960e01b815260048101849052602481018390526060916001600160a01b03169063c5958af990604401600060405180830381865afa158015612315573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261159a9190810190614568565b6000805460405163ce5e11bf60e01b815260048101859052602481018490526001600160a01b039091169063ce5e11bf90604401602060405180830381865afa15801561238e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159a91906143c0565b6101015483111580156123c55750600083115b6124075760405162461bcd60e51b8152602060048201526013602482015272159bdd1948191bd95cc81b9bdd08195e1a5cdd606a1b60448201526064016109b8565b6000838152610105602052604090206005810154156124685760405162461bcd60e51b815260206004820152601d60248201527f566f74652068617320616c7265616479206265656e2074616c6c69656400000060448201526064016109b8565b33600090815260138201602052604090205460ff16156124ca5760405162461bcd60e51b815260206004820152601860248201527f53656e6465722068617320616c726561647920766f746564000000000000000060448201526064016109b8565b336000818152601383016020526040808220805460ff1916600117905560fe5490516370a0823160e01b8152600481019390935290916001600160a01b03909116906370a0823190602401602060405180830381865afa158015612532573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061255691906143c0565b60fd54604051630733bdef60e41b815233600482015291925060009182916001600160a01b03169063733bdef09060240161010060405180830381865afa1580156125a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125c9919061496c565b5050505050925092505080826125df91906143d9565b6125e990846143d9565b925084156126eb578284600601600201600082825461260891906143d9565b909155505060fd54604051631c3c149f60e11b81523360048201526001600160a01b0390911690633878293e90602401602060405180830381865afa158015612655573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061267991906143c0565b600e8501805460009061268d9084906143d9565b9091555061269c905033613945565b600b850180546000906126b09084906143d9565b9091555050610100546001600160a01b031633036126e657600184600f0160020160008282546126e091906143d9565b90915550505b6128d5565b85156127e0578284600601600001600082825461270891906143d9565b909155505060fd54604051631c3c149f60e11b81523360048201526001600160a01b0390911690633878293e90602401602060405180830381865afa158015612755573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061277991906143c0565b600c8501805460009061278d9084906143d9565b9091555061279c905033613945565b6009850180546000906127b09084906143d9565b9091555050610100546001600160a01b031633036126e657600184600f0160000160008282546126e091906143d9565b828460060160010160008282546127f791906143d9565b909155505060fd54604051631c3c149f60e11b81523360048201526001600160a01b0390911690633878293e90602401602060405180830381865afa158015612844573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061286891906143c0565b600d8501805460009061287c9084906143d9565b9091555061288b905033613945565b600a8501805460009061289f9084906143d9565b9091555050610100546001600160a01b031633036128d557600184600f0160010160008282546128cf91906143d9565b90915550505b336000908152610107602052604081208054916128f18361438a565b90915550506040805188815287151560208201523381830152861515606082015290517fbe6f1c58cc15c8e86d6f0ef23c5a30eb33319af3b57f6b7d9b56ccfa87696b849181900360800190a150505050505050565b6000805460405163703e2a4360e11b815260048101859052602481018490526001600160a01b039091169063e07c548690604401602060405180830381865afa158015612998573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159a91906143ec565b6129c4613899565b6001600160a01b038116612a295760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109b8565b611522816138f3565b6000806000612a408561203b565b905080600003612a5757600080925092505061143f565b80612a61816149c9565b9150600190506000808381612a768a8361233d565b9050888111612a91576000809750975050505050505061143f565b612a9b8a8461233d565b905088811115612aaa57600094505b8415612b5a576002612abc84846143d9565b612ac691906148ba565b9350612ad28a8561233d565b905088811115612b13576000612aed8b6106c9600188614409565b9050898111612aff5760009550612b0d565b612b0a600186614409565b92505b50612aaa565b6000612b248b6106c98760016143d9565b905089811115612b47576000955084612b3c8161438a565b955050809150612b0d565b612b528560016143d9565b935050612aaa565b612b648a82611525565b612b7a576001849750975050505050505061143f565b612b848a82611525565b8015612b8f57508584105b15612bb25783612b9e8161438a565b945050612bab8a8561233d565b9050612b7a565b8584148015612bc65750612bc68a82611525565b15612bdd576000809750975050505050505061143f565b6001849750975050505050505061143f565b60015460405163690ebcf760e11b8152600481018390526000918291829182916001600160a01b039091169063d21d79ee90602401602060405180830381865afa158015612c41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c6591906143c0565b90506060612c788261058e4260016143d9565b945090506000849003612c98576000806101949450945094505050612cad565b6000612ca382613a96565b955060c893505050505b9193909250565b600081815261010560205260409020610101548211801590612cd65750600082115b612d225760405162461bcd60e51b815260206004820152601860248201527f44697370757465204944206d7573742062652076616c6964000000000000000060448201526064016109b8565b601281015460ff1615612d775760405162461bcd60e51b815260206004820152601e60248201527f566f74652068617320616c7265616479206265656e206578656375746564000060448201526064016109b8565b6000816005015411612dcb5760405162461bcd60e51b815260206004820152601460248201527f566f7465206d7573742062652074616c6c69656400000000000000000000000060448201526064016109b8565b600181015481546000908152610106602052604090205414612e2f5760405162461bcd60e51b815260206004820152601660248201527f4d757374206265207468652066696e616c20766f74650000000000000000000060448201526064016109b8565b61012c816005015442612e429190614409565b1015612eb65760405162461bcd60e51b815260206004820152603760248201527f35206d696e757465732068617320746f20706173732061667465722074616c6c60448201527f7920746f20616c6c6f7720666f7220646973707574657300000000000000000060648201526084016109b8565b60128101805460ff1916600117905560008281526101036020908152604080832080548452610104909252822080549192612ef0836149c9565b90915550600090508060016012850154610100900460ff166002811115612f1957612f196141a1565b036130b85783546000908152610106602052604090205491505b81156130b3578354600090815261010660205260409020612f55600184614409565b81548110612f6557612f6561435e565b9060005260206000200154905061010560008281526020019081526020016000209350816001036130195760fe54601285015460048581015460405163a9059cbb60e01b81526001600160a01b0362010000909404841692810192909252602482015291169063a9059cbb906044016020604051808303816000875af1158015612ff3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061301791906143a3565b505b60fe54601285015460048087015460405163a9059cbb60e01b81526001600160a01b0362010000909404841692810192909252602482015291169063a9059cbb906044016020604051808303816000875af115801561307c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130a091906143a3565b50816130ab816149c9565b925050612f33565b6133ac565b60026012850154610100900460ff1660028111156130d8576130d86141a1565b0361326a5783546000908152610106602052604090205491505b81156131e3578354600090815261010660205260409020613114600184614409565b815481106131245761312461435e565b60009182526020808320919091015480835261010590915260409182902060fe546012820154600480840154955163a9059cbb60e01b81526001600160a01b03620100009093048316918101919091526024810195909552919750919350169063a9059cbb906044016020604051808303816000875af11580156131ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131d091906143a3565b50816131db816149c9565b9250506130f2565b60fe54600384015460048086015460405163a9059cbb60e01b81526001600160a01b0393841692810192909252602482015291169063a9059cbb906044016020604051808303816000875af1158015613240573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061326491906143a3565b506133ac565b60006012850154610100900460ff16600281111561328a5761328a6141a1565b036133ac5783546000908152610106602052604081205492505b821561331d5784546000908152610106602052604090206132c6600185614409565b815481106132d6576132d661435e565b906000526020600020015491506101056000838152602001908152602001600020945084600401548161330991906143d9565b905082613315816149c9565b9350506132a4565b600484015461332c90826143d9565b60fe54600386015460405163a9059cbb60e01b81526001600160a01b03918216600482015260248101849052929350169063a9059cbb906044016020604051808303816000875af1158015613385573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133a991906143a3565b50505b60008581526101056020526040908190206012015490517f40d231bf91823121de9e1c012d95f835ea5684dc1d93360d9510a30543345da4916133f9918891610100900460ff16906149e0565b60405180910390a15050505050565b60608060008061341c88610797888a614409565b915091508161346d576040805160008082526020820190925290613450565b606081526020019060019003908161343b5790505b5060408051600081526020810190915290945092506136ee915050565b600061347989896113c6565b9093509050826134cc5760408051600080825260208201909252906134ae565b60608152602001906001900390816134995790505b5060408051600081526020810190915290955093506136ee92505050565b60008060008867ffffffffffffffff8111156134ea576134ea613d82565b604051908082528060200260200182016040528015613513578160200160208202803683370190505b5090505b888310801561353a5750848261352e8660016143d9565b6135389190614409565b115b1561359e57600061354f8d6106c98588614409565b905061355b8d82611525565b61358b57808285815181106135725761357261435e565b6020908102919091010152836135878161438a565b9450505b826135958161438a565b93505050613517565b60008367ffffffffffffffff8111156135b9576135b9613d82565b6040519080825280602002602001820160405280156135ec57816020015b60608152602001906001900390816135d75790505b50905060008467ffffffffffffffff81111561360a5761360a613d82565b604051908082528060200260200182016040528015613633578160200160208202803683370190505b50905060005b858110156136e157838161364e600189614409565b6136589190614409565b815181106136685761366861435e565b60200260200101518282815181106136825761368261435e565b6020026020010181815250506136b18f8383815181106136a4576136a461435e565b60200260200101516122c4565b8382815181106136c3576136c361435e565b602002602001018190525080806136d99061438a565b915050613639565b5090985096505050505050505b94509492505050565b611522613899565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615613732576117d283613aed565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561378c575060408051601f3d908101601f19168201909252613789918101906143c0565b60015b6137ef5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016109b8565b600080516020614af6833981519152811461385e5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016109b8565b506117d2838383613b89565b603454610100900460ff166138915760405162461bcd60e51b81526004016109b8906149f4565b612039613bae565b6067546001600160a01b031633146120395760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109b8565b606780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600080600061395f610102546107084261058e9190614409565b90925090508015613a8f576000828060200190518101906139809190614a3f565b905060005b8151811015613a8c576000808383815181106139a3576139a361435e565b60200260200101516001600160a01b0316886040516024016139d491906001600160a01b0391909116815260200190565b60408051601f198184030181529181526020820180516001600160e01b03166345d6082360e01b17905251613a099190614ad9565b6000604051808303816000865af19150503d8060008114613a46576040519150601f19603f3d011682016040523d82523d6000602084013e613a4b565b606091505b50915091508115613a775780806020019051810190613a6a91906143c0565b613a7490886143d9565b96505b50508080613a849061438a565b915050613985565b50505b5050919050565b6000805b8251811015613ae757828181518110613ab557613ab561435e565b016020015160f81c613ac98361010061450c565b613ad391906143d9565b915080613adf8161438a565b915050613a9a565b50919050565b6001600160a01b0381163b613b5a5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016109b8565b600080516020614af683398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b613b9283613bde565b600082511180613b9f5750805b156117d2576108b98383613c1e565b603454610100900460ff16613bd55760405162461bcd60e51b81526004016109b8906149f4565b612039336138f3565b613be781613aed565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061159a8383604051806060016040528060278152602001614b16602791396060600080856001600160a01b031685604051613c5b9190614ad9565b600060405180830381855af49150503d8060008114613c96576040519150601f19603f3d011682016040523d82523d6000602084013e613c9b565b606091505b5091509150613cac86838387613cb8565b925050505b9392505050565b60608315613d27578251600003613d20576001600160a01b0385163b613d205760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016109b8565b5081613d31565b613d318383613d39565b949350505050565b815115613d495781518083602001fd5b8060405162461bcd60e51b81526004016109b89190614261565b6040518061022001604052806011906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613dc157613dc1613d82565b604052919050565b600067ffffffffffffffff821115613de357613de3613d82565b5060051b60200190565b801515811461152257600080fd5b600082601f830112613e0c57600080fd5b81356020613e21613e1c83613dc9565b613d98565b82815260059290921b84018101918181019086841115613e4057600080fd5b8286015b84811015613e64578035613e5781613ded565b8352918301918301613e44565b509695505050505050565b600080600060608486031215613e8457600080fd5b833567ffffffffffffffff80821115613e9c57600080fd5b818601915086601f830112613eb057600080fd5b81356020613ec0613e1c83613dc9565b82815260059290921b8401810191818101908a841115613edf57600080fd5b948201945b83861015613efd57853582529482019490820190613ee4565b97505087013592505080821115613f1357600080fd5b613f1f87838801613dfb565b93506040860135915080821115613f3557600080fd5b50613f4286828701613dfb565b9150509250925092565b600060208284031215613f5e57600080fd5b5035919050565b6001600160a01b038116811461152257600080fd5b600060208284031215613f8c57600080fd5b8135613cb181613f65565b60008060408385031215613faa57600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b83811015613fe957815187529582019590820190600101613fcd565b509495945050505050565b60208152600061159a6020830184613fb9565b6000806040838503121561401a57600080fd5b823561402581613f65565b9150602083013561403581613f65565b809150509250929050565b600067ffffffffffffffff82111561405a5761405a613d82565b50601f01601f191660200190565b6000806040838503121561407b57600080fd5b823561408681613f65565b9150602083013567ffffffffffffffff8111156140a257600080fd5b8301601f810185136140b357600080fd5b80356140c1613e1c82614040565b8181528660208385010111156140d657600080fd5b816020840160208301376000602083830101528093505050509250929050565b60005b838110156141115781810151838201526020016140f9565b50506000910152565b600081518084526141328160208601602086016140f6565b601f01601f19169290920160200192915050565b848152836020820152608060408201526000614165608083018561411a565b90506001600160a01b038316606083015295945050505050565b604081526000614192604083018561411a565b90508260208301529392505050565b634e487b7160e01b600052602160045260246000fd5b600381106141d557634e487b7160e01b600052602160045260246000fd5b9052565b8581526102a0810160208083018760005b6011811015614207578151835291830191908301906001016141ea565b505050508415156102408301526142226102608301856141b7565b6001600160a01b0383166102808301529695505050505050565b6000806040838503121561424f57600080fd5b82359150602083013561403581613f65565b60208152600061159a602083018461411a565b60008060006060848603121561428957600080fd5b83359250602084013561429b81613ded565b915060408401356142ab81613ded565b809150509250925092565b600080600080608085870312156142cc57600080fd5b5050823594602084013594506040840135936060013592509050565b6000604082016040835280855180835260608501915060608160051b8601019250602080880160005b8381101561433f57605f1988870301855261432d86835161411a565b95509382019390820190600101614311565b5050858403818701525050506143558185613fb9565b95945050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161439c5761439c614374565b5060010190565b6000602082840312156143b557600080fd5b8151613cb181613ded565b6000602082840312156143d257600080fd5b5051919050565b8082018082111561159d5761159d614374565b6000602082840312156143fe57600080fd5b8151613cb181613f65565b8181038181111561159d5761159d614374565b600181815b8085111561445757816000190482111561443d5761443d614374565b8085161561444a57918102915b93841c9390800290614421565b509250929050565b60008261446e5750600161159d565b8161447b5750600061159d565b8160018114614491576002811461449b576144b7565b600191505061159d565b60ff8411156144ac576144ac614374565b50506001821b61159d565b5060208310610133831016604e8410600b84101617156144da575081810a61159d565b6144e4838361441c565b80600019048211156144f8576144f8614374565b029392505050565b600061159a838361445f565b808202811582820484141761159d5761159d614374565b600082601f83011261453457600080fd5b8151614542613e1c82614040565b81815284602083860101111561455757600080fd5b613d318260208301602087016140f6565b60006020828403121561457a57600080fd5b815167ffffffffffffffff81111561459157600080fd5b613d3184828501614523565b600181811c908216806145b157607f821691505b602082108103613ae757634e487b7160e01b600052602260045260246000fd5b601f8211156117d257600081815260208120601f850160051c810160208610156145f85750805b601f850160051c820191505b8181101561461757828155600101614604565b505050505050565b815167ffffffffffffffff81111561463957614639613d82565b61464d81614647845461459d565b846145d1565b602080601f831160018114614682576000841561466a5750858301515b600019600386901b1c1916600185901b178555614617565b600085815260208120601f198616915b828110156146b157888601518255948401946001909101908401614692565b50858210156146cf5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b8181036146ea575050565b6146f4825461459d565b67ffffffffffffffff81111561470c5761470c613d82565b61471a81614647845461459d565b6000601f82116001811461474e57600083156147365750848201545b600019600385901b1c1916600184901b1784556147b3565b600085815260209020601f19841690600086815260209020845b838110156147885782860154825560019586019590910190602001614768565b50858310156147a65781850154600019600388901b60f8161c191681555b50505060018360011b0184555b5050505050565b600080604083850312156147cd57600080fd5b82516147d881613ded565b6020939093015192949293505050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60408152601060408201526f4175746f70617941646472657373657360801b606082015260806020820152600061159a608083018461411a565b6000826148d757634e487b7160e01b600052601260045260246000fd5b500490565b848152608081016148f060208301866141b7565b6001600160a01b03808516604084015280841660608401525095945050505050565b60008060006060848603121561492757600080fd5b835161493281613ded565b602085015190935067ffffffffffffffff81111561494f57600080fd5b61495b86828701614523565b925050604084015190509250925092565b600080600080600080600080610100898b03121561498957600080fd5b505086516020880151604089015160608a015160808b015160a08c015160c08d015160e0909d0151959e949d50929b919a50985090965094509092509050565b6000816149d8576149d8614374565b506000190190565b82815260408101613cb160208301846141b7565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006020808385031215614a5257600080fd5b825167ffffffffffffffff811115614a6957600080fd5b8301601f81018513614a7a57600080fd5b8051614a88613e1c82613dc9565b81815260059190911b82018301908381019087831115614aa757600080fd5b928401925b82841015614ace578351614abf81613f65565b82529284019290840190614aac565b979650505050505050565b60008251614aeb8184602087016140f6565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122002de718331af9066d89ff540e0c05edddf3167f47d51521dd1ede16a9b7e439364736f6c63430008140033

Deployed ByteCode

0x6080604052600436106102555760003560e01c80638da5cb5b11610149578063d8add0f6116100c6578063f2fde38b1161008a578063f98a4eca11610064578063f98a4eca146107d7578063fc0c546a146107f7578063fcd4a5461461081757600080fd5b8063f2fde38b1461075c578063f66f49c31461077c578063f78eea831461079c57600080fd5b8063d8add0f6146106ce578063dbc0c085146106e5578063df133bca14610706578063e07c548614610726578063e7b3387c1461074657600080fd5b8063bbf3e10b1161010d578063bbf3e10b1461061e578063bdc7d9d814610633578063c5958af91461066a578063c638407114610697578063ce5e11bf146106ae57600080fd5b80638da5cb5b14610555578063a792765f14610573578063a7c438bc14610593578063a89ae4ba146105de578063a95c372d146105fe57600080fd5b80634d318b0e116101d757806364ee3c6d1161019b57806364ee3c6d146104a1578063715018a6146104cf57806377b03e0d146104e45780637dc0d1d0146105045780638d8242731461052457600080fd5b80634d318b0e146104095780634e9fe708146104295780634f1ef2861461044957806352d1902d1461045c5780636169c3081461047157600080fd5b8063294490851161021e578063294490851461032a5780632af8aae0146103615780633659cfe61461039957806344e87f91146103b9578063485cc955146103e957600080fd5b8062b121901461025a5780630e1596ef1461027c578063193b505b146102bd5780631f379acc146102dd578063248638e5146102fd575b600080fd5b34801561026657600080fd5b5061027a610275366004613e6f565b610845565b005b34801561028857600080fd5b506102aa610297366004613f4c565b6000908152610104602052604090205490565b6040519081526020015b60405180910390f35b3480156102c957600080fd5b5061027a6102d8366004613f7a565b6108bf565b3480156102e957600080fd5b5061027a6102f8366004613f97565b6108f7565b34801561030957600080fd5b5061031d610318366004613f4c565b611363565b6040516102b49190613ff4565b34801561033657600080fd5b5061034a610345366004613f97565b6113c6565b6040805192151583526020830191909152016102b4565b34801561036d57600080fd5b50600154610381906001600160a01b031681565b6040516001600160a01b0390911681526020016102b4565b3480156103a557600080fd5b5061027a6103b4366004613f7a565b611446565b3480156103c557600080fd5b506103d96103d4366004613f97565b611525565b60405190151581526020016102b4565b3480156103f557600080fd5b5061027a610404366004614007565b6115a3565b34801561041557600080fd5b5061027a610424366004613f4c565b6117d7565b34801561043557600080fd5b5061031d610444366004613f7a565b611d0b565b61027a610457366004614068565b611d76565b34801561046857600080fd5b506102aa611e46565b34801561047d57600080fd5b5061049161048c366004613f4c565b611ef9565b6040516102b49493929190614146565b3480156104ad57600080fd5b506104c16104bc366004613f97565b611fce565b6040516102b492919061417f565b3480156104db57600080fd5b5061027a612027565b3480156104f057600080fd5b506102aa6104ff366004613f4c565b61203b565b34801561051057600080fd5b5060fd54610381906001600160a01b031681565b34801561053057600080fd5b5061054461053f366004613f4c565b6120a9565b6040516102b49594939291906141d9565b34801561056157600080fd5b506067546001600160a01b0316610381565b34801561057f57600080fd5b506104c161058e366004613f97565b6121b3565b34801561059f57600080fd5b506103d96105ae36600461423c565b6000828152610105602090815260408083206001600160a01b038516845260130190915290205460ff1692915050565b3480156105ea57600080fd5b5060ff54610381906001600160a01b031681565b34801561060a57600080fd5b50600054610381906001600160a01b031681565b34801561062a57600080fd5b506102aa61223a565b34801561063f57600080fd5b506102aa61064e366004613f7a565b6001600160a01b03166000908152610107602052604090205490565b34801561067657600080fd5b5061068a610685366004613f97565b6122c4565b6040516102b49190614261565b3480156106a357600080fd5b506102aa6101015481565b3480156106ba57600080fd5b506102aa6106c9366004613f97565b61233d565b3480156106da57600080fd5b506102aa6101025481565b3480156106f157600080fd5b5061010054610381906001600160a01b031681565b34801561071257600080fd5b5061027a610721366004614274565b6123b2565b34801561073257600080fd5b50610381610741366004613f97565b612947565b34801561075257600080fd5b50610101546102aa565b34801561076857600080fd5b5061027a610777366004613f7a565b6129bc565b34801561078857600080fd5b5061034a610797366004613f97565b612a32565b3480156107a857600080fd5b506107bc6107b7366004613f4c565b612bef565b604080519384526020840192909252908201526060016102b4565b3480156107e357600080fd5b5061027a6107f2366004613f4c565b612cb4565b34801561080357600080fd5b5060fe54610381906001600160a01b031681565b34801561082357600080fd5b506108376108323660046142b6565b613408565b6040516102b49291906142e8565b60005b83518110156108b9576108a78482815181106108665761086661435e565b60200260200101518483815181106108805761088061435e565b602002602001015184848151811061089a5761089a61435e565b60200260200101516123b2565b806108b18161438a565b915050610848565b50505050565b6001546001600160a01b0316156108d557600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60fd5460405163fd0b69af60e01b8152600481018490526001600160a01b039091169063fd0b69af90602401602060405180830381865afa158015610940573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096491906143a3565b156109c15760405162461bcd60e51b815260206004820152602260248201527f6d616e6167656420717565726965732063616e6e6f7420626520646973707574604482015261195960f21b60648201526084015b60405180910390fd5b60fd54604051630935408d60e41b815260048101849052602481018390526001600160a01b039091169063935408d090604401602060405180830381865afa158015610a11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3591906143c0565b600003610a8f5760405162461bcd60e51b815260206004820152602260248201527f6e6f2076616c75652065786973747320617420676976656e2074696d6573746160448201526106d760f41b60648201526084016109b8565b6040805160208082018590528183018490528251808303840181526060909201909252805191012061010154600090610ac99060016143d9565b60008381526101066020908152604080832080546001808201835582865284862090910186905585855261010584528285206101039094529382902089815593840188905560fd54915163703e2a4360e11b8152600481018a905260248101899052949550939192916001600160a01b039091169063e07c548690604401602060405180830381865afa158015610b64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8891906143ec565b600382810180546001600160a01b0319166001600160a01b0393841617815587855560128501805475ffffffffffffffffffffffffffffffffffffffff0000191633620100000217905543918501919091554260028501558454600185810191909155905490911660009081526101086020908152604082208054938401815582528120909101859055610c1a61223a565b8454909150600103610ef75761012c610c338842614409565b10610c9b5760405162461bcd60e51b815260206004820152603260248201527f44697370757465206d75737420626520737461727465642077697468696e207260448201527165706f7274696e67206c6f636b2074696d6560701b60648201526084016109b8565b600088815261010460205260408120805491610cb68361438a565b90915550506000888152610104602052604090205460041015610d515760fd60009054906101000a90046001600160a01b03166001600160a01b031663722580b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4a91906143c0565b9050610d85565b60008881526101046020526040902054610d6d90600190614409565b610d78906002614500565b610d82908261450c565b90505b60fd54600383015460405163137f0a8d60e21b81526001600160a01b039182166004820152306024820152911690634dfc2a34906044016020604051808303816000875af1158015610ddb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dff91906143c0565b60048381019190915560fd5460405163c5958af960e01b81529182018a9052602482018990526001600160a01b03169063c5958af990604401600060405180830381865afa158015610e55573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610e7d9190810190614568565b6002830190610e8c908261461f565b5060fd546040516316d7b73f60e21b8152600481018a9052602481018990526001600160a01b0390911690635b5edcfc90604401600060405180830381600087803b158015610eda57600080fd5b505af1158015610eee573d6000803e3d6000fd5b505050506110e7565b83546000908590610f0a90600290614409565b81548110610f1a57610f1a61435e565b9060005260206000200154905061012c61010560008381526020019081526020016000206005015442610f4d9190614409565b10610fb55760405162461bcd60e51b815260206004820152603260248201527f4e6577206469737075746520726f756e64206d75737420626520737461727465604482015271642077697468696e2035206d696e7574657360701b60648201526084016109b8565b84546004101561103d5760fd60009054906101000a90046001600160a01b03166001600160a01b031663722580b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015611012573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103691906143c0565b9150611063565b845461104b90600190614409565b611056906002614500565b611060908361450c565b91505b61010360008660008154811061107b5761107b61435e565b906000526020600020015481526020019081526020016000206004015483600401819055506101036000866000815481106110b8576110b861435e565b906000526020600020015481526020019081526020016000206002018360020190816110e491906146df565b50505b60fd60009054906101000a90046001600160a01b03166001600160a01b031663722580b66040518163ffffffff1660e01b8152600401602060405180830381865afa15801561113a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115e91906143c0565b8111156111df5760fd60009054906101000a90046001600160a01b03166001600160a01b031663722580b66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111dc91906143c0565b90505b6004830181905561010180549060006111f78361438a565b909155505060fe546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015611253573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061127791906143a3565b6112b65760405162461bcd60e51b815260206004820152601060248201526f119959481b5d5cdd081899481c185a5960821b60448201526064016109b8565b60038201546012840154600285015460018601548654600090815261010660209081526040918290205482518c81529182018f90528183018e90526001600160a01b03968716606083015262010000909504909516608086015260a085019290925260c084015260e08301849052610100830191909152517ffbfeca72a80efb0d1aabf7f937aaec719fa5c81548a4ade65b40ecdec0afca4e918190036101200190a15050505050505050565b600081815261010660209081526040918290208054835181840281018401909452808452606093928301828280156113ba57602002820191906000526020600020905b8154815260200190600101908083116113a6575b50505050509050919050565b60008054604051632944908560e01b8152600481018590526024810184905282916001600160a01b0316906329449085906044016040805180830381865afa158015611416573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143a91906147ba565b915091505b9250929050565b6001600160a01b037f0000000000000000000000005110db881ef213f401842385d7eb0ab64d47331d16300361148e5760405162461bcd60e51b81526004016109b8906147e8565b7f0000000000000000000000005110db881ef213f401842385d7eb0ab64d47331d6001600160a01b03166114d7600080516020614af6833981519152546001600160a01b031690565b6001600160a01b0316146114fd5760405162461bcd60e51b81526004016109b890614834565b611506816136f7565b60408051600080825260208201909252611522918391906136ff565b50565b600080546040516344e87f9160e01b815260048101859052602481018490526001600160a01b03909116906344e87f9190604401602060405180830381865afa158015611576573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159a91906143a3565b90505b92915050565b603454610100900460ff16158080156115c35750603454600160ff909116105b806115dd5750303b1580156115dd575060345460ff166001145b6116405760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016109b8565b6034805460ff191660011790558015611663576034805461ff0019166101001790555b61166b61386a565b600080546001600160a01b0319166001600160a01b03851617905560408051602080820183526000825291516116a19201614261565b60408051601f19818403018152908290526116be91602001614880565b60408051808303601f1901815282825280516020918201206101025560fd80546001600160a01b0319166001600160a01b03881690811790915563021fd35d60e31b8452915191926310fe9ae892600480830193928290030181865afa15801561172c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061175091906143ec565b60fe80546001600160a01b03199081166001600160a01b039384161790915560ff80548216868416179055610100805490911691841691909117905580156117d2576034805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6000818152610105602052604090206005810154156118385760405162461bcd60e51b815260206004820152601d60248201527f566f74652068617320616c7265616479206265656e2074616c6c69656400000060448201526064016109b8565b61010154821115801561184b5750600082115b61188d5760405162461bcd60e51b8152602060048201526013602482015272159bdd1948191bd95cc81b9bdd08195e1a5cdd606a1b60448201526064016109b8565b600181015461189d90607861450c565b60028201546118ac9042614409565b1015806118ca57506102d08160020154426118c79190614409565b10155b6119165760405162461bcd60e51b815260206004820152601f60248201527f54696d6520666f7220766f74696e6720686173206e6f7420656c61707365640060448201526064016109b8565b60088101546007820154600683015460009291611932916143d9565b61193c91906143d9565b600e830154600d840154600c85015492935060009261195b91906143d9565b61196591906143d9565b60118401546010850154600f86015492935060009261198491906143d9565b61198e91906143d9565b600b850154600a86015460098701549293506000926119ad91906143d9565b6119b791906143d9565b9050836000036119cf57836119cb8161438a565b9450505b826000036119e557826119e18161438a565b9350505b816000036119fb57816119f78161438a565b9250505b80600003611a115780611a0d8161438a565b9150505b60098501546000908290611a2d90670de0b6b3a764000061450c565b611a3791906148ba565b600f8701548490611a5090670de0b6b3a764000061450c565b611a5a91906148ba565b600c8801548690611a7390670de0b6b3a764000061450c565b611a7d91906148ba565b60068901548890611a9690670de0b6b3a764000061450c565b611aa091906148ba565b611aaa91906143d9565b611ab491906143d9565b611abe91906143d9565b90506000828760090160010154670de0b6b3a7640000611ade919061450c565b611ae891906148ba565b60108801548590611b0190670de0b6b3a764000061450c565b611b0b91906148ba565b600d8901548790611b2490670de0b6b3a764000061450c565b611b2e91906148ba565b60078a01548990611b4790670de0b6b3a764000061450c565b611b5191906148ba565b611b5b91906143d9565b611b6591906143d9565b611b6f91906143d9565b90506000838860090160020154670de0b6b3a7640000611b8f919061450c565b611b9991906148ba565b60118901548690611bb290670de0b6b3a764000061450c565b611bbc91906148ba565b600e8a01548890611bd590670de0b6b3a764000061450c565b611bdf91906148ba565b60088b01548a90611bf890670de0b6b3a764000061450c565b611c0291906148ba565b611c0c91906143d9565b611c1691906143d9565b611c2091906143d9565b9050611c2c81836143d9565b831115611c51576012880180546001919061ff001916610100835b0217905550611c8c565b611c5b81846143d9565b821115611c7a576012880180546000919061ff00191661010083611c47565b60128801805461ff0019166102001790555b426005890155601288015460008a81526101036020526040908190206003015490517fa2d4e500801849d40ad00f0f12ba92a5263f83ec68946e647be95cfbe581c7b692611cf8928d9260ff610100840416926001600160a01b036201000090910481169216906148dc565b60405180910390a1505050505050505050565b6001600160a01b038116600090815261010860209081526040918290208054835181840281018401909452808452606093928301828280156113ba57602002820191906000526020600020908154815260200190600101908083116113a65750505050509050919050565b6001600160a01b037f0000000000000000000000005110db881ef213f401842385d7eb0ab64d47331d163003611dbe5760405162461bcd60e51b81526004016109b8906147e8565b7f0000000000000000000000005110db881ef213f401842385d7eb0ab64d47331d6001600160a01b0316611e07600080516020614af6833981519152546001600160a01b031690565b6001600160a01b031614611e2d5760405162461bcd60e51b81526004016109b890614834565b611e36826136f7565b611e42828260016136ff565b5050565b6000306001600160a01b037f0000000000000000000000005110db881ef213f401842385d7eb0ab64d47331d1614611ee65760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016109b8565b50600080516020614af683398151915290565b600081815261010360205260408120805460018201546003830154600284018054869560609587959194909391926001600160a01b03909116908290611f3e9061459d565b80601f0160208091040260200160405190810160405280929190818152602001828054611f6a9061459d565b8015611fb75780601f10611f8c57610100808354040283529160200191611fb7565b820191906000526020600020905b815481529060010190602001808311611f9a57829003601f168201915b505050505091509450945094509450509193509193565b60606000806000611fdf8686612a32565b9150915081612006576000604051806020016040528060008152509093509350505061143f565b612010868261233d565b925061201c86846122c4565b935050509250929050565b61202f613899565b61203960006138f3565b565b600080546040516377b03e0d60e01b8152600481018490526001600160a01b03909116906377b03e0d90602401602060405180830381865afa158015612085573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159d91906143c0565b60006120b3613d63565b5050600090815261010560209081526040918290208054835161022081018552600183015481526002830154938101939093526003820154938301939093526004810154606083015260058101546080830152600681015460a0830152600781015460c0830152600881015460e0830152600981015461010080840191909152600a820154610120840152600b820154610140840152600c820154610160840152600d820154610180840152600e8201546101a0840152600f8201546101c084015260108201546101e084015260118201546102008401526012909101549293919260ff808216939282041691620100009091046001600160a01b031690565b6000805460405163a792765f60e01b81526004810185905260248101849052606092916001600160a01b03169063a792765f90604401600060405180830381865afa158015612206573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261222e9190810190614912565b90969095509350505050565b6000600a60fd60009054906101000a90046001600160a01b03166001600160a01b031663722580b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015612291573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122b591906143c0565b6122bf91906148ba565b905090565b60005460405163c5958af960e01b815260048101849052602481018390526060916001600160a01b03169063c5958af990604401600060405180830381865afa158015612315573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261159a9190810190614568565b6000805460405163ce5e11bf60e01b815260048101859052602481018490526001600160a01b039091169063ce5e11bf90604401602060405180830381865afa15801561238e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159a91906143c0565b6101015483111580156123c55750600083115b6124075760405162461bcd60e51b8152602060048201526013602482015272159bdd1948191bd95cc81b9bdd08195e1a5cdd606a1b60448201526064016109b8565b6000838152610105602052604090206005810154156124685760405162461bcd60e51b815260206004820152601d60248201527f566f74652068617320616c7265616479206265656e2074616c6c69656400000060448201526064016109b8565b33600090815260138201602052604090205460ff16156124ca5760405162461bcd60e51b815260206004820152601860248201527f53656e6465722068617320616c726561647920766f746564000000000000000060448201526064016109b8565b336000818152601383016020526040808220805460ff1916600117905560fe5490516370a0823160e01b8152600481019390935290916001600160a01b03909116906370a0823190602401602060405180830381865afa158015612532573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061255691906143c0565b60fd54604051630733bdef60e41b815233600482015291925060009182916001600160a01b03169063733bdef09060240161010060405180830381865afa1580156125a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125c9919061496c565b5050505050925092505080826125df91906143d9565b6125e990846143d9565b925084156126eb578284600601600201600082825461260891906143d9565b909155505060fd54604051631c3c149f60e11b81523360048201526001600160a01b0390911690633878293e90602401602060405180830381865afa158015612655573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061267991906143c0565b600e8501805460009061268d9084906143d9565b9091555061269c905033613945565b600b850180546000906126b09084906143d9565b9091555050610100546001600160a01b031633036126e657600184600f0160020160008282546126e091906143d9565b90915550505b6128d5565b85156127e0578284600601600001600082825461270891906143d9565b909155505060fd54604051631c3c149f60e11b81523360048201526001600160a01b0390911690633878293e90602401602060405180830381865afa158015612755573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061277991906143c0565b600c8501805460009061278d9084906143d9565b9091555061279c905033613945565b6009850180546000906127b09084906143d9565b9091555050610100546001600160a01b031633036126e657600184600f0160000160008282546126e091906143d9565b828460060160010160008282546127f791906143d9565b909155505060fd54604051631c3c149f60e11b81523360048201526001600160a01b0390911690633878293e90602401602060405180830381865afa158015612844573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061286891906143c0565b600d8501805460009061287c9084906143d9565b9091555061288b905033613945565b600a8501805460009061289f9084906143d9565b9091555050610100546001600160a01b031633036128d557600184600f0160010160008282546128cf91906143d9565b90915550505b336000908152610107602052604081208054916128f18361438a565b90915550506040805188815287151560208201523381830152861515606082015290517fbe6f1c58cc15c8e86d6f0ef23c5a30eb33319af3b57f6b7d9b56ccfa87696b849181900360800190a150505050505050565b6000805460405163703e2a4360e11b815260048101859052602481018490526001600160a01b039091169063e07c548690604401602060405180830381865afa158015612998573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159a91906143ec565b6129c4613899565b6001600160a01b038116612a295760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109b8565b611522816138f3565b6000806000612a408561203b565b905080600003612a5757600080925092505061143f565b80612a61816149c9565b9150600190506000808381612a768a8361233d565b9050888111612a91576000809750975050505050505061143f565b612a9b8a8461233d565b905088811115612aaa57600094505b8415612b5a576002612abc84846143d9565b612ac691906148ba565b9350612ad28a8561233d565b905088811115612b13576000612aed8b6106c9600188614409565b9050898111612aff5760009550612b0d565b612b0a600186614409565b92505b50612aaa565b6000612b248b6106c98760016143d9565b905089811115612b47576000955084612b3c8161438a565b955050809150612b0d565b612b528560016143d9565b935050612aaa565b612b648a82611525565b612b7a576001849750975050505050505061143f565b612b848a82611525565b8015612b8f57508584105b15612bb25783612b9e8161438a565b945050612bab8a8561233d565b9050612b7a565b8584148015612bc65750612bc68a82611525565b15612bdd576000809750975050505050505061143f565b6001849750975050505050505061143f565b60015460405163690ebcf760e11b8152600481018390526000918291829182916001600160a01b039091169063d21d79ee90602401602060405180830381865afa158015612c41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c6591906143c0565b90506060612c788261058e4260016143d9565b945090506000849003612c98576000806101949450945094505050612cad565b6000612ca382613a96565b955060c893505050505b9193909250565b600081815261010560205260409020610101548211801590612cd65750600082115b612d225760405162461bcd60e51b815260206004820152601860248201527f44697370757465204944206d7573742062652076616c6964000000000000000060448201526064016109b8565b601281015460ff1615612d775760405162461bcd60e51b815260206004820152601e60248201527f566f74652068617320616c7265616479206265656e206578656375746564000060448201526064016109b8565b6000816005015411612dcb5760405162461bcd60e51b815260206004820152601460248201527f566f7465206d7573742062652074616c6c69656400000000000000000000000060448201526064016109b8565b600181015481546000908152610106602052604090205414612e2f5760405162461bcd60e51b815260206004820152601660248201527f4d757374206265207468652066696e616c20766f74650000000000000000000060448201526064016109b8565b61012c816005015442612e429190614409565b1015612eb65760405162461bcd60e51b815260206004820152603760248201527f35206d696e757465732068617320746f20706173732061667465722074616c6c60448201527f7920746f20616c6c6f7720666f7220646973707574657300000000000000000060648201526084016109b8565b60128101805460ff1916600117905560008281526101036020908152604080832080548452610104909252822080549192612ef0836149c9565b90915550600090508060016012850154610100900460ff166002811115612f1957612f196141a1565b036130b85783546000908152610106602052604090205491505b81156130b3578354600090815261010660205260409020612f55600184614409565b81548110612f6557612f6561435e565b9060005260206000200154905061010560008281526020019081526020016000209350816001036130195760fe54601285015460048581015460405163a9059cbb60e01b81526001600160a01b0362010000909404841692810192909252602482015291169063a9059cbb906044016020604051808303816000875af1158015612ff3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061301791906143a3565b505b60fe54601285015460048087015460405163a9059cbb60e01b81526001600160a01b0362010000909404841692810192909252602482015291169063a9059cbb906044016020604051808303816000875af115801561307c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130a091906143a3565b50816130ab816149c9565b925050612f33565b6133ac565b60026012850154610100900460ff1660028111156130d8576130d86141a1565b0361326a5783546000908152610106602052604090205491505b81156131e3578354600090815261010660205260409020613114600184614409565b815481106131245761312461435e565b60009182526020808320919091015480835261010590915260409182902060fe546012820154600480840154955163a9059cbb60e01b81526001600160a01b03620100009093048316918101919091526024810195909552919750919350169063a9059cbb906044016020604051808303816000875af11580156131ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131d091906143a3565b50816131db816149c9565b9250506130f2565b60fe54600384015460048086015460405163a9059cbb60e01b81526001600160a01b0393841692810192909252602482015291169063a9059cbb906044016020604051808303816000875af1158015613240573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061326491906143a3565b506133ac565b60006012850154610100900460ff16600281111561328a5761328a6141a1565b036133ac5783546000908152610106602052604081205492505b821561331d5784546000908152610106602052604090206132c6600185614409565b815481106132d6576132d661435e565b906000526020600020015491506101056000838152602001908152602001600020945084600401548161330991906143d9565b905082613315816149c9565b9350506132a4565b600484015461332c90826143d9565b60fe54600386015460405163a9059cbb60e01b81526001600160a01b03918216600482015260248101849052929350169063a9059cbb906044016020604051808303816000875af1158015613385573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133a991906143a3565b50505b60008581526101056020526040908190206012015490517f40d231bf91823121de9e1c012d95f835ea5684dc1d93360d9510a30543345da4916133f9918891610100900460ff16906149e0565b60405180910390a15050505050565b60608060008061341c88610797888a614409565b915091508161346d576040805160008082526020820190925290613450565b606081526020019060019003908161343b5790505b5060408051600081526020810190915290945092506136ee915050565b600061347989896113c6565b9093509050826134cc5760408051600080825260208201909252906134ae565b60608152602001906001900390816134995790505b5060408051600081526020810190915290955093506136ee92505050565b60008060008867ffffffffffffffff8111156134ea576134ea613d82565b604051908082528060200260200182016040528015613513578160200160208202803683370190505b5090505b888310801561353a5750848261352e8660016143d9565b6135389190614409565b115b1561359e57600061354f8d6106c98588614409565b905061355b8d82611525565b61358b57808285815181106135725761357261435e565b6020908102919091010152836135878161438a565b9450505b826135958161438a565b93505050613517565b60008367ffffffffffffffff8111156135b9576135b9613d82565b6040519080825280602002602001820160405280156135ec57816020015b60608152602001906001900390816135d75790505b50905060008467ffffffffffffffff81111561360a5761360a613d82565b604051908082528060200260200182016040528015613633578160200160208202803683370190505b50905060005b858110156136e157838161364e600189614409565b6136589190614409565b815181106136685761366861435e565b60200260200101518282815181106136825761368261435e565b6020026020010181815250506136b18f8383815181106136a4576136a461435e565b60200260200101516122c4565b8382815181106136c3576136c361435e565b602002602001018190525080806136d99061438a565b915050613639565b5090985096505050505050505b94509492505050565b611522613899565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615613732576117d283613aed565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561378c575060408051601f3d908101601f19168201909252613789918101906143c0565b60015b6137ef5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016109b8565b600080516020614af6833981519152811461385e5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016109b8565b506117d2838383613b89565b603454610100900460ff166138915760405162461bcd60e51b81526004016109b8906149f4565b612039613bae565b6067546001600160a01b031633146120395760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109b8565b606780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600080600061395f610102546107084261058e9190614409565b90925090508015613a8f576000828060200190518101906139809190614a3f565b905060005b8151811015613a8c576000808383815181106139a3576139a361435e565b60200260200101516001600160a01b0316886040516024016139d491906001600160a01b0391909116815260200190565b60408051601f198184030181529181526020820180516001600160e01b03166345d6082360e01b17905251613a099190614ad9565b6000604051808303816000865af19150503d8060008114613a46576040519150601f19603f3d011682016040523d82523d6000602084013e613a4b565b606091505b50915091508115613a775780806020019051810190613a6a91906143c0565b613a7490886143d9565b96505b50508080613a849061438a565b915050613985565b50505b5050919050565b6000805b8251811015613ae757828181518110613ab557613ab561435e565b016020015160f81c613ac98361010061450c565b613ad391906143d9565b915080613adf8161438a565b915050613a9a565b50919050565b6001600160a01b0381163b613b5a5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016109b8565b600080516020614af683398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b613b9283613bde565b600082511180613b9f5750805b156117d2576108b98383613c1e565b603454610100900460ff16613bd55760405162461bcd60e51b81526004016109b8906149f4565b612039336138f3565b613be781613aed565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061159a8383604051806060016040528060278152602001614b16602791396060600080856001600160a01b031685604051613c5b9190614ad9565b600060405180830381855af49150503d8060008114613c96576040519150601f19603f3d011682016040523d82523d6000602084013e613c9b565b606091505b5091509150613cac86838387613cb8565b925050505b9392505050565b60608315613d27578251600003613d20576001600160a01b0385163b613d205760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016109b8565b5081613d31565b613d318383613d39565b949350505050565b815115613d495781518083602001fd5b8060405162461bcd60e51b81526004016109b89190614261565b6040518061022001604052806011906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613dc157613dc1613d82565b604052919050565b600067ffffffffffffffff821115613de357613de3613d82565b5060051b60200190565b801515811461152257600080fd5b600082601f830112613e0c57600080fd5b81356020613e21613e1c83613dc9565b613d98565b82815260059290921b84018101918181019086841115613e4057600080fd5b8286015b84811015613e64578035613e5781613ded565b8352918301918301613e44565b509695505050505050565b600080600060608486031215613e8457600080fd5b833567ffffffffffffffff80821115613e9c57600080fd5b818601915086601f830112613eb057600080fd5b81356020613ec0613e1c83613dc9565b82815260059290921b8401810191818101908a841115613edf57600080fd5b948201945b83861015613efd57853582529482019490820190613ee4565b97505087013592505080821115613f1357600080fd5b613f1f87838801613dfb565b93506040860135915080821115613f3557600080fd5b50613f4286828701613dfb565b9150509250925092565b600060208284031215613f5e57600080fd5b5035919050565b6001600160a01b038116811461152257600080fd5b600060208284031215613f8c57600080fd5b8135613cb181613f65565b60008060408385031215613faa57600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b83811015613fe957815187529582019590820190600101613fcd565b509495945050505050565b60208152600061159a6020830184613fb9565b6000806040838503121561401a57600080fd5b823561402581613f65565b9150602083013561403581613f65565b809150509250929050565b600067ffffffffffffffff82111561405a5761405a613d82565b50601f01601f191660200190565b6000806040838503121561407b57600080fd5b823561408681613f65565b9150602083013567ffffffffffffffff8111156140a257600080fd5b8301601f810185136140b357600080fd5b80356140c1613e1c82614040565b8181528660208385010111156140d657600080fd5b816020840160208301376000602083830101528093505050509250929050565b60005b838110156141115781810151838201526020016140f9565b50506000910152565b600081518084526141328160208601602086016140f6565b601f01601f19169290920160200192915050565b848152836020820152608060408201526000614165608083018561411a565b90506001600160a01b038316606083015295945050505050565b604081526000614192604083018561411a565b90508260208301529392505050565b634e487b7160e01b600052602160045260246000fd5b600381106141d557634e487b7160e01b600052602160045260246000fd5b9052565b8581526102a0810160208083018760005b6011811015614207578151835291830191908301906001016141ea565b505050508415156102408301526142226102608301856141b7565b6001600160a01b0383166102808301529695505050505050565b6000806040838503121561424f57600080fd5b82359150602083013561403581613f65565b60208152600061159a602083018461411a565b60008060006060848603121561428957600080fd5b83359250602084013561429b81613ded565b915060408401356142ab81613ded565b809150509250925092565b600080600080608085870312156142cc57600080fd5b5050823594602084013594506040840135936060013592509050565b6000604082016040835280855180835260608501915060608160051b8601019250602080880160005b8381101561433f57605f1988870301855261432d86835161411a565b95509382019390820190600101614311565b5050858403818701525050506143558185613fb9565b95945050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161439c5761439c614374565b5060010190565b6000602082840312156143b557600080fd5b8151613cb181613ded565b6000602082840312156143d257600080fd5b5051919050565b8082018082111561159d5761159d614374565b6000602082840312156143fe57600080fd5b8151613cb181613f65565b8181038181111561159d5761159d614374565b600181815b8085111561445757816000190482111561443d5761443d614374565b8085161561444a57918102915b93841c9390800290614421565b509250929050565b60008261446e5750600161159d565b8161447b5750600061159d565b8160018114614491576002811461449b576144b7565b600191505061159d565b60ff8411156144ac576144ac614374565b50506001821b61159d565b5060208310610133831016604e8410600b84101617156144da575081810a61159d565b6144e4838361441c565b80600019048211156144f8576144f8614374565b029392505050565b600061159a838361445f565b808202811582820484141761159d5761159d614374565b600082601f83011261453457600080fd5b8151614542613e1c82614040565b81815284602083860101111561455757600080fd5b613d318260208301602087016140f6565b60006020828403121561457a57600080fd5b815167ffffffffffffffff81111561459157600080fd5b613d3184828501614523565b600181811c908216806145b157607f821691505b602082108103613ae757634e487b7160e01b600052602260045260246000fd5b601f8211156117d257600081815260208120601f850160051c810160208610156145f85750805b601f850160051c820191505b8181101561461757828155600101614604565b505050505050565b815167ffffffffffffffff81111561463957614639613d82565b61464d81614647845461459d565b846145d1565b602080601f831160018114614682576000841561466a5750858301515b600019600386901b1c1916600185901b178555614617565b600085815260208120601f198616915b828110156146b157888601518255948401946001909101908401614692565b50858210156146cf5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b8181036146ea575050565b6146f4825461459d565b67ffffffffffffffff81111561470c5761470c613d82565b61471a81614647845461459d565b6000601f82116001811461474e57600083156147365750848201545b600019600385901b1c1916600184901b1784556147b3565b600085815260209020601f19841690600086815260209020845b838110156147885782860154825560019586019590910190602001614768565b50858310156147a65781850154600019600388901b60f8161c191681555b50505060018360011b0184555b5050505050565b600080604083850312156147cd57600080fd5b82516147d881613ded565b6020939093015192949293505050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60408152601060408201526f4175746f70617941646472657373657360801b606082015260806020820152600061159a608083018461411a565b6000826148d757634e487b7160e01b600052601260045260246000fd5b500490565b848152608081016148f060208301866141b7565b6001600160a01b03808516604084015280841660608401525095945050505050565b60008060006060848603121561492757600080fd5b835161493281613ded565b602085015190935067ffffffffffffffff81111561494f57600080fd5b61495b86828701614523565b925050604084015190509250925092565b600080600080600080600080610100898b03121561498957600080fd5b505086516020880151604089015160608a015160808b015160a08c015160c08d015160e0909d0151959e949d50929b919a50985090965094509092509050565b6000816149d8576149d8614374565b506000190190565b82815260408101613cb160208301846141b7565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006020808385031215614a5257600080fd5b825167ffffffffffffffff811115614a6957600080fd5b8301601f81018513614a7a57600080fd5b8051614a88613e1c82613dc9565b81815260059190911b82018301908381019087831115614aa757600080fd5b928401925b82841015614ace578351614abf81613f65565b82529284019290840190614aac565b979650505050505050565b60008251614aeb8184602087016140f6565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122002de718331af9066d89ff540e0c05edddf3167f47d51521dd1ede16a9b7e439364736f6c63430008140033