Contract 0xd9157453e2668b2fc45b7a803d3fef3642430cc0 15

 

Contract Overview

Tellor Protocol: Oracle
Balance:
0 ETH

EtherValue:
$0.00

Token:
Txn Hash Method
Block
From
To
Value
0x53eb559665538e49c02e3226dc8be1f66239ab37bdf01c07bb0df798f518dce2Submit Value1128387172023-11-29 16:43:3110 hrs 52 mins ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.0001909643520.010135043
0x85c3f4f6f529cdde327ff0f78a2eb5cbc70027f91bafcd65a4e5ccb68774e4a2Submit Value1128315392023-11-29 12:44:1514 hrs 51 mins ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.0001121589590.010345906
0xc80baef9e9701e30daf232fac840a61a2646b3638b71408212fcaa4971814584Submit Value1128243312023-11-29 8:43:5918 hrs 51 mins ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.0001100663620.010260181
0x60961b9e2a80791d7f39fc70989469cd1d0ee203c017ad182dd1184d0f454e0fSubmit Value1128171232023-11-29 4:43:4322 hrs 51 mins ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.000124300850.007883647
0xa52bc23ca76b9e4c177ad83ff7b85916450a8d40d534da5e2fc4408e8c427067Submit Value1128099142023-11-29 0:43:251 day 2 hrs ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.0001147264380.005553823
0x457b11a6246ac8ae159c87a9e96d38ff7dfff1407dcb3901c8e37c9c97f7cba0Submit Value1128027312023-11-28 20:43:591 day 6 hrs ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.00022390060.008489334
0x4325e61ad8b15e891d8cd94c6ab6057fd06c7ed0bedab217bc09a6f79da3ec9fSubmit Value1127955172023-11-28 16:43:311 day 10 hrs ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.000150783780.010022139
0xe0fce6746c003097a861e28940d009c5a660f0bc21e490365cdd0388b48caf1aWithdraw Stake1127907872023-11-28 14:05:511 day 13 hrs ago0xf288eb2539bfe8883747fa4513f1613e98cfc33b IN  Tellor Protocol: Oracle0 ETH0.000101022010.006434196
0x7fface65cc2105b709d5f6abe238e8a4916dc7ea59984e9992e1935552dcfce8Submit Value1127883352023-11-28 12:44:071 day 14 hrs ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.0000919094250.007075726
0xe1ca1eda15383476a36ac842790f66aa3c3fe49521700157caedadcf174614d9Submit Value1127811252023-11-28 8:43:471 day 18 hrs ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.0000921422210.008261218
0xbe0cf79628ea4e84b68ddf3f9dc662f9eab2087e6707e72d8537a9fc359c5640Submit Value1127739142023-11-28 4:43:251 day 22 hrs ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.0001032542840.00691268
0xc63772f97d767766f55affee9e1b20d54f7a05a4d8974cb0305549b6ca784571Submit Value1127667352023-11-28 0:44:072 days 2 hrs ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.0001041111970.006111461
0xf866293c4844ea5190e3aa75797523fb1868499bc4709a141d43bd56e1d010f5Submit Value1127595242023-11-27 20:43:452 days 6 hrs ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.0001193997990.007918035
0xeaa6ff11f2962c220d7e8bb42f042303f5483cc5ac8ea31b7d4e237bad63d742Submit Value1127523132023-11-27 16:43:232 days 10 hrs ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.0001510434810.006905572
0x2ffa9ef63aa67f9072f2eb97acc71d67f658d80f420218eb2b0d298508f8f6fdSubmit Value1127451322023-11-27 12:44:012 days 14 hrs ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.0001133049350.007596522
0xeeb6d86630f1bc7de56e63fdf144c53ecce1e8a6c94b9907cf84c4a747d2ba8fSubmit Value1127379232023-11-27 8:43:432 days 18 hrs ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.0000916486590.007964049
0xb0b7a4ee9285693338e1dc5d92054b131cb5f1fcc888de6cd1a214d7ac5b9430Submit Value1127307142023-11-27 4:43:252 days 22 hrs ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.0000701571680.008928897
0xbf22783d28f0c7636e0a825b9778fd2360bbeda02d0ef96f421225155cea5d88Submit Value1127235352023-11-27 0:44:073 days 2 hrs ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.000109059370.009778712
0xb4b349c04d0e2c92c89ee3b8f99f3b4e1982e69af15af85ff316feee47c25fddSubmit Value1127163232023-11-26 20:43:433 days 6 hrs ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.0000944674850.011399431
0x5e3935d313aae4a11eec653596f43d68571fd8ba086aa458f2e6713d4a96c8f4Submit Value1127091122023-11-26 16:43:213 days 10 hrs ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.0001303763670.010504654
0x6bffa6e7c5c92ed75149d8d71c4e5be203534cb1d2e3ac63daa6ddf86c56c230Submit Value1127019332023-11-26 12:44:033 days 14 hrs ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.0000785919660.00874572
0x55256d606e478dd9a7a897c0838e93268629734bbce5eec1f9109ab52d4ccbbeSubmit Value1126947252023-11-26 8:43:473 days 18 hrs ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.0000724954980.007935143
0x669d25a7873a90a6b09e0a668f841c9ca2dde1e058fa50c42f1d813629289e03Submit Value1126875162023-11-26 4:43:293 days 22 hrs ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.0000643458460.008868318
0xf362d6751b95886b90f4ddd9657e27011ffdaa12d091e2c5ae02d1cdeea4a9b8Submit Value1126803382023-11-26 0:44:134 days 2 hrs ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.0000691220840.010674161
0x479feebf31192f1ab0f7c8c55da3e7cbf8833f4748fd2915374980c598530718Submit Value1126731262023-11-25 20:43:494 days 6 hrs ago0x33f1d3942f35bcc4cfd1e4e0522e25684091b95e IN  Tellor Protocol: Oracle0 ETH0.0000801327870.007988058
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xfc9e1a4ed36a2d4c41c6324cf51c7d63b7383715cc5b8a551222b2aec718f61e1075549722023-07-30 9:18:41122 days 18 hrs ago 0xce8ddac74177174f7243d4767d011f40a5fd483b Tellor Protocol: Oracle0 ETH
0xfc9e1a4ed36a2d4c41c6324cf51c7d63b7383715cc5b8a551222b2aec718f61e1075549722023-07-30 9:18:41122 days 18 hrs ago 0xce8ddac74177174f7243d4767d011f40a5fd483b Tellor Protocol: Oracle0 ETH
0xfc9e1a4ed36a2d4c41c6324cf51c7d63b7383715cc5b8a551222b2aec718f61e1075549722023-07-30 9:18:41122 days 18 hrs ago 0xce8ddac74177174f7243d4767d011f40a5fd483b Tellor Protocol: Oracle0 ETH
0xc298eecf5c21caa51aa220f5da991136befc70078e8c3c97a86ced739c4082131075537532023-07-30 8:38:03122 days 18 hrs ago 0xce8ddac74177174f7243d4767d011f40a5fd483b Tellor Protocol: Oracle0 ETH
0xb6e7c7943e32dabc1b852e9997d547e95af9672c89b33769b5881702cad522de1075521142023-07-30 7:43:25122 days 19 hrs ago 0xce8ddac74177174f7243d4767d011f40a5fd483b Tellor Protocol: Oracle0 ETH
0x079d2a9e9bf85db924aa0f2adc0630398c87569f2124c2a053aa1d7e987582871075516802023-07-30 7:28:57122 days 20 hrs ago Tellor Protocol: Oracle Tellor Tributes: TRB Token0 ETH
0xf299448a1f75a7434c37fe04b3153109f275151e14c2a4db955a01fbcb7556021075516722023-07-30 7:28:41122 days 20 hrs ago Tellor Protocol: Oracle Tellor Tributes: TRB Token0 ETH
0xe7b18d5c7965add73e0ff29066f0768502bc4c3619829313672a32999dbae9cc1075514822023-07-30 7:22:21122 days 20 hrs ago Tellor Protocol: Oracle Tellor Tributes: TRB Token0 ETH
0xf5b96b38694f6f1a51cf5631eab3cddcc1a1c65d3a98c1164da31978de71b9031075491372023-07-30 6:04:11122 days 21 hrs ago 0xce8ddac74177174f7243d4767d011f40a5fd483b Tellor Protocol: Oracle0 ETH
0x885c84c91ab342eac08ff2809613a9674c1e6d80429dbf9a9cd772d0cbe2618f1075487652023-07-30 5:51:47122 days 21 hrs ago 0xce8ddac74177174f7243d4767d011f40a5fd483b Tellor Protocol: Oracle0 ETH
0x02be99601e711afc22f99b4610f1ec54a035be1cbb18f7e93c00092f31e0b7331075467532023-07-30 4:44:43122 days 22 hrs ago 0xce8ddac74177174f7243d4767d011f40a5fd483b Tellor Protocol: Oracle0 ETH
0x010a12078de3839edc1b21824ebe9cdf12086f8df28c6a6fa68e1fa76a6763341075446782023-07-30 3:35:33122 days 23 hrs ago Tellor Protocol: Oracle Tellor Tributes: TRB Token0 ETH
0x5e42f4a3697f60bceb10b6ab54bf202368416c9c6a17f9aca2c14059f87cb2a01075446702023-07-30 3:35:17123 days ago Tellor Protocol: Oracle Tellor Tributes: TRB Token0 ETH
0xd73bd1e2f25d77270eab96b379ecb795452945b74e01e64b6e253dc1a93513f51075446142023-07-30 3:33:25123 days 2 mins ago 0xce8ddac74177174f7243d4767d011f40a5fd483b Tellor Protocol: Oracle0 ETH
0x3a8665347fc319990c7c6d8b3e0ddeb3594fc720e746672e460b7a0a8373c1451075444812023-07-30 3:28:59123 days 6 mins ago Tellor Protocol: Oracle Tellor Tributes: TRB Token0 ETH
0x1c40eaf6195ad8897993d4c9c237da55bd15ad584a81004b6b33e0855ddbc0d31075438042023-07-30 3:06:25123 days 29 mins ago 0xce8ddac74177174f7243d4767d011f40a5fd483b Tellor Protocol: Oracle0 ETH
0xc962562cfc05c36dc2aa69e533c59097c3c97af6c8cd6b24f58a6d3417d187701075405092023-07-30 1:16:35123 days 2 hrs ago 0xce8ddac74177174f7243d4767d011f40a5fd483b Tellor Protocol: Oracle0 ETH
0x4f04eace15799790dd5850a7428bd062574c9dd98d6c0321931d66e53ef8d1b71075404952023-07-30 1:16:07123 days 2 hrs ago 0xce8ddac74177174f7243d4767d011f40a5fd483b Tellor Protocol: Oracle0 ETH
0x84c5e70b8c50165bdcf475183be233c4b390cbd03a23e548cac8506c2622374e1075394292023-07-30 0:40:35123 days 2 hrs ago 0xce8ddac74177174f7243d4767d011f40a5fd483b Tellor Protocol: Oracle0 ETH
0x7092edcb942939e5c193ebdb9efc58223de51157c83f24e9d022fca821f80d7f1075394042023-07-30 0:39:45123 days 2 hrs ago 0xce8ddac74177174f7243d4767d011f40a5fd483b Tellor Protocol: Oracle0 ETH
0xa3051929c60efecc0214ad8aa29451389b749ec56bf579860f4826767e9947ce1075393602023-07-30 0:38:17123 days 2 hrs ago 0xce8ddac74177174f7243d4767d011f40a5fd483b Tellor Protocol: Oracle0 ETH
0x7f78ed3a7a703bcab928be3afbbe29e5255b4975f893d123d8a04c0e875505b81075376762023-07-29 23:42:09123 days 3 hrs ago Tellor Protocol: Oracle Tellor Tributes: TRB Token0 ETH
0x1b41ab5c67ad40b8abe4e80c62ee26f18eee6d4da58fa9b2d5761c0f029a7d331075376682023-07-29 23:41:53123 days 3 hrs ago Tellor Protocol: Oracle Tellor Tributes: TRB Token0 ETH
0x401f8b19de434af5083736bddbb37f21126226e1db7b9628f6f7646b5902726b1075374792023-07-29 23:35:35123 days 3 hrs ago Tellor Protocol: Oracle Tellor Tributes: TRB Token0 ETH
0xe155844abaf6d875c43bf59729b7b3f8da5769a8265b06e0be93e5d9bb35f9541075358092023-07-29 22:39:55123 days 4 hrs ago 0xce8ddac74177174f7243d4767d011f40a5fd483b Tellor Protocol: Oracle0 ETH
[ 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 : 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);
}

File 2 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 {
    // Storage
    IERC20 public token; // token used for staking and rewards
    address public governance; // address with ability to remove values and slash reporters
    address public owner; // contract deployer, can call init function once
    uint256 public accumulatedRewardPerShare; // accumulated staking reward per staked token
    uint256 public minimumStakeAmount; // minimum amount of tokens required to stake
    uint256 public reportingLock; // base amount of time before a reporter is able to submit a value again
    uint256 public rewardRate; // total staking rewards released per second
    uint256 public stakeAmount; // minimum amount required to be a staker
    uint256 public stakeAmountDollarTarget; // amount of US dollars required to be a staker
    uint256 public stakingRewardsBalance; // total amount of staking rewards
    bytes32 public stakingTokenPriceQueryId; // staking token SpotPrice queryId, used for updating stakeAmount
    uint256 public timeBasedReward = 5e17; // amount of TB rewards released per 5 minutes
    uint256 public timeOfLastAllocation; // time of last update to accumulatedRewardPerShare
    uint256 public timeOfLastNewValue = block.timestamp; // time of the last new submitted value, originally set to the block timestamp
    uint256 public totalRewardDebt; // staking reward debt, used to calculate real staking rewards balance
    uint256 public totalStakeAmount; // total amount of tokens locked in contract (via stake)
    uint256 public totalStakers; // total number of stakers with at least stakeAmount staked, not exact
    uint256 public toWithdraw; //amountLockedForWithdrawal

    mapping(bytes32 => Report) private reports; // mapping of query IDs to a report
    mapping(address => StakeInfo) private 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
        mapping(uint256 => bool) isDisputed;
    }

    struct StakeInfo {
        uint256 startDate; // stake or withdrawal request start date
        uint256 stakedBalance; // staked token balance
        uint256 lockedBalance; // amount locked for withdrawal
        uint256 rewardDebt; // used for staking reward calculation
        uint256 reporterLastTimestamp; // timestamp of reporter's last reported value
        uint256 reportsSubmitted; // total number of reports submitted by reporter
        uint256 startVoteCount; // total number of governance votes when stake deposited
        uint256 startVoteTally; // staker vote tally when stake deposited
        bool staked; // used to keep track of total stakers
        mapping(bytes32 => uint256) reportsSubmittedByQueryId; // mapping of queryId to number of reports submitted by reporter
    }

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

    // Functions
    /**
     * @dev Initializes system parameters
     * @param _token address of token used for staking and rewards
     * @param _reportingLock base amount of time (seconds) before reporter is able to report again
     * @param _stakeAmountDollarTarget fixed USD amount that stakeAmount targets on updateStakeAmount
     * @param _stakingTokenPrice current price of staking token in USD (18 decimals)
     * @param _stakingTokenPriceQueryId queryId where staking token price is reported
     */
    constructor(
        address _token,
        uint256 _reportingLock,
        uint256 _stakeAmountDollarTarget,
        uint256 _stakingTokenPrice,
        uint256 _minimumStakeAmount,
        bytes32 _stakingTokenPriceQueryId
    ) {
        require(_token != address(0), "must set token address");
        require(_stakingTokenPrice > 0, "must set staking token price");
        require(_reportingLock > 0, "must set reporting lock");
        require(_stakingTokenPriceQueryId != bytes32(0), "must set staking token price queryId");
        token = IERC20(_token);
        owner = msg.sender;
        reportingLock = _reportingLock;
        stakeAmountDollarTarget = _stakeAmountDollarTarget;
        minimumStakeAmount = _minimumStakeAmount;
        uint256 _potentialStakeAmount = (_stakeAmountDollarTarget * 1e18) / _stakingTokenPrice;
        if(_potentialStakeAmount < _minimumStakeAmount) {
            stakeAmount = _minimumStakeAmount;
        } else {
            stakeAmount = _potentialStakeAmount;
        }
        stakingTokenPriceQueryId = _stakingTokenPriceQueryId;
    }

    /**
     * @dev Allows the owner to initialize the governance (flex addy needed for governance deployment)
     * @param _governanceAddress address of governance contract (github.com/tellor-io/governance)
     */
    function init(address _governanceAddress) external {
        require(msg.sender == owner, "only owner can set governance address");
        require(governance == address(0), "governance address already set");
        require(
            _governanceAddress != address(0),
            "governance address can't be zero address"
        );
        governance = _governanceAddress;
    }

    /**
     * @dev Funds the Flex contract with staking rewards (paid by autopay and minting)
     * @param _amount amount of tokens to fund contract with
     */
    function addStakingRewards(uint256 _amount) external {
        require(token.transferFrom(msg.sender, address(this), _amount));
        _updateRewards();
        stakingRewardsBalance += _amount;
        // update reward rate = real staking rewards balance / 30 days
        rewardRate =
            (stakingRewardsBalance -
                ((accumulatedRewardPerShare * totalStakeAmount) /
                    1e18 -
                    totalRewardDebt)) /
            30 days;
    }

    /**
     * @dev Allows a reporter to submit stake
     * @param _amount amount of tokens to stake
     */
    function depositStake(uint256 _amount) external {
        require(governance != address(0), "governance address not set");
        StakeInfo storage _staker = stakerDetails[msg.sender];
        uint256 _stakedBalance = _staker.stakedBalance;
        uint256 _lockedBalance = _staker.lockedBalance;
        if (_lockedBalance > 0) {
            if (_lockedBalance >= _amount) {
                // if staker's locked balance covers full _amount, use that
                _staker.lockedBalance -= _amount;
                toWithdraw -= _amount;
            } else {
                // otherwise, stake the whole locked balance and transfer the
                // remaining amount from the staker's address
                require(
                    token.transferFrom(
                        msg.sender,
                        address(this),
                        _amount - _lockedBalance
                    )
                );
                toWithdraw -= _staker.lockedBalance;
                _staker.lockedBalance = 0;
            }
        } else {
            if (_stakedBalance == 0) {
                // if staked balance and locked balance equal 0, save current vote tally.
                // voting participation used for calculating rewards
                (bool _success, bytes memory _returnData) = governance.call(
                    abi.encodeWithSignature("getVoteCount()")
                );
                if (_success) {
                    _staker.startVoteCount = uint256(abi.decode(_returnData, (uint256)));
                }
                (_success,_returnData) = governance.call(
                    abi.encodeWithSignature("getVoteTallyByAddress(address)",msg.sender)
                );
                if(_success){
                    _staker.startVoteTally =  abi.decode(_returnData,(uint256));
                }
            }
            require(token.transferFrom(msg.sender, address(this), _amount));
        }
        _updateStakeAndPayRewards(msg.sender, _stakedBalance + _amount);
        _staker.startDate = block.timestamp; // This resets the staker start date to now
        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 _report = reports[_queryId];
        require(!_report.isDisputed[_timestamp], "value already disputed");
        uint256 _index = _report.timestampIndex[_timestamp];
        require(_timestamp == _report.timestamps[_index], "invalid timestamp");
        _report.valueByTimestamp[_timestamp] = "";
        _report.isDisputed[_timestamp] = true;
        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"
        );
        _updateStakeAndPayRewards(msg.sender, _staker.stakedBalance - _amount);
        _staker.startDate = block.timestamp;
        _staker.lockedBalance += _amount;
        toWithdraw += _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 _slashAmount uint256 amount of token slashed and sent to recipient address
     */
    function slashReporter(address _reporter, address _recipient)
        external
        returns (uint256 _slashAmount)
    {
        require(msg.sender == governance, "only governance can slash reporter");
        StakeInfo storage _staker = stakerDetails[_reporter];
        uint256 _stakedBalance = _staker.stakedBalance;
        uint256 _lockedBalance = _staker.lockedBalance;
        require(_stakedBalance + _lockedBalance > 0, "zero staker balance");
        if (_lockedBalance >= stakeAmount) {
            // if locked balance is at least stakeAmount, slash from locked balance
            _slashAmount = stakeAmount;
            _staker.lockedBalance -= stakeAmount;
            toWithdraw -= stakeAmount;
        } else if (_lockedBalance + _stakedBalance >= stakeAmount) {
            // if locked balance + staked balance is at least stakeAmount,
            // slash from locked balance and slash remainder from staked balance
            _slashAmount = stakeAmount;
            _updateStakeAndPayRewards(
                _reporter,
                _stakedBalance - (stakeAmount - _lockedBalance)
            );
            toWithdraw -= _lockedBalance;
            _staker.lockedBalance = 0;
        } else {
            // if sum(locked balance + staked balance) is less than stakeAmount,
            // slash sum
            _slashAmount = _stakedBalance + _lockedBalance;
            toWithdraw -= _lockedBalance;
            _updateStakeAndPayRewards(_reporter, 0);
            _staker.lockedBalance = 0;
        }
        require(token.transfer(_recipient, _slashAmount));
        emit ReporterSlashed(_reporter, _recipient, _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 calldata _queryData
    ) external {
        require(keccak256(_value) != keccak256(""), "value must be submitted");
        Report storage _report = reports[_queryId];
        require(
            _nonce == _report.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),
            "query id must be hash of query data"
        );
        _staker.reporterLastTimestamp = block.timestamp;
        // Checks for no double reporting of timestamps
        require(
            _report.reporterByTimestamp[block.timestamp] == address(0),
            "timestamp already reported for"
        );
        // Update number of timestamps, value for given timestamp, and reporter for timestamp
        _report.timestampIndex[block.timestamp] = _report.timestamps.length;
        _report.timestamps.push(block.timestamp);
        _report.timestampToBlockNum[block.timestamp] = block.number;
        _report.valueByTimestamp[block.timestamp] = _value;
        _report.reporterByTimestamp[block.timestamp] = msg.sender;
        // Disperse Time Based Reward
        uint256 _reward = ((block.timestamp - timeOfLastNewValue) * timeBasedReward) / 300; //.5 TRB per 5 minutes
        uint256 _totalTimeBasedRewardsBalance =
            token.balanceOf(address(this)) -
            (totalStakeAmount + stakingRewardsBalance + toWithdraw);
        if (_totalTimeBasedRewardsBalance > 0 && _reward > 0) {
            if (_totalTimeBasedRewardsBalance < _reward) {
                token.transfer(msg.sender, _totalTimeBasedRewardsBalance);
            } else {
                token.transfer(msg.sender, _reward);
            }
        }
        // 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 Updates the stake amount after retrieving the latest
     * 12+-hour-old staking token price from the oracle
     */
    function updateStakeAmount() external {
        // get staking token price
        (bool _valFound, bytes memory _val, ) = getDataBefore(
            stakingTokenPriceQueryId,
            block.timestamp - 12 hours
        );
        if (_valFound) {
            uint256 _stakingTokenPrice = abi.decode(_val, (uint256));
            require(
                _stakingTokenPrice >= 0.01 ether && _stakingTokenPrice < 1000000 ether,
                "invalid staking token price"
            );

            uint256 _adjustedStakeAmount = (stakeAmountDollarTarget * 1e18) / _stakingTokenPrice;
            if(_adjustedStakeAmount < minimumStakeAmount) {
                stakeAmount = minimumStakeAmount;
            } else {
                stakeAmount = _adjustedStakeAmount;
            }
            emit NewStakeAmount(stakeAmount);
        }
    }

    /**
     * @dev Withdraws a reporter's stake after the lock period expires
     */
    function withdrawStake() external {
        StakeInfo storage _staker = stakerDetails[msg.sender];
        // Ensure reporter is locked and that enough time has passed
        require(
            block.timestamp - _staker.startDate >= 7 days,
            "7 days didn't pass"
        );
        require(
            _staker.lockedBalance > 0,
            "reporter not locked for withdrawal"
        );
        require(token.transfer(msg.sender, _staker.lockedBalance));
        toWithdraw -= _staker.lockedBalance;
        _staker.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 _value the latest submitted value for the given queryId
     */
    function getCurrentValue(bytes32 _queryId)
        external
        view
        returns (bytes memory _value)
    {
        bool _didGet;
        (_didGet, _value, ) = getDataBefore(_queryId, block.timestamp + 1);
        if(!_didGet){revert();}
    }

    /**
     * @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)
        public
        view
        returns (
            bool _ifRetrieve,
            bytes memory _value,
            uint256 _timestampRetrieved
        )
    {
        (bool _found, uint256 _index) = getIndexForDataBefore(
            _queryId,
            _timestamp
        );
        if (!_found) return (false, bytes(""), 0);
        _timestampRetrieved = getTimestampbyQueryIdandIndex(_queryId, _index);
        _value = retrieveData(_queryId, _timestampRetrieved);
        return (true, _value, _timestampRetrieved);
    }

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

    /**
     * @dev Returns the pending staking reward for a given address
     * @param _stakerAddress staker address to look up
     * @return _pendingReward - pending reward for given staker
     */
    function getPendingRewardByStaker(address _stakerAddress)
        external
        returns (uint256 _pendingReward)
    {
        StakeInfo storage _staker = stakerDetails[_stakerAddress];
        _pendingReward = (_staker.stakedBalance *
            _getUpdatedAccumulatedRewardPerShare()) /
            1e18 -
            _staker.rewardDebt;
        (bool _success, bytes memory _returnData) = governance.call(
            abi.encodeWithSignature("getVoteCount()")
        );
        uint256 _numberOfVotes;
        if (_success) {
                _numberOfVotes = uint256(abi.decode(_returnData, (uint256))) - _staker.startVoteCount;
        }
        if (_numberOfVotes > 0) {
                (_success,_returnData) = governance.call(
                    abi.encodeWithSignature("getVoteTallyByAddress(address)",_stakerAddress)
                );
                if(_success){
                    _pendingReward =
                        (_pendingReward * (abi.decode(_returnData,(uint256)) - _staker.startVoteTally)) 
                        / _numberOfVotes;
                }
        }
    }

    /**
     * @dev Returns the real staking rewards balance after accounting for unclaimed rewards
     * @return uint256 real staking rewards balance
     */
    function getRealStakingRewardsBalance() external view returns (uint256) {
        uint256 _pendingRewards = (_getUpdatedAccumulatedRewardPerShare() *
            totalStakeAmount) /
            1e18 -
            totalRewardDebt;
        return (stakingRewardsBalance - _pendingRewards);
    }

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

    /**
     * @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 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 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 Returns 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
     * @return bool whether staker is counted in totalStakers
     */
    function getStakerInfo(address _stakerAddress)
        external
        view
        returns (
            uint256,
            uint256,
            uint256,
            uint256,
            uint256,
            uint256,
            uint256,
            uint256,
            bool
        )
    {
        StakeInfo storage _staker = stakerDetails[_stakerAddress];
        return (
            _staker.startDate,
            _staker.stakedBalance,
            _staker.lockedBalance,
            _staker.rewardDebt,
            _staker.reporterLastTimestamp,
            _staker.reportsSubmitted,
            _staker.startVoteCount,
            _staker.startVoteTally,
            _staker.staked
        );
    }

    /**
     * @dev Returns the timestamp for the last value of any ID from the oracle
     * @return uint256 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)
        public
        view
        returns (uint256)
    {
        return reports[_queryId].timestamps[_index];
    }

    /**
     * @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)
    {
        uint256 _count = getNewValueCountbyQueryId(_queryId);
        if (_count > 0) {
            uint256 _middle;
            uint256 _start = 0;
            uint256 _end = _count - 1;
            uint256 _time;
            //Checking Boundaries to short-circuit the algorithm
            _time = getTimestampbyQueryIdandIndex(_queryId, _start);
            if (_time >= _timestamp) return (false, 0);
            _time = getTimestampbyQueryIdandIndex(_queryId, _end);
            if (_time < _timestamp) {
                while(isInDispute(_queryId, _time) && _end > 0) {
                    _end--;
                    _time = getTimestampbyQueryIdandIndex(_queryId, _end);
                }
                if(_end == 0 && isInDispute(_queryId, _time)) {
                    return (false, 0);
                }
                return (true, _end);
            }
            //Since the value is within our boundaries, do a binary search
            while (true) {
                _middle = (_end - _start) / 2 + 1 + _start;
                _time = getTimestampbyQueryIdandIndex(_queryId, _middle);
                if (_time < _timestamp) {
                    //get immediate next value
                    uint256 _nextTime = getTimestampbyQueryIdandIndex(
                        _queryId,
                        _middle + 1
                    );
                    if (_nextTime >= _timestamp) {
                        if(!isInDispute(_queryId, _time)) {
                            // _time is correct
                            return (true, _middle);
                        } else {
                            // iterate backwards until we find a non-disputed value
                            while(isInDispute(_queryId, _time) && _middle > 0) {
                                _middle--;
                                _time = getTimestampbyQueryIdandIndex(_queryId, _middle);
                            }
                            if(_middle == 0 && isInDispute(_queryId, _time)) {
                                return (false, 0);
                            }
                            // _time is correct
                            return (true, _middle);
                        }
                    } else {
                        //look from middle + 1(next value) to end
                        _start = _middle + 1;
                    }
                } else {
                    uint256 _prevTime = getTimestampbyQueryIdandIndex(
                        _queryId,
                        _middle - 1
                    );
                    if (_prevTime < _timestamp) {
                        if(!isInDispute(_queryId, _prevTime)) {
                            // _prevTime is correct
                            return (true, _middle - 1);
                        } else {
                            // iterate backwards until we find a non-disputed value
                            _middle--;
                            while(isInDispute(_queryId, _prevTime) && _middle > 0) {
                                _middle--;
                                _prevTime = getTimestampbyQueryIdandIndex(
                                    _queryId,
                                    _middle
                                );
                            }
                            if(_middle == 0 && isInDispute(_queryId, _prevTime)) {
                                return (false, 0);
                            }
                            // _prevtime is correct
                            return (true, _middle);
                        }
                    } else {
                        //look from start to middle -1(prev value)
                        _end = _middle - 1;
                    }
                }
            }
        }
        return (false, 0);
    }

    /**
     * @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 Returns total number of current stakers. Reporters with stakedBalance less than stakeAmount are excluded from this total
     * @return uint256 total stakers
     */
    function getTotalStakers() external view returns (uint256) {
        return totalStakers;
    }

    /**
     * @dev Returns total balance of time based rewards in contract
     * @return uint256 amount of trb
     */
    function getTotalTimeBasedRewardsBalance() external view returns (uint256) {
        return token.balanceOf(address(this)) - (totalStakeAmount + stakingRewardsBalance + toWithdraw);
    }

    /**
     * @dev Returns whether a given value is disputed
     * @param _queryId unique ID of the data feed
     * @param _timestamp timestamp of the value
     * @return bool whether the value is disputed
     */
    function isInDispute(bytes32 _queryId, uint256 _timestamp)
        public
        view
        returns (bool)
    {
        return reports[_queryId].isDisputed[_timestamp];
    }

    /**
     * @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)
        public
        view
        returns (bytes memory)
    {
        return reports[_queryId].valueByTimestamp[_timestamp];
    }

    /**
     * @dev Used during the upgrade process to verify valid Tellor contracts
     * @return bool value used to verify valid Tellor contracts
     */
    function verify() external pure returns (uint256) {
        return 9999;
    }

    // *****************************************************************************
    // *                                                                           *
    // *                          Internal functions                               *
    // *                                                                           *
    // *****************************************************************************

    /**
     * @dev Updates accumulated staking rewards per staked token
     */
    function _updateRewards() internal {
        if (timeOfLastAllocation == block.timestamp) {
            return;
        }
        if (totalStakeAmount == 0 || rewardRate == 0) {
            timeOfLastAllocation = block.timestamp;
            return;
        }
        // calculate accumulated reward per token staked
        uint256 _newAccumulatedRewardPerShare = accumulatedRewardPerShare +
            ((block.timestamp - timeOfLastAllocation) * rewardRate * 1e18) /
            totalStakeAmount;
        // calculate accumulated reward with _newAccumulatedRewardPerShare
        uint256 _accumulatedReward = (_newAccumulatedRewardPerShare *
            totalStakeAmount) /
            1e18 -
            totalRewardDebt;
        if (_accumulatedReward >= stakingRewardsBalance) {
            // if staking rewards run out, calculate remaining reward per staked
            // token and set rewardRate to 0
            uint256 _newPendingRewards = stakingRewardsBalance -
                ((accumulatedRewardPerShare * totalStakeAmount) /
                    1e18 -
                    totalRewardDebt);
            accumulatedRewardPerShare +=
                (_newPendingRewards * 1e18) /
                totalStakeAmount;
            rewardRate = 0;
        } else {
            accumulatedRewardPerShare = _newAccumulatedRewardPerShare;
        }
        timeOfLastAllocation = block.timestamp;
    }

    /**
     * @dev Called whenever a user's stake amount changes. First updates staking rewards,
     * transfers pending rewards to user's address, and finally updates user's stake amount
     * and other relevant variables.
     * @param _stakerAddress address of user whose stake is being updated
     * @param _newStakedBalance new staked balance of user
     */
    function _updateStakeAndPayRewards(
        address _stakerAddress,
        uint256 _newStakedBalance
    ) internal {
        _updateRewards();
        StakeInfo storage _staker = stakerDetails[_stakerAddress];
        if (_staker.stakedBalance > 0) {
            // if address already has a staked balance, calculate and transfer pending rewards
            uint256 _pendingReward = (_staker.stakedBalance *
                accumulatedRewardPerShare) /
                1e18 -
                _staker.rewardDebt;
            // get staker voting participation rate
            uint256 _numberOfVotes;
            (bool _success, bytes memory _returnData) = governance.call(
                abi.encodeWithSignature("getVoteCount()")
            );
            if (_success) {
                _numberOfVotes =
                    uint256(abi.decode(_returnData, (uint256))) -
                    _staker.startVoteCount;
            }
            if (_numberOfVotes > 0) {
                // staking reward = pending reward * voting participation rate
                (_success, _returnData) = governance.call(
                    abi.encodeWithSignature("getVoteTallyByAddress(address)",_stakerAddress)
                );
                if(_success){
                    uint256 _voteTally = abi.decode(_returnData,(uint256));
                    uint256 _tempPendingReward =
                        (_pendingReward *
                            (_voteTally - _staker.startVoteTally)) /
                        _numberOfVotes;
                    if (_tempPendingReward < _pendingReward) {
                        _pendingReward = _tempPendingReward;
                    }
                }
            }
            stakingRewardsBalance -= _pendingReward;
            require(token.transfer(msg.sender, _pendingReward));
            totalRewardDebt -= _staker.rewardDebt;
            totalStakeAmount -= _staker.stakedBalance;
        }
        _staker.stakedBalance = _newStakedBalance;
        // Update total stakers
        if (_staker.stakedBalance >= stakeAmount) {
            if (_staker.staked == false) {
                totalStakers++;
            }
            _staker.staked = true;
        } else {
            if (_staker.staked == true && totalStakers > 0) {
                totalStakers--;
            }
            _staker.staked = false;
        }
        // tracks rewards accumulated before stake amount updated
        _staker.rewardDebt =
            (_staker.stakedBalance * accumulatedRewardPerShare) /
            1e18;
        totalRewardDebt += _staker.rewardDebt;
        totalStakeAmount += _staker.stakedBalance;
        // update reward rate if staking rewards are available 
        // given staker's updated parameters
        if(rewardRate == 0) {
            rewardRate =
            (stakingRewardsBalance -
                ((accumulatedRewardPerShare * totalStakeAmount) /
                    1e18 -
                    totalRewardDebt)) /
            30 days;
        }
    }

    /**
     * @dev Internal function retrieves updated accumulatedRewardPerShare
     * @return uint256 up-to-date accumulated reward per share
     */
    function _getUpdatedAccumulatedRewardPerShare()
        internal
        view
        returns (uint256)
    {
        if (totalStakeAmount == 0) {
            return accumulatedRewardPerShare;
        }
        uint256 _newAccumulatedRewardPerShare = accumulatedRewardPerShare +
            ((block.timestamp - timeOfLastAllocation) * rewardRate * 1e18) /
            totalStakeAmount;
        uint256 _accumulatedReward = (_newAccumulatedRewardPerShare *
            totalStakeAmount) /
            1e18 -
            totalRewardDebt;
        if (_accumulatedReward >= stakingRewardsBalance) {
            uint256 _newPendingRewards = stakingRewardsBalance -
                ((accumulatedRewardPerShare * totalStakeAmount) /
                    1e18 -
                    totalRewardDebt);
            _newAccumulatedRewardPerShare =
                accumulatedRewardPerShare +
                (_newPendingRewards * 1e18) /
                totalStakeAmount;
        }
        return _newAccumulatedRewardPerShare;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_reportingLock","type":"uint256"},{"internalType":"uint256","name":"_stakeAmountDollarTarget","type":"uint256"},{"internalType":"uint256","name":"_stakingTokenPrice","type":"uint256"},{"internalType":"uint256","name":"_minimumStakeAmount","type":"uint256"},{"internalType":"bytes32","name":"_stakingTokenPriceQueryId","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"_queryId","type":"bytes32"},{"indexed":true,"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":true,"internalType":"address","name":"_reporter","type":"address"}],"name":"NewReport","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_newStakeAmount","type":"uint256"}],"name":"NewStakeAmount","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_staker","type":"address"},{"indexed":true,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"NewStaker","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"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":[],"name":"accumulatedRewardPerShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"addStakingRewards","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":"_value","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_queryId","type":"bytes32"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"getDataBefore","outputs":[{"internalType":"bool","name":"_ifRetrieve","type":"bool"},{"internalType":"bytes","name":"_value","type":"bytes"},{"internalType":"uint256","name":"_timestampRetrieved","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGovernanceAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_queryId","type":"bytes32"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"getIndexForDataBefore","outputs":[{"internalType":"bool","name":"_found","type":"bool"},{"internalType":"uint256","name":"_index","type":"uint256"}],"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":"address","name":"_stakerAddress","type":"address"}],"name":"getPendingRewardByStaker","outputs":[{"internalType":"uint256","name":"_pendingReward","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getRealStakingRewardsBalance","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":"_stakerAddress","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"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bool","name":"","type":"bool"}],"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":"getTotalStakers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalTimeBasedRewardsBalance","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":"address","name":"_governanceAddress","type":"address"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_queryId","type":"bytes32"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"isInDispute","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumStakeAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","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":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_reporter","type":"address"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"slashReporter","outputs":[{"internalType":"uint256","name":"_slashAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakeAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakeAmountDollarTarget","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingRewardsBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingTokenPriceQueryId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":"timeBasedReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"timeOfLastAllocation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"timeOfLastNewValue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toWithdraw","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":"totalRewardDebt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStakeAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStakers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"updateStakeAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"verify","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"withdrawStake","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526706f05b59d3b20000600b5542600d553480156200002157600080fd5b506040516200331438038062003314833981016040819052620000449162000223565b6001600160a01b038616620000a05760405162461bcd60e51b815260206004820152601660248201527f6d7573742073657420746f6b656e20616464726573730000000000000000000060448201526064015b60405180910390fd5b60008311620000f25760405162461bcd60e51b815260206004820152601c60248201527f6d75737420736574207374616b696e6720746f6b656e20707269636500000000604482015260640162000097565b60008511620001445760405162461bcd60e51b815260206004820152601760248201527f6d75737420736574207265706f7274696e67206c6f636b000000000000000000604482015260640162000097565b806200019f5760405162461bcd60e51b8152602060048201526024808201527f6d75737420736574207374616b696e6720746f6b656e207072696365207175656044820152631c9e525960e21b606482015260840162000097565b600080546001600160a01b0388166001600160a01b0319918216178255600280549091163317905560058690556008859055600483905583620001eb86670de0b6b3a7640000620002a3565b620001f7919062000282565b9050828110156200020d57600783905562000213565b60078190555b50600a5550620002cf9350505050565b60008060008060008060c087890312156200023c578182fd5b86516001600160a01b038116811462000253578283fd5b6020880151604089015160608a015160808b015160a0909b0151939c929b509099909850965090945092505050565b6000826200029e57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615620002ca57634e487b7160e01b81526011600452602481fd5b500290565b61303580620002df6000396000f3fe608060405234801561001057600080fd5b50600436106103575760003560e01c806373252494116101c8578063adf1639d11610104578063ce5e11bf116100a2578063d9c51cd41161007c578063d9c51cd4146107fe578063e07c548614610811578063fc0c546a14610849578063fc735e991461085c57610357565b8063ce5e11bf146107da578063cecb0647146107ed578063d75174e1146107f657610357565b8063c0d416b8116100de578063c0d416b8146107a3578063c0f95d52146107ac578063c5958af9146107b4578063cb82cc8f146107c757610357565b8063adf1639d14610768578063bed9d86114610788578063bf5745d61461079057610357565b80638929f4c61161017157806394409a561161014b57806394409a561461070557806396426d971461070e5780639d9b16ed14610717578063a792765f1461074657610357565b80638929f4c6146106b05780638da5cb5b146106c3578063935408d0146106d657610357565b80637b0a47ee116101a25780637b0a47ee1461069557806383bb38771461069e57806386989038146106a757610357565b806373252494146105b8578063733bdef0146105c957806377b03e0d1461067557610357565b80633a0ce342116102975780635b5edcfc116102405780636b036f451161021a5780636b036f45146105965780636dd0a70f1461059f5780636fd4f229146105a7578063722580b6146105b057610357565b80635b5edcfc146105675780635eaa9ced1461057a57806360c7dc471461058d57610357565b80634dfc2a34116102715780634dfc2a341461051557806350005b83146105285780635aa6e6751461055457610357565b80633a0ce342146104c357806344e87f91146104cb578063460c33a21461050d57610357565b80632b6696a7116103045780633321fc41116102de5780633321fc4114610495578063347f23361461049e57806336d42195146104a75780633878293e146104b057610357565b80632b6696a7146104195780632e206cd71461048457806331ed0db41461048d57610357565b806314c2a1bc1161033557806314c2a1bc146103d257806319ab453c146103da57806329449085146103ef57610357565b806304d932e21461035c57806310fe9ae81461037857806311938e0814610398575b600080fd5b61036560095481565b6040519081526020015b60405180910390f35b610380610864565b6040516001600160a01b03909116815260200161036f565b6103656103a6366004612cd1565b6001600160a01b0391909116600090815260136020908152604080832093835260099093019052205490565b600f54610365565b6103ed6103e8366004612c7e565b610874565b005b6104026103fd366004612db2565b6109c3565b60408051921515835260208301919091520161036f565b610465610427366004612db2565b6000918252601260209081526040808420928452600483018252808420546005909301909152909120546001600160a01b039091169160ff90911690565b604080516001600160a01b03909316835290151560208301520161036f565b610365600c5481565b601054610365565b61036560055481565b61036560115481565b61036560035481565b6103656104be366004612c7e565b610d15565b6103ed610d37565b6104fd6104d9366004612db2565b60009182526012602090815260408084209284526005909201905290205460ff1690565b604051901515815260200161036f565b600554610365565b610365610523366004612c9f565b610e5f565b610365610536366004612c7e565b6001600160a01b031660009081526013602052604090206004015490565b600154610380906001600160a01b031681565b6103ed610575366004612db2565b6110f0565b6103ed610588366004612d32565b6112c4565b61036560075481565b61036560045481565b6103656118af565b610365600d5481565b600754610365565b6001546001600160a01b0316610380565b61062f6105d7366004612c7e565b6001600160a01b0316600090815260136020526040902080546001820154600283015460038401546004850154600586015460068701546007880154600890980154969895979496939592949193909260ff90911690565b60408051998a5260208a0198909852968801959095526060870193909352608086019190915260a085015260c084015260e083015215156101008201526101200161036f565b610365610683366004612d1a565b60009081526012602052604090205490565b61036560065481565b610365600e5481565b61036560105481565b6103ed6106be366004612d1a565b6118fd565b600254610380906001600160a01b031681565b6103656106e4366004612db2565b60009182526012602090815260408084209284526002909201905290205490565b610365600f5481565b610365600b5481565b610365610725366004612db2565b60009182526012602090815260408084209284526001909201905290205490565b610759610754366004612db2565b6119e9565b60405161036f93929190612e6d565b61077b610776366004612d1a565b611a4c565b60405161036f9190612ed1565b6103ed611a74565b61036561079e366004612c7e565b611c21565b61036560085481565b600d54610365565b61077b6107c2366004612db2565b611e19565b6103ed6107d5366004612d1a565b611eca565b6103656107e8366004612db2565b61229b565b610365600a5481565b6103656122dc565b6103ed61080c366004612d1a565b612385565b61038061081f366004612db2565b6000918252601260209081526040808420928452600490920190529020546001600160a01b031690565b600054610380906001600160a01b031681565b61270f610365565b6000546001600160a01b03165b90565b6002546001600160a01b031633146108e15760405162461bcd60e51b815260206004820152602560248201527f6f6e6c79206f776e65722063616e2073657420676f7665726e616e6365206164604482015264647265737360d81b60648201526084015b60405180910390fd5b6001546001600160a01b03161561093a5760405162461bcd60e51b815260206004820152601e60248201527f676f7665726e616e6365206164647265737320616c726561647920736574000060448201526064016108d8565b6001600160a01b0381166109a15760405162461bcd60e51b815260206004820152602860248201527f676f7665726e616e636520616464726573732063616e2774206265207a65726f604482015267206164647265737360c01b60648201526084016108d8565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526012602052604081205481908015610d0557600080806109e9600185612f3b565b905060006109f7898461229b565b9050878110610a1157600080965096505050505050610d0e565b610a1b898361229b565b905087811015610ac5575b600089815260126020908152604080832084845260050190915290205460ff168015610a525750600082115b15610a755781610a6181612f82565b925050610a6e898361229b565b9050610a26565b81158015610a9f5750600089815260126020908152604080832084845260050190915290205460ff165b15610ab557600080965096505050505050610d0e565b50600195509350610d0e92505050565b826002610ad28285612f3b565b610adc9190612efc565b610ae7906001612ee4565b610af19190612ee4565b9350610afd898561229b565b905087811015610c0c576000610b188a6107e8876001612ee4565b9050888110610bf95760008a815260126020908152604080832085845260050190915290205460ff16610b575760018597509750505050505050610d0e565b60008a815260126020908152604080832085845260050190915290205460ff168015610b835750600085115b15610ba65784610b9281612f82565b955050610b9f8a8661229b565b9150610b57565b84158015610bd0575060008a815260126020908152604080832085845260050190915290205460ff165b15610be75760008097509750505050505050610d0e565b60018597509750505050505050610d0e565b610c04856001612ee4565b935050610d00565b6000610c1d8a6107e8600188612f3b565b905088811015610cf15760008a815260126020908152604080832084845260050190915290205460ff16610c66576001610c578187612f3b565b97509750505050505050610d0e565b84610c7081612f82565b9550505b60008a815260126020908152604080832084845260050190915290205460ff168015610ca05750600085115b15610cc35784610caf81612f82565b955050610cbc8a8661229b565b9050610c74565b84158015610bd0575060008a815260126020908152604080832084845260050190915290205460ff16610bd0565b610cfc600186612f3b565b9250505b610ac5565b60008092509250505b9250929050565b6001600160a01b0381166000908152601360205260409020600501545b919050565b600080610d4e600a5461a8c0426107549190612f3b565b50915091508115610e5b57600081806020019051810190610d6f9190612dd3565b9050662386f26fc100008110158015610d91575069d3c21bcecceda100000081105b610ddd5760405162461bcd60e51b815260206004820152601b60248201527f696e76616c6964207374616b696e6720746f6b656e207072696365000000000060448201526064016108d8565b600081600854670de0b6b3a7640000610df69190612f1c565b610e009190612efc565b9050600454811015610e1757600454600755610e1d565b60078190555b7f1af37d6aaef3c5ef293c3c63d0ac302f60db7fde22eb9f5e96ebd56992832110600754604051610e5091815260200190565b60405180910390a150505b5050565b6001546000906001600160a01b03163314610ec75760405162461bcd60e51b815260206004820152602260248201527f6f6e6c7920676f7665726e616e63652063616e20736c617368207265706f727460448201526132b960f11b60648201526084016108d8565b6001600160a01b0383166000908152601360205260408120600181015460028201549192909190610ef88284612ee4565b11610f3b5760405162461bcd60e51b81526020600482015260136024820152727a65726f207374616b65722062616c616e636560681b60448201526064016108d8565b6007548110610f84576007549350600754836002016000828254610f5f9190612f3b565b909155505060075460118054600090610f79908490612f3b565b909155506110129050565b600754610f918383612ee4565b10610fdb576007549350610fb886610fa98387612f3b565b610fb39085612f3b565b61248a565b8060116000828254610fca9190612f3b565b909155505060006002840155611012565b610fe58183612ee4565b93508060116000828254610ff99190612f3b565b9091555061100a905086600061248a565b600060028401555b60005460405163a9059cbb60e01b81526001600160a01b038781166004830152602482018790529091169063a9059cbb90604401602060405180830381600087803b15801561106057600080fd5b505af1158015611074573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110989190612cfa565b6110a157600080fd5b604080516001600160a01b038781168252602082018790528816917f4317784407a22e643706ef000f5c0eea399dea3632613786167ab71c9446e3ac910160405180910390a250505092915050565b6001546001600160a01b031633146111545760405162461bcd60e51b815260206004820152602160248201527f63616c6c6572206d75737420626520676f7665726e616e6365206164647265736044820152607360f81b60648201526084016108d8565b6000828152601260209081526040808320848452600581019092529091205460ff16156111c35760405162461bcd60e51b815260206004820152601660248201527f76616c756520616c72656164792064697370757465640000000000000000000060448201526064016108d8565b600082815260018201602052604090205481548290829081106111f657634e487b7160e01b600052603260045260246000fd5b906000526020600020015483146112435760405162461bcd60e51b81526020600482015260116024820152700696e76616c69642074696d657374616d7607c1b60448201526064016108d8565b604080516020808201808452600080845287815260038701909252929020905161126d9290612b1a565b50600083815260058301602052604090819020805460ff19166001179055517fb326db0e54476c677e2b35b75856ac6f4d8bbfb0a6de6690582ebe4dabce0de790610e509086908690918252602082015260400190565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47085856040516112f5929190612e41565b6040518091039020141561134b5760405162461bcd60e51b815260206004820152601760248201527f76616c7565206d757374206265207375626d697474656400000000000000000060448201526064016108d8565b60008681526012602052604090208054841480611366575083155b6113b25760405162461bcd60e51b815260206004820181905260248201527f6e6f6e6365206d757374206d617463682074696d657374616d7020696e64657860448201526064016108d8565b336000908152601360205260409020600754600182015410156114295760405162461bcd60e51b815260206004820152602960248201527f62616c616e6365206d7573742062652067726561746572207468616e207374616044820152681ad948185b5bdd5b9d60ba1b60648201526084016108d8565b600754816001015461143b9190612efc565b60055461144a906103e8612f1c565b6114549190612efc565b60048201546114639042612f3b565b61146f906103e8612f1c565b116114ce5760405162461bcd60e51b815260206004820152602960248201527f7374696c6c20696e207265706f727465722074696d65206c6f636b2c20706c6560448201526861736520776169742160b81b60648201526084016108d8565b83836040516114de929190612e41565b604051809103902088146115405760405162461bcd60e51b815260206004820152602360248201527f7175657279206964206d7573742062652068617368206f66207175657279206460448201526261746160e81b60648201526084016108d8565b4260048083018290556000918252830160205260409020546001600160a01b0316156115ae5760405162461bcd60e51b815260206004820152601e60248201527f74696d657374616d7020616c7265616479207265706f7274656420666f72000060448201526064016108d8565b815442600081815260018086016020908152604080842086905591850187558683528083209094018390559181526002850183528181204390556003850190925290206115fc908888612b9e565b50426000818152600484016020526040812080546001600160a01b03191633179055600b54600d54919261012c9261163391612f3b565b61163d9190612f1c565b6116479190612efc565b90506000601154600954600f5461165e9190612ee4565b6116689190612ee4565b6000546040516370a0823160e01b81523060048201526001600160a01b03909116906370a082319060240160206040518083038186803b1580156116ab57600080fd5b505afa1580156116bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e39190612dd3565b6116ed9190612f3b565b90506000811180156116ff5750600082115b1561181c57818110156117965760005460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b15801561175857600080fd5b505af115801561176c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117909190612cfa565b5061181c565b60005460405163a9059cbb60e01b8152336004820152602481018490526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b1580156117e257600080fd5b505af11580156117f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061181a9190612cfa565b505b42600d5560058301805490600061183283612fce565b909155505060008a8152600984016020526040812080549161185383612fce565b9190505550336001600160a01b0316428b7f48e9e2c732ba278de6ac88a3a57a5c5ba13d3d8370e709b3b98333a57876ca958c8c8c8c8c60405161189b959493929190612e98565b60405180910390a450505050505050505050565b600080600e54670de0b6b3a7640000600f546118c96128c3565b6118d39190612f1c565b6118dd9190612efc565b6118e79190612f3b565b9050806009546118f79190612f3b565b91505090565b33600090815260136020526040902060018101548211156119605760405162461bcd60e51b815260206004820152601b60248201527f696e73756666696369656e74207374616b65642062616c616e6365000000000060448201526064016108d8565b61197433838360010154610fb39190612f3b565b42815560028101805483919060009061198e908490612ee4565b9250508190555081601160008282546119a79190612ee4565b909155505060408051338152602081018490527f3d8d9df4bd0172df32e557fa48e96435cd7f2cac06aaffacfaee608e6f7898ef910160405180910390a15050565b6000606060008060006119fc87876109c3565b9150915081611a265760006040518060200160405280600081525060009450945094505050611a45565b611a30878261229b565b9250611a3c8784611e19565b93506001945050505b9250925092565b60606000611a5f83610754426001612ee4565b509250905080611a6e57600080fd5b50919050565b336000908152601360205260409020805462093a8090611a949042612f3b565b1015611ad75760405162461bcd60e51b8152602060048201526012602482015271372064617973206469646e2774207061737360701b60448201526064016108d8565b6000816002015411611b365760405162461bcd60e51b815260206004820152602260248201527f7265706f72746572206e6f74206c6f636b656420666f72207769746864726177604482015261185b60f21b60648201526084016108d8565b600054600282015460405163a9059cbb60e01b815233600482015260248101919091526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b158015611b8857600080fd5b505af1158015611b9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bc09190612cfa565b611bc957600080fd5b806002015460116000828254611bdf9190612f3b565b9091555050600060028201556040513381527f4a7934670bd8304e7da22378be1368f7c4fef17c5aee81804beda8638fe428ec9060200160405180910390a150565b6001600160a01b03811660009081526013602052604081206003810154670de0b6b3a7640000611c4f6128c3565b8360010154611c5e9190612f1c565b611c689190612efc565b611c729190612f3b565b60015460408051600481526024810182526020810180516001600160e01b03166339ecce1f60e21b179052905192945060009283926001600160a01b031691611cba91612e51565b6000604051808303816000865af19150503d8060008114611cf7576040519150601f19603f3d011682016040523d82523d6000602084013e611cfc565b606091505b509150915060008215611d2f57836006015482806020019051810190611d229190612dd3565b611d2c9190612f3b565b90505b8015611e10576001546040516001600160a01b0388811660248301529091169060440160408051601f198184030181529181526020820180516001600160e01b03166317b8fb3b60e31b17905251611d879190612e51565b6000604051808303816000865af19150503d8060008114611dc4576040519150601f19603f3d011682016040523d82523d6000602084013e611dc9565b606091505b5090935091508215611e105780846007015483806020019051810190611def9190612dd3565b611df99190612f3b565b611e039087612f1c565b611e0d9190612efc565b94505b50505050919050565b60008281526012602090815260408083208484526003019091529020805460609190611e4490612f99565b80601f0160208091040260200160405190810160405280929190818152602001828054611e7090612f99565b8015611ebd5780601f10611e9257610100808354040283529160200191611ebd565b820191906000526020600020905b815481529060010190602001808311611ea057829003601f168201915b5050505050905092915050565b6001546001600160a01b0316611f225760405162461bcd60e51b815260206004820152601a60248201527f676f7665726e616e63652061646472657373206e6f742073657400000000000060448201526064016108d8565b33600090815260136020526040902060018101546002820154801561205557838110611f805783836002016000828254611f5c9190612f3b565b925050819055508360116000828254611f759190612f3b565b909155506120509050565b6000546001600160a01b03166323b872dd3330611f9d8589612f3b565b6040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401602060405180830381600087803b158015611fec57600080fd5b505af1158015612000573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120249190612cfa565b61202d57600080fd5b8260020154601160008282546120439190612f3b565b9091555050600060028401555b612257565b816121c45760015460408051600481526024810182526020810180516001600160e01b03166339ecce1f60e21b179052905160009283926001600160a01b03909116916120a29190612e51565b6000604051808303816000865af19150503d80600081146120df576040519150601f19603f3d011682016040523d82523d6000602084013e6120e4565b606091505b5091509150811561210957808060200190518101906121039190612dd3565b60068601555b6001546040513360248201526001600160a01b039091169060440160408051601f198184030181529181526020820180516001600160e01b03166317b8fb3b60e31b179052516121599190612e51565b6000604051808303816000865af19150503d8060008114612196576040519150601f19603f3d011682016040523d82523d6000602084013e61219b565b606091505b50909250905081156121c157808060200190518101906121bb9190612dd3565b60078601555b50505b6000546040516323b872dd60e01b8152336004820152306024820152604481018690526001600160a01b03909116906323b872dd90606401602060405180830381600087803b15801561221657600080fd5b505af115801561222a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061224e9190612cfa565b61225757600080fd5b61226533610fb38685612ee4565b428355604051849033907fa96c2cce65119a2170d1711a6e82f18f2006448828483ba7545e59547654364790600090a350505050565b60008281526012602052604081208054839081106122c957634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b6000601154600954600f546122f19190612ee4565b6122fb9190612ee4565b6000546040516370a0823160e01b81523060048201526001600160a01b03909116906370a082319060240160206040518083038186803b15801561233e57600080fd5b505afa158015612352573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123769190612dd3565b6123809190612f3b565b905090565b6000546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd90606401602060405180830381600087803b1580156123d757600080fd5b505af11580156123eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061240f9190612cfa565b61241857600080fd5b6124206129d7565b80600960008282546124329190612ee4565b9250508190555062278d00600e54670de0b6b3a7640000600f546003546124599190612f1c565b6124639190612efc565b61246d9190612f3b565b60095461247a9190612f3b565b6124849190612efc565b60065550565b6124926129d7565b6001600160a01b03821660009081526013602052604090206001810154156127805760008160030154670de0b6b3a764000060035484600101546124d69190612f1c565b6124e09190612efc565b6124ea9190612f3b565b60015460408051600481526024810182526020810180516001600160e01b03166339ecce1f60e21b1790529051929350600092839283926001600160a01b03909116916125379190612e51565b6000604051808303816000865af19150503d8060008114612574576040519150601f19603f3d011682016040523d82523d6000602084013e612579565b606091505b509150915081156125aa5784600601548180602001905181019061259d9190612dd3565b6125a79190612f3b565b92505b82156126a0576001546040516001600160a01b0389811660248301529091169060440160408051601f198184030181529181526020820180516001600160e01b03166317b8fb3b60e31b179052516126029190612e51565b6000604051808303816000865af19150503d806000811461263f576040519150601f19603f3d011682016040523d82523d6000602084013e612644565b606091505b50909250905081156126a0576000818060200190518101906126669190612dd3565b905060008487600701548361267b9190612f3b565b6126859088612f1c565b61268f9190612efc565b90508581101561269d578095505b50505b83600960008282546126b29190612f3b565b909155505060005460405163a9059cbb60e01b8152336004820152602481018690526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b15801561270357600080fd5b505af1158015612717573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061273b9190612cfa565b61274457600080fd5b8460030154600e600082825461275a9190612f3b565b90915550506001850154600f8054600090612776908490612f3b565b9091555050505050505b6001810182905560075482106127c657600881015460ff166127b257601080549060006127ac83612fce565b91905055505b60088101805460ff19166001179055612809565b600881015460ff16151560011480156127e157506000601054115b156127fc57601080549060006127f683612f82565b91905055505b60088101805460ff191690555b670de0b6b3a764000060035482600101546128249190612f1c565b61282e9190612efc565b60038201819055600e8054600090612847908490612ee4565b90915550506001810154600f8054600090612863908490612ee4565b90915550506006546128be5762278d00600e54670de0b6b3a7640000600f5460035461288f9190612f1c565b6128999190612efc565b6128a39190612f3b565b6009546128b09190612f3b565b6128ba9190612efc565b6006555b505050565b6000600f54600014156128d95750600354610871565b6000600f54600654600c54426128ef9190612f3b565b6128f99190612f1c565b61290b90670de0b6b3a7640000612f1c565b6129159190612efc565b6003546129229190612ee4565b90506000600e54670de0b6b3a7640000600f54846129409190612f1c565b61294a9190612efc565b6129549190612f3b565b905060095481106129d1576000600e54670de0b6b3a7640000600f5460035461297d9190612f1c565b6129879190612efc565b6129919190612f3b565b60095461299e9190612f3b565b600f549091506129b682670de0b6b3a7640000612f1c565b6129c09190612efc565b6003546129cd9190612ee4565b9250505b50905090565b42600c5414156129e657612b18565b600f5415806129f55750600654155b15612a035742600c55612b18565b6000600f54600654600c5442612a199190612f3b565b612a239190612f1c565b612a3590670de0b6b3a7640000612f1c565b612a3f9190612efc565b600354612a4c9190612ee4565b90506000600e54670de0b6b3a7640000600f5484612a6a9190612f1c565b612a749190612efc565b612a7e9190612f3b565b90506009548110612b0b576000600e54670de0b6b3a7640000600f54600354612aa79190612f1c565b612ab19190612efc565b612abb9190612f3b565b600954612ac89190612f3b565b600f54909150612ae082670de0b6b3a7640000612f1c565b612aea9190612efc565b60036000828254612afb9190612ee4565b9091555050600060065550612b11565b60038290555b505042600c555b565b828054612b2690612f99565b90600052602060002090601f016020900481019282612b485760008555612b8e565b82601f10612b6157805160ff1916838001178555612b8e565b82800160010185558215612b8e579182015b82811115612b8e578251825591602001919060010190612b73565b50612b9a929150612c12565b5090565b828054612baa90612f99565b90600052602060002090601f016020900481019282612bcc5760008555612b8e565b82601f10612be55782800160ff19823516178555612b8e565b82800160010185558215612b8e579182015b82811115612b8e578235825591602001919060010190612bf7565b5b80821115612b9a5760008155600101612c13565b80356001600160a01b0381168114610d3257600080fd5b60008083601f840112612c4f578182fd5b50813567ffffffffffffffff811115612c66578182fd5b602083019150836020828501011115610d0e57600080fd5b600060208284031215612c8f578081fd5b612c9882612c27565b9392505050565b60008060408385031215612cb1578081fd5b612cba83612c27565b9150612cc860208401612c27565b90509250929050565b60008060408385031215612ce3578182fd5b612cec83612c27565b946020939093013593505050565b600060208284031215612d0b578081fd5b81518015158114612c98578182fd5b600060208284031215612d2b578081fd5b5035919050565b60008060008060008060808789031215612d4a578182fd5b86359550602087013567ffffffffffffffff80821115612d68578384fd5b612d748a838b01612c3e565b9097509550604089013594506060890135915080821115612d93578384fd5b50612da089828a01612c3e565b979a9699509497509295939492505050565b60008060408385031215612dc4578182fd5b50508035926020909101359150565b600060208284031215612de4578081fd5b5051919050565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b60008151808452612e2d816020860160208601612f52565b601f01601f19169290920160200192915050565b6000828483379101908152919050565b60008251612e63818460208701612f52565b9190910192915050565b6000841515825260606020830152612e886060830185612e15565b9050826040830152949350505050565b600060608252612eac606083018789612deb565b8560208401528281036040840152612ec5818587612deb565b98975050505050505050565b600060208252612c986020830184612e15565b60008219821115612ef757612ef7612fe9565b500190565b600082612f1757634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615612f3657612f36612fe9565b500290565b600082821015612f4d57612f4d612fe9565b500390565b60005b83811015612f6d578181015183820152602001612f55565b83811115612f7c576000848401525b50505050565b600081612f9157612f91612fe9565b506000190190565b600181811c90821680612fad57607f821691505b60208210811415611a6e57634e487b7160e01b600052602260045260246000fd5b6000600019821415612fe257612fe2612fe9565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220268f9e82824a9050611227d9c7f68f2327bead04bdf2781127992b30b477ef0c64736f6c63430008030033000000000000000000000000af8ca653fa2772d58f4368b0a71980e9e3ceb888000000000000000000000000000000000000000000000000000000000000a8c00000000000000000000000000000000000000000000000056bc75e2d63100000000000000000000000000000000000000000000000000000d02ab486cedc00000000000000000000000000000000000000000000000000008ac7230489e800005c13cd9c97dbb98f2429c101a2a8150e6c7a0ddaff6124ee176a3a411067ded0

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

000000000000000000000000af8ca653fa2772d58f4368b0a71980e9e3ceb888000000000000000000000000000000000000000000000000000000000000a8c00000000000000000000000000000000000000000000000056bc75e2d63100000000000000000000000000000000000000000000000000000d02ab486cedc00000000000000000000000000000000000000000000000000008ac7230489e800005c13cd9c97dbb98f2429c101a2a8150e6c7a0ddaff6124ee176a3a411067ded0

-----Decoded View---------------
Arg [0] : _token (address): 0xaf8cA653Fa2772d58f4368B0a71980e9E3cEB888
Arg [1] : _reportingLock (uint256): 43200
Arg [2] : _stakeAmountDollarTarget (uint256): 100000000000000000000
Arg [3] : _stakingTokenPrice (uint256): 15000000000000000000
Arg [4] : _minimumStakeAmount (uint256): 10000000000000000000
Arg [5] : _stakingTokenPriceQueryId (bytes32): 0x5c13cd9c97dbb98f2429c101a2a8150e6c7a0ddaff6124ee176a3a411067ded0

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 000000000000000000000000af8ca653fa2772d58f4368b0a71980e9e3ceb888
Arg [1] : 000000000000000000000000000000000000000000000000000000000000a8c0
Arg [2] : 0000000000000000000000000000000000000000000000056bc75e2d63100000
Arg [3] : 000000000000000000000000000000000000000000000000d02ab486cedc0000
Arg [4] : 0000000000000000000000000000000000000000000000008ac7230489e80000
Arg [5] : 5c13cd9c97dbb98f2429c101a2a8150e6c7a0ddaff6124ee176a3a411067ded0


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.