Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
Governance
Compiler Version
v0.8.3+commit.8d00100c
Optimization Enabled:
Yes with 300 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.3;
import "./interfaces/IOracle.sol";
import "./interfaces/IERC20.sol";
import "usingtellor/contracts/UsingTellor.sol";
/**
@author Tellor Inc.
@title Governance
@dev This is a governance contract to be used with TellorFlex. It handles disputing
* Tellor oracle data and voting on those disputes
*/
contract Governance is UsingTellor {
// Storage
IOracle public oracle; // Tellor oracle contract
IERC20 public token; // token used for dispute fees, same as reporter staking token
address public oracleAddress; //tellorFlex address
address public teamMultisig; // address of team multisig wallet, one of four stakeholder groups
uint256 public voteCount; // total number of votes initiated
bytes32 public autopayAddrsQueryId =
keccak256(abi.encode("AutopayAddresses", abi.encode(bytes("")))); // query id for autopay addresses array
mapping(uint256 => Dispute) private disputeInfo; // mapping of dispute IDs to the details of the dispute
mapping(bytes32 => uint256) private openDisputesOnId; // mapping of a query ID to the number of disputes on that query ID
mapping(uint256 => Vote) private voteInfo; // mapping of dispute IDs to the details of the vote
mapping(bytes32 => uint256[]) private voteRounds; // mapping of vote identifier hashes to an array of dispute IDs
mapping(address => uint256) private voteTallyByAddress; // mapping of addresses to the number of votes they have cast
mapping(address => uint256[]) private disputeIdsByReporter; // mapping of reporter addresses to an array of dispute IDs
enum VoteResult {
FAILED,
PASSED,
INVALID
} // status of a potential vote
// Structs
struct Dispute {
bytes32 queryId; // query ID of disputed value
uint256 timestamp; // timestamp of disputed value
bytes value; // disputed value
address disputedReporter; // reporter who submitted the disputed value
uint256 slashedAmount; // amount of tokens slashed from reporter
}
struct Tally {
uint256 doesSupport; // number of votes in favor
uint256 against; // number of votes against
uint256 invalidQuery; // number of votes for invalid
}
struct Vote {
bytes32 identifierHash; // identifier hash of the vote
uint256 voteRound; // the round of voting on a given dispute or proposal
uint256 startDate; // timestamp of when vote was initiated
uint256 blockNumber; // block number of when vote was initiated
uint256 fee; // fee paid to initiate the vote round
uint256 tallyDate; // timestamp of when the votes were tallied
Tally tokenholders; // vote tally of tokenholders
Tally users; // vote tally of users
Tally reporters; // vote tally of reporters
Tally teamMultisig; // vote tally of teamMultisig
bool executed; // boolean of whether the vote was executed
VoteResult result; // VoteResult after votes were tallied
address initiator; // address which initiated dispute/proposal
mapping(address => bool) voted; // mapping of address to whether or not they voted
}
// Events
event NewDispute(
uint256 _disputeId,
bytes32 _queryId,
uint256 _timestamp,
address _reporter
); // Emitted when a new dispute is opened
event Voted(
uint256 _disputeId,
bool _supports,
address _voter,
bool _invalidQuery
); // Emitted when an address casts their vote
event VoteExecuted(uint256 _disputeId, VoteResult _result); // Emitted when a vote is executed
event VoteTallied(
uint256 _disputeId,
VoteResult _result,
address _initiator,
address _reporter
); // Emitted when all casting for a vote is tallied
/**
* @dev Initializes contract parameters
* @param _tellor address of tellor oracle contract to be governed
* @param _teamMultisig address of tellor team multisig, one of four voting
* stakeholder groups
*/
constructor(
address payable _tellor,
address _teamMultisig
) UsingTellor(_tellor) {
oracle = IOracle(_tellor);
token = IERC20(oracle.getTokenAddress());
oracleAddress = _tellor;
teamMultisig = _teamMultisig;
}
/**
* @dev Initializes a dispute/vote in the system
* @param _queryId being disputed
* @param _timestamp being disputed
*/
function beginDispute(bytes32 _queryId, uint256 _timestamp) external {
// Ensure value actually exists
address _reporter = oracle.getReporterByTimestamp(_queryId, _timestamp);
require(_reporter != address(0), "no value exists at given timestamp");
bytes32 _hash = keccak256(abi.encodePacked(_queryId, _timestamp));
// Push new vote round
uint256 _disputeId = voteCount + 1;
uint256[] storage _voteRounds = voteRounds[_hash];
_voteRounds.push(_disputeId);
// Create new vote and dispute
Vote storage _thisVote = voteInfo[_disputeId];
Dispute storage _thisDispute = disputeInfo[_disputeId];
// Initialize dispute information - query ID, timestamp, value, etc.
_thisDispute.queryId = _queryId;
_thisDispute.timestamp = _timestamp;
_thisDispute.disputedReporter = _reporter;
// Initialize vote information - hash, initiator, block number, etc.
_thisVote.identifierHash = _hash;
_thisVote.initiator = msg.sender;
_thisVote.blockNumber = block.number;
_thisVote.startDate = block.timestamp;
_thisVote.voteRound = _voteRounds.length;
disputeIdsByReporter[_reporter].push(_disputeId);
uint256 _disputeFee = getDisputeFee();
if (_voteRounds.length == 1) {
require(
block.timestamp - _timestamp < 12 hours,
"Dispute must be started within reporting lock time"
);
openDisputesOnId[_queryId]++;
// calculate dispute fee based on number of open disputes on query ID
if (openDisputesOnId[_queryId] > 4) {
_disputeFee = oracle.getStakeAmount();
} else {
_disputeFee =
_disputeFee *
2 ** (openDisputesOnId[_queryId] - 1);
}
// slash a single stakeAmount from reporter
_thisDispute.slashedAmount = oracle.slashReporter(
_reporter,
address(this)
);
_thisDispute.value = oracle.retrieveData(_queryId, _timestamp);
oracle.removeValue(_queryId, _timestamp);
} else {
uint256 _prevId = _voteRounds[_voteRounds.length - 2];
require(
block.timestamp - voteInfo[_prevId].tallyDate < 1 days,
"New dispute round must be started within a day"
);
if (_voteRounds.length > 4) {
_disputeFee = oracle.getStakeAmount();
} else {
_disputeFee = _disputeFee * 2 ** (_voteRounds.length - 1);
}
_thisDispute.slashedAmount = disputeInfo[_voteRounds[0]]
.slashedAmount;
_thisDispute.value = disputeInfo[_voteRounds[0]].value;
}
_thisVote.fee = _disputeFee;
voteCount++;
require(
token.transferFrom(msg.sender, address(this), _disputeFee),
"Fee must be paid"
); // This is the dispute fee. Returned if dispute passes
emit NewDispute(_disputeId, _queryId, _timestamp, _reporter);
}
/**
* @dev Executes vote and transfers corresponding balances to initiator/reporter
* @param _disputeId is the ID of the vote being executed
*/
function executeVote(uint256 _disputeId) external {
// Ensure validity of vote ID, vote has been executed, and vote must be tallied
Vote storage _thisVote = voteInfo[_disputeId];
require(
_disputeId <= voteCount && _disputeId > 0,
"Dispute ID must be valid"
);
require(!_thisVote.executed, "Vote has already been executed");
require(_thisVote.tallyDate > 0, "Vote must be tallied");
// Ensure vote must be final vote and that time has to be pass (86400 = 24 * 60 * 60 for seconds in a day)
require(
voteRounds[_thisVote.identifierHash].length == _thisVote.voteRound,
"Must be the final vote"
);
//The time has to pass after the vote is tallied
require(
block.timestamp - _thisVote.tallyDate >= 1 days,
"1 day has to pass after tally to allow for disputes"
);
_thisVote.executed = true;
Dispute storage _thisDispute = disputeInfo[_disputeId];
openDisputesOnId[_thisDispute.queryId]--;
uint256 _i;
uint256 _voteID;
if (_thisVote.result == VoteResult.PASSED) {
// If vote is in dispute and passed, iterate through each vote round and transfer the dispute to initiator
for (
_i = voteRounds[_thisVote.identifierHash].length;
_i > 0;
_i--
) {
_voteID = voteRounds[_thisVote.identifierHash][_i - 1];
_thisVote = voteInfo[_voteID];
// If the first vote round, also make sure to transfer the reporter's slashed stake to the initiator
if (_i == 1) {
token.transfer(
_thisVote.initiator,
_thisDispute.slashedAmount
);
}
token.transfer(_thisVote.initiator, _thisVote.fee);
}
} else if (_thisVote.result == VoteResult.INVALID) {
// If vote is in dispute and is invalid, iterate through each vote round and transfer the dispute fee to initiator
for (
_i = voteRounds[_thisVote.identifierHash].length;
_i > 0;
_i--
) {
_voteID = voteRounds[_thisVote.identifierHash][_i - 1];
_thisVote = voteInfo[_voteID];
token.transfer(_thisVote.initiator, _thisVote.fee);
}
// Transfer slashed tokens back to disputed reporter
token.transfer(
_thisDispute.disputedReporter,
_thisDispute.slashedAmount
);
} else if (_thisVote.result == VoteResult.FAILED) {
// If vote is in dispute and fails, iterate through each vote round and transfer the dispute fee to disputed reporter
uint256 _reporterReward = 0;
for (
_i = voteRounds[_thisVote.identifierHash].length;
_i > 0;
_i--
) {
_voteID = voteRounds[_thisVote.identifierHash][_i - 1];
_thisVote = voteInfo[_voteID];
_reporterReward += _thisVote.fee;
}
_reporterReward += _thisDispute.slashedAmount;
token.transfer(_thisDispute.disputedReporter, _reporterReward);
}
emit VoteExecuted(_disputeId, voteInfo[_disputeId].result);
}
/**
* @dev Tallies the votes and begins the 1 day challenge period
* @param _disputeId is the dispute id
*/
function tallyVotes(uint256 _disputeId) external {
// Ensure vote has not been executed and that vote has not been tallied
Vote storage _thisVote = voteInfo[_disputeId];
require(_thisVote.tallyDate == 0, "Vote has already been tallied");
require(
_disputeId <= voteCount && _disputeId > 0,
"Vote does not exist"
);
// Determine appropriate vote duration dispute round
// Vote time increases as rounds increase but only up to 6 days (withdrawal period)
require(
block.timestamp - _thisVote.startDate >=
86400 * _thisVote.voteRound ||
block.timestamp - _thisVote.startDate >= 86400 * 6,
"Time for voting has not elapsed"
);
// Get total votes from each separate stakeholder group. This will allow
// normalization so each group's votes can be combined and compared to
// determine the vote outcome.
uint256 _tokenVoteSum = _thisVote.tokenholders.doesSupport +
_thisVote.tokenholders.against +
_thisVote.tokenholders.invalidQuery;
uint256 _reportersVoteSum = _thisVote.reporters.doesSupport +
_thisVote.reporters.against +
_thisVote.reporters.invalidQuery;
uint256 _multisigVoteSum = _thisVote.teamMultisig.doesSupport +
_thisVote.teamMultisig.against +
_thisVote.teamMultisig.invalidQuery;
uint256 _usersVoteSum = _thisVote.users.doesSupport +
_thisVote.users.against +
_thisVote.users.invalidQuery;
// Cannot divide by zero
if (_tokenVoteSum == 0) {
_tokenVoteSum++;
}
if (_reportersVoteSum == 0) {
_reportersVoteSum++;
}
if (_multisigVoteSum == 0) {
_multisigVoteSum++;
}
if (_usersVoteSum == 0) {
_usersVoteSum++;
}
// Normalize and combine each stakeholder group votes
uint256 _scaledDoesSupport = ((_thisVote.tokenholders.doesSupport *
1e18) / _tokenVoteSum) +
((_thisVote.reporters.doesSupport * 1e18) / _reportersVoteSum) +
((_thisVote.teamMultisig.doesSupport * 1e18) / _multisigVoteSum) +
((_thisVote.users.doesSupport * 1e18) / _usersVoteSum);
uint256 _scaledAgainst = ((_thisVote.tokenholders.against * 1e18) /
_tokenVoteSum) +
((_thisVote.reporters.against * 1e18) / _reportersVoteSum) +
((_thisVote.teamMultisig.against * 1e18) / _multisigVoteSum) +
((_thisVote.users.against * 1e18) / _usersVoteSum);
uint256 _scaledInvalid = ((_thisVote.tokenholders.invalidQuery * 1e18) /
_tokenVoteSum) +
((_thisVote.reporters.invalidQuery * 1e18) / _reportersVoteSum) +
((_thisVote.teamMultisig.invalidQuery * 1e18) / _multisigVoteSum) +
((_thisVote.users.invalidQuery * 1e18) / _usersVoteSum);
// If votes in support outweight the sum of against and invalid, result is passed
if (_scaledDoesSupport > _scaledAgainst + _scaledInvalid) {
_thisVote.result = VoteResult.PASSED;
// If votes in against outweight the sum of support and invalid, result is failed
} else if (_scaledAgainst > _scaledDoesSupport + _scaledInvalid) {
_thisVote.result = VoteResult.FAILED;
// Otherwise, result is invalid
} else {
_thisVote.result = VoteResult.INVALID;
}
_thisVote.tallyDate = block.timestamp; // Update time vote was tallied
emit VoteTallied(
_disputeId,
_thisVote.result,
_thisVote.initiator,
disputeInfo[_disputeId].disputedReporter
);
}
/**
* @dev Enables the sender address to cast a vote
* @param _disputeId is the ID of the vote
* @param _supports is the address's vote: whether or not they support or are against
* @param _invalidQuery is whether or not the dispute is valid
*/
function vote(
uint256 _disputeId,
bool _supports,
bool _invalidQuery
) public {
// Ensure that dispute has not been executed and that vote does not exist and is not tallied
require(
_disputeId <= voteCount && _disputeId > 0,
"Vote does not exist"
);
Vote storage _thisVote = voteInfo[_disputeId];
require(_thisVote.tallyDate == 0, "Vote has already been tallied");
require(!_thisVote.voted[msg.sender], "Sender has already voted");
// Update voting status and increment total queries for support, invalid, or against based on vote
_thisVote.voted[msg.sender] = true;
uint256 _tokenBalance = token.balanceOf(msg.sender);
(, uint256 _stakedBalance, uint256 _lockedBalance, , , , , ) = oracle
.getStakerInfo(msg.sender);
_tokenBalance += _stakedBalance + _lockedBalance;
if (_invalidQuery) {
_thisVote.tokenholders.invalidQuery += _tokenBalance;
_thisVote.reporters.invalidQuery += oracle
.getReportsSubmittedByAddress(msg.sender);
_thisVote.users.invalidQuery += _getUserTips(msg.sender);
if (msg.sender == teamMultisig) {
_thisVote.teamMultisig.invalidQuery += 1;
}
} else if (_supports) {
_thisVote.tokenholders.doesSupport += _tokenBalance;
_thisVote.reporters.doesSupport += oracle
.getReportsSubmittedByAddress(msg.sender);
_thisVote.users.doesSupport += _getUserTips(msg.sender);
if (msg.sender == teamMultisig) {
_thisVote.teamMultisig.doesSupport += 1;
}
} else {
_thisVote.tokenholders.against += _tokenBalance;
_thisVote.reporters.against += oracle.getReportsSubmittedByAddress(
msg.sender
);
_thisVote.users.against += _getUserTips(msg.sender);
if (msg.sender == teamMultisig) {
_thisVote.teamMultisig.against += 1;
}
}
voteTallyByAddress[msg.sender]++;
emit Voted(_disputeId, _supports, msg.sender, _invalidQuery);
}
/**
* @dev Enables the sender address to cast votes for multiple disputes
* @param _disputeIds is an array of vote IDs
* @param _supports is an array of the address's votes: whether or not they support or are against
* @param _invalidQuery is array of whether or not the dispute is valid
*/
function voteOnMultipleDisputes(
uint256[] memory _disputeIds,
bool[] memory _supports,
bool[] memory _invalidQuery
) external {
for (uint256 _i = 0; _i < _disputeIds.length; _i++) {
vote(_disputeIds[_i], _supports[_i], _invalidQuery[_i]);
}
}
// *****************************************************************************
// * *
// * Getters *
// * *
// *****************************************************************************
/**
* @dev Determines if an address voted for a specific vote
* @param _disputeId is the ID of the vote
* @param _voter is the address of the voter to check for
* @return bool of whether or note the address voted for the specific vote
*/
function didVote(
uint256 _disputeId,
address _voter
) external view returns (bool) {
return voteInfo[_disputeId].voted[_voter];
}
/**
* @dev Get the latest dispute fee
*/
function getDisputeFee() public view returns (uint256) {
return (oracle.getStakeAmount() / 10);
}
function getDisputesByReporter(
address _reporter
) external view returns (uint256[] memory) {
return disputeIdsByReporter[_reporter];
}
/**
* @dev Returns info on a dispute for a given ID
* @param _disputeId is the ID of a specific dispute
* @return bytes32 of the data ID of the dispute
* @return uint256 of the timestamp of the dispute
* @return bytes memory of the value being disputed
* @return address of the reporter being disputed
*/
function getDisputeInfo(
uint256 _disputeId
) external view returns (bytes32, uint256, bytes memory, address) {
Dispute storage _d = disputeInfo[_disputeId];
return (_d.queryId, _d.timestamp, _d.value, _d.disputedReporter);
}
/**
* @dev Returns the number of open disputes for a specific query ID
* @param _queryId is the ID of a specific data feed
* @return uint256 of the number of open disputes for the query ID
*/
function getOpenDisputesOnId(
bytes32 _queryId
) external view returns (uint256) {
return openDisputesOnId[_queryId];
}
/**
* @dev Returns the total number of votes
* @return uint256 of the total number of votes
*/
function getVoteCount() external view returns (uint256) {
return voteCount;
}
/**
* @dev Returns info on a vote for a given vote ID
* @param _disputeId is the ID of a specific vote
* @return bytes32 identifier hash of the vote
* @return uint256[17] memory of the pertinent round info (vote rounds, start date, fee, etc.)
* @return bool memory of both whether or not the vote was executed
* @return VoteResult result of the vote
* @return address memory of the vote initiator
*/
function getVoteInfo(
uint256 _disputeId
)
external
view
returns (bytes32, uint256[17] memory, bool, VoteResult, address)
{
Vote storage _v = voteInfo[_disputeId];
return (
_v.identifierHash,
[
_v.voteRound,
_v.startDate,
_v.blockNumber,
_v.fee,
_v.tallyDate,
_v.tokenholders.doesSupport,
_v.tokenholders.against,
_v.tokenholders.invalidQuery,
_v.users.doesSupport,
_v.users.against,
_v.users.invalidQuery,
_v.reporters.doesSupport,
_v.reporters.against,
_v.reporters.invalidQuery,
_v.teamMultisig.doesSupport,
_v.teamMultisig.against,
_v.teamMultisig.invalidQuery
],
_v.executed,
_v.result,
_v.initiator
);
}
/**
* @dev Returns an array of voting rounds for a given vote
* @param _hash is the identifier hash for a vote
* @return uint256[] memory dispute IDs of the vote rounds
*/
function getVoteRounds(
bytes32 _hash
) external view returns (uint256[] memory) {
return voteRounds[_hash];
}
/**
* @dev Returns the total number of votes cast by an address
* @param _voter is the address of the voter to check for
* @return uint256 of the total number of votes cast by the voter
*/
function getVoteTallyByAddress(
address _voter
) external view returns (uint256) {
return voteTallyByAddress[_voter];
}
// Internal
/**
* @dev Retrieves total tips contributed to autopay by a given address
* @param _user address of the user to check the tip count for
* @return _userTipTally uint256 of total tips contributed to autopay by the address
*/
function _getUserTips(
address _user
) internal returns (uint256 _userTipTally) {
// get autopay addresses array from oracle
(bytes memory _autopayAddrsBytes, uint256 _timestamp) = getDataBefore(
autopayAddrsQueryId,
block.timestamp - 12 hours
);
if (_timestamp > 0) {
address[] memory _autopayAddrs = abi.decode(
_autopayAddrsBytes,
(address[])
);
// iterate through autopay addresses retrieve tips by user address
for (uint256 _i = 0; _i < _autopayAddrs.length; _i++) {
(bool _success, bytes memory _returnData) = _autopayAddrs[_i]
.call(
abi.encodeWithSignature(
"getTipsByAddress(address)",
_user
)
);
if (_success) {
_userTipTally += abi.decode(_returnData, (uint256));
}
}
}
}
}// 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);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.3;
/**
@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.
*/
interface IOracle {
/**
* @dev Removes a value from the oracle.
* Note: this function is only callable by the Governance contract.
* @param _queryId is ID of the specific data feed
* @param _timestamp is the timestamp of the data value to remove
*/
function removeValue(bytes32 _queryId, uint256 _timestamp) external;
/**
* @dev Slashes a reporter and transfers their stake amount to the given recipient
* Note: this function is only callable by the governance address.
* @param _reporter is the address of the reporter being slashed
* @param _recipient is the address receiving the reporter's stake
* @return uint256 amount of token slashed and sent to recipient address
*/
function slashReporter(address _reporter, address _recipient)
external
returns (uint256);
// *****************************************************************************
// * *
// * Getters *
// * *
// *****************************************************************************
/**
* @dev Returns the block number at a given timestamp
* @param _queryId is ID of the specific data feed
* @param _timestamp is the timestamp to find the corresponding block number for
* @return uint256 block number of the timestamp for the given data ID
*/
function getBlockNumberByTimestamp(bytes32 _queryId, uint256 _timestamp)
external
view
returns (uint256);
/**
* @dev Returns the address of the reporter who submitted a value for a data ID at a specific time
* @param _queryId is ID of the specific data feed
* @param _timestamp is the timestamp to find a corresponding reporter for
* @return address of the reporter who reported the value for the data ID at the given timestamp
*/
function getReporterByTimestamp(bytes32 _queryId, uint256 _timestamp)
external
view
returns (address);
/**
* @dev Returns the number of values submitted by a specific reporter address
* @param _reporter is the address of a reporter
* @return uint256 of the number of values submitted by the given reporter
*/
function getReportsSubmittedByAddress(address _reporter)
external
view
returns (uint256);
/**
* @dev Returns amount required to report oracle values
* @return uint256 stake amount
*/
function getStakeAmount() external view returns (uint256);
/**
* @dev Allows users to retrieve all information about a staker
* @param _stakerAddress address of staker inquiring about
* @return uint startDate of staking
* @return uint current amount staked
* @return uint current amount locked for withdrawal
* @return uint reward debt used to calculate staking rewards
* @return uint reporter's last reported timestamp
* @return uint total number of reports submitted by reporter
* @return uint governance vote count when first staked
* @return uint number of votes cast by staker when first staked
*/
function getStakerInfo(address _stakerAddress)
external
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
);
/**
* @dev Retrieves the latest value for the queryId before the specified timestamp
* @param _queryId is the queryId to look up the value for
* @param _timestamp before which to search for latest value
* @return _ifRetrieve bool true if able to retrieve a non-zero value
* @return _value the value retrieved
* @return _timestampRetrieved the value's timestamp
*/
function getDataBefore(bytes32 _queryId, uint256 _timestamp)
external
view
returns (
bool _ifRetrieve,
bytes memory _value,
uint256 _timestampRetrieved
);
/**
* @dev Returns the address of the token used for staking
* @return address of the token used for staking
*/
function getTokenAddress() external view returns (address);
/**
* @dev Retrieve value from oracle based on timestamp
* @param _queryId being requested
* @param _timestamp to retrieve data/value from
* @return bytes value for timestamp submitted
*/
function retrieveData(bytes32 _queryId, uint256 _timestamp)
external
view
returns (bytes memory);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
/**
* @dev EIP2362 Interface for pull oracles
* https://github.com/tellor-io/EIP-2362
*/
interface IERC2362
{
/**
* @dev Exposed function pertaining to EIP standards
* @param _id bytes32 ID of the query
* @return int,uint,uint returns the value, timestamp, and status code of query
*/
function valueFor(bytes32 _id) external view returns(int256,uint256,uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IMappingContract{
function getTellorID(bytes32 _id) external view returns(bytes32);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
interface ITellor {
//Controller
function addresses(bytes32) external view returns (address);
function uints(bytes32) external view returns (uint256);
function burn(uint256 _amount) external;
function changeDeity(address _newDeity) external;
function changeOwner(address _newOwner) external;
function changeUint(bytes32 _target, uint256 _amount) external;
function migrate() external;
function mint(address _reciever, uint256 _amount) external;
function init() external;
function getAllDisputeVars(uint256 _disputeId)
external
view
returns (
bytes32,
bool,
bool,
bool,
address,
address,
address,
uint256[9] memory,
int256
);
function getDisputeIdByDisputeHash(bytes32 _hash)
external
view
returns (uint256);
function getDisputeUintVars(uint256 _disputeId, bytes32 _data)
external
view
returns (uint256);
function getLastNewValueById(uint256 _requestId)
external
view
returns (uint256, bool);
function retrieveData(uint256 _requestId, uint256 _timestamp)
external
view
returns (uint256);
function getNewValueCountbyRequestId(uint256 _requestId)
external
view
returns (uint256);
function getAddressVars(bytes32 _data) external view returns (address);
function getUintVar(bytes32 _data) external view returns (uint256);
function totalSupply() external view returns (uint256);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function isMigrated(address _addy) external view returns (bool);
function allowance(address _user, address _spender)
external
view
returns (uint256);
function allowedToTrade(address _user, uint256 _amount)
external
view
returns (bool);
function approve(address _spender, uint256 _amount) external returns (bool);
function approveAndTransferFrom(
address _from,
address _to,
uint256 _amount
) external returns (bool);
function balanceOf(address _user) external view returns (uint256);
function balanceOfAt(address _user, uint256 _blockNumber)
external
view
returns (uint256);
function transfer(address _to, uint256 _amount)
external
returns (bool success);
function transferFrom(
address _from,
address _to,
uint256 _amount
) external returns (bool success);
function depositStake() external;
function requestStakingWithdraw() external;
function withdrawStake() external;
function changeStakingStatus(address _reporter, uint256 _status) external;
function slashReporter(address _reporter, address _disputer) external;
function getStakerInfo(address _staker)
external
view
returns (uint256, uint256);
function getTimestampbyRequestIDandIndex(uint256 _requestId, uint256 _index)
external
view
returns (uint256);
function getNewCurrentVariables()
external
view
returns (
bytes32 _c,
uint256[5] memory _r,
uint256 _d,
uint256 _t
);
function getNewValueCountbyQueryId(bytes32 _queryId)
external
view
returns (uint256);
function getTimestampbyQueryIdandIndex(bytes32 _queryId, uint256 _index)
external
view
returns (uint256);
function retrieveData(bytes32 _queryId, uint256 _timestamp)
external
view
returns (bytes memory);
//Governance
enum VoteResult {
FAILED,
PASSED,
INVALID
}
function setApprovedFunction(bytes4 _func, bool _val) external;
function beginDispute(bytes32 _queryId, uint256 _timestamp) external;
function delegate(address _delegate) external;
function delegateOfAt(address _user, uint256 _blockNumber)
external
view
returns (address);
function executeVote(uint256 _disputeId) external;
function proposeVote(
address _contract,
bytes4 _function,
bytes calldata _data,
uint256 _timestamp
) external;
function tallyVotes(uint256 _disputeId) external;
function governance() external view returns (address);
function updateMinDisputeFee() external;
function verify() external pure returns (uint256);
function vote(
uint256 _disputeId,
bool _supports,
bool _invalidQuery
) external;
function voteFor(
address[] calldata _addys,
uint256 _disputeId,
bool _supports,
bool _invalidQuery
) external;
function getDelegateInfo(address _holder)
external
view
returns (address, uint256);
function isFunctionApproved(bytes4 _func) external view returns (bool);
function isApprovedGovernanceContract(address _contract)
external
returns (bool);
function getVoteRounds(bytes32 _hash)
external
view
returns (uint256[] memory);
function getVoteCount() external view returns (uint256);
function getVoteInfo(uint256 _disputeId)
external
view
returns (
bytes32,
uint256[9] memory,
bool[2] memory,
VoteResult,
bytes memory,
bytes4,
address[2] memory
);
function getDisputeInfo(uint256 _disputeId)
external
view
returns (
uint256,
uint256,
bytes memory,
address
);
function getOpenDisputesOnId(bytes32 _queryId)
external
view
returns (uint256);
function didVote(uint256 _disputeId, address _voter)
external
view
returns (bool);
//Oracle
function getReportTimestampByIndex(bytes32 _queryId, uint256 _index)
external
view
returns (uint256);
function getValueByTimestamp(bytes32 _queryId, uint256 _timestamp)
external
view
returns (bytes memory);
function getBlockNumberByTimestamp(bytes32 _queryId, uint256 _timestamp)
external
view
returns (uint256);
function getReportingLock() external view returns (uint256);
function getReporterByTimestamp(bytes32 _queryId, uint256 _timestamp)
external
view
returns (address);
function reportingLock() external view returns (uint256);
function removeValue(bytes32 _queryId, uint256 _timestamp) external;
function getTipsByUser(address _user) external view returns(uint256);
function tipQuery(bytes32 _queryId, uint256 _tip, bytes memory _queryData) external;
function submitValue(bytes32 _queryId, bytes calldata _value, uint256 _nonce, bytes memory _queryData) external;
function burnTips() external;
function changeReportingLock(uint256 _newReportingLock) external;
function getReportsSubmittedByAddress(address _reporter) external view returns(uint256);
function changeTimeBasedReward(uint256 _newTimeBasedReward) external;
function getReporterLastTimestamp(address _reporter) external view returns(uint256);
function getTipsById(bytes32 _queryId) external view returns(uint256);
function getTimeBasedReward() external view returns(uint256);
function getTimestampCountById(bytes32 _queryId) external view returns(uint256);
function getTimestampIndexByTimestamp(bytes32 _queryId, uint256 _timestamp) external view returns(uint256);
function getCurrentReward(bytes32 _queryId) external view returns(uint256, uint256);
function getCurrentValue(bytes32 _queryId) external view returns(bytes memory);
function getDataBefore(bytes32 _queryId, uint256 _timestamp) external view returns(bool _ifRetrieve, bytes memory _value, uint256 _timestampRetrieved);
function getTimeOfLastNewValue() external view returns(uint256);
function depositStake(uint256 _amount) external;
function requestStakingWithdraw(uint256 _amount) external;
//Test functions
function changeAddressVar(bytes32 _id, address _addy) external;
//parachute functions
function killContract() external;
function migrateFor(address _destination, uint256 _amount) external;
function rescue51PercentAttack(address _tokenHolder) external;
function rescueBrokenDataReporting() external;
function rescueFailedUpdate() external;
//Tellor 360
function addStakingRewards(uint256 _amount) external;
function _sliceUint(bytes memory _b)
external
pure
returns (uint256 _number);
function claimOneTimeTip(bytes32 _queryId, uint256[] memory _timestamps)
external;
function claimTip(
bytes32 _feedId,
bytes32 _queryId,
uint256[] memory _timestamps
) external;
function fee() external view returns (uint256);
function feedsWithFunding(uint256) external view returns (bytes32);
function fundFeed(
bytes32 _feedId,
bytes32 _queryId,
uint256 _amount
) external;
function getCurrentFeeds(bytes32 _queryId)
external
view
returns (bytes32[] memory);
function getCurrentTip(bytes32 _queryId) external view returns (uint256);
function getDataAfter(bytes32 _queryId, uint256 _timestamp)
external
view
returns (bytes memory _value, uint256 _timestampRetrieved);
function getDataFeed(bytes32 _feedId)
external
view
returns (Autopay.FeedDetails memory);
function getFundedFeeds() external view returns (bytes32[] memory);
function getFundedQueryIds() external view returns (bytes32[] memory);
function getIndexForDataAfter(bytes32 _queryId, uint256 _timestamp)
external
view
returns (bool _found, uint256 _index);
function getIndexForDataBefore(bytes32 _queryId, uint256 _timestamp)
external
view
returns (bool _found, uint256 _index);
function getMultipleValuesBefore(
bytes32 _queryId,
uint256 _timestamp,
uint256 _maxAge,
uint256 _maxCount
)
external
view
returns (uint256[] memory _values, uint256[] memory _timestamps);
function getPastTipByIndex(bytes32 _queryId, uint256 _index)
external
view
returns (Autopay.Tip memory);
function getPastTipCount(bytes32 _queryId) external view returns (uint256);
function getPastTips(bytes32 _queryId)
external
view
returns (Autopay.Tip[] memory);
function getQueryIdFromFeedId(bytes32 _feedId)
external
view
returns (bytes32);
function getRewardAmount(
bytes32 _feedId,
bytes32 _queryId,
uint256[] memory _timestamps
) external view returns (uint256 _cumulativeReward);
function getRewardClaimedStatus(
bytes32 _feedId,
bytes32 _queryId,
uint256 _timestamp
) external view returns (bool);
function getTipsByAddress(address _user) external view returns (uint256);
function isInDispute(bytes32 _queryId, uint256 _timestamp)
external
view
returns (bool);
function queryIdFromDataFeedId(bytes32) external view returns (bytes32);
function queryIdsWithFunding(uint256) external view returns (bytes32);
function queryIdsWithFundingIndex(bytes32) external view returns (uint256);
function setupDataFeed(
bytes32 _queryId,
uint256 _reward,
uint256 _startTime,
uint256 _interval,
uint256 _window,
uint256 _priceThreshold,
uint256 _rewardIncreasePerSecond,
bytes memory _queryData,
uint256 _amount
) external;
function tellor() external view returns (address);
function tip(
bytes32 _queryId,
uint256 _amount,
bytes memory _queryData
) external;
function tips(bytes32, uint256)
external
view
returns (uint256 amount, uint256 timestamp);
function token() external view returns (address);
function userTipsTotal(address) external view returns (uint256);
function valueFor(bytes32 _id)
external
view
returns (
int256 _value,
uint256 _timestamp,
uint256 _statusCode
);
}
interface Autopay {
struct FeedDetails {
uint256 reward;
uint256 balance;
uint256 startTime;
uint256 interval;
uint256 window;
uint256 priceThreshold;
uint256 rewardIncreasePerSecond;
uint256 feedsWithFundingIndex;
}
struct Tip {
uint256 amount;
uint256 timestamp;
}
function getStakeAmount() external view returns(uint256);
function stakeAmount() external view returns(uint256);
function token() external view returns(address);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
import "./interface/ITellor.sol";
import "./interface/IERC2362.sol";
import "./interface/IMappingContract.sol";
/**
@author Tellor Inc
@title UsingTellor
@dev This contract helps smart contracts read data from Tellor
*/
contract UsingTellor is IERC2362 {
ITellor public tellor;
IMappingContract public idMappingContract;
/*Constructor*/
/**
* @dev the constructor sets the oracle address in storage
* @param _tellor is the Tellor Oracle address
*/
constructor(address payable _tellor) {
tellor = ITellor(_tellor);
}
/*Getters*/
/**
* @dev Retrieves the next value for the queryId after the specified timestamp
* @param _queryId is the queryId to look up the value for
* @param _timestamp after which to search for next value
* @return _value the value retrieved
* @return _timestampRetrieved the value's timestamp
*/
function getDataAfter(bytes32 _queryId, uint256 _timestamp)
public
view
returns (bytes memory _value, uint256 _timestampRetrieved)
{
(bool _found, uint256 _index) = getIndexForDataAfter(
_queryId,
_timestamp
);
if (!_found) {
return ("", 0);
}
_timestampRetrieved = getTimestampbyQueryIdandIndex(_queryId, _index);
_value = retrieveData(_queryId, _timestampRetrieved);
return (_value, _timestampRetrieved);
}
/**
* @dev Retrieves the latest value for the queryId before the specified timestamp
* @param _queryId is the queryId to look up the value for
* @param _timestamp before which to search for latest value
* @return _value the value retrieved
* @return _timestampRetrieved the value's timestamp
*/
function getDataBefore(bytes32 _queryId, uint256 _timestamp)
public
view
returns (bytes memory _value, uint256 _timestampRetrieved)
{
(, _value, _timestampRetrieved) = tellor.getDataBefore(
_queryId,
_timestamp
);
}
/**
* @dev Retrieves latest array index of data before the specified timestamp for the queryId
* @param _queryId is the queryId to look up the index for
* @param _timestamp is the timestamp before which to search for the latest index
* @return _found whether the index was found
* @return _index the latest index found before the specified timestamp
*/
// slither-disable-next-line calls-loop
function getIndexForDataAfter(bytes32 _queryId, uint256 _timestamp)
public
view
returns (bool _found, uint256 _index)
{
uint256 _count = getNewValueCountbyQueryId(_queryId);
if (_count == 0) return (false, 0);
_count--;
bool _search = true; // perform binary search
uint256 _middle = 0;
uint256 _start = 0;
uint256 _end = _count;
uint256 _timestampRetrieved;
// checking boundaries to short-circuit the algorithm
_timestampRetrieved = getTimestampbyQueryIdandIndex(_queryId, _end);
if (_timestampRetrieved <= _timestamp) return (false, 0);
_timestampRetrieved = getTimestampbyQueryIdandIndex(_queryId, _start);
if (_timestampRetrieved > _timestamp) {
// candidate found, check for disputes
_search = false;
}
// since the value is within our boundaries, do a binary search
while (_search) {
_middle = (_end + _start) / 2;
_timestampRetrieved = getTimestampbyQueryIdandIndex(
_queryId,
_middle
);
if (_timestampRetrieved > _timestamp) {
// get immediate previous value
uint256 _prevTime = getTimestampbyQueryIdandIndex(
_queryId,
_middle - 1
);
if (_prevTime <= _timestamp) {
// candidate found, check for disputes
_search = false;
} else {
// look from start to middle -1(prev value)
_end = _middle - 1;
}
} else {
// get immediate next value
uint256 _nextTime = getTimestampbyQueryIdandIndex(
_queryId,
_middle + 1
);
if (_nextTime > _timestamp) {
// candidate found, check for disputes
_search = false;
_middle++;
_timestampRetrieved = _nextTime;
} else {
// look from middle + 1(next value) to end
_start = _middle + 1;
}
}
}
// candidate found, check for disputed values
if (!isInDispute(_queryId, _timestampRetrieved)) {
// _timestampRetrieved is correct
return (true, _middle);
} else {
// iterate forward until we find a non-disputed value
while (
isInDispute(_queryId, _timestampRetrieved) && _middle < _count
) {
_middle++;
_timestampRetrieved = getTimestampbyQueryIdandIndex(
_queryId,
_middle
);
}
if (
_middle == _count && isInDispute(_queryId, _timestampRetrieved)
) {
return (false, 0);
}
// _timestampRetrieved is correct
return (true, _middle);
}
}
/**
* @dev Retrieves latest array index of data before the specified timestamp for the queryId
* @param _queryId is the queryId to look up the index for
* @param _timestamp is the timestamp before which to search for the latest index
* @return _found whether the index was found
* @return _index the latest index found before the specified timestamp
*/
// slither-disable-next-line calls-loop
function getIndexForDataBefore(bytes32 _queryId, uint256 _timestamp)
public
view
returns (bool _found, uint256 _index)
{
return tellor.getIndexForDataBefore(_queryId, _timestamp);
}
/**
* @dev Retrieves multiple uint256 values before the specified timestamp
* @param _queryId the unique id of the data query
* @param _timestamp the timestamp before which to search for values
* @param _maxAge the maximum number of seconds before the _timestamp to search for values
* @param _maxCount the maximum number of values to return
* @return _values the values retrieved, ordered from oldest to newest
* @return _timestamps the timestamps of the values retrieved
*/
function getMultipleValuesBefore(
bytes32 _queryId,
uint256 _timestamp,
uint256 _maxAge,
uint256 _maxCount
)
public
view
returns (bytes[] memory _values, uint256[] memory _timestamps)
{
// get index of first possible value
(bool _ifRetrieve, uint256 _startIndex) = getIndexForDataAfter(
_queryId,
_timestamp - _maxAge
);
// no value within range
if (!_ifRetrieve) {
return (new bytes[](0), new uint256[](0));
}
uint256 _endIndex;
// get index of last possible value
(_ifRetrieve, _endIndex) = getIndexForDataBefore(_queryId, _timestamp);
// no value before _timestamp
if (!_ifRetrieve) {
return (new bytes[](0), new uint256[](0));
}
uint256 _valCount = 0;
uint256 _index = 0;
uint256[] memory _timestampsArrayTemp = new uint256[](_maxCount);
// generate array of non-disputed timestamps within range
while (_valCount < _maxCount && _endIndex + 1 - _index > _startIndex) {
uint256 _timestampRetrieved = getTimestampbyQueryIdandIndex(
_queryId,
_endIndex - _index
);
if (!isInDispute(_queryId, _timestampRetrieved)) {
_timestampsArrayTemp[_valCount] = _timestampRetrieved;
_valCount++;
}
_index++;
}
bytes[] memory _valuesArray = new bytes[](_valCount);
uint256[] memory _timestampsArray = new uint256[](_valCount);
// retrieve values and reverse timestamps order
for (uint256 _i = 0; _i < _valCount; _i++) {
_timestampsArray[_i] = _timestampsArrayTemp[_valCount - 1 - _i];
_valuesArray[_i] = retrieveData(_queryId, _timestampsArray[_i]);
}
return (_valuesArray, _timestampsArray);
}
/**
* @dev Counts the number of values that have been submitted for the queryId
* @param _queryId the id to look up
* @return uint256 count of the number of values received for the queryId
*/
function getNewValueCountbyQueryId(bytes32 _queryId)
public
view
returns (uint256)
{
return tellor.getNewValueCountbyQueryId(_queryId);
}
/**
* @dev Returns the address of the reporter who submitted a value for a data ID at a specific time
* @param _queryId is ID of the specific data feed
* @param _timestamp is the timestamp to find a corresponding reporter for
* @return address of the reporter who reported the value for the data ID at the given timestamp
*/
function getReporterByTimestamp(bytes32 _queryId, uint256 _timestamp)
public
view
returns (address)
{
return tellor.getReporterByTimestamp(_queryId, _timestamp);
}
/**
* @dev Gets the timestamp for the value based on their index
* @param _queryId is the id to look up
* @param _index is the value index to look up
* @return uint256 timestamp
*/
function getTimestampbyQueryIdandIndex(bytes32 _queryId, uint256 _index)
public
view
returns (uint256)
{
return tellor.getTimestampbyQueryIdandIndex(_queryId, _index);
}
/**
* @dev Determines whether a value with a given queryId and timestamp has been disputed
* @param _queryId is the value id to look up
* @param _timestamp is the timestamp of the value to look up
* @return bool true if queryId/timestamp is under dispute
*/
function isInDispute(bytes32 _queryId, uint256 _timestamp)
public
view
returns (bool)
{
return tellor.isInDispute(_queryId, _timestamp);
}
/**
* @dev Retrieve value from oracle based on queryId/timestamp
* @param _queryId being requested
* @param _timestamp to retrieve data/value from
* @return bytes value for query/timestamp submitted
*/
function retrieveData(bytes32 _queryId, uint256 _timestamp)
public
view
returns (bytes memory)
{
return tellor.retrieveData(_queryId, _timestamp);
}
/**
* @dev allows dev to set mapping contract for valueFor (EIP2362)
* @param _addy address of mapping contract
*/
function setIdMappingContract(address _addy) external {
require(address(idMappingContract) == address(0));
idMappingContract = IMappingContract(_addy);
}
/**
* @dev Retrieve most recent int256 value from oracle based on queryId
* @param _id being requested
* @return _value most recent value submitted
* @return _timestamp timestamp of most recent value
* @return _statusCode 200 if value found, 404 if not found
*/
function valueFor(bytes32 _id)
external
view
override
returns (
int256 _value,
uint256 _timestamp,
uint256 _statusCode
)
{
bytes32 _queryId = idMappingContract.getTellorID(_id);
bytes memory _valueBytes;
(_valueBytes, _timestamp) = getDataBefore(
_queryId,
block.timestamp + 1
);
if (_timestamp == 0) {
return (0, 0, 404);
}
uint256 _valueUint = _sliceUint(_valueBytes);
_value = int256(_valueUint);
return (_value, _timestamp, 200);
}
// Internal functions
/**
* @dev Convert bytes to uint256
* @param _b bytes value to convert to uint256
* @return _number uint256 converted from bytes
*/
function _sliceUint(bytes memory _b)
internal
pure
returns (uint256 _number)
{
for (uint256 _i = 0; _i < _b.length; _i++) {
_number = _number * 256 + uint8(_b[_i]);
}
}
}{
"optimizer": {
"enabled": true,
"runs": 300
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address payable","name":"_tellor","type":"address"},{"internalType":"address","name":"_teamMultisig","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_disputeId","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"_queryId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"_timestamp","type":"uint256"},{"indexed":false,"internalType":"address","name":"_reporter","type":"address"}],"name":"NewDispute","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_disputeId","type":"uint256"},{"indexed":false,"internalType":"enum Governance.VoteResult","name":"_result","type":"uint8"}],"name":"VoteExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_disputeId","type":"uint256"},{"indexed":false,"internalType":"enum Governance.VoteResult","name":"_result","type":"uint8"},{"indexed":false,"internalType":"address","name":"_initiator","type":"address"},{"indexed":false,"internalType":"address","name":"_reporter","type":"address"}],"name":"VoteTallied","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_disputeId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"_supports","type":"bool"},{"indexed":false,"internalType":"address","name":"_voter","type":"address"},{"indexed":false,"internalType":"bool","name":"_invalidQuery","type":"bool"}],"name":"Voted","type":"event"},{"inputs":[],"name":"autopayAddrsQueryId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_queryId","type":"bytes32"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"beginDispute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_disputeId","type":"uint256"},{"internalType":"address","name":"_voter","type":"address"}],"name":"didVote","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_disputeId","type":"uint256"}],"name":"executeVote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_queryId","type":"bytes32"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"getDataAfter","outputs":[{"internalType":"bytes","name":"_value","type":"bytes"},{"internalType":"uint256","name":"_timestampRetrieved","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_queryId","type":"bytes32"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"getDataBefore","outputs":[{"internalType":"bytes","name":"_value","type":"bytes"},{"internalType":"uint256","name":"_timestampRetrieved","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDisputeFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_disputeId","type":"uint256"}],"name":"getDisputeInfo","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_reporter","type":"address"}],"name":"getDisputesByReporter","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_queryId","type":"bytes32"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"getIndexForDataAfter","outputs":[{"internalType":"bool","name":"_found","type":"bool"},{"internalType":"uint256","name":"_index","type":"uint256"}],"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"},{"internalType":"uint256","name":"_timestamp","type":"uint256"},{"internalType":"uint256","name":"_maxAge","type":"uint256"},{"internalType":"uint256","name":"_maxCount","type":"uint256"}],"name":"getMultipleValuesBefore","outputs":[{"internalType":"bytes[]","name":"_values","type":"bytes[]"},{"internalType":"uint256[]","name":"_timestamps","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":"bytes32","name":"_queryId","type":"bytes32"}],"name":"getOpenDisputesOnId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"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":"getVoteCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_disputeId","type":"uint256"}],"name":"getVoteInfo","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint256[17]","name":"","type":"uint256[17]"},{"internalType":"bool","name":"","type":"bool"},{"internalType":"enum Governance.VoteResult","name":"","type":"uint8"},{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_hash","type":"bytes32"}],"name":"getVoteRounds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_voter","type":"address"}],"name":"getVoteTallyByAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"idMappingContract","outputs":[{"internalType":"contract IMappingContract","name":"","type":"address"}],"stateMutability":"view","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":"oracle","outputs":[{"internalType":"contract IOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracleAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_queryId","type":"bytes32"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"retrieveData","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_addy","type":"address"}],"name":"setIdMappingContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_disputeId","type":"uint256"}],"name":"tallyVotes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"teamMultisig","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tellor","outputs":[{"internalType":"contract ITellor","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_id","type":"bytes32"}],"name":"valueFor","outputs":[{"internalType":"int256","name":"_value","type":"int256"},{"internalType":"uint256","name":"_timestamp","type":"uint256"},{"internalType":"uint256","name":"_statusCode","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_disputeId","type":"uint256"},{"internalType":"bool","name":"_supports","type":"bool"},{"internalType":"bool","name":"_invalidQuery","type":"bool"}],"name":"vote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"voteCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_disputeIds","type":"uint256[]"},{"internalType":"bool[]","name":"_supports","type":"bool[]"},{"internalType":"bool[]","name":"_invalidQuery","type":"bool[]"}],"name":"voteOnMultipleDisputes","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60a060405260006080908152620000189060c06200020f565b60408051601f1981840301815290829052620000379160200162000224565b604051602081830303815290604052805190602001206007553480156200005d57600080fd5b5060405162003e3438038062003e34833981016040819052620000809162000183565b600080546001600160a01b0384166001600160a01b0319918216811790925560028054909116821790556040805163021fd35d60e31b815290516310fe9ae891600480820192602092909190829003018186803b158015620000e157600080fd5b505afa158015620000f6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200011c91906200015d565b600380546001600160a01b03199081166001600160a01b03938416179091556004805482169483169490941790935560058054909316911617905562000279565b6000602082840312156200016f578081fd5b81516200017c8162000260565b9392505050565b6000806040838503121562000196578081fd5b8251620001a38162000260565b6020840151909250620001b68162000260565b809150509250929050565b60008151808452815b81811015620001e857602081850181015186830182015201620001ca565b81811115620001fa5782602083870101525b50601f01601f19169290920160200192915050565b6000602082526200017c6020830184620001c1565b600060408252601060408301526f4175746f70617941646472657373657360801b6060830152608060208301526200017c6080830184620001c1565b6001600160a01b03811681146200027657600080fd5b50565b613bab80620002896000396000f3fe608060405234801561001057600080fd5b50600436106102055760003560e01c8063a7c438bc1161011a578063dbc0c085116100ad578063f66f49c31161007c578063f66f49c3146104f1578063f78eea8314610504578063f98a4eca14610532578063fc0c546a14610545578063fcd4a5461461055857610205565b8063dbc0c085146104b0578063df133bca146104c3578063e07c5486146104d6578063e7b3387c146104e957610205565b8063c5958af9116100e9578063c5958af91461046b578063c63840711461048b578063ce5e11bf14610494578063d8add0f6146104a757610205565b8063a7c438bc146103ea578063a89ae4ba14610427578063bbf3e10b1461043a578063bdc7d9d81461044257610205565b806344e87f911161019d57806364ee3c6d1161016c57806364ee3c6d1461036c57806377b03e0d1461038d5780637dc0d1d0146103a05780638d824273146103b3578063a792765f146103d757610205565b806344e87f91146103005780634d318b0e146103235780634e9fe708146103365780636169c3081461034957610205565b80631f379acc116101d95780631f379acc14610290578063248638e5146102a357806329449085146102c35780632af8aae0146102ed57610205565b8062b121901461020a5780630e1596ef1461021f578063193b505b146102525780631959ad5b14610265575b600080fd5b61021d61021836600461337c565b610579565b005b61023f61022d3660046134fa565b60009081526009602052604090205490565b6040519081526020015b60405180910390f35b61021d6102603660046132a8565b61061d565b600054610278906001600160a01b031681565b6040516001600160a01b039091168152602001610249565b61021d61029e36600461352a565b610655565b6102b66102b13660046134fa565b610eba565b6040516102499190613794565b6102d66102d136600461352a565b610f1c565b604080519215158352602083019190915201610249565b600154610278906001600160a01b031681565b61031361030e36600461352a565b610fab565b6040519015158152602001610249565b61021d6103313660046134fa565b611036565b6102b66103443660046132a8565b61154b565b61035c6103573660046134fa565b6115b5565b604051610249949392919061380a565b61037f61037a36600461352a565b611689565b604051610249929190613856565b61023f61039b3660046134fa565b6116e2565b600254610278906001600160a01b031681565b6103c66103c13660046134fa565b611765565b6040516102499594939291906137a7565b61037f6103e536600461352a565b61186a565b6103136103f83660046135af565b6000828152600a602090815260408083206001600160a01b038516845260130190915290205460ff1692915050565b600454610278906001600160a01b031681565b61023f611900565b61023f6104503660046132a8565b6001600160a01b03166000908152600c602052604090205490565b61047e61047936600461352a565b611999565b6040516102499190613843565b61023f60065481565b61023f6104a236600461352a565b611a21565b61023f60075481565b600554610278906001600160a01b031681565b61021d6104d13660046135de565b611aa5565b6102786104e436600461352a565b612082565b60065461023f565b6102d66104ff36600461352a565b612106565b6105176105123660046134fa565b6122c2565b60408051938452602084019290925290820152606001610249565b61021d6105403660046134fa565b612392565b600354610278906001600160a01b031681565b61056b61056636600461354b565b612b71565b60405161024992919061371f565b60005b8351811015610617576106058482815181106105a857634e487b7160e01b600052603260045260246000fd5b60200260200101518483815181106105d057634e487b7160e01b600052603260045260246000fd5b60200260200101518484815181106105f857634e487b7160e01b600052603260045260246000fd5b6020026020010151611aa5565b8061060f81613b08565b91505061057c565b50505050565b6001546001600160a01b03161561063357600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60025460405163703e2a4360e11b815260048101849052602481018390526000916001600160a01b03169063e07c54869060440160206040518083038186803b1580156106a157600080fd5b505afa1580156106b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d991906132c4565b90506001600160a01b0381166107415760405162461bcd60e51b815260206004820152602260248201527f6e6f2076616c75652065786973747320617420676976656e2074696d6573746160448201526106d760f41b60648201526084015b60405180910390fd5b6040805160208082018690528183018590528251808303840181526060909201909252805191012060065460009061077a906001613917565b6000838152600b60209081526040808320805460018082018355828652848620909101869055858552600a8452828520600885528386208c81558083018c9055600380820180546001600160a01b0319166001600160a01b038e169081179091558b845560128401805475ffffffffffffffffffffffffffffffffffffffff0000191633620100000217905543918401919091554260028401558454838501558752600d8652938620805492830181558652938520018590559394509091610840611900565b845490915060011415610b4b5761a8c061085a8942613a79565b106108c25760405162461bcd60e51b815260206004820152603260248201527f44697370757465206d75737420626520737461727465642077697468696e207260448201527165706f7274696e67206c6f636b2074696d6560701b6064820152608401610738565b60008981526009602052604081208054916108dc83613b08565b90915550506000898152600960205260409020546004101561098557600260009054906101000a90046001600160a01b03166001600160a01b031663722580b66040518163ffffffff1660e01b815260040160206040518083038186803b15801561094657600080fd5b505afa15801561095a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097e9190613512565b90506109b8565b6000898152600960205260409020546109a090600190613a79565b6109ab90600261398c565b6109b59082613a5a565b90505b60025460405163137f0a8d60e21b81526001600160a01b03898116600483015230602483015290911690634dfc2a3490604401602060405180830381600087803b158015610a0557600080fd5b505af1158015610a19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3d9190613512565b60048381019190915560025460405163c5958af960e01b81529182018b9052602482018a90526001600160a01b03169063c5958af99060440160006040518083038186803b158015610a8e57600080fd5b505afa158015610aa2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610aca919081019061357c565b8051610ae0916002850191602090910190613093565b506002546040516316d7b73f60e21b8152600481018b9052602481018a90526001600160a01b0390911690635b5edcfc90604401600060405180830381600087803b158015610b2e57600080fd5b505af1158015610b42573d6000803e3d6000fd5b50505050610d79565b83546000908590610b5e90600290613a79565b81548110610b7c57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905062015180600a60008381526020019081526020016000206005015442610baf9190613a79565b10610c135760405162461bcd60e51b815260206004820152602e60248201527f4e6577206469737075746520726f756e64206d7573742062652073746172746560448201526d642077697468696e20612064617960901b6064820152608401610738565b845460041015610caa57600260009054906101000a90046001600160a01b03166001600160a01b031663722580b66040518163ffffffff1660e01b815260040160206040518083038186803b158015610c6b57600080fd5b505afa158015610c7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca39190613512565b9150610cd0565b8454610cb890600190613a79565b610cc390600261398c565b610ccd9083613a5a565b91505b6008600086600081548110610cf557634e487b7160e01b600052603260045260246000fd5b906000526020600020015481526020019081526020016000206004015483600401819055506008600086600081548110610d3f57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154815260200190815260200160002060020183600201908054610d6b90613ad3565b610d76929190613117565b50505b6004830181905560068054906000610d9083613b08565b90915550506003546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd90606401602060405180830381600087803b158015610de757600080fd5b505af1158015610dfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1f9190613459565b610e5e5760405162461bcd60e51b815260206004820152601060248201526f119959481b5d5cdd081899481c185a5960821b6044820152606401610738565b60408051868152602081018b90529081018990526001600160a01b03881660608201527f12b7317353cd7caa8eae8057464e3de356c1429d814fb3421797eccb19043044906080015b60405180910390a1505050505050505050565b6000818152600b6020908152604091829020805483518184028101840190945280845260609392830182828015610f1057602002820191906000526020600020905b815481526020019060010190808311610efc575b50505050509050919050565b60008054604051632944908560e01b8152600481018590526024810184905282916001600160a01b031690632944908590604401604080518083038186803b158015610f6757600080fd5b505afa158015610f7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9f91906134cd565b915091505b9250929050565b600080546040516344e87f9160e01b815260048101859052602481018490526001600160a01b03909116906344e87f919060440160206040518083038186803b158015610ff757600080fd5b505afa15801561100b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102f9190613459565b9392505050565b6000818152600a602052604090206005810154156110965760405162461bcd60e51b815260206004820152601d60248201527f566f74652068617320616c7265616479206265656e2074616c6c6965640000006044820152606401610738565b60065482111580156110a85750600082115b6110ea5760405162461bcd60e51b8152602060048201526013602482015272159bdd1948191bd95cc81b9bdd08195e1a5cdd606a1b6044820152606401610738565b60018101546110fc9062015180613a5a565b600282015461110b9042613a79565b10158061112a57506207e9008160020154426111279190613a79565b10155b6111765760405162461bcd60e51b815260206004820152601f60248201527f54696d6520666f7220766f74696e6720686173206e6f7420656c6170736564006044820152606401610738565b6008810154600782015460068301546000929161119291613917565b61119c9190613917565b600e830154600d840154600c8501549293506000926111bb9190613917565b6111c59190613917565b60118401546010850154600f8601549293506000926111e49190613917565b6111ee9190613917565b600b850154600a860154600987015492935060009261120d9190613917565b6112179190613917565b90508361122c578361122881613b08565b9450505b8261123f578261123b81613b08565b9350505b81611252578161124e81613b08565b9250505b80611265578061126181613b08565b9150505b6009850154600090829061128190670de0b6b3a7640000613a5a565b61128b919061392f565b600f87015484906112a490670de0b6b3a7640000613a5a565b6112ae919061392f565b600c88015486906112c790670de0b6b3a7640000613a5a565b6112d1919061392f565b600689015488906112ea90670de0b6b3a7640000613a5a565b6112f4919061392f565b6112fe9190613917565b6113089190613917565b6113129190613917565b90506000828760090160010154670de0b6b3a76400006113329190613a5a565b61133c919061392f565b6010880154859061135590670de0b6b3a7640000613a5a565b61135f919061392f565b600d890154879061137890670de0b6b3a7640000613a5a565b611382919061392f565b60078a0154899061139b90670de0b6b3a7640000613a5a565b6113a5919061392f565b6113af9190613917565b6113b99190613917565b6113c39190613917565b90506000838860090160020154670de0b6b3a76400006113e39190613a5a565b6113ed919061392f565b6011890154869061140690670de0b6b3a7640000613a5a565b611410919061392f565b600e8a0154889061142990670de0b6b3a7640000613a5a565b611433919061392f565b60088b01548a9061144c90670de0b6b3a7640000613a5a565b611456919061392f565b6114609190613917565b61146a9190613917565b6114749190613917565b90506114808183613917565b8311156114a5576012880180546001919061ff001916610100835b02179055506114e0565b6114af8184613917565b8211156114ce576012880180546000919061ff0019166101008361149b565b60128801805461ff0019166102001790555b426005890155601288015460008a815260086020526040908190206003015490517fa2d4e500801849d40ad00f0f12ba92a5263f83ec68946e647be95cfbe581c7b692610ea7928d9260ff610100840416926001600160a01b0362010000909104811692169061388c565b6001600160a01b0381166000908152600d6020908152604091829020805483518184028101840190945280845260609392830182828015610f105760200282019190600052602060002090815481526020019060010190808311610efc5750505050509050919050565b6000818152600860205260408120805460018201546003830154600284018054869560609587959194909391926001600160a01b039091169082906115f990613ad3565b80601f016020809104026020016040519081016040528092919081815260200182805461162590613ad3565b80156116725780601f1061164757610100808354040283529160200191611672565b820191906000526020600020905b81548152906001019060200180831161165557829003601f168201915b505050505091509450945094509450509193509193565b6060600080600061169a8686612106565b91509150816116c15760006040518060200160405280600081525090935093505050610fa4565b6116cb8682611a21565b92506116d78684611999565b935050509250929050565b600080546040516377b03e0d60e01b8152600481018490526001600160a01b03909116906377b03e0d9060240160206040518083038186803b15801561172757600080fd5b505afa15801561173b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061175f9190613512565b92915050565b600061176f613192565b50506000908152600a60208181526040928390208054845161022081018652600183015481526002830154938101939093526003820154948301949094526004810154606083015260058101546080830152600681015460a0830152600781015460c0830152600881015460e083015260098101546101008084019190915292810154610120830152600b810154610140830152600c810154610160830152600d810154610180830152600e8101546101a0830152600f8101546101c083015260108101546101e08301526011810154610200830152601201549293909260ff8082169382041691620100009091046001600160a01b031690565b6000805460405163a792765f60e01b81526004810185905260248101849052606092916001600160a01b03169063a792765f9060440160006040518083038186803b1580156118b857600080fd5b505afa1580156118cc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526118f49190810190613475565b90969095509350505050565b6000600a600260009054906101000a90046001600160a01b03166001600160a01b031663722580b66040518163ffffffff1660e01b815260040160206040518083038186803b15801561195257600080fd5b505afa158015611966573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061198a9190613512565b611994919061392f565b905090565b60005460405163c5958af960e01b815260048101849052602481018390526060916001600160a01b03169063c5958af99060440160006040518083038186803b1580156119e557600080fd5b505afa1580156119f9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261102f919081019061357c565b6000805460405163ce5e11bf60e01b815260048101859052602481018490526001600160a01b039091169063ce5e11bf9060440160206040518083038186803b158015611a6d57600080fd5b505afa158015611a81573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102f9190613512565b6006548311158015611ab75750600083115b611af95760405162461bcd60e51b8152602060048201526013602482015272159bdd1948191bd95cc81b9bdd08195e1a5cdd606a1b6044820152606401610738565b6000838152600a60205260409020600581015415611b595760405162461bcd60e51b815260206004820152601d60248201527f566f74652068617320616c7265616479206265656e2074616c6c6965640000006044820152606401610738565b33600090815260138201602052604090205460ff1615611bbb5760405162461bcd60e51b815260206004820152601860248201527f53656e6465722068617320616c726561647920766f74656400000000000000006044820152606401610738565b336000818152601383016020526040808220805460ff1916600117905560035490516370a0823160e01b8152600481019390935290916001600160a01b03909116906370a082319060240160206040518083038186803b158015611c1e57600080fd5b505afa158015611c32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c569190613512565b600254604051630733bdef60e41b815233600482015291925060009182916001600160a01b03169063733bdef0906024016101006040518083038186803b158015611ca057600080fd5b505afa158015611cb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cd8919061361f565b505050505092509250508082611cee9190613917565b611cf89084613917565b92508415611e095782846006016002016000828254611d179190613917565b9091555050600254604051631c3c149f60e11b81523360048201526001600160a01b0390911690633878293e9060240160206040518083038186803b158015611d5f57600080fd5b505afa158015611d73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d979190613512565b600e85018054600090611dab908490613917565b90915550611dba905033612ed0565b600b85018054600090611dce908490613917565b90915550506005546001600160a01b0316331415611e0457600184600f016002016000828254611dfe9190613917565b90915550505b612011565b8515611f0d5782846006016000016000828254611e269190613917565b9091555050600254604051631c3c149f60e11b81523360048201526001600160a01b0390911690633878293e9060240160206040518083038186803b158015611e6e57600080fd5b505afa158015611e82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea69190613512565b600c85018054600090611eba908490613917565b90915550611ec9905033612ed0565b600985018054600090611edd908490613917565b90915550506005546001600160a01b0316331415611e0457600184600f016000016000828254611dfe9190613917565b82846006016001016000828254611f249190613917565b9091555050600254604051631c3c149f60e11b81523360048201526001600160a01b0390911690633878293e9060240160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa49190613512565b600d85018054600090611fb8908490613917565b90915550611fc7905033612ed0565b600a85018054600090611fdb908490613917565b90915550506005546001600160a01b031633141561201157600184600f01600101600082825461200b9190613917565b90915550505b336000908152600c6020526040812080549161202c83613b08565b90915550506040805188815287151560208201523381830152861515606082015290517fbe6f1c58cc15c8e86d6f0ef23c5a30eb33319af3b57f6b7d9b56ccfa87696b849181900360800190a150505050505050565b6000805460405163703e2a4360e11b815260048101859052602481018490526001600160a01b039091169063e07c54869060440160206040518083038186803b1580156120ce57600080fd5b505afa1580156120e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102f91906132c4565b6000806000612114856116e2565b905080612128576000809250925050610fa4565b8061213281613abc565b91506001905060008083816121478a83611a21565b90508881116121625760008097509750505050505050610fa4565b61216c8a84611a21565b90508881111561217b57600094505b841561222d57600261218d8484613917565b612197919061392f565b93506121a38a85611a21565b9050888111156121e45760006121be8b6104a2600188613a79565b90508981116121d057600095506121de565b6121db600186613a79565b92505b50612228565b60006121f58b6104a2876001613917565b90508981111561221857600095508461220d81613b08565b955050809150612226565b612223856001613917565b93505b505b61217b565b6122378a82610fab565b61224d5760018497509750505050505050610fa4565b6122578a82610fab565b801561226257508584105b15612285578361227181613b08565b94505061227e8a85611a21565b905061224d565b858414801561229957506122998a82610fab565b156122b05760008097509750505050505050610fa4565b60018497509750505050505050610fa4565b6001546040516387a475fd60e01b8152600481018390526000918291829182916001600160a01b03909116906387a475fd9060240160206040518083038186803b15801561230f57600080fd5b505afa158015612323573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123479190613512565b9050606061235a826103e5426001613917565b945090508361237657600080610194945094509450505061238b565b60006123818261302e565b955060c893505050505b9193909250565b6000818152600a6020526040902060065482118015906123b25750600082115b6123fe5760405162461bcd60e51b815260206004820152601860248201527f44697370757465204944206d7573742062652076616c696400000000000000006044820152606401610738565b601281015460ff16156124535760405162461bcd60e51b815260206004820152601e60248201527f566f74652068617320616c7265616479206265656e20657865637574656400006044820152606401610738565b60008160050154116124a75760405162461bcd60e51b815260206004820152601460248201527f566f7465206d7573742062652074616c6c6965640000000000000000000000006044820152606401610738565b600181015481546000908152600b60205260409020541461250a5760405162461bcd60e51b815260206004820152601660248201527f4d757374206265207468652066696e616c20766f7465000000000000000000006044820152606401610738565b6201518081600501544261251e9190613a79565b10156125885760405162461bcd60e51b815260206004820152603360248201527f31206461792068617320746f20706173732061667465722074616c6c7920746f60448201527220616c6c6f7720666f7220646973707574657360681b6064820152608401610738565b60128101805460ff1916600117905560008281526008602090815260408083208054845260099092528220805491926125c083613abc565b90915550600090508060016012850154610100900460ff1660028111156125f757634e487b7160e01b600052602160045260246000fd5b14156127c15783546000908152600b602052604090205491505b81156127bc5783546000908152600b60205260409020612632600184613a79565b8154811061265057634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050600a60008281526020019081526020016000209350816001141561271357600354601285015460048581015460405163a9059cbb60e01b81526001600160a01b0362010000909404841692810192909252602482015291169063a9059cbb90604401602060405180830381600087803b1580156126d957600080fd5b505af11580156126ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127119190613459565b505b600354601285015460048087015460405163a9059cbb60e01b81526001600160a01b0362010000909404841692810192909252602482015291169063a9059cbb90604401602060405180830381600087803b15801561277157600080fd5b505af1158015612785573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127a99190613459565b50816127b481613abc565b925050612611565b612b16565b60026012850154610100900460ff1660028111156127ef57634e487b7160e01b600052602160045260246000fd5b14156129ab5783546000908152600b602052604090205491505b81156129155783546000908152600b6020526040902061282a600184613a79565b8154811061284857634e487b7160e01b600052603260045260246000fd5b600091825260208083209190910154808352600a9091526040918290206003546012820154600480840154955163a9059cbb60e01b81526001600160a01b03620100009093048316918101919091526024810195909552919750919350169063a9059cbb90604401602060405180830381600087803b1580156128ca57600080fd5b505af11580156128de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129029190613459565b508161290d81613abc565b925050612809565b600380549084015460048086015460405163a9059cbb60e01b81526001600160a01b0393841692810192909252602482015291169063a9059cbb90604401602060405180830381600087803b15801561296d57600080fd5b505af1158015612981573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129a59190613459565b50612b16565b60006012850154610100900460ff1660028111156129d957634e487b7160e01b600052602160045260246000fd5b1415612b165783546000908152600b602052604081205492505b8215612a785784546000908152600b60205260409020612a14600185613a79565b81548110612a3257634e487b7160e01b600052603260045260246000fd5b90600052602060002001549150600a60008381526020019081526020016000209450846004015481612a649190613917565b905082612a7081613abc565b9350506129f3565b6004840154612a879082613917565b600380549086015460405163a9059cbb60e01b81526001600160a01b03918216600482015260248101849052929350169063a9059cbb90604401602060405180830381600087803b158015612adb57600080fd5b505af1158015612aef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b139190613459565b50505b6000858152600a6020526040908190206012015490517f40d231bf91823121de9e1c012d95f835ea5684dc1d93360d9510a30543345da491612b62918891610100900460ff1690613878565b60405180910390a15050505050565b606080600080612b85886104ff888a613a79565b9150915081612bd6576040805160008082526020820190925290612bb9565b6060815260200190600190039081612ba45790505b506040805160008152602081019091529094509250612ec7915050565b6000612be28989610f1c565b909350905082612c35576040805160008082526020820190925290612c17565b6060815260200190600190039081612c025790505b506040805160008152602081019091529095509350612ec792505050565b60008060008867ffffffffffffffff811115612c6157634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015612c8a578160200160208202803683370190505b5090505b8883108015612cb157508482612ca5866001613917565b612caf9190613a79565b115b15612d23576000612cc68d6104a28588613a79565b9050612cd28d82610fab565b612d105780828581518110612cf757634e487b7160e01b600052603260045260246000fd5b602090810291909101015283612d0c81613b08565b9450505b82612d1a81613b08565b93505050612c8e565b60008367ffffffffffffffff811115612d4c57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015612d7f57816020015b6060815260200190600190039081612d6a5790505b50905060008467ffffffffffffffff811115612dab57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015612dd4578160200160208202803683370190505b50905060005b85811015612eba578381612def600189613a79565b612df99190613a79565b81518110612e1757634e487b7160e01b600052603260045260246000fd5b6020026020010151828281518110612e3f57634e487b7160e01b600052603260045260246000fd5b602002602001018181525050612e7c8f838381518110612e6f57634e487b7160e01b600052603260045260246000fd5b6020026020010151611999565b838281518110612e9c57634e487b7160e01b600052603260045260246000fd5b60200260200101819052508080612eb290613b08565b915050612dda565b5090985096505050505050505b94509492505050565b6000806000612ee960075461a8c0426103e59190613a79565b9092509050801561302757600082806020019051810190612f0a91906132e0565b905060005b815181101561302457600080838381518110612f3b57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b031688604051602401612f6c91906001600160a01b0391909116815260200190565b60408051601f198184030181529181526020820180516001600160e01b03166345d6082360e01b17905251612fa19190613703565b6000604051808303816000865af19150503d8060008114612fde576040519150601f19603f3d011682016040523d82523d6000602084013e612fe3565b606091505b5091509150811561300f57808060200190518101906130029190613512565b61300c9088613917565b96505b5050808061301c90613b08565b915050612f0f565b50505b5050919050565b6000805b825181101561308d5782818151811061305b57634e487b7160e01b600052603260045260246000fd5b016020015160f81c61306f83610100613a5a565b6130799190613917565b91508061308581613b08565b915050613032565b50919050565b82805461309f90613ad3565b90600052602060002090601f0160209004810192826130c15760008555613107565b82601f106130da57805160ff1916838001178555613107565b82800160010185558215613107579182015b828111156131075782518255916020019190600101906130ec565b506131139291506131b1565b5090565b82805461312390613ad3565b90600052602060002090601f0160209004810192826131455760008555613107565b82601f106131565780548555613107565b8280016001018555821561310757600052602060002091601f016020900482015b82811115613107578254825591600101919060010190613177565b6040518061022001604052806011906020820280368337509192915050565b5b8082111561311357600081556001016131b2565b600082601f8301126131d6578081fd5b813560206131eb6131e6836138f3565b6138c2565b80838252828201915082860187848660051b890101111561320a578586fd5b855b8581101561323157813561321f81613b67565b8452928401929084019060010161320c565b5090979650505050505050565b600082601f83011261324e578081fd5b815167ffffffffffffffff81111561326857613268613b39565b61327b601f8201601f19166020016138c2565b81815284602083860101111561328f578283fd5b6132a0826020830160208701613a90565b949350505050565b6000602082840312156132b9578081fd5b813561102f81613b4f565b6000602082840312156132d5578081fd5b815161102f81613b4f565b600060208083850312156132f2578182fd5b825167ffffffffffffffff811115613308578283fd5b8301601f81018513613318578283fd5b80516133266131e6826138f3565b80828252848201915084840188868560051b8701011115613345578687fd5b8694505b8385101561337057805161335c81613b4f565b835260019490940193918501918501613349565b50979650505050505050565b600080600060608486031215613390578182fd5b833567ffffffffffffffff808211156133a7578384fd5b818601915086601f8301126133ba578384fd5b813560206133ca6131e6836138f3565b8083825282820191508286018b848660051b89010111156133e9578889fd5b8896505b8487101561340b5780358352600196909601959183019183016133ed565b5097505087013592505080821115613421578384fd5b61342d878388016131c6565b93506040860135915080821115613442578283fd5b5061344f868287016131c6565b9150509250925092565b60006020828403121561346a578081fd5b815161102f81613b67565b600080600060608486031215613489578283fd5b835161349481613b67565b602085015190935067ffffffffffffffff8111156134b0578283fd5b6134bc8682870161323e565b925050604084015190509250925092565b600080604083850312156134df578182fd5b82516134ea81613b67565b6020939093015192949293505050565b60006020828403121561350b578081fd5b5035919050565b600060208284031215613523578081fd5b5051919050565b6000806040838503121561353c578182fd5b50508035926020909101359150565b60008060008060808587031215613560578182fd5b5050823594602084013594506040840135936060013592509050565b60006020828403121561358d578081fd5b815167ffffffffffffffff8111156135a3578182fd5b6132a08482850161323e565b600080604083850312156135c1578182fd5b8235915060208301356135d381613b4f565b809150509250929050565b6000806000606084860312156135f2578081fd5b83359250602084013561360481613b67565b9150604084013561361481613b67565b809150509250925092565b600080600080600080600080610100898b03121561363b578586fd5b505086516020880151604089015160608a015160808b015160a08c015160c08d015160e0909d0151959e949d50929b919a50985090965094509092509050565b6000815180845260208085019450808401835b838110156136aa5781518752958201959082019060010161368e565b509495945050505050565b600081518084526136cd816020860160208601613a90565b601f01601f19169290920160200192915050565b600381106136ff57634e487b7160e01b600052602160045260246000fd5b9052565b60008251613715818460208701613a90565b9190910192915050565b6000604082016040835280855180835260608501915060608160051b86010192506020808801855b8381101561377557605f198887030185526137638683516136b5565b95509382019390820190600101613747565b50508584038187015250505061378b818561367b565b95945050505050565b60006020825261102f602083018461367b565b8581526102a0810160208083018760005b60118110156137d5578151835291830191908301906001016137b8565b505050508415156102408301526137f06102608301856136e1565b6001600160a01b0383166102808301529695505050505050565b60008582528460208301526080604083015261382960808301856136b5565b90506001600160a01b038316606083015295945050505050565b60006020825261102f60208301846136b5565b60006040825261386960408301856136b5565b90508260208301529392505050565b8281526040810161102f60208301846136e1565b848152608081016138a060208301866136e1565b6001600160a01b03808516604084015280841660608401525095945050505050565b604051601f8201601f1916810167ffffffffffffffff811182821017156138eb576138eb613b39565b604052919050565b600067ffffffffffffffff82111561390d5761390d613b39565b5060051b60200190565b6000821982111561392a5761392a613b23565b500190565b60008261394a57634e487b7160e01b81526012600452602481fd5b500490565b80825b60018086116139615750612ec7565b81870482111561397357613973613b23565b8086161561398057918102915b9490941c938002613952565b600061102f60001984846000826139a55750600161102f565b816139b25750600061102f565b81600181146139c857600281146139d2576139ff565b600191505061102f565b60ff8411156139e3576139e3613b23565b6001841b9150848211156139f9576139f9613b23565b5061102f565b5060208310610133831016604e8410600b8410161715613a32575081810a83811115613a2d57613a2d613b23565b61102f565b613a3f848484600161394f565b808604821115613a5157613a51613b23565b02949350505050565b6000816000190483118215151615613a7457613a74613b23565b500290565b600082821015613a8b57613a8b613b23565b500390565b60005b83811015613aab578181015183820152602001613a93565b838111156106175750506000910152565b600081613acb57613acb613b23565b506000190190565b600181811c90821680613ae757607f821691505b6020821081141561308d57634e487b7160e01b600052602260045260246000fd5b6000600019821415613b1c57613b1c613b23565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114613b6457600080fd5b50565b8015158114613b6457600080fdfea2646970667358221220d430664f5f63987d8c7e884d4eda4cc1876f1977aa1fea560434b0fb9ca3dfe564736f6c634300080300330000000000000000000000008cfc184c877154a8f9ffe0fe75649dbe5e2dbebf000000000000000000000000d57aa8f0ccb32a33ab9fe4e4a5f425c343733f7c
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102055760003560e01c8063a7c438bc1161011a578063dbc0c085116100ad578063f66f49c31161007c578063f66f49c3146104f1578063f78eea8314610504578063f98a4eca14610532578063fc0c546a14610545578063fcd4a5461461055857610205565b8063dbc0c085146104b0578063df133bca146104c3578063e07c5486146104d6578063e7b3387c146104e957610205565b8063c5958af9116100e9578063c5958af91461046b578063c63840711461048b578063ce5e11bf14610494578063d8add0f6146104a757610205565b8063a7c438bc146103ea578063a89ae4ba14610427578063bbf3e10b1461043a578063bdc7d9d81461044257610205565b806344e87f911161019d57806364ee3c6d1161016c57806364ee3c6d1461036c57806377b03e0d1461038d5780637dc0d1d0146103a05780638d824273146103b3578063a792765f146103d757610205565b806344e87f91146103005780634d318b0e146103235780634e9fe708146103365780636169c3081461034957610205565b80631f379acc116101d95780631f379acc14610290578063248638e5146102a357806329449085146102c35780632af8aae0146102ed57610205565b8062b121901461020a5780630e1596ef1461021f578063193b505b146102525780631959ad5b14610265575b600080fd5b61021d61021836600461337c565b610579565b005b61023f61022d3660046134fa565b60009081526009602052604090205490565b6040519081526020015b60405180910390f35b61021d6102603660046132a8565b61061d565b600054610278906001600160a01b031681565b6040516001600160a01b039091168152602001610249565b61021d61029e36600461352a565b610655565b6102b66102b13660046134fa565b610eba565b6040516102499190613794565b6102d66102d136600461352a565b610f1c565b604080519215158352602083019190915201610249565b600154610278906001600160a01b031681565b61031361030e36600461352a565b610fab565b6040519015158152602001610249565b61021d6103313660046134fa565b611036565b6102b66103443660046132a8565b61154b565b61035c6103573660046134fa565b6115b5565b604051610249949392919061380a565b61037f61037a36600461352a565b611689565b604051610249929190613856565b61023f61039b3660046134fa565b6116e2565b600254610278906001600160a01b031681565b6103c66103c13660046134fa565b611765565b6040516102499594939291906137a7565b61037f6103e536600461352a565b61186a565b6103136103f83660046135af565b6000828152600a602090815260408083206001600160a01b038516845260130190915290205460ff1692915050565b600454610278906001600160a01b031681565b61023f611900565b61023f6104503660046132a8565b6001600160a01b03166000908152600c602052604090205490565b61047e61047936600461352a565b611999565b6040516102499190613843565b61023f60065481565b61023f6104a236600461352a565b611a21565b61023f60075481565b600554610278906001600160a01b031681565b61021d6104d13660046135de565b611aa5565b6102786104e436600461352a565b612082565b60065461023f565b6102d66104ff36600461352a565b612106565b6105176105123660046134fa565b6122c2565b60408051938452602084019290925290820152606001610249565b61021d6105403660046134fa565b612392565b600354610278906001600160a01b031681565b61056b61056636600461354b565b612b71565b60405161024992919061371f565b60005b8351811015610617576106058482815181106105a857634e487b7160e01b600052603260045260246000fd5b60200260200101518483815181106105d057634e487b7160e01b600052603260045260246000fd5b60200260200101518484815181106105f857634e487b7160e01b600052603260045260246000fd5b6020026020010151611aa5565b8061060f81613b08565b91505061057c565b50505050565b6001546001600160a01b03161561063357600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60025460405163703e2a4360e11b815260048101849052602481018390526000916001600160a01b03169063e07c54869060440160206040518083038186803b1580156106a157600080fd5b505afa1580156106b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d991906132c4565b90506001600160a01b0381166107415760405162461bcd60e51b815260206004820152602260248201527f6e6f2076616c75652065786973747320617420676976656e2074696d6573746160448201526106d760f41b60648201526084015b60405180910390fd5b6040805160208082018690528183018590528251808303840181526060909201909252805191012060065460009061077a906001613917565b6000838152600b60209081526040808320805460018082018355828652848620909101869055858552600a8452828520600885528386208c81558083018c9055600380820180546001600160a01b0319166001600160a01b038e169081179091558b845560128401805475ffffffffffffffffffffffffffffffffffffffff0000191633620100000217905543918401919091554260028401558454838501558752600d8652938620805492830181558652938520018590559394509091610840611900565b845490915060011415610b4b5761a8c061085a8942613a79565b106108c25760405162461bcd60e51b815260206004820152603260248201527f44697370757465206d75737420626520737461727465642077697468696e207260448201527165706f7274696e67206c6f636b2074696d6560701b6064820152608401610738565b60008981526009602052604081208054916108dc83613b08565b90915550506000898152600960205260409020546004101561098557600260009054906101000a90046001600160a01b03166001600160a01b031663722580b66040518163ffffffff1660e01b815260040160206040518083038186803b15801561094657600080fd5b505afa15801561095a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097e9190613512565b90506109b8565b6000898152600960205260409020546109a090600190613a79565b6109ab90600261398c565b6109b59082613a5a565b90505b60025460405163137f0a8d60e21b81526001600160a01b03898116600483015230602483015290911690634dfc2a3490604401602060405180830381600087803b158015610a0557600080fd5b505af1158015610a19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3d9190613512565b60048381019190915560025460405163c5958af960e01b81529182018b9052602482018a90526001600160a01b03169063c5958af99060440160006040518083038186803b158015610a8e57600080fd5b505afa158015610aa2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610aca919081019061357c565b8051610ae0916002850191602090910190613093565b506002546040516316d7b73f60e21b8152600481018b9052602481018a90526001600160a01b0390911690635b5edcfc90604401600060405180830381600087803b158015610b2e57600080fd5b505af1158015610b42573d6000803e3d6000fd5b50505050610d79565b83546000908590610b5e90600290613a79565b81548110610b7c57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905062015180600a60008381526020019081526020016000206005015442610baf9190613a79565b10610c135760405162461bcd60e51b815260206004820152602e60248201527f4e6577206469737075746520726f756e64206d7573742062652073746172746560448201526d642077697468696e20612064617960901b6064820152608401610738565b845460041015610caa57600260009054906101000a90046001600160a01b03166001600160a01b031663722580b66040518163ffffffff1660e01b815260040160206040518083038186803b158015610c6b57600080fd5b505afa158015610c7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca39190613512565b9150610cd0565b8454610cb890600190613a79565b610cc390600261398c565b610ccd9083613a5a565b91505b6008600086600081548110610cf557634e487b7160e01b600052603260045260246000fd5b906000526020600020015481526020019081526020016000206004015483600401819055506008600086600081548110610d3f57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154815260200190815260200160002060020183600201908054610d6b90613ad3565b610d76929190613117565b50505b6004830181905560068054906000610d9083613b08565b90915550506003546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd90606401602060405180830381600087803b158015610de757600080fd5b505af1158015610dfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1f9190613459565b610e5e5760405162461bcd60e51b815260206004820152601060248201526f119959481b5d5cdd081899481c185a5960821b6044820152606401610738565b60408051868152602081018b90529081018990526001600160a01b03881660608201527f12b7317353cd7caa8eae8057464e3de356c1429d814fb3421797eccb19043044906080015b60405180910390a1505050505050505050565b6000818152600b6020908152604091829020805483518184028101840190945280845260609392830182828015610f1057602002820191906000526020600020905b815481526020019060010190808311610efc575b50505050509050919050565b60008054604051632944908560e01b8152600481018590526024810184905282916001600160a01b031690632944908590604401604080518083038186803b158015610f6757600080fd5b505afa158015610f7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9f91906134cd565b915091505b9250929050565b600080546040516344e87f9160e01b815260048101859052602481018490526001600160a01b03909116906344e87f919060440160206040518083038186803b158015610ff757600080fd5b505afa15801561100b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102f9190613459565b9392505050565b6000818152600a602052604090206005810154156110965760405162461bcd60e51b815260206004820152601d60248201527f566f74652068617320616c7265616479206265656e2074616c6c6965640000006044820152606401610738565b60065482111580156110a85750600082115b6110ea5760405162461bcd60e51b8152602060048201526013602482015272159bdd1948191bd95cc81b9bdd08195e1a5cdd606a1b6044820152606401610738565b60018101546110fc9062015180613a5a565b600282015461110b9042613a79565b10158061112a57506207e9008160020154426111279190613a79565b10155b6111765760405162461bcd60e51b815260206004820152601f60248201527f54696d6520666f7220766f74696e6720686173206e6f7420656c6170736564006044820152606401610738565b6008810154600782015460068301546000929161119291613917565b61119c9190613917565b600e830154600d840154600c8501549293506000926111bb9190613917565b6111c59190613917565b60118401546010850154600f8601549293506000926111e49190613917565b6111ee9190613917565b600b850154600a860154600987015492935060009261120d9190613917565b6112179190613917565b90508361122c578361122881613b08565b9450505b8261123f578261123b81613b08565b9350505b81611252578161124e81613b08565b9250505b80611265578061126181613b08565b9150505b6009850154600090829061128190670de0b6b3a7640000613a5a565b61128b919061392f565b600f87015484906112a490670de0b6b3a7640000613a5a565b6112ae919061392f565b600c88015486906112c790670de0b6b3a7640000613a5a565b6112d1919061392f565b600689015488906112ea90670de0b6b3a7640000613a5a565b6112f4919061392f565b6112fe9190613917565b6113089190613917565b6113129190613917565b90506000828760090160010154670de0b6b3a76400006113329190613a5a565b61133c919061392f565b6010880154859061135590670de0b6b3a7640000613a5a565b61135f919061392f565b600d890154879061137890670de0b6b3a7640000613a5a565b611382919061392f565b60078a0154899061139b90670de0b6b3a7640000613a5a565b6113a5919061392f565b6113af9190613917565b6113b99190613917565b6113c39190613917565b90506000838860090160020154670de0b6b3a76400006113e39190613a5a565b6113ed919061392f565b6011890154869061140690670de0b6b3a7640000613a5a565b611410919061392f565b600e8a0154889061142990670de0b6b3a7640000613a5a565b611433919061392f565b60088b01548a9061144c90670de0b6b3a7640000613a5a565b611456919061392f565b6114609190613917565b61146a9190613917565b6114749190613917565b90506114808183613917565b8311156114a5576012880180546001919061ff001916610100835b02179055506114e0565b6114af8184613917565b8211156114ce576012880180546000919061ff0019166101008361149b565b60128801805461ff0019166102001790555b426005890155601288015460008a815260086020526040908190206003015490517fa2d4e500801849d40ad00f0f12ba92a5263f83ec68946e647be95cfbe581c7b692610ea7928d9260ff610100840416926001600160a01b0362010000909104811692169061388c565b6001600160a01b0381166000908152600d6020908152604091829020805483518184028101840190945280845260609392830182828015610f105760200282019190600052602060002090815481526020019060010190808311610efc5750505050509050919050565b6000818152600860205260408120805460018201546003830154600284018054869560609587959194909391926001600160a01b039091169082906115f990613ad3565b80601f016020809104026020016040519081016040528092919081815260200182805461162590613ad3565b80156116725780601f1061164757610100808354040283529160200191611672565b820191906000526020600020905b81548152906001019060200180831161165557829003601f168201915b505050505091509450945094509450509193509193565b6060600080600061169a8686612106565b91509150816116c15760006040518060200160405280600081525090935093505050610fa4565b6116cb8682611a21565b92506116d78684611999565b935050509250929050565b600080546040516377b03e0d60e01b8152600481018490526001600160a01b03909116906377b03e0d9060240160206040518083038186803b15801561172757600080fd5b505afa15801561173b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061175f9190613512565b92915050565b600061176f613192565b50506000908152600a60208181526040928390208054845161022081018652600183015481526002830154938101939093526003820154948301949094526004810154606083015260058101546080830152600681015460a0830152600781015460c0830152600881015460e083015260098101546101008084019190915292810154610120830152600b810154610140830152600c810154610160830152600d810154610180830152600e8101546101a0830152600f8101546101c083015260108101546101e08301526011810154610200830152601201549293909260ff8082169382041691620100009091046001600160a01b031690565b6000805460405163a792765f60e01b81526004810185905260248101849052606092916001600160a01b03169063a792765f9060440160006040518083038186803b1580156118b857600080fd5b505afa1580156118cc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526118f49190810190613475565b90969095509350505050565b6000600a600260009054906101000a90046001600160a01b03166001600160a01b031663722580b66040518163ffffffff1660e01b815260040160206040518083038186803b15801561195257600080fd5b505afa158015611966573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061198a9190613512565b611994919061392f565b905090565b60005460405163c5958af960e01b815260048101849052602481018390526060916001600160a01b03169063c5958af99060440160006040518083038186803b1580156119e557600080fd5b505afa1580156119f9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261102f919081019061357c565b6000805460405163ce5e11bf60e01b815260048101859052602481018490526001600160a01b039091169063ce5e11bf9060440160206040518083038186803b158015611a6d57600080fd5b505afa158015611a81573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102f9190613512565b6006548311158015611ab75750600083115b611af95760405162461bcd60e51b8152602060048201526013602482015272159bdd1948191bd95cc81b9bdd08195e1a5cdd606a1b6044820152606401610738565b6000838152600a60205260409020600581015415611b595760405162461bcd60e51b815260206004820152601d60248201527f566f74652068617320616c7265616479206265656e2074616c6c6965640000006044820152606401610738565b33600090815260138201602052604090205460ff1615611bbb5760405162461bcd60e51b815260206004820152601860248201527f53656e6465722068617320616c726561647920766f74656400000000000000006044820152606401610738565b336000818152601383016020526040808220805460ff1916600117905560035490516370a0823160e01b8152600481019390935290916001600160a01b03909116906370a082319060240160206040518083038186803b158015611c1e57600080fd5b505afa158015611c32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c569190613512565b600254604051630733bdef60e41b815233600482015291925060009182916001600160a01b03169063733bdef0906024016101006040518083038186803b158015611ca057600080fd5b505afa158015611cb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cd8919061361f565b505050505092509250508082611cee9190613917565b611cf89084613917565b92508415611e095782846006016002016000828254611d179190613917565b9091555050600254604051631c3c149f60e11b81523360048201526001600160a01b0390911690633878293e9060240160206040518083038186803b158015611d5f57600080fd5b505afa158015611d73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d979190613512565b600e85018054600090611dab908490613917565b90915550611dba905033612ed0565b600b85018054600090611dce908490613917565b90915550506005546001600160a01b0316331415611e0457600184600f016002016000828254611dfe9190613917565b90915550505b612011565b8515611f0d5782846006016000016000828254611e269190613917565b9091555050600254604051631c3c149f60e11b81523360048201526001600160a01b0390911690633878293e9060240160206040518083038186803b158015611e6e57600080fd5b505afa158015611e82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea69190613512565b600c85018054600090611eba908490613917565b90915550611ec9905033612ed0565b600985018054600090611edd908490613917565b90915550506005546001600160a01b0316331415611e0457600184600f016000016000828254611dfe9190613917565b82846006016001016000828254611f249190613917565b9091555050600254604051631c3c149f60e11b81523360048201526001600160a01b0390911690633878293e9060240160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa49190613512565b600d85018054600090611fb8908490613917565b90915550611fc7905033612ed0565b600a85018054600090611fdb908490613917565b90915550506005546001600160a01b031633141561201157600184600f01600101600082825461200b9190613917565b90915550505b336000908152600c6020526040812080549161202c83613b08565b90915550506040805188815287151560208201523381830152861515606082015290517fbe6f1c58cc15c8e86d6f0ef23c5a30eb33319af3b57f6b7d9b56ccfa87696b849181900360800190a150505050505050565b6000805460405163703e2a4360e11b815260048101859052602481018490526001600160a01b039091169063e07c54869060440160206040518083038186803b1580156120ce57600080fd5b505afa1580156120e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102f91906132c4565b6000806000612114856116e2565b905080612128576000809250925050610fa4565b8061213281613abc565b91506001905060008083816121478a83611a21565b90508881116121625760008097509750505050505050610fa4565b61216c8a84611a21565b90508881111561217b57600094505b841561222d57600261218d8484613917565b612197919061392f565b93506121a38a85611a21565b9050888111156121e45760006121be8b6104a2600188613a79565b90508981116121d057600095506121de565b6121db600186613a79565b92505b50612228565b60006121f58b6104a2876001613917565b90508981111561221857600095508461220d81613b08565b955050809150612226565b612223856001613917565b93505b505b61217b565b6122378a82610fab565b61224d5760018497509750505050505050610fa4565b6122578a82610fab565b801561226257508584105b15612285578361227181613b08565b94505061227e8a85611a21565b905061224d565b858414801561229957506122998a82610fab565b156122b05760008097509750505050505050610fa4565b60018497509750505050505050610fa4565b6001546040516387a475fd60e01b8152600481018390526000918291829182916001600160a01b03909116906387a475fd9060240160206040518083038186803b15801561230f57600080fd5b505afa158015612323573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123479190613512565b9050606061235a826103e5426001613917565b945090508361237657600080610194945094509450505061238b565b60006123818261302e565b955060c893505050505b9193909250565b6000818152600a6020526040902060065482118015906123b25750600082115b6123fe5760405162461bcd60e51b815260206004820152601860248201527f44697370757465204944206d7573742062652076616c696400000000000000006044820152606401610738565b601281015460ff16156124535760405162461bcd60e51b815260206004820152601e60248201527f566f74652068617320616c7265616479206265656e20657865637574656400006044820152606401610738565b60008160050154116124a75760405162461bcd60e51b815260206004820152601460248201527f566f7465206d7573742062652074616c6c6965640000000000000000000000006044820152606401610738565b600181015481546000908152600b60205260409020541461250a5760405162461bcd60e51b815260206004820152601660248201527f4d757374206265207468652066696e616c20766f7465000000000000000000006044820152606401610738565b6201518081600501544261251e9190613a79565b10156125885760405162461bcd60e51b815260206004820152603360248201527f31206461792068617320746f20706173732061667465722074616c6c7920746f60448201527220616c6c6f7720666f7220646973707574657360681b6064820152608401610738565b60128101805460ff1916600117905560008281526008602090815260408083208054845260099092528220805491926125c083613abc565b90915550600090508060016012850154610100900460ff1660028111156125f757634e487b7160e01b600052602160045260246000fd5b14156127c15783546000908152600b602052604090205491505b81156127bc5783546000908152600b60205260409020612632600184613a79565b8154811061265057634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050600a60008281526020019081526020016000209350816001141561271357600354601285015460048581015460405163a9059cbb60e01b81526001600160a01b0362010000909404841692810192909252602482015291169063a9059cbb90604401602060405180830381600087803b1580156126d957600080fd5b505af11580156126ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127119190613459565b505b600354601285015460048087015460405163a9059cbb60e01b81526001600160a01b0362010000909404841692810192909252602482015291169063a9059cbb90604401602060405180830381600087803b15801561277157600080fd5b505af1158015612785573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127a99190613459565b50816127b481613abc565b925050612611565b612b16565b60026012850154610100900460ff1660028111156127ef57634e487b7160e01b600052602160045260246000fd5b14156129ab5783546000908152600b602052604090205491505b81156129155783546000908152600b6020526040902061282a600184613a79565b8154811061284857634e487b7160e01b600052603260045260246000fd5b600091825260208083209190910154808352600a9091526040918290206003546012820154600480840154955163a9059cbb60e01b81526001600160a01b03620100009093048316918101919091526024810195909552919750919350169063a9059cbb90604401602060405180830381600087803b1580156128ca57600080fd5b505af11580156128de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129029190613459565b508161290d81613abc565b925050612809565b600380549084015460048086015460405163a9059cbb60e01b81526001600160a01b0393841692810192909252602482015291169063a9059cbb90604401602060405180830381600087803b15801561296d57600080fd5b505af1158015612981573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129a59190613459565b50612b16565b60006012850154610100900460ff1660028111156129d957634e487b7160e01b600052602160045260246000fd5b1415612b165783546000908152600b602052604081205492505b8215612a785784546000908152600b60205260409020612a14600185613a79565b81548110612a3257634e487b7160e01b600052603260045260246000fd5b90600052602060002001549150600a60008381526020019081526020016000209450846004015481612a649190613917565b905082612a7081613abc565b9350506129f3565b6004840154612a879082613917565b600380549086015460405163a9059cbb60e01b81526001600160a01b03918216600482015260248101849052929350169063a9059cbb90604401602060405180830381600087803b158015612adb57600080fd5b505af1158015612aef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b139190613459565b50505b6000858152600a6020526040908190206012015490517f40d231bf91823121de9e1c012d95f835ea5684dc1d93360d9510a30543345da491612b62918891610100900460ff1690613878565b60405180910390a15050505050565b606080600080612b85886104ff888a613a79565b9150915081612bd6576040805160008082526020820190925290612bb9565b6060815260200190600190039081612ba45790505b506040805160008152602081019091529094509250612ec7915050565b6000612be28989610f1c565b909350905082612c35576040805160008082526020820190925290612c17565b6060815260200190600190039081612c025790505b506040805160008152602081019091529095509350612ec792505050565b60008060008867ffffffffffffffff811115612c6157634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015612c8a578160200160208202803683370190505b5090505b8883108015612cb157508482612ca5866001613917565b612caf9190613a79565b115b15612d23576000612cc68d6104a28588613a79565b9050612cd28d82610fab565b612d105780828581518110612cf757634e487b7160e01b600052603260045260246000fd5b602090810291909101015283612d0c81613b08565b9450505b82612d1a81613b08565b93505050612c8e565b60008367ffffffffffffffff811115612d4c57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015612d7f57816020015b6060815260200190600190039081612d6a5790505b50905060008467ffffffffffffffff811115612dab57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015612dd4578160200160208202803683370190505b50905060005b85811015612eba578381612def600189613a79565b612df99190613a79565b81518110612e1757634e487b7160e01b600052603260045260246000fd5b6020026020010151828281518110612e3f57634e487b7160e01b600052603260045260246000fd5b602002602001018181525050612e7c8f838381518110612e6f57634e487b7160e01b600052603260045260246000fd5b6020026020010151611999565b838281518110612e9c57634e487b7160e01b600052603260045260246000fd5b60200260200101819052508080612eb290613b08565b915050612dda565b5090985096505050505050505b94509492505050565b6000806000612ee960075461a8c0426103e59190613a79565b9092509050801561302757600082806020019051810190612f0a91906132e0565b905060005b815181101561302457600080838381518110612f3b57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b031688604051602401612f6c91906001600160a01b0391909116815260200190565b60408051601f198184030181529181526020820180516001600160e01b03166345d6082360e01b17905251612fa19190613703565b6000604051808303816000865af19150503d8060008114612fde576040519150601f19603f3d011682016040523d82523d6000602084013e612fe3565b606091505b5091509150811561300f57808060200190518101906130029190613512565b61300c9088613917565b96505b5050808061301c90613b08565b915050612f0f565b50505b5050919050565b6000805b825181101561308d5782818151811061305b57634e487b7160e01b600052603260045260246000fd5b016020015160f81c61306f83610100613a5a565b6130799190613917565b91508061308581613b08565b915050613032565b50919050565b82805461309f90613ad3565b90600052602060002090601f0160209004810192826130c15760008555613107565b82601f106130da57805160ff1916838001178555613107565b82800160010185558215613107579182015b828111156131075782518255916020019190600101906130ec565b506131139291506131b1565b5090565b82805461312390613ad3565b90600052602060002090601f0160209004810192826131455760008555613107565b82601f106131565780548555613107565b8280016001018555821561310757600052602060002091601f016020900482015b82811115613107578254825591600101919060010190613177565b6040518061022001604052806011906020820280368337509192915050565b5b8082111561311357600081556001016131b2565b600082601f8301126131d6578081fd5b813560206131eb6131e6836138f3565b6138c2565b80838252828201915082860187848660051b890101111561320a578586fd5b855b8581101561323157813561321f81613b67565b8452928401929084019060010161320c565b5090979650505050505050565b600082601f83011261324e578081fd5b815167ffffffffffffffff81111561326857613268613b39565b61327b601f8201601f19166020016138c2565b81815284602083860101111561328f578283fd5b6132a0826020830160208701613a90565b949350505050565b6000602082840312156132b9578081fd5b813561102f81613b4f565b6000602082840312156132d5578081fd5b815161102f81613b4f565b600060208083850312156132f2578182fd5b825167ffffffffffffffff811115613308578283fd5b8301601f81018513613318578283fd5b80516133266131e6826138f3565b80828252848201915084840188868560051b8701011115613345578687fd5b8694505b8385101561337057805161335c81613b4f565b835260019490940193918501918501613349565b50979650505050505050565b600080600060608486031215613390578182fd5b833567ffffffffffffffff808211156133a7578384fd5b818601915086601f8301126133ba578384fd5b813560206133ca6131e6836138f3565b8083825282820191508286018b848660051b89010111156133e9578889fd5b8896505b8487101561340b5780358352600196909601959183019183016133ed565b5097505087013592505080821115613421578384fd5b61342d878388016131c6565b93506040860135915080821115613442578283fd5b5061344f868287016131c6565b9150509250925092565b60006020828403121561346a578081fd5b815161102f81613b67565b600080600060608486031215613489578283fd5b835161349481613b67565b602085015190935067ffffffffffffffff8111156134b0578283fd5b6134bc8682870161323e565b925050604084015190509250925092565b600080604083850312156134df578182fd5b82516134ea81613b67565b6020939093015192949293505050565b60006020828403121561350b578081fd5b5035919050565b600060208284031215613523578081fd5b5051919050565b6000806040838503121561353c578182fd5b50508035926020909101359150565b60008060008060808587031215613560578182fd5b5050823594602084013594506040840135936060013592509050565b60006020828403121561358d578081fd5b815167ffffffffffffffff8111156135a3578182fd5b6132a08482850161323e565b600080604083850312156135c1578182fd5b8235915060208301356135d381613b4f565b809150509250929050565b6000806000606084860312156135f2578081fd5b83359250602084013561360481613b67565b9150604084013561361481613b67565b809150509250925092565b600080600080600080600080610100898b03121561363b578586fd5b505086516020880151604089015160608a015160808b015160a08c015160c08d015160e0909d0151959e949d50929b919a50985090965094509092509050565b6000815180845260208085019450808401835b838110156136aa5781518752958201959082019060010161368e565b509495945050505050565b600081518084526136cd816020860160208601613a90565b601f01601f19169290920160200192915050565b600381106136ff57634e487b7160e01b600052602160045260246000fd5b9052565b60008251613715818460208701613a90565b9190910192915050565b6000604082016040835280855180835260608501915060608160051b86010192506020808801855b8381101561377557605f198887030185526137638683516136b5565b95509382019390820190600101613747565b50508584038187015250505061378b818561367b565b95945050505050565b60006020825261102f602083018461367b565b8581526102a0810160208083018760005b60118110156137d5578151835291830191908301906001016137b8565b505050508415156102408301526137f06102608301856136e1565b6001600160a01b0383166102808301529695505050505050565b60008582528460208301526080604083015261382960808301856136b5565b90506001600160a01b038316606083015295945050505050565b60006020825261102f60208301846136b5565b60006040825261386960408301856136b5565b90508260208301529392505050565b8281526040810161102f60208301846136e1565b848152608081016138a060208301866136e1565b6001600160a01b03808516604084015280841660608401525095945050505050565b604051601f8201601f1916810167ffffffffffffffff811182821017156138eb576138eb613b39565b604052919050565b600067ffffffffffffffff82111561390d5761390d613b39565b5060051b60200190565b6000821982111561392a5761392a613b23565b500190565b60008261394a57634e487b7160e01b81526012600452602481fd5b500490565b80825b60018086116139615750612ec7565b81870482111561397357613973613b23565b8086161561398057918102915b9490941c938002613952565b600061102f60001984846000826139a55750600161102f565b816139b25750600061102f565b81600181146139c857600281146139d2576139ff565b600191505061102f565b60ff8411156139e3576139e3613b23565b6001841b9150848211156139f9576139f9613b23565b5061102f565b5060208310610133831016604e8410600b8410161715613a32575081810a83811115613a2d57613a2d613b23565b61102f565b613a3f848484600161394f565b808604821115613a5157613a51613b23565b02949350505050565b6000816000190483118215151615613a7457613a74613b23565b500290565b600082821015613a8b57613a8b613b23565b500390565b60005b83811015613aab578181015183820152602001613a93565b838111156106175750506000910152565b600081613acb57613acb613b23565b506000190190565b600181811c90821680613ae757607f821691505b6020821081141561308d57634e487b7160e01b600052602260045260246000fd5b6000600019821415613b1c57613b1c613b23565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114613b6457600080fd5b50565b8015158114613b6457600080fdfea2646970667358221220d430664f5f63987d8c7e884d4eda4cc1876f1977aa1fea560434b0fb9ca3dfe564736f6c63430008030033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000008cfc184c877154a8f9ffe0fe75649dbe5e2dbebf000000000000000000000000d57aa8f0ccb32a33ab9fe4e4a5f425c343733f7c
-----Decoded View---------------
Arg [0] : _tellor (address): 0x8cFc184c877154a8F9ffE0fe75649dbe5e2DBEbf
Arg [1] : _teamMultisig (address): 0xd57Aa8f0Ccb32a33Ab9Fe4e4a5f425c343733f7c
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000008cfc184c877154a8f9ffe0fe75649dbe5e2dbebf
Arg [1] : 000000000000000000000000d57aa8f0ccb32a33ab9fe4e4a5f425c343733f7c
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| ETH | 100.00% | $20.79 | 10.313 | $214.41 |
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.