Contract 0xe12e73c06f983ffd535840033973a1b382fc8df8

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xad89a3cf248498478f8e88d304154e3d61dcb2388351d4c87fc84ed834aa35b8Submit220381022022-08-30 20:08:1690 days 1 hr ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.00009748197 ETH
0xc9370bb39bb305a0b178015d4b291cb8b1b4822d0b53fdb0f302f468b6106339Submit219510702022-08-30 8:07:3590 days 13 hrs ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000088984759 ETH
0x63074bff6e5bbd41d01595a5d93227f387482fce6fbe00fb7269acbcca0b3909Submit219068472022-08-29 22:59:4490 days 22 hrs ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000103418328 ETH
0x93dda58a916cab2d8f829ad2806e45c1bc7927b9d83f886ed1b067953ec44a1cSubmit218957112022-08-29 20:08:1991 days 1 hr ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000111391487 ETH
0xb2685d7654b32737e464b9654e2926e8838b84c56e07d84dd73d45b03c60003eSubmit218130882022-08-29 8:07:3291 days 13 hrs ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000076709506 ETH
0xca4449825f43d65ad10d9c2fb6075effa7987f1aec67d708a16ee9d95992fc94Submit217620172022-08-28 22:58:2291 days 22 hrs ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000048777308 ETH
0x5106cf222e7e58e1ffd90efdd2d415cb8bdce097c25f6f10bf26cdebf80e25ceSubmit217477502022-08-28 20:07:5392 days 1 hr ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000050614421 ETH
0xf22d39bc9cd999a372940f2361c58aed53eb49d2785c8d28917271773abb7e5cSubmit216586802022-08-28 8:07:4992 days 13 hrs ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000039669975 ETH
0xa3828c95248f271270202f2fbb11104af2b526ff457e4b14f45cbaa3b0699ca5Submit215872952022-08-27 20:08:0893 days 1 hr ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000058927507 ETH
0xdfd8cfa052b2874735f1a4fb2ff5ef03633441d3f0315f920d5d2f84a33bfdcbSubmit214628312022-08-26 22:59:0293 days 22 hrs ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000104479365 ETH
0x71a2657eb29231523c8169e3c5229ef4560039846a73dd4653ef9f5effd5aa20Submit214515792022-08-26 20:07:2794 days 1 hr ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000120131854 ETH
0x56ee1813d27f45b2fc05033404316fcb33fae4976f1f3b964d1e6afbf08b1bbcSubmit212253932022-08-25 8:07:4895 days 13 hrs ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000065878583 ETH
0x42df8a24607976a3de313c721ee526ed6c0cd0ff5800375d63bc8ee6c6bf7444Submit211927532022-08-24 22:58:2995 days 22 hrs ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000077989426 ETH
0x949867e39c25cba4ee3f5a11c9c5c24e4576431c9be8d6ac924ce62ebb632594Submit211841442022-08-24 20:08:2296 days 1 hr ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000075876232 ETH
0xd989521682a3dba9a6e47ea10b156a7627da50ab8ab75720c4f2f2354fcb8c29Submit211311232022-08-24 8:07:3696 days 13 hrs ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000058993597 ETH
0x83e86a3d07e59a58df99f0f1a5e73d19b7a1637ae3a35c3329e998a12862058dSubmit210441992022-08-23 10:57:5597 days 10 hrs ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000067436572 ETH
0x0dc7eb72e0b7800ff86b35018893ef8551da2be6c1ebf802a1c0169e01a7a6f7Submit210009942022-08-22 22:58:2097 days 22 hrs ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000093712424 ETH
0x9e5618862d5876f6a3d70fe7a9b10bd710d022a07fc37d1ab07677a63e8cd033Submit210009322022-08-22 22:58:2097 days 22 hrs ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.0000937052 ETH
0x4aac915576539f023e1cfa0cc78238fae39b4a9e0188d404a9067e2247ecfc1fSubmit209539422022-08-22 10:57:5198 days 10 hrs ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000048052339 ETH
0x23438eb88a11d3826fa26568f654c64674293d491bd97c96646e1da6a82a3982Submit208206782022-08-20 22:59:1399 days 22 hrs ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000075591089 ETH
0x89b1a20c2537295ef6605d8a45f10b4d77be2b485a55daf9c4a43ca8a70b0548Submit208206292022-08-20 22:57:1499 days 22 hrs ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000075783616 ETH
0x17f8276cd065c410b513a2414b7333abb105ec29c586224fc5b4a4bb0792f7c2Submit207723592022-08-20 10:58:27100 days 10 hrs ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.00006122509 ETH
0x64573535900a959f99811836593fb07afc990c5a6eb84bf1a491b1bc94700e0eSubmit207310912022-08-19 23:00:09100 days 22 hrs ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000083726644 ETH
0x1f4a7da80d973a73ad27e19cca7a2bc28ba20078bff4831042e37b13d79b2a24Submit207309352022-08-19 22:57:40100 days 22 hrs ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000083301717 ETH
0xf15458ce6bc6a53e783a9ac9292bdf1f7be29b62d9de7dd6b437223d9b3b5b3eSubmit206775502022-08-19 10:58:14101 days 10 hrs ago0x746d1bc4aae7b76d3431c0441cdf9bf160e34c4e IN  0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH0.000072235594 ETH
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x9c48374dfd520c75f604897d35e1c330a8bc188d931378781ec291772f9c1f22418869412022-11-28 13:21:088 hrs 27 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x53a9c9618443a24286673502fb46eb5a3eb5e2ac81f8dada19ea61e740f1d087418724882022-11-28 12:12:059 hrs 36 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x53a9c9618443a24286673502fb46eb5a3eb5e2ac81f8dada19ea61e740f1d087418724882022-11-28 12:12:059 hrs 36 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x53a9c9618443a24286673502fb46eb5a3eb5e2ac81f8dada19ea61e740f1d087418724882022-11-28 12:12:059 hrs 36 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x53a9c9618443a24286673502fb46eb5a3eb5e2ac81f8dada19ea61e740f1d087418724882022-11-28 12:12:059 hrs 36 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x53a9c9618443a24286673502fb46eb5a3eb5e2ac81f8dada19ea61e740f1d087418724882022-11-28 12:12:059 hrs 36 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x684d02b71cacde4285a2968ce90909f4fb09ae4792b7f8d0a6b519aa885ea35d418721792022-11-28 12:10:359 hrs 38 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x684d02b71cacde4285a2968ce90909f4fb09ae4792b7f8d0a6b519aa885ea35d418721792022-11-28 12:10:359 hrs 38 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x684d02b71cacde4285a2968ce90909f4fb09ae4792b7f8d0a6b519aa885ea35d418721792022-11-28 12:10:359 hrs 38 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x684d02b71cacde4285a2968ce90909f4fb09ae4792b7f8d0a6b519aa885ea35d418721792022-11-28 12:10:359 hrs 38 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x684d02b71cacde4285a2968ce90909f4fb09ae4792b7f8d0a6b519aa885ea35d418721792022-11-28 12:10:359 hrs 38 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x684d02b71cacde4285a2968ce90909f4fb09ae4792b7f8d0a6b519aa885ea35d418721792022-11-28 12:10:359 hrs 38 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x684d02b71cacde4285a2968ce90909f4fb09ae4792b7f8d0a6b519aa885ea35d418721792022-11-28 12:10:359 hrs 38 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x684d02b71cacde4285a2968ce90909f4fb09ae4792b7f8d0a6b519aa885ea35d418721792022-11-28 12:10:359 hrs 38 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x684d02b71cacde4285a2968ce90909f4fb09ae4792b7f8d0a6b519aa885ea35d418721792022-11-28 12:10:359 hrs 38 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x684d02b71cacde4285a2968ce90909f4fb09ae4792b7f8d0a6b519aa885ea35d418721792022-11-28 12:10:359 hrs 38 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x728db9ea1541dfecac665752c4c1ffba1e0f77a5fe87b01c4c4c771c1f24740f418705472022-11-28 12:02:369 hrs 46 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x6abe31e3c8380abb94f4e3d5bbd6a8b4eb50ba38356d19cd7142f6a6aa174f7d418685872022-11-28 11:52:339 hrs 56 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x6abe31e3c8380abb94f4e3d5bbd6a8b4eb50ba38356d19cd7142f6a6aa174f7d418685872022-11-28 11:52:339 hrs 56 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x6abe31e3c8380abb94f4e3d5bbd6a8b4eb50ba38356d19cd7142f6a6aa174f7d418685872022-11-28 11:52:339 hrs 56 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x6abe31e3c8380abb94f4e3d5bbd6a8b4eb50ba38356d19cd7142f6a6aa174f7d418685872022-11-28 11:52:339 hrs 56 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x6abe31e3c8380abb94f4e3d5bbd6a8b4eb50ba38356d19cd7142f6a6aa174f7d418685872022-11-28 11:52:339 hrs 56 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x6abe31e3c8380abb94f4e3d5bbd6a8b4eb50ba38356d19cd7142f6a6aa174f7d418685872022-11-28 11:52:339 hrs 56 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x6abe31e3c8380abb94f4e3d5bbd6a8b4eb50ba38356d19cd7142f6a6aa174f7d418685872022-11-28 11:52:339 hrs 56 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x6abe31e3c8380abb94f4e3d5bbd6a8b4eb50ba38356d19cd7142f6a6aa174f7d418685872022-11-28 11:52:339 hrs 56 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FluxAggregator

Compiler Version
v0.6.6+commit.6c089d02

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 13 : FluxAggregator.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.6;

import "./Median.sol";
import "./Owned.sol";
import "./SafeMath128.sol";
import "./SafeMath32.sol";
import "./SafeMath64.sol";
import "./interfaces/AggregatorV2V3Interface.sol";
import "./interfaces/AggregatorValidatorInterface.sol";
import "./interfaces/LinkTokenInterface.sol";
import "./vendor/SafeMathChainlink.sol";

/**
 * @title The Prepaid Aggregator contract
 * @notice Handles aggregating data pushed in from off-chain, and unlocks
 * payment for oracles as they report. Oracles' submissions are gathered in
 * rounds, with each round aggregating the submissions for each oracle into a
 * single answer. The latest aggregated answer is exposed as well as historical
 * answers and their updated at timestamp.
 */
contract FluxAggregator is AggregatorV2V3Interface, Owned {
  using SafeMathChainlink for uint256;
  using SafeMath128 for uint128;
  using SafeMath64 for uint64;
  using SafeMath32 for uint32;

  struct Round {
    int256 answer;
    uint64 startedAt;
    uint64 updatedAt;
    uint32 answeredInRound;
  }

  struct RoundDetails {
    int256[] submissions;
    uint32 maxSubmissions;
    uint32 minSubmissions;
    uint32 timeout;
    uint128 paymentAmount;
  }

  struct OracleStatus {
    uint128 withdrawable;
    uint32 startingRound;
    uint32 endingRound;
    uint32 lastReportedRound;
    uint32 lastStartedRound;
    int256 latestSubmission;
    uint16 index;
    address admin;
    address pendingAdmin;
  }

  struct Requester {
    bool authorized;
    uint32 delay;
    uint32 lastStartedRound;
  }

  struct Funds {
    uint128 available;
    uint128 allocated;
  }

  LinkTokenInterface public linkToken;
  AggregatorValidatorInterface public validator;

  // Round related params
  uint128 public paymentAmount;
  uint32 public maxSubmissionCount;
  uint32 public minSubmissionCount;
  uint32 public restartDelay;
  uint32 public timeout;
  uint8 public override decimals;
  string public override description;

  int256 immutable public minSubmissionValue;
  int256 immutable public maxSubmissionValue;

  uint256 constant public override version = 3;

  /**
   * @notice To ensure owner isn't withdrawing required funds as oracles are
   * submitting updates, we enforce that the contract maintains a minimum
   * reserve of RESERVE_ROUNDS * oracleCount() LINK earmarked for payment to
   * oracles. (Of course, this doesn't prevent the contract from running out of
   * funds without the owner's intervention.)
   */
  uint256 constant private RESERVE_ROUNDS = 2;
  uint256 constant private MAX_ORACLE_COUNT = 77;
  uint32 constant private ROUND_MAX = 2**32-1;
  uint256 private constant VALIDATOR_GAS_LIMIT = 100000;
  // An error specific to the Aggregator V3 Interface, to prevent possible
  // confusion around accidentally reading unset values as reported values.
  string constant private V3_NO_DATA_ERROR = "No data present";

  uint32 private reportingRoundId;
  uint32 internal latestRoundId;
  mapping(address => OracleStatus) private oracles;
  mapping(uint32 => Round) internal rounds;
  mapping(uint32 => RoundDetails) internal details;
  mapping(address => Requester) internal requesters;
  address[] private oracleAddresses;
  Funds private recordedFunds;

  event AvailableFundsUpdated(
    uint256 indexed amount
  );
  event RoundDetailsUpdated(
    uint128 indexed paymentAmount,
    uint32 indexed minSubmissionCount,
    uint32 indexed maxSubmissionCount,
    uint32 restartDelay,
    uint32 timeout // measured in seconds
  );
  event OraclePermissionsUpdated(
    address indexed oracle,
    bool indexed whitelisted
  );
  event OracleAdminUpdated(
    address indexed oracle,
    address indexed newAdmin
  );
  event OracleAdminUpdateRequested(
    address indexed oracle,
    address admin,
    address newAdmin
  );
  event SubmissionReceived(
    int256 indexed submission,
    uint32 indexed round,
    address indexed oracle
  );
  event RequesterPermissionsSet(
    address indexed requester,
    bool authorized,
    uint32 delay
  );
  event ValidatorUpdated(
    address indexed previous,
    address indexed current
  );

  /**
   * @notice set up the aggregator with initial configuration
   * @param _link The address of the LINK token
   * @param _paymentAmount The amount paid of LINK paid to each oracle per submission, in wei (units of 10⁻¹⁸ LINK)
   * @param _timeout is the number of seconds after the previous round that are
   * allowed to lapse before allowing an oracle to skip an unfinished round
   * @param _validator is an optional contract address for validating
   * external validation of answers
   * @param _minSubmissionValue is an immutable check for a lower bound of what
   * submission values are accepted from an oracle
   * @param _maxSubmissionValue is an immutable check for an upper bound of what
   * submission values are accepted from an oracle
   * @param _decimals represents the number of decimals to offset the answer by
   * @param _description a short description of what is being reported
   */
  constructor(
    address _link,
    uint128 _paymentAmount,
    uint32 _timeout,
    address _validator,
    int256 _minSubmissionValue,
    int256 _maxSubmissionValue,
    uint8 _decimals,
    string memory _description
  ) public {
    linkToken = LinkTokenInterface(_link);
    updateFutureRounds(_paymentAmount, 0, 0, 0, _timeout);
    setValidator(_validator);
    minSubmissionValue = _minSubmissionValue;
    maxSubmissionValue = _maxSubmissionValue;
    decimals = _decimals;
    description = _description;
    rounds[0].updatedAt = uint64(block.timestamp.sub(uint256(_timeout)));
  }

  /**
   * @notice called by oracles when they have witnessed a need to update
   * @param _roundId is the ID of the round this submission pertains to
   * @param _submission is the updated data that the oracle is submitting
   */
  function submit(uint256 _roundId, int256 _submission)
    external
  {
    bytes memory error = validateOracleRound(msg.sender, uint32(_roundId));
    require(_submission >= minSubmissionValue, "value below minSubmissionValue");
    require(_submission <= maxSubmissionValue, "value above maxSubmissionValue");
    require(error.length == 0, string(error));

    oracleInitializeNewRound(uint32(_roundId));
    recordSubmission(_submission, uint32(_roundId));
    (bool updated, int256 newAnswer) = updateRoundAnswer(uint32(_roundId));
    payOracle(uint32(_roundId));
    deleteRoundDetails(uint32(_roundId));
    if (updated) {
      validateAnswer(uint32(_roundId), newAnswer);
    }
  }

  /**
   * @notice called by the owner to remove and add new oracles as well as
   * update the round related parameters that pertain to total oracle count
   * @param _removed is the list of addresses for the new Oracles being removed
   * @param _added is the list of addresses for the new Oracles being added
   * @param _addedAdmins is the admin addresses for the new respective _added
   * list. Only this address is allowed to access the respective oracle's funds
   * @param _minSubmissions is the new minimum submission count for each round
   * @param _maxSubmissions is the new maximum submission count for each round
   * @param _restartDelay is the number of rounds an Oracle has to wait before
   * they can initiate a round
   */
  function changeOracles(
    address[] calldata _removed,
    address[] calldata _added,
    address[] calldata _addedAdmins,
    uint32 _minSubmissions,
    uint32 _maxSubmissions,
    uint32 _restartDelay
  )
    external
    onlyOwner()
  {
    for (uint256 i = 0; i < _removed.length; i++) {
      removeOracle(_removed[i]);
    }

    require(_added.length == _addedAdmins.length, "need same oracle and admin count");
    require(uint256(oracleCount()).add(_added.length) <= MAX_ORACLE_COUNT, "max oracles allowed");

    for (uint256 i = 0; i < _added.length; i++) {
      addOracle(_added[i], _addedAdmins[i]);
    }

    updateFutureRounds(paymentAmount, _minSubmissions, _maxSubmissions, _restartDelay, timeout);
  }

  /**
   * @notice update the round and payment related parameters for subsequent
   * rounds
   * @param _paymentAmount is the payment amount for subsequent rounds
   * @param _minSubmissions is the new minimum submission count for each round
   * @param _maxSubmissions is the new maximum submission count for each round
   * @param _restartDelay is the number of rounds an Oracle has to wait before
   * they can initiate a round
   */
  function updateFutureRounds(
    uint128 _paymentAmount,
    uint32 _minSubmissions,
    uint32 _maxSubmissions,
    uint32 _restartDelay,
    uint32 _timeout
  )
    public
    onlyOwner()
  {
    uint32 oracleNum = oracleCount(); // Save on storage reads
    require(_maxSubmissions >= _minSubmissions, "max must equal/exceed min");
    require(oracleNum >= _maxSubmissions, "max cannot exceed total");
    require(oracleNum == 0 || oracleNum > _restartDelay, "delay cannot exceed total");
    require(recordedFunds.available >= requiredReserve(_paymentAmount), "insufficient funds for payment");
    if (oracleCount() > 0) {
      require(_minSubmissions > 0, "min must be greater than 0");
    }

    paymentAmount = _paymentAmount;
    minSubmissionCount = _minSubmissions;
    maxSubmissionCount = _maxSubmissions;
    restartDelay = _restartDelay;
    timeout = _timeout;

    emit RoundDetailsUpdated(
      paymentAmount,
      _minSubmissions,
      _maxSubmissions,
      _restartDelay,
      _timeout
    );
  }

  /**
   * @notice the amount of payment yet to be withdrawn by oracles
   */
  function allocatedFunds()
    external
    view
    returns (uint128)
  {
    return recordedFunds.allocated;
  }

  /**
   * @notice the amount of future funding available to oracles
   */
  function availableFunds()
    external
    view
    returns (uint128)
  {
    return recordedFunds.available;
  }

  /**
   * @notice recalculate the amount of LINK available for payouts
   */
  function updateAvailableFunds()
    public
  {
    Funds memory funds = recordedFunds;

    uint256 nowAvailable = linkToken.balanceOf(address(this)).sub(funds.allocated);

    if (funds.available != nowAvailable) {
      recordedFunds.available = uint128(nowAvailable);
      emit AvailableFundsUpdated(nowAvailable);
    }
  }

  /**
   * @notice returns the number of oracles
   */
  function oracleCount() public view returns (uint8) {
    return uint8(oracleAddresses.length);
  }

  /**
   * @notice returns an array of addresses containing the oracles on contract
   */
  function getOracles() external view returns (address[] memory) {
    return oracleAddresses;
  }

  /**
   * @notice get the most recently reported answer
   *
   * @dev #[deprecated] Use latestRoundData instead. This does not error if no
   * answer has been reached, it will simply return 0. Either wait to point to
   * an already answered Aggregator or use the recommended latestRoundData
   * instead which includes better verification information.
   */
  function latestAnswer()
    public
    view
    virtual
    override
    returns (int256)
  {
    return rounds[latestRoundId].answer;
  }

  /**
   * @notice get the most recent updated at timestamp
   *
   * @dev #[deprecated] Use latestRoundData instead. This does not error if no
   * answer has been reached, it will simply return 0. Either wait to point to
   * an already answered Aggregator or use the recommended latestRoundData
   * instead which includes better verification information.
   */
  function latestTimestamp()
    public
    view
    virtual
    override
    returns (uint256)
  {
    return rounds[latestRoundId].updatedAt;
  }

  /**
   * @notice get the ID of the last updated round
   *
   * @dev #[deprecated] Use latestRoundData instead. This does not error if no
   * answer has been reached, it will simply return 0. Either wait to point to
   * an already answered Aggregator or use the recommended latestRoundData
   * instead which includes better verification information.
   */
  function latestRound()
    public
    view
    virtual
    override
    returns (uint256)
  {
    return latestRoundId;
  }

  /**
   * @notice get past rounds answers
   * @param _roundId the round number to retrieve the answer for
   *
   * @dev #[deprecated] Use getRoundData instead. This does not error if no
   * answer has been reached, it will simply return 0. Either wait to point to
   * an already answered Aggregator or use the recommended getRoundData
   * instead which includes better verification information.
   */
  function getAnswer(uint256 _roundId)
    public
    view
    virtual
    override
    returns (int256)
  {
    if (validRoundId(_roundId)) {
      return rounds[uint32(_roundId)].answer;
    }
    return 0;
  }

  /**
   * @notice get timestamp when an answer was last updated
   * @param _roundId the round number to retrieve the updated timestamp for
   *
   * @dev #[deprecated] Use getRoundData instead. This does not error if no
   * answer has been reached, it will simply return 0. Either wait to point to
   * an already answered Aggregator or use the recommended getRoundData
   * instead which includes better verification information.
   */
  function getTimestamp(uint256 _roundId)
    public
    view
    virtual
    override
    returns (uint256)
  {
    if (validRoundId(_roundId)) {
      return rounds[uint32(_roundId)].updatedAt;
    }
    return 0;
  }

  /**
   * @notice get data about a round. Consumers are encouraged to check
   * that they're receiving fresh data by inspecting the updatedAt and
   * answeredInRound return values.
   * @param _roundId the round ID to retrieve the round data for
   * @return roundId is the round ID for which data was retrieved
   * @return answer is the answer for the given round
   * @return startedAt is the timestamp when the round was started. This is 0
   * if the round hasn't been started yet.
   * @return updatedAt is the timestamp when the round last was updated (i.e.
   * answer was last computed)
   * @return answeredInRound is the round ID of the round in which the answer
   * was computed. answeredInRound may be smaller than roundId when the round
   * timed out. answeredInRound is equal to roundId when the round didn't time out
   * and was completed regularly.
   * @dev Note that for in-progress rounds (i.e. rounds that haven't yet received
   * maxSubmissions) answer and updatedAt may change between queries.
   */
  function getRoundData(uint80 _roundId)
    public
    view
    virtual
    override
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    )
  {
    Round memory r = rounds[uint32(_roundId)];

    require(r.answeredInRound > 0 && validRoundId(_roundId), V3_NO_DATA_ERROR);

    return (
      _roundId,
      r.answer,
      r.startedAt,
      r.updatedAt,
      r.answeredInRound
    );
  }

  /**
   * @notice get data about the latest round. Consumers are encouraged to check
   * that they're receiving fresh data by inspecting the updatedAt and
   * answeredInRound return values. Consumers are encouraged to
   * use this more fully featured method over the "legacy" latestRound/
   * latestAnswer/latestTimestamp functions. Consumers are encouraged to check
   * that they're receiving fresh data by inspecting the updatedAt and
   * answeredInRound return values.
   * @return roundId is the round ID for which data was retrieved
   * @return answer is the answer for the given round
   * @return startedAt is the timestamp when the round was started. This is 0
   * if the round hasn't been started yet.
   * @return updatedAt is the timestamp when the round last was updated (i.e.
   * answer was last computed)
   * @return answeredInRound is the round ID of the round in which the answer
   * was computed. answeredInRound may be smaller than roundId when the round
   * timed out. answeredInRound is equal to roundId when the round didn't time
   * out and was completed regularly.
   * @dev Note that for in-progress rounds (i.e. rounds that haven't yet
   * received maxSubmissions) answer and updatedAt may change between queries.
   */
   function latestRoundData()
    public
    view
    virtual
    override
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    )
  {
    return getRoundData(latestRoundId);
  }


  /**
   * @notice query the available amount of LINK for an oracle to withdraw
   */
  function withdrawablePayment(address _oracle)
    external
    view
    returns (uint256)
  {
    return oracles[_oracle].withdrawable;
  }

  /**
   * @notice transfers the oracle's LINK to another address. Can only be called
   * by the oracle's admin.
   * @param _oracle is the oracle whose LINK is transferred
   * @param _recipient is the address to send the LINK to
   * @param _amount is the amount of LINK to send
   */
  function withdrawPayment(address _oracle, address _recipient, uint256 _amount)
    external
  {
    require(oracles[_oracle].admin == msg.sender, "only callable by admin");

    // Safe to downcast _amount because the total amount of LINK is less than 2^128.
    uint128 amount = uint128(_amount);
    uint128 available = oracles[_oracle].withdrawable;
    require(available >= amount, "insufficient withdrawable funds");

    oracles[_oracle].withdrawable = available.sub(amount);
    recordedFunds.allocated = recordedFunds.allocated.sub(amount);

    assert(linkToken.transfer(_recipient, uint256(amount)));
  }

  /**
   * @notice transfers the owner's LINK to another address
   * @param _recipient is the address to send the LINK to
   * @param _amount is the amount of LINK to send
   */
  function withdrawFunds(address _recipient, uint256 _amount)
    external
    onlyOwner()
  {
    uint256 available = uint256(recordedFunds.available);
    require(available.sub(requiredReserve(paymentAmount)) >= _amount, "insufficient reserve funds");
    require(linkToken.transfer(_recipient, _amount), "token transfer failed");
    updateAvailableFunds();
  }

  /**
   * @notice get the admin address of an oracle
   * @param _oracle is the address of the oracle whose admin is being queried
   */
  function getAdmin(address _oracle)
    external
    view
    returns (address)
  {
    return oracles[_oracle].admin;
  }

  /**
   * @notice transfer the admin address for an oracle
   * @param _oracle is the address of the oracle whose admin is being transferred
   * @param _newAdmin is the new admin address
   */
  function transferAdmin(address _oracle, address _newAdmin)
    external
  {
    require(oracles[_oracle].admin == msg.sender, "only callable by admin");
    oracles[_oracle].pendingAdmin = _newAdmin;

    emit OracleAdminUpdateRequested(_oracle, msg.sender, _newAdmin);
  }

  /**
   * @notice accept the admin address transfer for an oracle
   * @param _oracle is the address of the oracle whose admin is being transferred
   */
  function acceptAdmin(address _oracle)
    external
  {
    require(oracles[_oracle].pendingAdmin == msg.sender, "only callable by pending admin");
    oracles[_oracle].pendingAdmin = address(0);
    oracles[_oracle].admin = msg.sender;

    emit OracleAdminUpdated(_oracle, msg.sender);
  }

  /**
   * @notice allows non-oracles to request a new round
   */
  function requestNewRound()
    external
    returns (uint80)
  {
    require(requesters[msg.sender].authorized, "not authorized requester");

    uint32 current = reportingRoundId;
    require(rounds[current].updatedAt > 0 || timedOut(current), "prev round must be supersedable");

    uint32 newRoundId = current.add(1);
    requesterInitializeNewRound(newRoundId);
    return newRoundId;
  }

  /**
   * @notice allows the owner to specify new non-oracles to start new rounds
   * @param _requester is the address to set permissions for
   * @param _authorized is a boolean specifying whether they can start new rounds or not
   * @param _delay is the number of rounds the requester must wait before starting another round
   */
  function setRequesterPermissions(address _requester, bool _authorized, uint32 _delay)
    external
    onlyOwner()
  {
    if (requesters[_requester].authorized == _authorized) return;

    if (_authorized) {
      requesters[_requester].authorized = _authorized;
      requesters[_requester].delay = _delay;
    } else {
      delete requesters[_requester];
    }

    emit RequesterPermissionsSet(_requester, _authorized, _delay);
  }

  /**
   * @notice called through LINK's transferAndCall to update available funds
   * in the same transaction as the funds were transferred to the aggregator
   * @param _data is mostly ignored. It is checked for length, to be sure
   * nothing strange is passed in.
   */
  function onTokenTransfer(address, uint256, bytes calldata _data)
    external
  {
    require(_data.length == 0, "transfer doesn't accept calldata");
    updateAvailableFunds();
  }

  /**
   * @notice a method to provide all current info oracles need. Intended only
   * only to be callable by oracles. Not for use by contracts to read state.
   * @param _oracle the address to look up information for.
   */
  function oracleRoundState(address _oracle, uint32 _queriedRoundId)
    external
    view
    returns (
      bool _eligibleToSubmit,
      uint32 _roundId,
      int256 _latestSubmission,
      uint64 _startedAt,
      uint64 _timeout,
      uint128 _availableFunds,
      uint8 _oracleCount,
      uint128 _paymentAmount
    )
  {
    require(msg.sender == tx.origin, "off-chain reading only");

    if (_queriedRoundId > 0) {
      Round storage round = rounds[_queriedRoundId];
      RoundDetails storage details = details[_queriedRoundId];
      return (
        eligibleForSpecificRound(_oracle, _queriedRoundId),
        _queriedRoundId,
        oracles[_oracle].latestSubmission,
        round.startedAt,
        details.timeout,
        recordedFunds.available,
        oracleCount(),
        (round.startedAt > 0 ? details.paymentAmount : paymentAmount)
      );
    } else {
      return oracleRoundStateSuggestRound(_oracle);
    }
  }

  /**
   * @notice method to update the address which does external data validation.
   * @param _newValidator designates the address of the new validation contract.
   */
  function setValidator(address _newValidator)
    public
    onlyOwner()
  {
    address previous = address(validator);

    if (previous != _newValidator) {
      validator = AggregatorValidatorInterface(_newValidator);

      emit ValidatorUpdated(previous, _newValidator);
    }
  }


  /**
   * Private
   */

  function initializeNewRound(uint32 _roundId)
    private
  {
    updateTimedOutRoundInfo(_roundId.sub(1));

    reportingRoundId = _roundId;
    RoundDetails memory nextDetails = RoundDetails(
      new int256[](0),
      maxSubmissionCount,
      minSubmissionCount,
      timeout,
      paymentAmount
    );
    details[_roundId] = nextDetails;
    rounds[_roundId].startedAt = uint64(block.timestamp);

    emit NewRound(_roundId, msg.sender, rounds[_roundId].startedAt);
  }

  function oracleInitializeNewRound(uint32 _roundId)
    private
  {
    if (!newRound(_roundId)) return;
    uint256 lastStarted = oracles[msg.sender].lastStartedRound; // cache storage reads
    if (_roundId <= lastStarted + restartDelay && lastStarted != 0) return;

    initializeNewRound(_roundId);

    oracles[msg.sender].lastStartedRound = _roundId;
  }

  function requesterInitializeNewRound(uint32 _roundId)
    private
  {
    if (!newRound(_roundId)) return;
    uint256 lastStarted = requesters[msg.sender].lastStartedRound; // cache storage reads
    require(_roundId > lastStarted + requesters[msg.sender].delay || lastStarted == 0, "must delay requests");

    initializeNewRound(_roundId);

    requesters[msg.sender].lastStartedRound = _roundId;
  }

  function updateTimedOutRoundInfo(uint32 _roundId)
    private
  {
    if (!timedOut(_roundId)) return;

    uint32 prevId = _roundId.sub(1);
    rounds[_roundId].answer = rounds[prevId].answer;
    rounds[_roundId].answeredInRound = rounds[prevId].answeredInRound;
    rounds[_roundId].updatedAt = uint64(block.timestamp);

    delete details[_roundId];
  }

  function eligibleForSpecificRound(address _oracle, uint32 _queriedRoundId)
    private
    view
    returns (bool _eligible)
  {
    if (rounds[_queriedRoundId].startedAt > 0) {
      return acceptingSubmissions(_queriedRoundId) && validateOracleRound(_oracle, _queriedRoundId).length == 0;
    } else {
      return delayed(_oracle, _queriedRoundId) && validateOracleRound(_oracle, _queriedRoundId).length == 0;
    }
  }

  function oracleRoundStateSuggestRound(address _oracle)
    private
    view
    returns (
      bool _eligibleToSubmit,
      uint32 _roundId,
      int256 _latestSubmission,
      uint64 _startedAt,
      uint64 _timeout,
      uint128 _availableFunds,
      uint8 _oracleCount,
      uint128 _paymentAmount
    )
  {
    Round storage round = rounds[0];
    OracleStatus storage oracle = oracles[_oracle];

    bool shouldSupersede = oracle.lastReportedRound == reportingRoundId || !acceptingSubmissions(reportingRoundId);
    // Instead of nudging oracles to submit to the next round, the inclusion of
    // the shouldSupersede bool in the if condition pushes them towards
    // submitting in a currently open round.
    if (supersedable(reportingRoundId) && shouldSupersede) {
      _roundId = reportingRoundId.add(1);
      round = rounds[_roundId];

      _paymentAmount = paymentAmount;
      _eligibleToSubmit = delayed(_oracle, _roundId);
    } else {
      _roundId = reportingRoundId;
      round = rounds[_roundId];

      _paymentAmount = details[_roundId].paymentAmount;
      _eligibleToSubmit = acceptingSubmissions(_roundId);
    }

    if (validateOracleRound(_oracle, _roundId).length != 0) {
      _eligibleToSubmit = false;
    }

    return (
      _eligibleToSubmit,
      _roundId,
      oracle.latestSubmission,
      round.startedAt,
      details[_roundId].timeout,
      recordedFunds.available,
      oracleCount(),
      _paymentAmount
    );
  }

  function updateRoundAnswer(uint32 _roundId)
    internal
    returns (bool, int256)
  {
    if (details[_roundId].submissions.length < details[_roundId].minSubmissions) {
      return (false, 0);
    }

    int256 newAnswer = Median.calculateInplace(details[_roundId].submissions);
    rounds[_roundId].answer = newAnswer;
    rounds[_roundId].updatedAt = uint64(block.timestamp);
    rounds[_roundId].answeredInRound = _roundId;
    latestRoundId = _roundId;

    emit AnswerUpdated(newAnswer, _roundId, now);

    return (true, newAnswer);
  }

  function validateAnswer(
    uint32 _roundId,
    int256 _newAnswer
  )
    private
  {
    AggregatorValidatorInterface av = validator; // cache storage reads
    if (address(av) == address(0)) return;

    uint32 prevRound = _roundId.sub(1);
    uint32 prevAnswerRoundId = rounds[prevRound].answeredInRound;
    int256 prevRoundAnswer = rounds[prevRound].answer;
    // We do not want the validator to ever prevent reporting, so we limit its
    // gas usage and catch any errors that may arise.
    try av.validate{gas: VALIDATOR_GAS_LIMIT}(
      prevAnswerRoundId,
      prevRoundAnswer,
      _roundId,
      _newAnswer
    ) {} catch {}
  }

  function payOracle(uint32 _roundId)
    private
  {
    uint128 payment = details[_roundId].paymentAmount;
    Funds memory funds = recordedFunds;
    funds.available = funds.available.sub(payment);
    funds.allocated = funds.allocated.add(payment);
    recordedFunds = funds;
    oracles[msg.sender].withdrawable = oracles[msg.sender].withdrawable.add(payment);

    emit AvailableFundsUpdated(funds.available);
  }

  function recordSubmission(int256 _submission, uint32 _roundId)
    private
  {
    require(acceptingSubmissions(_roundId), "round not accepting submissions");

    details[_roundId].submissions.push(_submission);
    oracles[msg.sender].lastReportedRound = _roundId;
    oracles[msg.sender].latestSubmission = _submission;

    emit SubmissionReceived(_submission, _roundId, msg.sender);
  }

  function deleteRoundDetails(uint32 _roundId)
    private
  {
    if (details[_roundId].submissions.length < details[_roundId].maxSubmissions) return;

    delete details[_roundId];
  }

  function timedOut(uint32 _roundId)
    private
    view
    returns (bool)
  {
    uint64 startedAt = rounds[_roundId].startedAt;
    uint32 roundTimeout = details[_roundId].timeout;
    return startedAt > 0 && roundTimeout > 0 && startedAt.add(roundTimeout) < block.timestamp;
  }

  function getStartingRound(address _oracle)
    private
    view
    returns (uint32)
  {
    uint32 currentRound = reportingRoundId;
    if (currentRound != 0 && currentRound == oracles[_oracle].endingRound) {
      return currentRound;
    }
    return currentRound.add(1);
  }

  function previousAndCurrentUnanswered(uint32 _roundId, uint32 _rrId)
    private
    view
    returns (bool)
  {
    return _roundId.add(1) == _rrId && rounds[_rrId].updatedAt == 0;
  }

  function requiredReserve(uint256 payment)
    private
    view
    returns (uint256)
  {
    return payment.mul(oracleCount()).mul(RESERVE_ROUNDS);
  }

  function addOracle(
    address _oracle,
    address _admin
  )
    private
  {
    require(!oracleEnabled(_oracle), "oracle already enabled");

    require(_admin != address(0), "cannot set admin to 0");
    require(oracles[_oracle].admin == address(0) || oracles[_oracle].admin == _admin, "owner cannot overwrite admin");

    oracles[_oracle].startingRound = getStartingRound(_oracle);
    oracles[_oracle].endingRound = ROUND_MAX;
    oracles[_oracle].index = uint16(oracleAddresses.length);
    oracleAddresses.push(_oracle);
    oracles[_oracle].admin = _admin;

    emit OraclePermissionsUpdated(_oracle, true);
    emit OracleAdminUpdated(_oracle, _admin);
  }

  function removeOracle(
    address _oracle
  )
    private
  {
    require(oracleEnabled(_oracle), "oracle not enabled");

    oracles[_oracle].endingRound = reportingRoundId.add(1);
    address tail = oracleAddresses[uint256(oracleCount()).sub(1)];
    uint16 index = oracles[_oracle].index;
    oracles[tail].index = index;
    delete oracles[_oracle].index;
    oracleAddresses[index] = tail;
    oracleAddresses.pop();

    emit OraclePermissionsUpdated(_oracle, false);
  }

  function validateOracleRound(address _oracle, uint32 _roundId)
    private
    view
    returns (bytes memory)
  {
    // cache storage reads
    uint32 startingRound = oracles[_oracle].startingRound;
    uint32 rrId = reportingRoundId;

    if (startingRound == 0) return "not enabled oracle";
    if (startingRound > _roundId) return "not yet enabled oracle";
    if (oracles[_oracle].endingRound < _roundId) return "no longer allowed oracle";
    if (oracles[_oracle].lastReportedRound >= _roundId) return "cannot report on previous rounds";
    if (_roundId != rrId && _roundId != rrId.add(1) && !previousAndCurrentUnanswered(_roundId, rrId)) return "invalid round to report";
    if (_roundId != 1 && !supersedable(_roundId.sub(1))) return "previous round not supersedable";
  }

  function supersedable(uint32 _roundId)
    private
    view
    returns (bool)
  {
    return rounds[_roundId].updatedAt > 0 || timedOut(_roundId);
  }

  function oracleEnabled(address _oracle)
    private
    view
    returns (bool)
  {
    return oracles[_oracle].endingRound == ROUND_MAX;
  }

  function acceptingSubmissions(uint32 _roundId)
    private
    view
    returns (bool)
  {
    return details[_roundId].maxSubmissions != 0;
  }

  function delayed(address _oracle, uint32 _roundId)
    private
    view
    returns (bool)
  {
    uint256 lastStarted = oracles[_oracle].lastStartedRound;
    return _roundId > lastStarted + restartDelay || lastStarted == 0;
  }

  function newRound(uint32 _roundId)
    private
    view
    returns (bool)
  {
    return _roundId == reportingRoundId.add(1);
  }

  function validRoundId(uint256 _roundId)
    private
    pure
    returns (bool)
  {
    return _roundId <= ROUND_MAX;
  }

}

File 2 of 13 : Median.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;

import "./vendor/SafeMathChainlink.sol";
import "./SignedSafeMath.sol";

library Median {
  using SignedSafeMath for int256;

  int256 constant INT_MAX = 2**255-1;

  /**
   * @notice Returns the sorted middle, or the average of the two middle indexed items if the
   * array has an even number of elements.
   * @dev The list passed as an argument isn't modified.
   * @dev This algorithm has expected runtime O(n), but for adversarially chosen inputs
   * the runtime is O(n^2).
   * @param list The list of elements to compare
   */
  function calculate(int256[] memory list)
    internal
    pure
    returns (int256)
  {
    return calculateInplace(copy(list));
  }

  /**
   * @notice See documentation for function calculate.
   * @dev The list passed as an argument may be permuted.
   */
  function calculateInplace(int256[] memory list)
    internal
    pure
    returns (int256)
  {
    require(0 < list.length, "list must not be empty");
    uint256 len = list.length;
    uint256 middleIndex = len / 2;
    if (len % 2 == 0) {
      int256 median1;
      int256 median2;
      (median1, median2) = quickselectTwo(list, 0, len - 1, middleIndex - 1, middleIndex);
      return SignedSafeMath.avg(median1, median2);
    } else {
      return quickselect(list, 0, len - 1, middleIndex);
    }
  }

  /**
   * @notice Maximum length of list that shortSelectTwo can handle
   */
  uint256 constant SHORTSELECTTWO_MAX_LENGTH = 7;

  /**
   * @notice Select the k1-th and k2-th element from list of length at most 7
   * @dev Uses an optimal sorting network
   */
  function shortSelectTwo(
    int256[] memory list,
    uint256 lo,
    uint256 hi,
    uint256 k1,
    uint256 k2
  )
    private
    pure
    returns (int256 k1th, int256 k2th)
  {
    // Uses an optimal sorting network (https://en.wikipedia.org/wiki/Sorting_network)
    // for lists of length 7. Network layout is taken from
    // http://jgamble.ripco.net/cgi-bin/nw.cgi?inputs=7&algorithm=hibbard&output=svg

    uint256 len = hi + 1 - lo;
    int256 x0 = list[lo + 0];
    int256 x1 = 1 < len ? list[lo + 1] : INT_MAX;
    int256 x2 = 2 < len ? list[lo + 2] : INT_MAX;
    int256 x3 = 3 < len ? list[lo + 3] : INT_MAX;
    int256 x4 = 4 < len ? list[lo + 4] : INT_MAX;
    int256 x5 = 5 < len ? list[lo + 5] : INT_MAX;
    int256 x6 = 6 < len ? list[lo + 6] : INT_MAX;

    if (x0 > x1) {(x0, x1) = (x1, x0);}
    if (x2 > x3) {(x2, x3) = (x3, x2);}
    if (x4 > x5) {(x4, x5) = (x5, x4);}
    if (x0 > x2) {(x0, x2) = (x2, x0);}
    if (x1 > x3) {(x1, x3) = (x3, x1);}
    if (x4 > x6) {(x4, x6) = (x6, x4);}
    if (x1 > x2) {(x1, x2) = (x2, x1);}
    if (x5 > x6) {(x5, x6) = (x6, x5);}
    if (x0 > x4) {(x0, x4) = (x4, x0);}
    if (x1 > x5) {(x1, x5) = (x5, x1);}
    if (x2 > x6) {(x2, x6) = (x6, x2);}
    if (x1 > x4) {(x1, x4) = (x4, x1);}
    if (x3 > x6) {(x3, x6) = (x6, x3);}
    if (x2 > x4) {(x2, x4) = (x4, x2);}
    if (x3 > x5) {(x3, x5) = (x5, x3);}
    if (x3 > x4) {(x3, x4) = (x4, x3);}

    uint256 index1 = k1 - lo;
    if (index1 == 0) {k1th = x0;}
    else if (index1 == 1) {k1th = x1;}
    else if (index1 == 2) {k1th = x2;}
    else if (index1 == 3) {k1th = x3;}
    else if (index1 == 4) {k1th = x4;}
    else if (index1 == 5) {k1th = x5;}
    else if (index1 == 6) {k1th = x6;}
    else {revert("k1 out of bounds");}

    uint256 index2 = k2 - lo;
    if (k1 == k2) {return (k1th, k1th);}
    else if (index2 == 0) {return (k1th, x0);}
    else if (index2 == 1) {return (k1th, x1);}
    else if (index2 == 2) {return (k1th, x2);}
    else if (index2 == 3) {return (k1th, x3);}
    else if (index2 == 4) {return (k1th, x4);}
    else if (index2 == 5) {return (k1th, x5);}
    else if (index2 == 6) {return (k1th, x6);}
    else {revert("k2 out of bounds");}
  }

  /**
   * @notice Selects the k-th ranked element from list, looking only at indices between lo and hi
   * (inclusive). Modifies list in-place.
   */
  function quickselect(int256[] memory list, uint256 lo, uint256 hi, uint256 k)
    private
    pure
    returns (int256 kth)
  {
    require(lo <= k);
    require(k <= hi);
    while (lo < hi) {
      if (hi - lo < SHORTSELECTTWO_MAX_LENGTH) {
        int256 ignore;
        (kth, ignore) = shortSelectTwo(list, lo, hi, k, k);
        return kth;
      }
      uint256 pivotIndex = partition(list, lo, hi);
      if (k <= pivotIndex) {
        // since pivotIndex < (original hi passed to partition),
        // termination is guaranteed in this case
        hi = pivotIndex;
      } else {
        // since (original lo passed to partition) <= pivotIndex,
        // termination is guaranteed in this case
        lo = pivotIndex + 1;
      }
    }
    return list[lo];
  }

  /**
   * @notice Selects the k1-th and k2-th ranked elements from list, looking only at indices between
   * lo and hi (inclusive). Modifies list in-place.
   */
  function quickselectTwo(
    int256[] memory list,
    uint256 lo,
    uint256 hi,
    uint256 k1,
    uint256 k2
  )
    internal // for testing
    pure
    returns (int256 k1th, int256 k2th)
  {
    require(k1 < k2);
    require(lo <= k1 && k1 <= hi);
    require(lo <= k2 && k2 <= hi);

    while (true) {
      if (hi - lo < SHORTSELECTTWO_MAX_LENGTH) {
        return shortSelectTwo(list, lo, hi, k1, k2);
      }
      uint256 pivotIdx = partition(list, lo, hi);
      if (k2 <= pivotIdx) {
        hi = pivotIdx;
      } else if (pivotIdx < k1) {
        lo = pivotIdx + 1;
      } else {
        assert(k1 <= pivotIdx && pivotIdx < k2);
        k1th = quickselect(list, lo, pivotIdx, k1);
        k2th = quickselect(list, pivotIdx + 1, hi, k2);
        return (k1th, k2th);
      }
    }
  }

  /**
   * @notice Partitions list in-place using Hoare's partitioning scheme.
   * Only elements of list between indices lo and hi (inclusive) will be modified.
   * Returns an index i, such that:
   * - lo <= i < hi
   * - forall j in [lo, i]. list[j] <= list[i]
   * - forall j in [i, hi]. list[i] <= list[j]
   */
  function partition(int256[] memory list, uint256 lo, uint256 hi)
    private
    pure
    returns (uint256)
  {
    // We don't care about overflow of the addition, because it would require a list
    // larger than any feasible computer's memory.
    int256 pivot = list[(lo + hi) / 2];
    lo -= 1; // this can underflow. that's intentional.
    hi += 1;
    while (true) {
      do {
        lo += 1;
      } while (list[lo] < pivot);
      do {
        hi -= 1;
      } while (list[hi] > pivot);
      if (lo < hi) {
        (list[lo], list[hi]) = (list[hi], list[lo]);
      } else {
        // Let orig_lo and orig_hi be the original values of lo and hi passed to partition.
        // Then, hi < orig_hi, because hi decreases *strictly* monotonically
        // in each loop iteration and
        // - either list[orig_hi] > pivot, in which case the first loop iteration
        //   will achieve hi < orig_hi;
        // - or list[orig_hi] <= pivot, in which case at least two loop iterations are
        //   needed:
        //   - lo will have to stop at least once in the interval
        //     [orig_lo, (orig_lo + orig_hi)/2]
        //   - (orig_lo + orig_hi)/2 < orig_hi
        return hi;
      }
    }
  }

  /**
   * @notice Makes an in-memory copy of the array passed in
   * @param list Reference to the array to be copied
   */
  function copy(int256[] memory list)
    private
    pure
    returns(int256[] memory)
  {
    int256[] memory list2 = new int256[](list.length);
    for (uint256 i = 0; i < list.length; i++) {
      list2[i] = list[i];
    }
    return list2;
  }
}

File 3 of 13 : Owned.sol
// SPDX-License-Identifier: MIT
pragma solidity >0.6.0 <0.8.0;

/**
 * @title The Owned contract
 * @notice A contract with helpers for basic contract ownership.
 */
contract Owned {

  address public owner;
  address private pendingOwner;

  event OwnershipTransferRequested(
    address indexed from,
    address indexed to
  );
  event OwnershipTransferred(
    address indexed from,
    address indexed to
  );

  constructor() public {
    owner = msg.sender;
  }

  /**
   * @dev Allows an owner to begin transferring ownership to a new address,
   * pending.
   */
  function transferOwnership(address _to)
    external
    onlyOwner()
  {
    pendingOwner = _to;

    emit OwnershipTransferRequested(owner, _to);
  }

  /**
   * @dev Allows an ownership transfer to be completed by the recipient.
   */
  function acceptOwnership()
    external
  {
    require(msg.sender == pendingOwner, "Must be proposed owner");

    address oldOwner = owner;
    owner = msg.sender;
    pendingOwner = address(0);

    emit OwnershipTransferred(oldOwner, msg.sender);
  }

  /**
   * @dev Reverts if called by anyone other than the contract owner.
   */
  modifier onlyOwner() {
    require(msg.sender == owner, "Only callable by owner");
    _;
  }

}

File 4 of 13 : SafeMath128.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 *
 * This library is a version of Open Zeppelin's SafeMath, modified to support
 * unsigned 128 bit integers.
 */
library SafeMath128 {
  /**
    * @dev Returns the addition of two unsigned integers, reverting on
    * overflow.
    *
    * Counterpart to Solidity's `+` operator.
    *
    * Requirements:
    * - Addition cannot overflow.
    */
  function add(uint128 a, uint128 b) internal pure returns (uint128) {
    uint128 c = a + b;
    require(c >= a, "SafeMath: addition overflow");

    return c;
  }

  /**
    * @dev Returns the subtraction of two unsigned integers, reverting on
    * overflow (when the result is negative).
    *
    * Counterpart to Solidity's `-` operator.
    *
    * Requirements:
    * - Subtraction cannot overflow.
    */
  function sub(uint128 a, uint128 b) internal pure returns (uint128) {
    require(b <= a, "SafeMath: subtraction overflow");
    uint128 c = a - b;

    return c;
  }

  /**
    * @dev Returns the multiplication of two unsigned integers, reverting on
    * overflow.
    *
    * Counterpart to Solidity's `*` operator.
    *
    * Requirements:
    * - Multiplication cannot overflow.
    */
  function mul(uint128 a, uint128 b) internal pure returns (uint128) {
    // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
    // benefit is lost if 'b' is also tested.
    // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
    if (a == 0) {
      return 0;
    }

    uint128 c = a * b;
    require(c / a == b, "SafeMath: multiplication overflow");

    return c;
  }

  /**
    * @dev Returns the integer division of two unsigned integers. Reverts on
    * division by zero. The result is rounded towards zero.
    *
    * Counterpart to Solidity's `/` operator. Note: this function uses a
    * `revert` opcode (which leaves remaining gas untouched) while Solidity
    * uses an invalid opcode to revert (consuming all remaining gas).
    *
    * Requirements:
    * - The divisor cannot be zero.
    */
  function div(uint128 a, uint128 b) internal pure returns (uint128) {
    // Solidity only automatically asserts when dividing by 0
    require(b > 0, "SafeMath: division by zero");
    uint128 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold

    return c;
  }

  /**
    * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
    * Reverts when dividing by zero.
    *
    * Counterpart to Solidity's `%` operator. This function uses a `revert`
    * opcode (which leaves remaining gas untouched) while Solidity uses an
    * invalid opcode to revert (consuming all remaining gas).
    *
    * Requirements:
    * - The divisor cannot be zero.
    */
  function mod(uint128 a, uint128 b) internal pure returns (uint128) {
    require(b != 0, "SafeMath: modulo by zero");
    return a % b;
  }
}

File 5 of 13 : SafeMath32.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 *
 * This library is a version of Open Zeppelin's SafeMath, modified to support
 * unsigned 32 bit integers.
 */
library SafeMath32 {
  /**
    * @dev Returns the addition of two unsigned integers, reverting on
    * overflow.
    *
    * Counterpart to Solidity's `+` operator.
    *
    * Requirements:
    * - Addition cannot overflow.
    */
  function add(uint32 a, uint32 b) internal pure returns (uint32) {
    uint32 c = a + b;
    require(c >= a, "SafeMath: addition overflow");

    return c;
  }

  /**
    * @dev Returns the subtraction of two unsigned integers, reverting on
    * overflow (when the result is negative).
    *
    * Counterpart to Solidity's `-` operator.
    *
    * Requirements:
    * - Subtraction cannot overflow.
    */
  function sub(uint32 a, uint32 b) internal pure returns (uint32) {
    require(b <= a, "SafeMath: subtraction overflow");
    uint32 c = a - b;

    return c;
  }

  /**
    * @dev Returns the multiplication of two unsigned integers, reverting on
    * overflow.
    *
    * Counterpart to Solidity's `*` operator.
    *
    * Requirements:
    * - Multiplication cannot overflow.
    */
  function mul(uint32 a, uint32 b) internal pure returns (uint32) {
    // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
    // benefit is lost if 'b' is also tested.
    // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
    if (a == 0) {
      return 0;
    }

    uint32 c = a * b;
    require(c / a == b, "SafeMath: multiplication overflow");

    return c;
  }

  /**
    * @dev Returns the integer division of two unsigned integers. Reverts on
    * division by zero. The result is rounded towards zero.
    *
    * Counterpart to Solidity's `/` operator. Note: this function uses a
    * `revert` opcode (which leaves remaining gas untouched) while Solidity
    * uses an invalid opcode to revert (consuming all remaining gas).
    *
    * Requirements:
    * - The divisor cannot be zero.
    */
  function div(uint32 a, uint32 b) internal pure returns (uint32) {
    // Solidity only automatically asserts when dividing by 0
    require(b > 0, "SafeMath: division by zero");
    uint32 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold

    return c;
  }

  /**
    * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
    * Reverts when dividing by zero.
    *
    * Counterpart to Solidity's `%` operator. This function uses a `revert`
    * opcode (which leaves remaining gas untouched) while Solidity uses an
    * invalid opcode to revert (consuming all remaining gas).
    *
    * Requirements:
    * - The divisor cannot be zero.
    */
  function mod(uint32 a, uint32 b) internal pure returns (uint32) {
    require(b != 0, "SafeMath: modulo by zero");
    return a % b;
  }
}

File 6 of 13 : SafeMath64.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 *
 * This library is a version of Open Zeppelin's SafeMath, modified to support
 * unsigned 64 bit integers.
 */
library SafeMath64 {
  /**
    * @dev Returns the addition of two unsigned integers, reverting on
    * overflow.
    *
    * Counterpart to Solidity's `+` operator.
    *
    * Requirements:
    * - Addition cannot overflow.
    */
  function add(uint64 a, uint64 b) internal pure returns (uint64) {
    uint64 c = a + b;
    require(c >= a, "SafeMath: addition overflow");

    return c;
  }

  /**
    * @dev Returns the subtraction of two unsigned integers, reverting on
    * overflow (when the result is negative).
    *
    * Counterpart to Solidity's `-` operator.
    *
    * Requirements:
    * - Subtraction cannot overflow.
    */
  function sub(uint64 a, uint64 b) internal pure returns (uint64) {
    require(b <= a, "SafeMath: subtraction overflow");
    uint64 c = a - b;

    return c;
  }

  /**
    * @dev Returns the multiplication of two unsigned integers, reverting on
    * overflow.
    *
    * Counterpart to Solidity's `*` operator.
    *
    * Requirements:
    * - Multiplication cannot overflow.
    */
  function mul(uint64 a, uint64 b) internal pure returns (uint64) {
    // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
    // benefit is lost if 'b' is also tested.
    // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
    if (a == 0) {
      return 0;
    }

    uint64 c = a * b;
    require(c / a == b, "SafeMath: multiplication overflow");

    return c;
  }

  /**
    * @dev Returns the integer division of two unsigned integers. Reverts on
    * division by zero. The result is rounded towards zero.
    *
    * Counterpart to Solidity's `/` operator. Note: this function uses a
    * `revert` opcode (which leaves remaining gas untouched) while Solidity
    * uses an invalid opcode to revert (consuming all remaining gas).
    *
    * Requirements:
    * - The divisor cannot be zero.
    */
  function div(uint64 a, uint64 b) internal pure returns (uint64) {
    // Solidity only automatically asserts when dividing by 0
    require(b > 0, "SafeMath: division by zero");
    uint64 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold

    return c;
  }

  /**
    * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
    * Reverts when dividing by zero.
    *
    * Counterpart to Solidity's `%` operator. This function uses a `revert`
    * opcode (which leaves remaining gas untouched) while Solidity uses an
    * invalid opcode to revert (consuming all remaining gas).
    *
    * Requirements:
    * - The divisor cannot be zero.
    */
  function mod(uint64 a, uint64 b) internal pure returns (uint64) {
    require(b != 0, "SafeMath: modulo by zero");
    return a % b;
  }
}

File 7 of 13 : AggregatorV2V3Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;

import "./AggregatorInterface.sol";
import "./AggregatorV3Interface.sol";

interface AggregatorV2V3Interface is AggregatorInterface, AggregatorV3Interface
{
}

File 8 of 13 : AggregatorValidatorInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;

interface AggregatorValidatorInterface {
  function validate(
    uint256 previousRoundId,
    int256 previousAnswer,
    uint256 currentRoundId,
    int256 currentAnswer
  ) external returns (bool);
}

File 9 of 13 : LinkTokenInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;

interface LinkTokenInterface {
  function allowance(address owner, address spender) external view returns (uint256 remaining);
  function approve(address spender, uint256 value) external returns (bool success);
  function balanceOf(address owner) external view returns (uint256 balance);
  function decimals() external view returns (uint8 decimalPlaces);
  function decreaseApproval(address spender, uint256 addedValue) external returns (bool success);
  function increaseApproval(address spender, uint256 subtractedValue) external;
  function name() external view returns (string memory tokenName);
  function symbol() external view returns (string memory tokenSymbol);
  function totalSupply() external view returns (uint256 totalTokensIssued);
  function transfer(address to, uint256 value) external returns (bool success);
  function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool success);
  function transferFrom(address from, address to, uint256 value) external returns (bool success);
}

File 10 of 13 : SafeMathChainlink.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMathChainlink {
  /**
    * @dev Returns the addition of two unsigned integers, reverting on
    * overflow.
    *
    * Counterpart to Solidity's `+` operator.
    *
    * Requirements:
    * - Addition cannot overflow.
    */
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    require(c >= a, "SafeMath: addition overflow");

    return c;
  }

  /**
    * @dev Returns the subtraction of two unsigned integers, reverting on
    * overflow (when the result is negative).
    *
    * Counterpart to Solidity's `-` operator.
    *
    * Requirements:
    * - Subtraction cannot overflow.
    */
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    require(b <= a, "SafeMath: subtraction overflow");
    uint256 c = a - b;

    return c;
  }

  /**
    * @dev Returns the multiplication of two unsigned integers, reverting on
    * overflow.
    *
    * Counterpart to Solidity's `*` operator.
    *
    * Requirements:
    * - Multiplication cannot overflow.
    */
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
    // benefit is lost if 'b' is also tested.
    // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
    if (a == 0) {
      return 0;
    }

    uint256 c = a * b;
    require(c / a == b, "SafeMath: multiplication overflow");

    return c;
  }

  /**
    * @dev Returns the integer division of two unsigned integers. Reverts on
    * division by zero. The result is rounded towards zero.
    *
    * Counterpart to Solidity's `/` operator. Note: this function uses a
    * `revert` opcode (which leaves remaining gas untouched) while Solidity
    * uses an invalid opcode to revert (consuming all remaining gas).
    *
    * Requirements:
    * - The divisor cannot be zero.
    */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // Solidity only automatically asserts when dividing by 0
    require(b > 0, "SafeMath: division by zero");
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold

    return c;
  }

  /**
    * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
    * Reverts when dividing by zero.
    *
    * Counterpart to Solidity's `%` operator. This function uses a `revert`
    * opcode (which leaves remaining gas untouched) while Solidity uses an
    * invalid opcode to revert (consuming all remaining gas).
    *
    * Requirements:
    * - The divisor cannot be zero.
    */
  function mod(uint256 a, uint256 b) internal pure returns (uint256) {
    require(b != 0, "SafeMath: modulo by zero");
    return a % b;
  }
}

File 11 of 13 : SignedSafeMath.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;

library SignedSafeMath {
  int256 constant private _INT256_MIN = -2**255;

  /**
   * @dev Multiplies two signed integers, reverts on overflow.
   */
  function mul(int256 a, int256 b) internal pure returns (int256) {
    // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
    // benefit is lost if 'b' is also tested.
    // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
    if (a == 0) {
      return 0;
    }

    require(!(a == -1 && b == _INT256_MIN), "SignedSafeMath: multiplication overflow");

    int256 c = a * b;
    require(c / a == b, "SignedSafeMath: multiplication overflow");

    return c;
  }

  /**
   * @dev Integer division of two signed integers truncating the quotient, reverts on division by zero.
   */
  function div(int256 a, int256 b) internal pure returns (int256) {
    require(b != 0, "SignedSafeMath: division by zero");
    require(!(b == -1 && a == _INT256_MIN), "SignedSafeMath: division overflow");

    int256 c = a / b;

    return c;
  }

  /**
   * @dev Subtracts two signed integers, reverts on overflow.
   */
  function sub(int256 a, int256 b) internal pure returns (int256) {
    int256 c = a - b;
    require((b >= 0 && c <= a) || (b < 0 && c > a), "SignedSafeMath: subtraction overflow");

    return c;
  }

  /**
   * @dev Adds two signed integers, reverts on overflow.
   */
  function add(int256 a, int256 b) internal pure returns (int256) {
    int256 c = a + b;
    require((b >= 0 && c >= a) || (b < 0 && c < a), "SignedSafeMath: addition overflow");

    return c;
  }

  /**
   * @notice Computes average of two signed integers, ensuring that the computation
   * doesn't overflow.
   * @dev If the result is not an integer, it is rounded towards zero. For example,
   * avg(-3, -4) = -3
   */
  function avg(int256 _a, int256 _b)
    internal
    pure
    returns (int256)
  {
    if ((_a < 0 && _b > 0) || (_a > 0 && _b < 0)) {
      return add(_a, _b) / 2;
    }
    int256 remainder = (_a % 2 + _b % 2) / 2;
    return add(add(_a / 2, _b / 2), remainder);
  }
}

File 12 of 13 : AggregatorInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;

interface AggregatorInterface {
  function latestAnswer()
    external
    view
    returns (
      int256
    );
  
  function latestTimestamp()
    external
    view
    returns (
      uint256
    );

  function latestRound()
    external
    view
    returns (
      uint256
    );

  function getAnswer(
    uint256 roundId
  )
    external
    view
    returns (
      int256
    );

  function getTimestamp(
    uint256 roundId
  )
    external
    view
    returns (
      uint256
    );

  event AnswerUpdated(
    int256 indexed current,
    uint256 indexed roundId,
    uint256 updatedAt
  );

  event NewRound(
    uint256 indexed roundId,
    address indexed startedBy,
    uint256 startedAt
  );
}

File 13 of 13 : AggregatorV3Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;

interface AggregatorV3Interface {

  function decimals()
    external
    view
    returns (
      uint8
    );

  function description()
    external
    view
    returns (
      string memory
    );

  function version()
    external
    view
    returns (
      uint256
    );

  // getRoundData and latestRoundData should both raise "No data present"
  // if they do not have data to report, instead of returning unset values
  // which could be misinterpreted as actual reported values.
  function getRoundData(
    uint80 _roundId
  )
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );

  function latestRoundData()
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );

}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_link","type":"address"},{"internalType":"uint128","name":"_paymentAmount","type":"uint128"},{"internalType":"uint32","name":"_timeout","type":"uint32"},{"internalType":"address","name":"_validator","type":"address"},{"internalType":"int256","name":"_minSubmissionValue","type":"int256"},{"internalType":"int256","name":"_maxSubmissionValue","type":"int256"},{"internalType":"uint8","name":"_decimals","type":"uint8"},{"internalType":"string","name":"_description","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"int256","name":"current","type":"int256"},{"indexed":true,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"updatedAt","type":"uint256"}],"name":"AnswerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AvailableFundsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":true,"internalType":"address","name":"startedBy","type":"address"},{"indexed":false,"internalType":"uint256","name":"startedAt","type":"uint256"}],"name":"NewRound","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oracle","type":"address"},{"indexed":false,"internalType":"address","name":"admin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"OracleAdminUpdateRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oracle","type":"address"},{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"}],"name":"OracleAdminUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oracle","type":"address"},{"indexed":true,"internalType":"bool","name":"whitelisted","type":"bool"}],"name":"OraclePermissionsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"OwnershipTransferRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"requester","type":"address"},{"indexed":false,"internalType":"bool","name":"authorized","type":"bool"},{"indexed":false,"internalType":"uint32","name":"delay","type":"uint32"}],"name":"RequesterPermissionsSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint128","name":"paymentAmount","type":"uint128"},{"indexed":true,"internalType":"uint32","name":"minSubmissionCount","type":"uint32"},{"indexed":true,"internalType":"uint32","name":"maxSubmissionCount","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"restartDelay","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"timeout","type":"uint32"}],"name":"RoundDetailsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"int256","name":"submission","type":"int256"},{"indexed":true,"internalType":"uint32","name":"round","type":"uint32"},{"indexed":true,"internalType":"address","name":"oracle","type":"address"}],"name":"SubmissionReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previous","type":"address"},{"indexed":true,"internalType":"address","name":"current","type":"address"}],"name":"ValidatorUpdated","type":"event"},{"inputs":[{"internalType":"address","name":"_oracle","type":"address"}],"name":"acceptAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"allocatedFunds","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"availableFunds","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_removed","type":"address[]"},{"internalType":"address[]","name":"_added","type":"address[]"},{"internalType":"address[]","name":"_addedAdmins","type":"address[]"},{"internalType":"uint32","name":"_minSubmissions","type":"uint32"},{"internalType":"uint32","name":"_maxSubmissions","type":"uint32"},{"internalType":"uint32","name":"_restartDelay","type":"uint32"}],"name":"changeOracles","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"description","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_oracle","type":"address"}],"name":"getAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_roundId","type":"uint256"}],"name":"getAnswer","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOracles","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint80","name":"_roundId","type":"uint80"}],"name":"getRoundData","outputs":[{"internalType":"uint80","name":"roundId","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_roundId","type":"uint256"}],"name":"getTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestAnswer","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestRoundData","outputs":[{"internalType":"uint80","name":"roundId","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"linkToken","outputs":[{"internalType":"contract LinkTokenInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSubmissionCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSubmissionValue","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minSubmissionCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minSubmissionValue","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"onTokenTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"oracleCount","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_oracle","type":"address"},{"internalType":"uint32","name":"_queriedRoundId","type":"uint32"}],"name":"oracleRoundState","outputs":[{"internalType":"bool","name":"_eligibleToSubmit","type":"bool"},{"internalType":"uint32","name":"_roundId","type":"uint32"},{"internalType":"int256","name":"_latestSubmission","type":"int256"},{"internalType":"uint64","name":"_startedAt","type":"uint64"},{"internalType":"uint64","name":"_timeout","type":"uint64"},{"internalType":"uint128","name":"_availableFunds","type":"uint128"},{"internalType":"uint8","name":"_oracleCount","type":"uint8"},{"internalType":"uint128","name":"_paymentAmount","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paymentAmount","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"requestNewRound","outputs":[{"internalType":"uint80","name":"","type":"uint80"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"restartDelay","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_requester","type":"address"},{"internalType":"bool","name":"_authorized","type":"bool"},{"internalType":"uint32","name":"_delay","type":"uint32"}],"name":"setRequesterPermissions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newValidator","type":"address"}],"name":"setValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_roundId","type":"uint256"},{"internalType":"int256","name":"_submission","type":"int256"}],"name":"submit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timeout","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_oracle","type":"address"},{"internalType":"address","name":"_newAdmin","type":"address"}],"name":"transferAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updateAvailableFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128","name":"_paymentAmount","type":"uint128"},{"internalType":"uint32","name":"_minSubmissions","type":"uint32"},{"internalType":"uint32","name":"_maxSubmissions","type":"uint32"},{"internalType":"uint32","name":"_restartDelay","type":"uint32"},{"internalType":"uint32","name":"_timeout","type":"uint32"}],"name":"updateFutureRounds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"validator","outputs":[{"internalType":"contract AggregatorValidatorInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oracle","type":"address"},{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawPayment","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oracle","type":"address"}],"name":"withdrawablePayment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60c06040523480156200001157600080fd5b5060405162004ad438038062004ad483398181016040526101008110156200003857600080fd5b815160208301516040808501516060860151608087015160a088015160c089015160e08a0180519651989a9799959894979396929591949391820192846401000000008211156200008857600080fd5b9083019060208201858111156200009e57600080fd5b8251640100000000811182820188101715620000b957600080fd5b82525081516020918201929091019080838360005b83811015620000e8578181015183820152602001620000ce565b50505050905090810190601f168015620001165780820380516001836020036101000a031916815260200191505b50604052505060008054336001600160a01b0319918216178255600280549091166001600160a01b038c16179055620001559150889080808a6200021f565b62000169856001600160e01b03620005fd16565b608084905260a08390526005805460ff191660ff8416179055805162000197906006906020840190620007e1565b50620001b88663ffffffff1642620006c760201b62002ef91790919060201c565b6000805260096020527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6c80546001600160401b03929092166801000000000000000002600160401b600160801b031990921691909117905550620008839650505050505050565b6000546001600160a01b031633146200027f576040805162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015290519081900360640190fd5b6000620002946001600160e01b036200072a16565b60ff1690508463ffffffff168463ffffffff161015620002fb576040805162461bcd60e51b815260206004820152601960248201527f6d6178206d75737420657175616c2f657863656564206d696e00000000000000604482015290519081900360640190fd5b8363ffffffff168163ffffffff1610156200035d576040805162461bcd60e51b815260206004820152601760248201527f6d61782063616e6e6f742065786365656420746f74616c000000000000000000604482015290519081900360640190fd5b63ffffffff811615806200037c57508263ffffffff168163ffffffff16115b620003ce576040805162461bcd60e51b815260206004820152601960248201527f64656c61792063616e6e6f742065786365656420746f74616c00000000000000604482015290519081900360640190fd5b620003eb6001600160801b0387166001600160e01b036200073116565b600d546001600160801b031610156200044b576040805162461bcd60e51b815260206004820152601e60248201527f696e73756666696369656e742066756e647320666f72207061796d656e740000604482015290519081900360640190fd5b6000620004606001600160e01b036200072a16565b60ff161115620004c65760008563ffffffff1611620004c6576040805162461bcd60e51b815260206004820152601a60248201527f6d696e206d7573742062652067726561746572207468616e2030000000000000604482015290519081900360640190fd5b85600460006101000a8154816001600160801b0302191690836001600160801b0316021790555084600460146101000a81548163ffffffff021916908363ffffffff16021790555083600460106101000a81548163ffffffff021916908363ffffffff16021790555082600460186101000a81548163ffffffff021916908363ffffffff160217905550816004601c6101000a81548163ffffffff021916908363ffffffff1602179055508363ffffffff168563ffffffff16600460009054906101000a90046001600160801b03166001600160801b03167f56800c9d1ed723511246614d15e58cfcde15b6a33c245b5c961b689c1890fd8f8686604051808363ffffffff1663ffffffff1681526020018263ffffffff1663ffffffff1681526020019250505060405180910390a4505050505050565b6000546001600160a01b031633146200065d576040805162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015290519081900360640190fd5b6003546001600160a01b039081169082168114620006c357600380546001600160a01b0319166001600160a01b0384811691821790925560405190918316907fcfac5dc75b8d9a7e074162f59d9adcd33da59f0fe8dfb21580db298fc0fdad0d90600090a35b5050565b6000828211156200071f576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b508082035b92915050565b600c545b90565b600062000724600262000768620007506001600160e01b036200072a16565b60ff16856200077c60201b620037221790919060201c565b6200077c60201b620037221790919060201c565b6000826200078d5750600062000724565b828202828482816200079b57fe5b0414620007da5760405162461bcd60e51b815260040180806020018281038252602181526020018062004ab36021913960400191505060405180910390fd5b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200082457805160ff191683800117855562000854565b8280016001018555821562000854579182015b828111156200085457825182559160200191906001019062000837565b506200086292915062000866565b5090565b6200072e91905b808211156200086257600081556001016200086d565b60805160a051614202620008b160003980610a845280610d08525080610a0f528061190052506142026000f3fe608060405234801561001057600080fd5b50600436106102535760003560e01c8063668a0f0211610146578063a4c0ed36116100c3578063c937450011610087578063c9374500146108b7578063d4cc54e4146108bf578063e2e40317146108c7578063e9ee6eeb146108ed578063f2fde38b1461091b578063feaf968c1461094157610253565b8063a4c0ed36146107c6578063b5ab58dc14610849578063b633620c14610866578063c107532914610883578063c35905c6146108af57610253565b80638205bf6a1161010a5780638205bf6a1461069557806388aa80e71461069d5780638da5cb5b1461072f57806398e5b12a146107375780639a6fc8f51461075e57610253565b8063668a0f02146105f857806370dea79a146106005780637284e4161461060857806379ba5097146106855780637c2b0b211461068d57610253565b806340884c52116101d457806357970e931161019857806357970e931461059457806358609e441461059c578063613d8fcc146105a4578063628806ef146105ac57806364efb22b146105d257610253565b806340884c521461050057806346fcff4c146105585780634f8fc3b51461057c57806350d25bcd1461058457806354fd4d501461058c57610253565b8063357ebb021161021b578063357ebb021461031557806338aa4c72146103365780633969c20f146103805780633a5381b5146104a65780633d3d7714146104ca57610253565b80631327d3d814610258578063202ee0ed1461028057806320ed0275146102a357806323ca2903146102dd578063313ce567146102f7575b600080fd5b61027e6004803603602081101561026e57600080fd5b50356001600160a01b0316610949565b005b61027e6004803603604081101561029657600080fd5b50803590602001356109ff565b61027e600480360360608110156102b957600080fd5b5080356001600160a01b03169060208101351515906040013563ffffffff16610bd1565b6102e5610d06565b60408051918252519081900360200190f35b6102ff610d2a565b6040805160ff9092168252519081900360200190f35b61031d610d33565b6040805163ffffffff9092168252519081900360200190f35b61027e600480360360a081101561034c57600080fd5b506001600160801b038135169063ffffffff6020820135811691604081013582169160608201358116916080013516610d46565b61027e600480360360c081101561039657600080fd5b810190602081018135600160201b8111156103b057600080fd5b8201836020820111156103c257600080fd5b803590602001918460208302840111600160201b831117156103e357600080fd5b919390929091602081019035600160201b81111561040057600080fd5b82018360208201111561041257600080fd5b803590602001918460208302840111600160201b8311171561043357600080fd5b919390929091602081019035600160201b81111561045057600080fd5b82018360208201111561046257600080fd5b803590602001918460208302840111600160201b8311171561048357600080fd5b919350915063ffffffff81358116916020810135821691604090910135166110e9565b6104ae6112b1565b604080516001600160a01b039092168252519081900360200190f35b61027e600480360360608110156104e057600080fd5b506001600160a01b038135811691602081013590911690604001356112c0565b6105086114b3565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561054457818101518382015260200161052c565b505050509050019250505060405180910390f35b610560611516565b604080516001600160801b039092168252519081900360200190f35b61027e611525565b6102e561163c565b6102e561165e565b6104ae611663565b61031d611672565b6102ff611685565b61027e600480360360208110156105c257600080fd5b50356001600160a01b031661168b565b6104ae600480360360208110156105e857600080fd5b50356001600160a01b0316611771565b6102e561179b565b61031d6117ae565b6106106117c1565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561064a578181015183820152602001610632565b50505050905090810190601f1680156106775780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61027e61184f565b6102e56118fe565b6102e5611922565b6106cf600480360360408110156106b357600080fd5b5080356001600160a01b0316906020013563ffffffff16611957565b60408051981515895263ffffffff9097166020890152878701959095526001600160401b0393841660608801529190921660808601526001600160801b0391821660a086015260ff1660c08501521660e083015251908190036101000190f35b6104ae611ab7565b61073f611ac6565b6040805169ffffffffffffffffffff9092168252519081900360200190f35b6107876004803603602081101561077457600080fd5b503569ffffffffffffffffffff16611be5565b6040805169ffffffffffffffffffff96871681526020810195909552848101939093526060840191909152909216608082015290519081900360a00190f35b61027e600480360360608110156107dc57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561080b57600080fd5b82018360208201111561081d57600080fd5b803590602001918460018302840111600160201b8311171561083e57600080fd5b509092509050611d1f565b6102e56004803603602081101561085f57600080fd5b5035611d80565b6102e56004803603602081101561087c57600080fd5b5035611db4565b61027e6004803603604081101561089957600080fd5b506001600160a01b038135169060200135611df3565b610560611f95565b61031d611fa4565b610560611fb7565b6102e5600480360360208110156108dd57600080fd5b50356001600160a01b0316611fcd565b61027e6004803603604081101561090357600080fd5b506001600160a01b0381358116916020013516611ff1565b61027e6004803603602081101561093157600080fd5b50356001600160a01b03166120d4565b610787612172565b6000546001600160a01b03163314610996576040805162461bcd60e51b815260206004820152601660248201526000805160206141ad833981519152604482015290519081900360640190fd5b6003546001600160a01b0390811690821681146109fb57600380546001600160a01b0319166001600160a01b0384811691821790925560405190918316907fcfac5dc75b8d9a7e074162f59d9adcd33da59f0fe8dfb21580db298fc0fdad0d90600090a35b5050565b6060610a0b33846121ac565b90507f0000000000000000000000000000000000000000000000000000000000000000821215610a82576040805162461bcd60e51b815260206004820152601e60248201527f76616c75652062656c6f77206d696e5375626d697373696f6e56616c75650000604482015290519081900360640190fd5b7f0000000000000000000000000000000000000000000000000000000000000000821315610af7576040805162461bcd60e51b815260206004820152601e60248201527f76616c75652061626f7665206d61785375626d697373696f6e56616c75650000604482015290519081900360640190fd5b8051819015610b845760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610b49578181015183820152602001610b31565b50505050905090810190601f168015610b765780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50610b8e8361244f565b610b9882846124e3565b600080610ba4856125bc565b91509150610bb185612714565b610bba85612857565b8115610bca57610bca85826128b6565b5050505050565b6000546001600160a01b03163314610c1e576040805162461bcd60e51b815260206004820152601660248201526000805160206141ad833981519152604482015290519081900360640190fd5b6001600160a01b0383166000908152600b602052604090205460ff1615158215151415610c4a57610d01565b8115610c8d576001600160a01b0383166000908152600b60205260409020805460ff19168315151764ffffffff00191661010063ffffffff841602179055610cb6565b6001600160a01b0383166000908152600b60205260409020805468ffffffffffffffffff191690555b60408051831515815263ffffffff8316602082015281516001600160a01b038616927fc3df5a754e002718f2e10804b99e6605e7c701d95cec9552c7680ca2b6f2820a928290030190a25b505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60055460ff1681565b600454600160c01b900463ffffffff1681565b6000546001600160a01b03163314610d93576040805162461bcd60e51b815260206004820152601660248201526000805160206141ad833981519152604482015290519081900360640190fd5b6000610d9d611685565b60ff1690508463ffffffff168463ffffffff161015610e03576040805162461bcd60e51b815260206004820152601960248201527f6d6178206d75737420657175616c2f657863656564206d696e00000000000000604482015290519081900360640190fd5b8363ffffffff168163ffffffff161015610e64576040805162461bcd60e51b815260206004820152601760248201527f6d61782063616e6e6f742065786365656420746f74616c000000000000000000604482015290519081900360640190fd5b63ffffffff81161580610e8257508263ffffffff168163ffffffff16115b610ed3576040805162461bcd60e51b815260206004820152601960248201527f64656c61792063616e6e6f742065786365656420746f74616c00000000000000604482015290519081900360640190fd5b610ee5866001600160801b03166129af565b600d546001600160801b03161015610f44576040805162461bcd60e51b815260206004820152601e60248201527f696e73756666696369656e742066756e647320666f72207061796d656e740000604482015290519081900360640190fd5b6000610f4e611685565b60ff161115610fb25760008563ffffffff1611610fb2576040805162461bcd60e51b815260206004820152601a60248201527f6d696e206d7573742062652067726561746572207468616e2030000000000000604482015290519081900360640190fd5b85600460006101000a8154816001600160801b0302191690836001600160801b0316021790555084600460146101000a81548163ffffffff021916908363ffffffff16021790555083600460106101000a81548163ffffffff021916908363ffffffff16021790555082600460186101000a81548163ffffffff021916908363ffffffff160217905550816004601c6101000a81548163ffffffff021916908363ffffffff1602179055508363ffffffff168563ffffffff16600460009054906101000a90046001600160801b03166001600160801b03167f56800c9d1ed723511246614d15e58cfcde15b6a33c245b5c961b689c1890fd8f8686604051808363ffffffff1663ffffffff1681526020018263ffffffff1663ffffffff1681526020019250505060405180910390a4505050505050565b6000546001600160a01b03163314611136576040805162461bcd60e51b815260206004820152601660248201526000805160206141ad833981519152604482015290519081900360640190fd5b60005b8881101561116d576111658a8a8381811061115057fe5b905060200201356001600160a01b03166129dd565b600101611139565b508584146111c2576040805162461bcd60e51b815260206004820181905260248201527f6e6565642073616d65206f7261636c6520616e642061646d696e20636f756e74604482015290519081900360640190fd5b604d6111df876111d0611685565b60ff169063ffffffff612bab16565b1115611228576040805162461bcd60e51b81526020600482015260136024820152721b585e081bdc9858db195cc8185b1b1bddd959606a1b604482015290519081900360640190fd5b60005b8681101561127b5761127388888381811061124257fe5b905060200201356001600160a01b031687878481811061125e57fe5b905060200201356001600160a01b0316612bfa565b60010161122b565b506004546112a6906001600160801b03811690859085908590600160e01b900463ffffffff16610d46565b505050505050505050565b6003546001600160a01b031681565b6001600160a01b03838116600090815260086020526040902060020154620100009004163314611330576040805162461bcd60e51b815260206004820152601660248201527537b7363c9031b0b63630b1363290313c9030b236b4b760511b604482015290519081900360640190fd5b6001600160a01b03831660009081526008602052604090205481906001600160801b039081169082168110156113ad576040805162461bcd60e51b815260206004820152601f60248201527f696e73756666696369656e7420776974686472617761626c652066756e647300604482015290519081900360640190fd5b6113c66001600160801b0382168363ffffffff612e8a16565b6001600160a01b038616600090815260086020526040902080546001600160801b0319166001600160801b03928316179055600d5461140e91600160801b9091041683612e8a565b600d80546001600160801b03928316600160801b029083161790556002546040805163a9059cbb60e01b81526001600160a01b03888116600483015293861660248201529051929091169163a9059cbb916044808201926020929091908290030181600087803b15801561148157600080fd5b505af1158015611495573d6000803e3d6000fd5b505050506040513d60208110156114ab57600080fd5b5051610bca57fe5b6060600c80548060200260200160405190810160405280929190818152602001828054801561150b57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116114ed575b505050505090505b90565b600d546001600160801b031690565b61152d61405b565b50604080518082018252600d546001600160801b038082168352600160801b90910416602080830182905260025484516370a0823160e01b8152306004820152945193946000946115de94936001600160a01b03909316926370a082319260248082019391829003018186803b1580156115a657600080fd5b505afa1580156115ba573d6000803e3d6000fd5b505050506040513d60208110156115d057600080fd5b50519063ffffffff612ef916565b82519091506001600160801b031681146109fb57600d80546001600160801b0319166001600160801b03831617905560405181907ffe25c73e3b9089fac37d55c4c7efcba6f04af04cebd2fc4d6d7dbb07e1e5234f90600090a25050565b600754600160201b900463ffffffff1660009081526009602052604090205490565b600381565b6002546001600160a01b031681565b600454600160801b900463ffffffff1681565b600c5490565b6001600160a01b038181166000908152600860205260409020600301541633146116fc576040805162461bcd60e51b815260206004820152601e60248201527f6f6e6c792063616c6c61626c652062792070656e64696e672061646d696e0000604482015290519081900360640190fd5b6001600160a01b0381166000818152600860205260408082206003810180546001600160a01b0319169055600201805462010000600160b01b031916336201000081029190911790915590519092917f0c5055390645c15a4be9a21b3f8d019153dcb4a0c125685da6eb84048e2fe90491a350565b6001600160a01b03808216600090815260086020526040902060020154620100009004165b919050565b600754600160201b900463ffffffff1690565b600454600160e01b900463ffffffff1681565b6006805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156118475780601f1061181c57610100808354040283529160200191611847565b820191906000526020600020905b81548152906001019060200180831161182a57829003601f168201915b505050505081565b6001546001600160a01b031633146118a7576040805162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b604482015290519081900360640190fd5b60008054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b7f000000000000000000000000000000000000000000000000000000000000000081565b600754600160201b900463ffffffff16600090815260096020526040902060010154600160401b90046001600160401b031690565b6000808080808080803332146119ad576040805162461bcd60e51b81526020600482015260166024820152756f66662d636861696e2072656164696e67206f6e6c7960501b604482015290519081900360640190fd5b63ffffffff891615611a905763ffffffff89166000908152600960209081526040808320600a9092529091206119e38c8c612f50565b6001600160a01b038d1660009081526008602052604090206001908101548482015491840154600d548f936001600160401b031691600160401b900463ffffffff16906001600160801b0316611a37611685565b60018901546001600160401b0316611a5a576004546001600160801b0316611a70565b6001880154600160601b90046001600160801b03165b8363ffffffff169350995099509950995099509950995099505050611aaa565b611a998a612fa5565b975097509750975097509750975097505b9295985092959890939650565b6000546001600160a01b031681565b336000908152600b602052604081205460ff16611b2a576040805162461bcd60e51b815260206004820152601860248201527f6e6f7420617574686f72697a6564207265717565737465720000000000000000604482015290519081900360640190fd5b60075463ffffffff16600081815260096020526040902060010154600160401b90046001600160401b0316151580611b665750611b6681613170565b611bb7576040805162461bcd60e51b815260206004820152601f60248201527f7072657620726f756e64206d75737420626520737570657273656461626c6500604482015290519081900360640190fd5b6000611bce63ffffffff808416906001906131fb16565b9050611bd98161324c565b63ffffffff1691505090565b6000806000806000611bf5614072565b5063ffffffff8087166000908152600960209081526040918290208251608081018452815481526001909101546001600160401b0380821693830193909352600160401b810490921692810192909252600160801b90049091166060820181905215801590611c745750611c748769ffffffffffffffffffff1661331a565b6040518060400160405280600f81526020016e139bc819185d18481c1c995cd95b9d608a1b81525090611ce85760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610b49578181015183820152602001610b31565b50805160208201516040830151606090930151989991986001600160401b0391821698509216955063ffffffff9091169350915050565b8015611d72576040805162461bcd60e51b815260206004820181905260248201527f7472616e7366657220646f65736e2774206163636570742063616c6c64617461604482015290519081900360640190fd5b611d7a611525565b50505050565b6000611d8b8261331a565b15611dac575063ffffffff8116600090815260096020526040902054611796565b506000919050565b6000611dbf8261331a565b15611dac575063ffffffff8116600090815260096020526040902060010154600160401b90046001600160401b0316611796565b6000546001600160a01b03163314611e40576040805162461bcd60e51b815260206004820152601660248201526000805160206141ad833981519152604482015290519081900360640190fd5b600d546004546001600160801b03918216918391611e6f91611e6291166129af565b839063ffffffff612ef916565b1015611ec2576040805162461bcd60e51b815260206004820152601a60248201527f696e73756666696369656e7420726573657276652066756e6473000000000000604482015290519081900360640190fd5b6002546040805163a9059cbb60e01b81526001600160a01b038681166004830152602482018690529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015611f1857600080fd5b505af1158015611f2c573d6000803e3d6000fd5b505050506040513d6020811015611f4257600080fd5b5051611f8d576040805162461bcd60e51b81526020600482015260156024820152741d1bdad95b881d1c985b9cd9995c8819985a5b1959605a1b604482015290519081900360640190fd5b610d01611525565b6004546001600160801b031681565b600454600160a01b900463ffffffff1681565b600d54600160801b90046001600160801b031690565b6001600160a01b03166000908152600860205260409020546001600160801b031690565b6001600160a01b03828116600090815260086020526040902060020154620100009004163314612061576040805162461bcd60e51b815260206004820152601660248201527537b7363c9031b0b63630b1363290313c9030b236b4b760511b604482015290519081900360640190fd5b6001600160a01b0382811660008181526008602090815260409182902060030180546001600160a01b0319169486169485179055815133815290810193909352805191927fb79bf2e89c2d70dde91d2991fb1ea69b7e478061ad7c04ed5b02b96bc52b8104929081900390910190a25050565b6000546001600160a01b03163314612121576040805162461bcd60e51b815260206004820152601660248201526000805160206141ad833981519152604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600080600080600061219b600760049054906101000a900463ffffffff1663ffffffff16611be5565b945094509450945094509091929394565b6001600160a01b03821660009081526008602052604090205460075460609163ffffffff600160801b909104811691168161221557604051806040016040528060128152602001716e6f7420656e61626c6564206f7261636c6560701b81525092505050612449565b8363ffffffff168263ffffffff16111561226157604051806040016040528060168152602001756e6f742079657420656e61626c6564206f7261636c6560501b81525092505050612449565b6001600160a01b03851660009081526008602052604090205463ffffffff808616600160a01b9092041610156122d0576040518060400160405280601881526020017f6e6f206c6f6e67657220616c6c6f776564206f7261636c65000000000000000081525092505050612449565b6001600160a01b03851660009081526008602052604090205463ffffffff808616600160c01b909204161061233e576040518060400160405280602081526020017f63616e6e6f74207265706f7274206f6e2070726576696f757320726f756e647381525092505050612449565b8063ffffffff168463ffffffff161415801561237a575061236a63ffffffff808316906001906131fb16565b63ffffffff168463ffffffff1614155b801561238d575061238b8482613324565b155b156123d1576040518060400160405280601781526020017f696e76616c696420726f756e6420746f207265706f727400000000000000000081525092505050612449565b8363ffffffff1660011415801561240257506124006123fb63ffffffff8087169060019061338416565b6133e7565b155b15612446576040518060400160405280601f81526020017f70726576696f757320726f756e64206e6f7420737570657273656461626c650081525092505050612449565b50505b92915050565b61245881613421565b612461576124e0565b3360009081526008602052604090205460045463ffffffff600160e01b909204821691600160c01b90910481168201908316118015906124a057508015155b156124ab57506124e0565b6124b482613452565b5033600090815260086020526040902080546001600160e01b0316600160e01b63ffffffff8416021790555b50565b6124ec81613605565b61253d576040805162461bcd60e51b815260206004820152601f60248201527f726f756e64206e6f7420616363657074696e67207375626d697373696f6e7300604482015290519081900360640190fd5b63ffffffff81166000818152600a6020908152604080832080546001808201835591855283852001879055338085526008909352818420805463ffffffff60c01b1916600160c01b8702178155018690555190929185917f92e98423f8adac6e64d0608e519fd1cefb861498385c6dee70d58fc926ddc68c9190a45050565b63ffffffff8082166000908152600a602052604081206001810154905491928392600160201b9092041611156125f75750600090508061270f565b63ffffffff83166000908152600a60209081526040808320805482518185028101850190935280835261265d9383018282801561265357602002820191906000526020600020905b81548152602001906001019080831161263f575b5050505050613625565b63ffffffff8516600081815260096020908152604091829020848155600101805467ffffffffffffffff60401b1916600160401b426001600160401b038116919091029190911763ffffffff60801b1916600160801b8602179091556007805467ffffffff000000001916600160201b860217905582519081529151939450919284927f0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f928290030190a36001925090505b915091565b63ffffffff81166000908152600a6020526040902060010154600160601b90046001600160801b031661274561405b565b5060408051808201909152600d546001600160801b03808216808452600160801b90920416602083015261277f908363ffffffff612e8a16565b6001600160801b03908116825260208201516127a291168363ffffffff6136ce16565b6001600160801b0390811660208084018290528351600d8054600160801b9094029185166001600160801b031990941693909317841617909155336000908152600890915260409020546127fd91168363ffffffff6136ce16565b3360009081526008602052604080822080546001600160801b0319166001600160801b03948516179055835190519216917ffe25c73e3b9089fac37d55c4c7efcba6f04af04cebd2fc4d6d7dbb07e1e5234f9190a2505050565b63ffffffff8082166000908152600a602052604090206001810154905491161115612881576124e0565b63ffffffff81166000908152600a60205260408120906128a18282614099565b5060010180546001600160e01b031916905550565b6003546001600160a01b0316806128cd57506109fb565b60006128e463ffffffff8086169060019061338416565b63ffffffff808216600090815260096020908152604080832060018101549054825163beed9b5160e01b8152600160801b90920486166004830181905260248301829052958b166044830152606482018a90529151959650939490936001600160a01b0388169363beed9b5193620186a093608480850194929391928390030190829088803b15801561297657600080fd5b5087f19350505050801561299c57506040513d602081101561299757600080fd5b505160015b6129a5576129a7565b505b505050505050565b600061244960026129d16129c1611685565b859060ff1663ffffffff61372216565b9063ffffffff61372216565b6129e68161377b565b612a2c576040805162461bcd60e51b81526020600482015260126024820152711bdc9858db19481b9bdd08195b98589b195960721b604482015290519081900360640190fd5b600754612a459063ffffffff908116906001906131fb16565b6001600160a01b0382166000908152600860205260408120805463ffffffff93909316600160a01b0263ffffffff60a01b1990931692909217909155600c612a9f6001612a90611685565b60ff169063ffffffff612ef916565b81548110612aa957fe5b6000918252602080832091909101546001600160a01b0385811680855260089093526040808520600290810180549390941680875291862001805461ffff90931661ffff199384168117909155939094528154169055600c8054929350909183919083908110612b1557fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600c805480612b4e57fe5b600082815260208120820160001990810180546001600160a01b03191690559091019091556040516001600160a01b038516907f18dd09695e4fbdae8d1a5edb11221eb04564269c29a089b9753a6535c54ba92e908390a3505050565b600082820183811015612bf3576040805162461bcd60e51b815260206004820152601b602482015260008051602061416c833981519152604482015290519081900360640190fd5b9392505050565b612c038261377b565b15612c4e576040805162461bcd60e51b81526020600482015260166024820152751bdc9858db1948185b1c9958591e48195b98589b195960521b604482015290519081900360640190fd5b6001600160a01b038116612ca1576040805162461bcd60e51b8152602060048201526015602482015274063616e6e6f74207365742061646d696e20746f203605c1b604482015290519081900360640190fd5b6001600160a01b03828116600090815260086020526040902060020154620100009004161580612cf657506001600160a01b038281166000908152600860205260409020600201546201000090048116908216145b612d47576040805162461bcd60e51b815260206004820152601c60248201527f6f776e65722063616e6e6f74206f76657277726974652061646d696e00000000604482015290519081900360640190fd5b612d50826137a6565b6001600160a01b03808416600081815260086020526040808220805463ffffffff60a01b1963ffffffff97909716600160801b0263ffffffff60801b19909116179590951663ffffffff60a01b178555600c80546002909601805461ffff90971661ffff19909716969096178655805460018181019092557fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c70180546001600160a01b031916851790558383528554948716620100000262010000600160b01b0319909516949094179094559251919290917f18dd09695e4fbdae8d1a5edb11221eb04564269c29a089b9753a6535c54ba92e9190a3806001600160a01b0316826001600160a01b03167f0c5055390645c15a4be9a21b3f8d019153dcb4a0c125685da6eb84048e2fe90460405160405180910390a35050565b6000826001600160801b0316826001600160801b03161115612ef3576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082821115612ef3576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b63ffffffff81166000908152600960205260408120600101546001600160401b031615612f9b57612f8082613605565b8015612f945750612f9183836121ac565b51155b9050612449565b612f808383613809565b6001600160a01b0381166000908152600860205260408120600754815483928392839283928392839283927fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b929091849163ffffffff908116600160c01b90920416148061302257506007546130209063ffffffff16613605565b155b6007549091506130379063ffffffff166133e7565b80156130405750805b156130995760075461305e9063ffffffff908116906001906131fb16565b63ffffffff81166000908152600960205260409020600454919b506001600160801b03909116945092506130928c8b613809565b9a506130e3565b60075463ffffffff166000818152600960209081526040808320600a90925290912060010154919b50600160601b9091046001600160801b0316945092506130e08a613605565b9a505b6130ed8c8b6121ac565b51156130f85760009a505b6001808301548482015463ffffffff808e166000908152600a6020526040902090930154600d548f948f94936001600160401b031692600160401b900416906001600160801b0316613148611685565b8a8363ffffffff1693509a509a509a509a509a509a509a509a50505050919395975091939597565b63ffffffff8082166000908152600960209081526040808320600190810154600a909352908320015491926001600160401b0390911691600160401b90041681158015906131c4575060008163ffffffff16115b80156131f35750426131e86001600160401b03841663ffffffff8085169061385316565b6001600160401b0316105b949350505050565b600082820163ffffffff8085169082161015612bf3576040805162461bcd60e51b815260206004820152601b602482015260008051602061416c833981519152604482015290519081900360640190fd5b61325581613421565b61325e576124e0565b336000908152600b602052604090205463ffffffff6501000000000082048116916101009004811682019083161180613295575080155b6132dc576040805162461bcd60e51b81526020600482015260136024820152726d7573742064656c617920726571756573747360681b604482015290519081900360640190fd5b6132e582613452565b50336000908152600b60205260409020805463ffffffff8316650100000000000268ffffffff00000000001990911617905550565b63ffffffff101590565b60008163ffffffff1661334760018563ffffffff166131fb90919063ffffffff16565b63ffffffff16148015612bf357505063ffffffff16600090815260096020526040902060010154600160401b90046001600160401b031615919050565b60008263ffffffff168263ffffffff161115612ef3576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b63ffffffff8116600090815260096020526040812060010154600160401b90046001600160401b0316151580612449575061244982613170565b60075460009061343d9063ffffffff908116906001906131fb16565b63ffffffff168263ffffffff16149050919050565b61346f61346a63ffffffff8084169060019061338416565b6138a7565b6007805463ffffffff191663ffffffff831617905561348c6140b7565b5060408051600060a0820181815260c083018452825260045463ffffffff600160801b82048116602080860191909152600160a01b8304821685870152600160e01b8304821660608601526001600160801b03909216608085015285168252600a8152929020815180519293849361350792849201906140e5565b5060208281015160019283018054604080870151606088015160809098015163ffffffff1990931663ffffffff9586161767ffffffff000000001916600160201b91861691909102176bffffffff00000000000000001916600160401b97851697909702969096176fffffffffffffffffffffffffffffffff60601b1916600160601b6001600160801b03909216919091021790558516600081815260098352849020909201805467ffffffffffffffff1916426001600160401b039081169190911791829055845191168152925133937f0109fc6f55cf40689f02fbaad7af7fe7bbac8a3d2186600afc7d3e10cac6027192908290030190a35050565b63ffffffff9081166000908152600a602052604090206001015416151590565b60008151600010613676576040805162461bcd60e51b81526020600482015260166024820152756c697374206d757374206e6f7420626520656d70747960501b604482015290519081900360640190fd5b815160028104600182166136b55760008061369b866000600187036001870387613969565b90925090506136aa8282613a47565b945050505050611796565b6136c58460006001850384613ab5565b92505050611796565b60008282016001600160801b038085169082161015612bf3576040805162461bcd60e51b815260206004820152601b602482015260008051602061416c833981519152604482015290519081900360640190fd5b60008261373157506000612449565b8282028284828161373e57fe5b0414612bf35760405162461bcd60e51b815260040180806020018281038252602181526020018061418c6021913960400191505060405180910390fd5b6001600160a01b031660009081526008602052604090205463ffffffff600160a01b90910481161490565b60075460009063ffffffff1680158015906137e857506001600160a01b03831660009081526008602052604090205463ffffffff828116600160a01b90920416145b156137f4579050611796565b612bf363ffffffff808316906001906131fb16565b6001600160a01b03821660009081526008602052604081205460045463ffffffff600160e01b909204821691600160c01b9091048116820190841611806131f35750159392505050565b60008282016001600160401b038085169082161015612bf3576040805162461bcd60e51b815260206004820152601b602482015260008051602061416c833981519152604482015290519081900360640190fd5b6138b081613170565b6138b9576124e0565b60006138d063ffffffff8084169060019061338416565b63ffffffff8181166000908152600960209081526040808320805488861685528285209081556001918201549101805463ffffffff60801b1916600160801b928390049096169091029490941767ffffffffffffffff60401b1916600160401b426001600160401b03160217909355600a90529081209192506139538282614099565b5060010180546001600160e01b03191690555050565b60008082841061397857600080fd5b8386111580156139885750848411155b61399157600080fd5b8286111580156139a15750848311155b6139aa57600080fd5b600786860310156139cb576139c28787878787613b46565b91509150613a3d565b60006139d8888888613f19565b90508084116139e957809550613a37565b848110156139fc57806001019650613a37565b808511158015613a0b57508381105b613a1157fe5b613a1d88888388613ab5565b9250613a2e88826001018887613ab5565b9150613a3d9050565b506139aa565b9550959350505050565b60008083128015613a585750600082135b80613a6e5750600083138015613a6e5750600082125b15613a8e576002613a7f8484613ff6565b81613a8657fe5b059050612449565b60006002808507818507010590506131f3613aaf6002860560028605613ff6565b82613ff6565b600081841115613ac457600080fd5b82821115613ad157600080fd5b82841015613b285760078484031015613afd576000613af38686868687613b46565b5091506131f39050565b6000613b0a868686613f19565b9050808311613b1b57809350613b22565b8060010194505b50613ad1565b848481518110613b3457fe5b60200260200101519050949350505050565b600080600086866001010390506000888860000181518110613b6457fe5b60200260200101519050600082600110613b85576001600160ff1b03613b9d565b898960010181518110613b9457fe5b60200260200101515b9050600083600210613bb6576001600160ff1b03613bce565b8a8a60020181518110613bc557fe5b60200260200101515b9050600084600310613be7576001600160ff1b03613bff565b8b8b60030181518110613bf657fe5b60200260200101515b9050600085600410613c18576001600160ff1b03613c30565b8c8c60040181518110613c2757fe5b60200260200101515b9050600086600510613c49576001600160ff1b03613c61565b8d8d60050181518110613c5857fe5b60200260200101515b9050600087600610613c7a576001600160ff1b03613c92565b8e8e60060181518110613c8957fe5b60200260200101515b905085871315613ca0579495945b83851315613cac579293925b81831315613cb8579091905b84871315613cc4579395935b83861315613cd0579294925b80831315613cda57915b84861315613ce6579394935b80821315613cf057905b82871315613cfc579195915b81861315613d08579094905b80851315613d1257935b82861315613d1e579194915b80841315613d2857925b82851315613d34579193915b81841315613d40579092905b82841315613d4c579192915b8d8c0380613d5c57879a50613e02565b8060011415613d6d57869a50613e02565b8060021415613d7e57859a50613e02565b8060031415613d8f57849a50613e02565b8060041415613da057839a50613e02565b8060051415613db157829a50613e02565b8060061415613dc257819a50613e02565b6040805162461bcd60e51b815260206004820152601060248201526f6b31206f7574206f6620626f756e647360801b604482015290519081900360640190fd5b8e8c038d8d1415613e2057508a9950613a3d98505050505050505050565b80613e375750969850613a3d975050505050505050565b8060011415613e525750959850613a3d975050505050505050565b8060021415613e6d5750949850613a3d975050505050505050565b8060031415613e885750939850613a3d975050505050505050565b8060041415613ea35750929850613a3d975050505050505050565b8060051415613ebe5750919850613a3d975050505050505050565b8060061415613ed95750909850613a3d975050505050505050565b6040805162461bcd60e51b815260206004820152601060248201526f6b32206f7574206f6620626f756e647360801b604482015290519081900360640190fd5b6000808460028585010481518110613f2d57fe5b602002602001015190506001840393506001830192505b60018401935080858581518110613f5757fe5b602002602001015112613f44575b60018303925080858481518110613f7857fe5b602002602001015113613f655782841015613fe857848381518110613f9957fe5b6020026020010151858581518110613fad57fe5b6020026020010151868681518110613fc157fe5b60200260200101878681518110613fd457fe5b602090810291909101019190915252613ff1565b82915050612bf3565b613f44565b600082820181831280159061400b5750838112155b80614020575060008312801561402057508381125b612bf35760405162461bcd60e51b815260040180806020018281038252602181526020018061414b6021913960400191505060405180910390fd5b604080518082019091526000808252602082015290565b60408051608081018252600080825260208201819052918101829052606081019190915290565b50805460008255906000526020600020908101906124e09190614130565b6040805160a08101825260608082526000602083018190529282018390528101829052608081019190915290565b828054828255906000526020600020908101928215614120579160200282015b82811115614120578251825591602001919060010190614105565b5061412c929150614130565b5090565b61151391905b8082111561412c576000815560010161413656fe5369676e6564536166654d6174683a206164646974696f6e206f766572666c6f77536166654d6174683a206164646974696f6e206f766572666c6f770000000000536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f6e6c792063616c6c61626c65206279206f776e657200000000000000000000a2646970667358221220a96675756f1f7df1d67153b722225ea02d65b440cae5d81af83a9dea00389da464736f6c63430006060033536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77000000000000000000000000f97f4df75117a78c1a5a0dbb814af92458539fb40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000009464f5245582f5553440000000000000000000000000000000000000000000000

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

000000000000000000000000f97f4df75117a78c1a5a0dbb814af92458539fb40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000009464f5245582f5553440000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _link (address): 0xf97f4df75117a78c1a5a0dbb814af92458539fb4
Arg [1] : _paymentAmount (uint128): 0
Arg [2] : _timeout (uint32): 30
Arg [3] : _validator (address): 0x0000000000000000000000000000000000000000
Arg [4] : _minSubmissionValue (int256): 1
Arg [5] : _maxSubmissionValue (int256): 10000000000000000
Arg [6] : _decimals (uint8): 8
Arg [7] : _description (string): FOREX/USD

-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 000000000000000000000000f97f4df75117a78c1a5a0dbb814af92458539fb4
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 000000000000000000000000000000000000000000000000000000000000001e
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [5] : 000000000000000000000000000000000000000000000000002386f26fc10000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000009
Arg [9] : 464f5245582f5553440000000000000000000000000000000000000000000000


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.