Contract 0xbB97C038c338c3DcAF06D5be3B4A3e0B24835f9C 4

Contract Overview

Balance:
0 Ether
Txn Hash
Method
Block
From
To
Value
0xf53769d4d1a0fc303cfb2062124ad78edb1a33e31694c056d98f13de93b28302Change Governanc...321056572022-06-10 15:27:0462 days 3 hrs ago0x7671ea70ce097bc82464b4ab78f79d279356b6cd IN  0xbb97c038c338c3dcaf06d5be3b4a3e0b24835f9c0 Ether0.‍00013758 4.‍9
0xd1fb830fff1494fb1e40f693ffa08cabefa267dad1379b71868f5ef71c80b34a0x60806040320928392022-06-09 20:25:2062 days 22 hrs ago0x7671ea70ce097bc82464b4ab78f79d279356b6cd IN  Create: TellorFlex0 Ether0.‍00271264 1.‍5
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0x0cb4d2b161acfcce66440c96b565f15789197c661a8babd6d97943273a3b5740321051032022-06-10 14:37:2862 days 4 hrs ago 0x3eb81a11dd28fe8ed9f53d1456248ac86d5893c6 0xbb97c038c338c3dcaf06d5be3b4a3e0b24835f9c0 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TellorFlex

Compiler Version
v0.8.3+commit.8d00100c

Optimization Enabled:
Yes with 300 runs

Other Settings:
default evmVersion
File 1 of 2 : TellorFlex.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.3;

import "./interfaces/IERC20.sol";

/**
 @author Tellor Inc.
 @title TellorFlex
 @dev This is a streamlined Tellor 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.
*/
contract TellorFlex {
    IERC20 public token;
    address public governance;
    uint256 public stakeAmount; //amount required to be a staker
    uint256 public totalStakeAmount; //total amount of tokens locked in contract (via stake)
    uint256 public reportingLock; // base amount of time before a reporter is able to submit a value again
    uint256 public timeOfLastNewValue = block.timestamp; // time of the last new submitted value, originally set to the block timestamp
    mapping(bytes32 => Report) private reports; // mapping of query IDs to a report
    mapping(address => StakeInfo) stakerDetails; //mapping from a persons address to their staking info

    // Structs
    struct Report {
        uint256[] timestamps; // array of all newValueTimestamps reported
        mapping(uint256 => uint256) timestampIndex; // mapping of timestamps to respective indices
        mapping(uint256 => uint256) timestampToBlockNum; // mapping of timestamp to block number
        mapping(uint256 => bytes) valueByTimestamp; // mapping of timestamps to values
        mapping(uint256 => address) reporterByTimestamp; // mapping of timestamps to reporters
    }

    struct StakeInfo {
        uint256 startDate; //stake start date
        uint256 stakedBalance; // staked balance
        uint256 lockedBalance; // amount locked for withdrawal
        uint256 reporterLastTimestamp; // timestamp of reporter's last reported value
        uint256 reportsSubmitted; // total number of reports submitted by reporter
        mapping(bytes32 => uint256) reportsSubmittedByQueryId;
    }

    // Events
    event NewGovernanceAddress(address _newGovernanceAddress);
    event NewReport(
        bytes32 _queryId,
        uint256 _time,
        bytes _value,
        uint256 _nonce,
        bytes _queryData,
        address _reporter
    );
    event NewReportingLock(uint256 _newReportingLock);
    event NewStakeAmount(uint256 _newStakeAmount);
    event NewStaker(address _staker, uint256 _amount);
    event ReporterSlashed(
        address _reporter,
        address _recipient,
        uint256 _slashAmount
    );
    event StakeWithdrawRequested(address _staker, uint256 _amount);
    event StakeWithdrawn(address _staker);
    event ValueRemoved(bytes32 _queryId, uint256 _timestamp);

    /**
     * @dev Initializes system parameters
     * @param _token address of token used for staking
     * @param _governance address which controls system
     * @param _stakeAmount amount of token needed to report oracle values
     * @param _reportingLock base amount of time (seconds) before reporter is able to report again
     */
    constructor(
        address _token,
        address _governance,
        uint256 _stakeAmount,
        uint256 _reportingLock
    ) {
        require(_token != address(0), "must set token address");
        require(_governance != address(0), "must set governance address");
        token = IERC20(_token);
        governance = _governance;
        stakeAmount = _stakeAmount;
        reportingLock = _reportingLock;
    }

    /**
     * @dev Changes governance address
     * @param _newGovernanceAddress new governance address
     */
    function changeGovernanceAddress(address _newGovernanceAddress) external {
        require(msg.sender == governance, "caller must be governance address");
        require(
            _newGovernanceAddress != address(0),
            "must set governance address"
        );
        governance = _newGovernanceAddress;
        emit NewGovernanceAddress(_newGovernanceAddress);
    }

    /**
     * @dev Changes base amount of time (seconds) before reporter is allowed to report again
     * @param _newReportingLock new reporter lock time in seconds
     */
    function changeReportingLock(uint256 _newReportingLock) external {
        require(msg.sender == governance, "caller must be governance address");
        require(
            _newReportingLock > 0,
            "reporting lock must be greater than zero"
        );
        reportingLock = _newReportingLock;
        emit NewReportingLock(_newReportingLock);
    }

    /**
     * @dev Changes amount of token stake required to report values
     * @param _newStakeAmount new reporter stake amount
     */
    function changeStakeAmount(uint256 _newStakeAmount) external {
        require(msg.sender == governance, "caller must be governance address");
        require(_newStakeAmount > 0, "stake amount must be greater than zero");
        stakeAmount = _newStakeAmount;
        emit NewStakeAmount(_newStakeAmount);
    }

    /**
     * @dev Allows a reporter to submit stake
     * @param _amount amount of tokens to stake
     */
    function depositStake(uint256 _amount) external {
        StakeInfo storage _staker = stakerDetails[msg.sender];
        if (_staker.lockedBalance > 0) {
            if (_staker.lockedBalance >= _amount) {
                _staker.lockedBalance -= _amount;
            } else {
                require(
                    token.transferFrom(
                        msg.sender,
                        address(this),
                        _amount - _staker.lockedBalance
                    )
                );
                _staker.lockedBalance = 0;
            }
        } else {
            require(token.transferFrom(msg.sender, address(this), _amount));
        }
        _staker.startDate = block.timestamp; // This resets their stake start date to now
        _staker.stakedBalance += _amount;
        totalStakeAmount += _amount;
        emit NewStaker(msg.sender, _amount);
    }

    /**
     * @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 {
        require(msg.sender == governance, "caller must be governance address");
        Report storage rep = reports[_queryId];
        uint256 _index = rep.timestampIndex[_timestamp];
        require(_timestamp == rep.timestamps[_index], "invalid timestamp");
        // Shift all timestamps back to reflect deletion of value
        for (uint256 _i = _index; _i < rep.timestamps.length - 1; _i++) {
            rep.timestamps[_i] = rep.timestamps[_i + 1];
            rep.timestampIndex[rep.timestamps[_i]] -= 1;
        }
        // Delete and reset timestamp and value
        delete rep.timestamps[rep.timestamps.length - 1];
        rep.timestamps.pop();
        rep.valueByTimestamp[_timestamp] = "";
        rep.timestampIndex[_timestamp] = 0;
        emit ValueRemoved(_queryId, _timestamp);
    }

    /**
     * @dev Allows a reporter to request to withdraw their stake
     * @param _amount amount of staked tokens requesting to withdraw
     */
    function requestStakingWithdraw(uint256 _amount) external {
        StakeInfo storage _staker = stakerDetails[msg.sender];
        require(
            _staker.stakedBalance >= _amount,
            "insufficient staked balance"
        );
        _staker.startDate = block.timestamp;
        _staker.lockedBalance += _amount;
        _staker.stakedBalance -= _amount;
        totalStakeAmount -= _amount;
        emit StakeWithdrawRequested(msg.sender, _amount);
    }

    /**
     * @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)
    {
        require(msg.sender == governance, "only governance can slash reporter");
        StakeInfo storage _staker = stakerDetails[_reporter];
        require(
            _staker.stakedBalance + _staker.lockedBalance > 0,
            "zero staker balance"
        );
        uint256 _slashAmount;
        if (_staker.lockedBalance >= stakeAmount) {
            _slashAmount = stakeAmount;
            _staker.lockedBalance -= stakeAmount;
        } else if (
            _staker.lockedBalance + _staker.stakedBalance >= stakeAmount
        ) {
            _slashAmount = stakeAmount;
            _staker.stakedBalance -= stakeAmount - _staker.lockedBalance;
            totalStakeAmount -= stakeAmount - _staker.lockedBalance;
            _staker.lockedBalance = 0;
        } else {
            _slashAmount = _staker.stakedBalance + _staker.lockedBalance;
            totalStakeAmount -= _staker.stakedBalance;
            _staker.stakedBalance = 0;
            _staker.lockedBalance = 0;
        }
        token.transfer(_recipient, _slashAmount);
        emit ReporterSlashed(_reporter, _recipient, _slashAmount);
        return (_slashAmount);
    }

    /**
     * @dev Allows a reporter to submit a value to the oracle
     * @param _queryId is ID of the specific data feed. Equals keccak256(_queryData) for non-legacy IDs
     * @param _value is the value the user submits to the oracle
     * @param _nonce is the current value count for the query id
     * @param _queryData is the data used to fulfill the data query
     */
    function submitValue(
        bytes32 _queryId,
        bytes calldata _value,
        uint256 _nonce,
        bytes memory _queryData
    ) external {
        Report storage rep = reports[_queryId];
        require(
            _nonce == rep.timestamps.length || _nonce == 0,
            "nonce must match timestamp index"
        );
        StakeInfo storage _staker = stakerDetails[msg.sender];
        require(
            _staker.stakedBalance >= stakeAmount,
            "balance must be greater than stake amount"
        );
        // Require reporter to abide by given reporting lock
        require(
            (block.timestamp - _staker.reporterLastTimestamp) * 1000 >
                (reportingLock * 1000) / (_staker.stakedBalance / stakeAmount),
            "still in reporter time lock, please wait!"
        );
        require(
            _queryId == keccak256(_queryData) || uint256(_queryId) <= 100,
            "id must be hash of bytes data"
        );
        _staker.reporterLastTimestamp = block.timestamp;
        // Checks for no double reporting of timestamps
        require(
            rep.reporterByTimestamp[block.timestamp] == address(0),
            "timestamp already reported for"
        );
        // Update number of timestamps, value for given timestamp, and reporter for timestamp
        rep.timestampIndex[block.timestamp] = rep.timestamps.length;
        rep.timestamps.push(block.timestamp);
        rep.timestampToBlockNum[block.timestamp] = block.number;
        rep.valueByTimestamp[block.timestamp] = _value;
        rep.reporterByTimestamp[block.timestamp] = msg.sender;
        // Update last oracle value and number of values submitted by a reporter
        timeOfLastNewValue = block.timestamp;
        _staker.reportsSubmitted++;
        _staker.reportsSubmittedByQueryId[_queryId]++;
        emit NewReport(
            _queryId,
            block.timestamp,
            _value,
            _nonce,
            _queryData,
            msg.sender
        );
    }

    /**
     * @dev Withdraws a reporter's stake
     */
    function withdrawStake() external {
        StakeInfo storage _s = stakerDetails[msg.sender];
        // Ensure reporter is locked and that enough time has passed
        require(block.timestamp - _s.startDate >= 7 days, "7 days didn't pass");
        require(_s.lockedBalance > 0, "reporter not locked for withdrawal");
        token.transfer(msg.sender, _s.lockedBalance);
        _s.lockedBalance = 0;
        emit StakeWithdrawn(msg.sender);
    }

    //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)
    {
        return reports[_queryId].timestampToBlockNum[_timestamp];
    }

    /**
     * @dev Returns the current value of a data feed given a specific ID
     * @param _queryId is the ID of the specific data feed
     * @return bytes memory of the current value of data
     */
    function getCurrentValue(bytes32 _queryId)
        external
        view
        returns (bytes memory)
    {
        return
            reports[_queryId].valueByTimestamp[
                reports[_queryId].timestamps[
                    reports[_queryId].timestamps.length - 1
                ]
            ];
    }

    /**
     * @dev Returns governance address
     * @return address governance
     */
    function getGovernanceAddress() external view returns (address) {
        return governance;
    }

    /**
     * @dev Counts the number of values that have been submitted for the request.
     * @param _queryId the id to look up
     * @return uint256 count of the number of values received for the id
     */
    function getNewValueCountbyQueryId(bytes32 _queryId)
        external
        view
        returns (uint256)
    {
        return reports[_queryId].timestamps.length;
    }

    /**
     * @dev Returns reporter address and whether a value was removed for a given queryId and timestamp
     * @param _queryId the id to look up
     * @param _timestamp is the timestamp of the value to look up
     * @return address reporter who submitted the value
     * @return bool true if the value was removed
     */
    function getReportDetails(bytes32 _queryId, uint256 _timestamp)
        external
        view
        returns (address, bool)
    {
        bool _wasRemoved = reports[_queryId].timestampIndex[_timestamp] == 0 &&
            keccak256(reports[_queryId].valueByTimestamp[_timestamp]) ==
            keccak256(bytes("")) &&
            reports[_queryId].reporterByTimestamp[_timestamp] != address(0);
        return (reports[_queryId].reporterByTimestamp[_timestamp], _wasRemoved);
    }

    /**
     * @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)
    {
        return reports[_queryId].reporterByTimestamp[_timestamp];
    }

    /**
     * @dev Returns the timestamp of the reporter's last submission
     * @param _reporter is address of the reporter
     * @return uint256 timestamp of the reporter's last submission
     */
    function getReporterLastTimestamp(address _reporter)
        external
        view
        returns (uint256)
    {
        return stakerDetails[_reporter].reporterLastTimestamp;
    }

    /**
     * @dev Returns the reporting lock time, the amount of time a reporter must wait to submit again
     * @return uint256 reporting lock time
     */
    function getReportingLock() external view returns (uint256) {
        return reportingLock;
    }

    /**
     * @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)
    {
        return stakerDetails[_reporter].reportsSubmitted;
    }

    /**
     * @dev Returns the number of values submitted to a specific queryId by a specific reporter address
     * @param _reporter is the address of a reporter
     * @param _queryId is the ID of the specific data feed
     * @return uint256 of the number of values submitted by the given reporter to the given queryId
     */
    function getReportsSubmittedByAddressAndQueryId(
        address _reporter,
        bytes32 _queryId
    ) external view returns (uint256) {
        return stakerDetails[_reporter].reportsSubmittedByQueryId[_queryId];
    }

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

    /**
     * @dev Allows users to retrieve all information about a staker
     * @param _staker address of staker inquiring about
     * @return uint startDate of staking
     * @return uint current amount staked
     * @return uint current amount locked for withdrawal
     * @return uint reporter's last reported timestamp
     * @return uint total number of reports submitted by reporter
     */
    function getStakerInfo(address _staker)
        external
        view
        returns (
            uint256,
            uint256,
            uint256,
            uint256,
            uint256
        )
    {
        return (
            stakerDetails[_staker].startDate,
            stakerDetails[_staker].stakedBalance,
            stakerDetails[_staker].lockedBalance,
            stakerDetails[_staker].reporterLastTimestamp,
            stakerDetails[_staker].reportsSubmitted
        );
    }

    /**
     * @dev Returns the timestamp for the last value of any ID from the oracle
     * @return uint256 of timestamp of the last oracle value
     */
    function getTimeOfLastNewValue() external view returns (uint256) {
        return timeOfLastNewValue;
    }

    /**
     * @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)
        external
        view
        returns (uint256)
    {
        return reports[_queryId].timestamps[_index];
    }

    /**
     * @dev Returns the index of a reporter timestamp in the timestamp array for a specific data ID
     * @param _queryId is ID of the specific data feed
     * @param _timestamp is the timestamp to find in the timestamps array
     * @return uint256 of the index of the reporter timestamp in the array for specific ID
     */
    function getTimestampIndexByTimestamp(bytes32 _queryId, uint256 _timestamp)
        external
        view
        returns (uint256)
    {
        return reports[_queryId].timestampIndex[_timestamp];
    }

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

    /**
     * @dev Returns total amount of token staked for reporting
     * @return uint256 total amount of token staked
     */
    function getTotalStakeAmount() external view returns (uint256) {
        return totalStakeAmount;
    }

    /**
     * @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)
    {
        return reports[_queryId].valueByTimestamp[_timestamp];
    }
}

File 2 of 2 : IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.3;

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);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 300
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_governance","type":"address"},{"internalType":"uint256","name":"_stakeAmount","type":"uint256"},{"internalType":"uint256","name":"_reportingLock","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_newGovernanceAddress","type":"address"}],"name":"NewGovernanceAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"_queryId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"_time","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"_value","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"_nonce","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"_queryData","type":"bytes"},{"indexed":false,"internalType":"address","name":"_reporter","type":"address"}],"name":"NewReport","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_newReportingLock","type":"uint256"}],"name":"NewReportingLock","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_newStakeAmount","type":"uint256"}],"name":"NewStakeAmount","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"NewStaker","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_reporter","type":"address"},{"indexed":false,"internalType":"address","name":"_recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"_slashAmount","type":"uint256"}],"name":"ReporterSlashed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"StakeWithdrawRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_staker","type":"address"}],"name":"StakeWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"_queryId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"ValueRemoved","type":"event"},{"inputs":[{"internalType":"address","name":"_newGovernanceAddress","type":"address"}],"name":"changeGovernanceAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newReportingLock","type":"uint256"}],"name":"changeReportingLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newStakeAmount","type":"uint256"}],"name":"changeStakeAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_queryId","type":"bytes32"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"getBlockNumberByTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_queryId","type":"bytes32"}],"name":"getCurrentValue","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGovernanceAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_queryId","type":"bytes32"}],"name":"getNewValueCountbyQueryId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_queryId","type":"bytes32"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"getReportDetails","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_queryId","type":"bytes32"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"getReporterByTimestamp","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_reporter","type":"address"}],"name":"getReporterLastTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReportingLock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_reporter","type":"address"}],"name":"getReportsSubmittedByAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_reporter","type":"address"},{"internalType":"bytes32","name":"_queryId","type":"bytes32"}],"name":"getReportsSubmittedByAddressAndQueryId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStakeAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"}],"name":"getStakerInfo","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTimeOfLastNewValue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_queryId","type":"bytes32"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"getTimestampIndexByTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_queryId","type":"bytes32"},{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"getTimestampbyQueryIdandIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalStakeAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"governance","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_queryId","type":"bytes32"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"removeValue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reportingLock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"requestStakingWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_queryId","type":"bytes32"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"retrieveData","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_reporter","type":"address"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"slashReporter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakeAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_queryId","type":"bytes32"},{"internalType":"bytes","name":"_value","type":"bytes"},{"internalType":"uint256","name":"_nonce","type":"uint256"},{"internalType":"bytes","name":"_queryData","type":"bytes"}],"name":"submitValue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timeOfLastNewValue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStakeAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawStake","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052426005553480156200001557600080fd5b5060405162001f3d38038062001f3d833981016040819052620000389162000148565b6001600160a01b038416620000945760405162461bcd60e51b815260206004820152601660248201527f6d7573742073657420746f6b656e20616464726573730000000000000000000060448201526064015b60405180910390fd5b6001600160a01b038316620000ec5760405162461bcd60e51b815260206004820152601b60248201527f6d7573742073657420676f7665726e616e63652061646472657373000000000060448201526064016200008b565b600080546001600160a01b039586166001600160a01b03199182161790915560018054949095169316929092179092556002919091556004556200018f565b80516001600160a01b03811681146200014357600080fd5b919050565b600080600080608085870312156200015e578384fd5b62000169856200012b565b935062000179602086016200012b565b6040860151606090960151949790965092505050565b611d9e806200019f6000396000f3fe608060405234801561001057600080fd5b50600436106101fb5760003560e01c8063722580b61161011a578063adf1639d116100ad578063ca79b5a91161007c578063ca79b5a9146104e6578063cb82cc8f146104f9578063ce5e11bf1461050c578063e07c54861461051f578063fc0c546a14610557576101fb565b8063adf1639d146104a3578063bed9d861146104c3578063c0f95d52146104cb578063c5958af9146104d3576101fb565b80638929f4c6116100e95780638929f4c614610429578063935408d01461043c57806394409a561461046b5780639d9b16ed14610474576101fb565b8063722580b614610382578063732524941461038a578063733bdef01461039b57806377b03e0d14610409576101fb565b80634dfc2a34116101925780635d183cfa116101615780635d183cfa1461034a5780635eaa9ced1461035d57806360c7dc47146103705780636fd4f22914610379576101fb565b80634dfc2a34146102e557806350005b83146102f85780635aa6e675146103245780635b5edcfc14610337576101fb565b80632b6696a7116101ce5780632b6696a71461028f5780633321fc41146102c15780633878293e146102ca578063460c33a2146102dd576101fb565b80630636769e1461020057806310fe9ae81461021557806311938e081461023f57806314c2a1bc14610287575b600080fd5b61021361020e366004611957565b61056a565b005b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b61027961024d3660046119aa565b6001600160a01b0391909116600090815260076020908152604080832093835260059093019052205490565b604051908152602001610236565b600354610279565b6102a261029d366004611ab0565b610648565b604080516001600160a01b039093168352901515602083015201610236565b61027960045481565b6102796102d8366004611957565b61072f565b600454610279565b6102796102f3366004611978565b610751565b610279610306366004611957565b6001600160a01b031660009081526007602052604090206003015490565b600154610222906001600160a01b031681565b610213610345366004611ab0565b6109f5565b6102136103583660046119f3565b610c83565b61021361036b366004611a0b565b610d43565b61027960025481565b61027960055481565b600254610279565b6001546001600160a01b0316610222565b6103e16103a9366004611957565b6001600160a01b0316600090815260076020526040902080546001820154600283015460038401546004909401549294919390929091565b604080519586526020860194909452928401919091526060830152608082015260a001610236565b6102796104173660046119f3565b60009081526006602052604090205490565b6102136104373660046119f3565b61108e565b61027961044a366004611ab0565b60009182526006602090815260408084209284526002909201905290205490565b61027960035481565b610279610482366004611ab0565b60009182526006602090815260408084209284526001909201905290205490565b6104b66104b13660046119f3565b611182565b6040516102369190611c24565b61021361126f565b600554610279565b6104b66104e1366004611ab0565b6113f3565b6102136104f43660046119f3565b6114a4565b6102136105073660046119f3565b611562565b61027961051a366004611ab0565b61176b565b61022261052d366004611ab0565b6000918252600660209081526040808420928452600490920190529020546001600160a01b031690565b600054610222906001600160a01b031681565b6001546001600160a01b0316331461059d5760405162461bcd60e51b815260040161059490611c37565b60405180910390fd5b6001600160a01b0381166105f35760405162461bcd60e51b815260206004820152601b60248201527f6d7573742073657420676f7665726e616e6365206164647265737300000000006044820152606401610594565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f682527aafb5b7e86077049b38534cd433dd39d523b92b0455dab09a16dc0a7db906020015b60405180910390a150565b6000828152600660209081526040808320848452600101909152812054819081901580156106ce5750604080516020808201835260009182905287825260068152828220878352600301905281902090517fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470916106c491611b1c565b6040518091039020145b80156106fe575060008581526006602090815260408083208784526004019091529020546001600160a01b031615155b60009586526006602090815260408088209688526004909601905293909420546001600160a01b0316949293505050565b6001600160a01b0381166000908152600760205260409020600401545b919050565b6001546000906001600160a01b031633146107b95760405162461bcd60e51b815260206004820152602260248201527f6f6e6c7920676f7665726e616e63652063616e20736c617368207265706f727460448201526132b960f11b6064820152608401610594565b6001600160a01b0383166000908152600760205260408120600281015460018201549192916107e89190611c78565b1161082b5760405162461bcd60e51b81526020600482015260136024820152727a65726f207374616b65722062616c616e636560681b6044820152606401610594565b60006002548260020154106108605760025490506002548260020160008282546108559190611ccf565b9091555061091b9050565b600254826001015483600201546108779190611c78565b106108db5750600280549082015461088f9082611ccf565b8260010160008282546108a29190611ccf565b909155505060028083015490546108b99190611ccf565b600360008282546108ca9190611ccf565b90915550506000600283015561091b565b816002015482600101546108ef9190611c78565b90508160010154600360008282546109079190611ccf565b909155505060006001830181905560028301555b60005460405163a9059cbb60e01b81526001600160a01b038681166004830152602482018490529091169063a9059cbb90604401602060405180830381600087803b15801561096957600080fd5b505af115801561097d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a191906119d3565b50604080516001600160a01b038088168252861660208201529081018290527f4317784407a22e643706ef000f5c0eea399dea3632613786167ab71c9446e3ac9060600160405180910390a1949350505050565b6001546001600160a01b03163314610a1f5760405162461bcd60e51b815260040161059490611c37565b600082815260066020908152604080832084845260018101909252909120548154829082908110610a6057634e487b7160e01b600052603260045260246000fd5b90600052602060002001548314610aad5760405162461bcd60e51b81526020600482015260116024820152700696e76616c69642074696d657374616d7607c1b6044820152606401610594565b805b8254610abd90600190611ccf565b811015610b955782610ad0826001611c78565b81548110610aee57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154836000018281548110610b1c57634e487b7160e01b600052603260045260246000fd5b90600052602060002001819055506001836001016000856000018481548110610b5557634e487b7160e01b600052603260045260246000fd5b906000526020600020015481526020019081526020016000206000828254610b7d9190611ccf565b90915550819050610b8d81611d21565b915050610aaf565b5081548290610ba690600190611ccf565b81548110610bc457634e487b7160e01b600052603260045260246000fd5b60009182526020822001558154829080610bee57634e487b7160e01b600052603160045260246000fd5b600082815260208082208301600019908101839055909201909255604080518083018083528482528785526003870190935292209151610c2f9291906117ac565b50600083815260018301602090815260408083209290925581518681529081018590527fb326db0e54476c677e2b35b75856ac6f4d8bbfb0a6de6690582ebe4dabce0de7910160405180910390a150505050565b6001546001600160a01b03163314610cad5760405162461bcd60e51b815260040161059490611c37565b60008111610d0e5760405162461bcd60e51b815260206004820152602860248201527f7265706f7274696e67206c6f636b206d7573742062652067726561746572207460448201526768616e207a65726f60c01b6064820152608401610594565b60048190556040518181527f15585049a76f383bbfc7c421ee17aeb528a0947dc478a0c796166239a452ba579060200161063d565b60008581526006602052604090208054831480610d5e575082155b610daa5760405162461bcd60e51b815260206004820181905260248201527f6e6f6e6365206d757374206d617463682074696d657374616d7020696e6465786044820152606401610594565b33600090815260076020526040902060025460018201541015610e215760405162461bcd60e51b815260206004820152602960248201527f62616c616e6365206d7573742062652067726561746572207468616e207374616044820152681ad948185b5bdd5b9d60ba1b6064820152608401610594565b6002548160010154610e339190611c90565b600454610e42906103e8611cb0565b610e4c9190611c90565b6003820154610e5b9042611ccf565b610e67906103e8611cb0565b11610ec65760405162461bcd60e51b815260206004820152602960248201527f7374696c6c20696e207265706f727465722074696d65206c6f636b2c20706c6560448201526861736520776169742160b81b6064820152608401610594565b82516020840120871480610edb575060648711155b610f275760405162461bcd60e51b815260206004820152601d60248201527f6964206d7573742062652068617368206f6620627974657320646174610000006044820152606401610594565b426003820181905560009081526004830160205260409020546001600160a01b031615610f965760405162461bcd60e51b815260206004820152601e60248201527f74696d657374616d7020616c7265616479207265706f7274656420666f7200006044820152606401610594565b81544260008181526001808601602090815260408084208690559185018755868352808320909401839055918152600285018352818120439055600385019092529020610fe4908787611830565b5042600081815260048085016020526040822080546001600160a01b0319163317905560059290925590820180549161101c83611d21565b90915550506000878152600582016020526040812080549161103d83611d21565b91905055507f48e9e2c732ba278de6ac88a3a57a5c5ba13d3d8370e709b3b98333a57876ca958742888888883360405161107d9796959493929190611bb7565b60405180910390a150505050505050565b33600090815260076020526040902060018101548211156110f15760405162461bcd60e51b815260206004820152601b60248201527f696e73756666696369656e74207374616b65642062616c616e636500000000006044820152606401610594565b42815560028101805483919060009061110b908490611c78565b92505081905550818160010160008282546111269190611ccf565b92505081905550816003600082825461113f9190611ccf565b909155505060408051338152602081018490527f3d8d9df4bd0172df32e557fa48e96435cd7f2cac06aaffacfaee608e6f7898ef91015b60405180910390a15050565b60008181526006602052604081208054606092600383019290916111a890600190611ccf565b815481106111c657634e487b7160e01b600052603260045260246000fd5b9060005260206000200154815260200190815260200160002080546111ea90611ce6565b80601f016020809104026020016040519081016040528092919081815260200182805461121690611ce6565b80156112635780601f1061123857610100808354040283529160200191611263565b820191906000526020600020905b81548152906001019060200180831161124657829003601f168201915b50505050509050919050565b336000908152600760205260409020805462093a809061128f9042611ccf565b10156112d25760405162461bcd60e51b8152602060048201526012602482015271372064617973206469646e2774207061737360701b6044820152606401610594565b60008160020154116113315760405162461bcd60e51b815260206004820152602260248201527f7265706f72746572206e6f74206c6f636b656420666f72207769746864726177604482015261185b60f21b6064820152608401610594565b600054600282015460405163a9059cbb60e01b815233600482015260248101919091526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b15801561138357600080fd5b505af1158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb91906119d3565b50600060028201556040513381527f4a7934670bd8304e7da22378be1368f7c4fef17c5aee81804beda8638fe428ec9060200161063d565b6000828152600660209081526040808320848452600301909152902080546060919061141e90611ce6565b80601f016020809104026020016040519081016040528092919081815260200182805461144a90611ce6565b80156114975780601f1061146c57610100808354040283529160200191611497565b820191906000526020600020905b81548152906001019060200180831161147a57829003601f168201915b5050505050905092915050565b6001546001600160a01b031633146114ce5760405162461bcd60e51b815260040161059490611c37565b6000811161152d5760405162461bcd60e51b815260206004820152602660248201527f7374616b6520616d6f756e74206d7573742062652067726561746572207468616044820152656e207a65726f60d01b6064820152608401610594565b60028190556040518181527f1af37d6aaef3c5ef293c3c63d0ac302f60db7fde22eb9f5e96ebd569928321109060200161063d565b33600090815260076020526040902060028101541561166a57818160020154106115a5578181600201600082825461159a9190611ccf565b909155506116659050565b60005460028201546001600160a01b03909116906323b872dd90339030906115cd9087611ccf565b6040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401602060405180830381600087803b15801561161c57600080fd5b505af1158015611630573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061165491906119d3565b61165d57600080fd5b600060028201555b6116fd565b6000546040516323b872dd60e01b8152336004820152306024820152604481018490526001600160a01b03909116906323b872dd90606401602060405180830381600087803b1580156116bc57600080fd5b505af11580156116d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f491906119d3565b6116fd57600080fd5b428155600181018054839190600090611717908490611c78565b9250508190555081600360008282546117309190611c78565b909155505060408051338152602081018490527fa96c2cce65119a2170d1711a6e82f18f2006448828483ba7545e5954765436479101611176565b600082815260066020526040812080548390811061179957634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b8280546117b890611ce6565b90600052602060002090601f0160209004810192826117da5760008555611820565b82601f106117f357805160ff1916838001178555611820565b82800160010185558215611820579182015b82811115611820578251825591602001919060010190611805565b5061182c9291506118a4565b5090565b82805461183c90611ce6565b90600052602060002090601f01602090048101928261185e5760008555611820565b82601f106118775782800160ff19823516178555611820565b82800160010185558215611820579182015b82811115611820578235825591602001919060010190611889565b5b8082111561182c57600081556001016118a5565b80356001600160a01b038116811461074c57600080fd5b600082601f8301126118e0578081fd5b813567ffffffffffffffff808211156118fb576118fb611d52565b604051601f8301601f19908116603f0116810190828211818310171561192357611923611d52565b8160405283815286602085880101111561193b578485fd5b8360208701602083013792830160200193909352509392505050565b600060208284031215611968578081fd5b611971826118b9565b9392505050565b6000806040838503121561198a578081fd5b611993836118b9565b91506119a1602084016118b9565b90509250929050565b600080604083850312156119bc578182fd5b6119c5836118b9565b946020939093013593505050565b6000602082840312156119e4578081fd5b81518015158114611971578182fd5b600060208284031215611a04578081fd5b5035919050565b600080600080600060808688031215611a22578081fd5b85359450602086013567ffffffffffffffff80821115611a40578283fd5b818801915088601f830112611a53578283fd5b813581811115611a61578384fd5b896020828501011115611a72578384fd5b60208301965080955050604088013593506060880135915080821115611a96578283fd5b50611aa3888289016118d0565b9150509295509295909350565b60008060408385031215611ac2578182fd5b50508035926020909101359150565b60008151808452815b81811015611af657602081850181015186830182015201611ada565b81811115611b075782602083870101525b50601f01601f19169290920160200192915050565b600080835482600182811c915080831680611b3857607f831692505b6020808410821415611b5857634e487b7160e01b87526022600452602487fd5b818015611b6c5760018114611b7d57611ba9565b60ff19861689528489019650611ba9565b60008a815260209020885b86811015611ba15781548b820152908501908301611b88565b505084890196505b509498975050505050505050565b600088825287602083015260c060408301528560c0830152858760e08401378060e08784010152601f19601f870116820185606084015260e0838203016080840152611c0660e0820186611ad1565b9150506001600160a01b03831660a083015298975050505050505050565b6000602082526119716020830184611ad1565b60208082526021908201527f63616c6c6572206d75737420626520676f7665726e616e6365206164647265736040820152607360f81b606082015260800190565b60008219821115611c8b57611c8b611d3c565b500190565b600082611cab57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611cca57611cca611d3c565b500290565b600082821015611ce157611ce1611d3c565b500390565b600181811c90821680611cfa57607f821691505b60208210811415611d1b57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415611d3557611d35611d3c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220eb644c6eafc93e8c9a72f935b1076fe829c2f8e5d895e023b98cdc4c1352e86f64736f6c634300080300330000000000000000000000007b8ac044ebce66acdf14197e8de38c1cc802db4a0000000000000000000000007671ea70ce097bc82464b4ab78f79d279356b6cd0000000000000000000000000000000000000000000000008ac7230489e80000000000000000000000000000000000000000000000000000000000000000a8c0

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

0000000000000000000000007b8ac044ebce66acdf14197e8de38c1cc802db4a0000000000000000000000007671ea70ce097bc82464b4ab78f79d279356b6cd0000000000000000000000000000000000000000000000008ac7230489e80000000000000000000000000000000000000000000000000000000000000000a8c0

-----Decoded View---------------
Arg [0] : _token (address): 0x7b8ac044ebce66acdf14197e8de38c1cc802db4a
Arg [1] : _governance (address): 0x7671ea70ce097bc82464b4ab78f79d279356b6cd
Arg [2] : _stakeAmount (uint256): 10000000000000000000
Arg [3] : _reportingLock (uint256): 43200

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000007b8ac044ebce66acdf14197e8de38c1cc802db4a
Arg [1] : 0000000000000000000000007671ea70ce097bc82464b4ab78f79d279356b6cd
Arg [2] : 0000000000000000000000000000000000000000000000008ac7230489e80000
Arg [3] : 000000000000000000000000000000000000000000000000000000000000a8c0


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading

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