{"constructor_args":"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000008e97b00000000000000000000000000000000000000000000000000000000003578d5000000000000000000000000d07294e6e917e07dfdcee882dd1e2565085c2ae0000000000000000000000000000000000000000000000000000000000000000100000000000000000000ffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000097d989a2d12ab455dd0835b78ce728be5d199a7d000000000000000000000000fc83e9d632362f20f07e178efef0281190311f5d0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000094a5059202f205553440000000000000000000000000000000000000000000000","is_partially_verified":false,"is_changed_bytecode":false,"abi":[{"inputs":[{"internalType":"uint32","name":"_maximumGasPrice","type":"uint32"},{"internalType":"uint32","name":"_reasonableGasPrice","type":"uint32"},{"internalType":"uint32","name":"_microLinkPerEth","type":"uint32"},{"internalType":"uint32","name":"_linkGweiPerObservation","type":"uint32"},{"internalType":"uint32","name":"_linkGweiPerTransmission","type":"uint32"},{"internalType":"contract LinkTokenInterface","name":"_link","type":"address"},{"internalType":"int192","name":"_minAnswer","type":"int192"},{"internalType":"int192","name":"_maxAnswer","type":"int192"},{"internalType":"contract AccessControllerInterface","name":"_billingAccessController","type":"address"},{"internalType":"contract AccessControllerInterface","name":"_requesterAccessController","type":"address"},{"internalType":"uint8","name":"_decimals","type":"uint8"},{"internalType":"string","name":"description","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"AddedAccess","type":"event"},{"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":false,"internalType":"contract AccessControllerInterface","name":"old","type":"address"},{"indexed":false,"internalType":"contract AccessControllerInterface","name":"current","type":"address"}],"name":"BillingAccessControllerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"maximumGasPrice","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"reasonableGasPrice","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"microLinkPerEth","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"linkGweiPerObservation","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"linkGweiPerTransmission","type":"uint32"}],"name":"BillingSet","type":"event"},{"anonymous":false,"inputs":[],"name":"CheckAccessDisabled","type":"event"},{"anonymous":false,"inputs":[],"name":"CheckAccessEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"previousConfigBlockNumber","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"configCount","type":"uint64"},{"indexed":false,"internalType":"address[]","name":"signers","type":"address[]"},{"indexed":false,"internalType":"address[]","name":"transmitters","type":"address[]"},{"indexed":false,"internalType":"uint8","name":"threshold","type":"uint8"},{"indexed":false,"internalType":"uint64","name":"encodedConfigVersion","type":"uint64"},{"indexed":false,"internalType":"bytes","name":"encoded","type":"bytes"}],"name":"ConfigSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract LinkTokenInterface","name":"_oldLinkToken","type":"address"},{"indexed":true,"internalType":"contract LinkTokenInterface","name":"_newLinkToken","type":"address"}],"name":"LinkTokenSet","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":"uint32","name":"aggregatorRoundId","type":"uint32"},{"indexed":false,"internalType":"int192","name":"answer","type":"int192"},{"indexed":false,"internalType":"address","name":"transmitter","type":"address"},{"indexed":false,"internalType":"int192[]","name":"observations","type":"int192[]"},{"indexed":false,"internalType":"bytes","name":"observers","type":"bytes"},{"indexed":false,"internalType":"bytes32","name":"rawReportContext","type":"bytes32"}],"name":"NewTransmission","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"transmitter","type":"address"},{"indexed":true,"internalType":"address","name":"payee","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"contract LinkTokenInterface","name":"linkToken","type":"address"}],"name":"OraclePaid","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":"transmitter","type":"address"},{"indexed":true,"internalType":"address","name":"current","type":"address"},{"indexed":true,"internalType":"address","name":"proposed","type":"address"}],"name":"PayeeshipTransferRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"transmitter","type":"address"},{"indexed":true,"internalType":"address","name":"previous","type":"address"},{"indexed":true,"internalType":"address","name":"current","type":"address"}],"name":"PayeeshipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"RemovedAccess","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract AccessControllerInterface","name":"old","type":"address"},{"indexed":false,"internalType":"contract AccessControllerInterface","name":"current","type":"address"}],"name":"RequesterAccessControllerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"requester","type":"address"},{"indexed":false,"internalType":"bytes16","name":"configDigest","type":"bytes16"},{"indexed":false,"internalType":"uint32","name":"epoch","type":"uint32"},{"indexed":false,"internalType":"uint8","name":"round","type":"uint8"}],"name":"RoundRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract AggregatorValidatorInterface","name":"previousValidator","type":"address"},{"indexed":false,"internalType":"uint32","name":"previousGasLimit","type":"uint32"},{"indexed":true,"internalType":"contract AggregatorValidatorInterface","name":"currentValidator","type":"address"},{"indexed":false,"internalType":"uint32","name":"currentGasLimit","type":"uint32"}],"name":"ValidatorConfigSet","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_transmitter","type":"address"}],"name":"acceptPayeeship","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"addAccess","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"billingAccessController","outputs":[{"internalType":"contract AccessControllerInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"checkEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":[],"name":"disableAccessCheck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableAccessCheck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_roundId","type":"uint256"}],"name":"getAnswer","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBilling","outputs":[{"internalType":"uint32","name":"maximumGasPrice","type":"uint32"},{"internalType":"uint32","name":"reasonableGasPrice","type":"uint32"},{"internalType":"uint32","name":"microLinkPerEth","type":"uint32"},{"internalType":"uint32","name":"linkGweiPerObservation","type":"uint32"},{"internalType":"uint32","name":"linkGweiPerTransmission","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLinkToken","outputs":[{"internalType":"contract LinkTokenInterface","name":"linkToken","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":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"bytes","name":"_calldata","type":"bytes"}],"name":"hasAccess","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestAnswer","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestConfigDetails","outputs":[{"internalType":"uint32","name":"configCount","type":"uint32"},{"internalType":"uint32","name":"blockNumber","type":"uint32"},{"internalType":"bytes16","name":"configDigest","type":"bytes16"}],"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":"latestTransmissionDetails","outputs":[{"internalType":"bytes16","name":"configDigest","type":"bytes16"},{"internalType":"uint32","name":"epoch","type":"uint32"},{"internalType":"uint8","name":"round","type":"uint8"},{"internalType":"int192","name":"latestAnswer","type":"int192"},{"internalType":"uint64","name":"latestTimestamp","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"linkAvailableForPayment","outputs":[{"internalType":"int256","name":"availableBalance","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxAnswer","outputs":[{"internalType":"int192","name":"","type":"int192"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minAnswer","outputs":[{"internalType":"int192","name":"","type":"int192"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_signerOrTransmitter","type":"address"}],"name":"oracleObservationCount","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_transmitter","type":"address"}],"name":"owedPayment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"removeAccess","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requestNewRound","outputs":[{"internalType":"uint80","name":"","type":"uint80"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requesterAccessController","outputs":[{"internalType":"contract AccessControllerInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_maximumGasPrice","type":"uint32"},{"internalType":"uint32","name":"_reasonableGasPrice","type":"uint32"},{"internalType":"uint32","name":"_microLinkPerEth","type":"uint32"},{"internalType":"uint32","name":"_linkGweiPerObservation","type":"uint32"},{"internalType":"uint32","name":"_linkGweiPerTransmission","type":"uint32"}],"name":"setBilling","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract AccessControllerInterface","name":"_billingAccessController","type":"address"}],"name":"setBillingAccessController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_signers","type":"address[]"},{"internalType":"address[]","name":"_transmitters","type":"address[]"},{"internalType":"uint8","name":"_threshold","type":"uint8"},{"internalType":"uint64","name":"_encodedConfigVersion","type":"uint64"},{"internalType":"bytes","name":"_encoded","type":"bytes"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract LinkTokenInterface","name":"_linkToken","type":"address"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"setLinkToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_transmitters","type":"address[]"},{"internalType":"address[]","name":"_payees","type":"address[]"}],"name":"setPayees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract AccessControllerInterface","name":"_requesterAccessController","type":"address"}],"name":"setRequesterAccessController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract AggregatorValidatorInterface","name":"_newValidator","type":"address"},{"internalType":"uint32","name":"_newGasLimit","type":"uint32"}],"name":"setValidatorConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_transmitter","type":"address"},{"internalType":"address","name":"_proposed","type":"address"}],"name":"transferPayeeship","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_report","type":"bytes"},{"internalType":"bytes32[]","name":"_rs","type":"bytes32[]"},{"internalType":"bytes32[]","name":"_ss","type":"bytes32[]"},{"internalType":"bytes32","name":"_rawVs","type":"bytes32"}],"name":"transmit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"transmitters","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"typeAndVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"validatorConfig","outputs":[{"internalType":"contract AggregatorValidatorInterface","name":"validator","type":"address"},{"internalType":"uint32","name":"gasLimit","type":"uint32"}],"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":"_transmitter","type":"address"}],"name":"withdrawPayment","outputs":[],"stateMutability":"nonpayable","type":"function"}],"conflicting_implementations":null,"certified":false,"additional_sources":[{"file_path":"contract/AccessControllerInterface.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.7.0;\n\ninterface AccessControllerInterface {\n  function hasAccess(address user, bytes calldata data) external view returns (bool);\n}\n"},{"file_path":"contract/AggregatorInterface.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.7.0;\n\ninterface AggregatorInterface {\n  function latestAnswer() external view returns (int256);\n  function latestTimestamp() external view returns (uint256);\n  function latestRound() external view returns (uint256);\n  function getAnswer(uint256 roundId) external view returns (int256);\n  function getTimestamp(uint256 roundId) external view returns (uint256);\n\n  event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 updatedAt);\n  event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt);\n}\n"},{"file_path":"contract/AggregatorV2V3Interface.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.7.0;\n\nimport \"./AggregatorInterface.sol\";\nimport \"./AggregatorV3Interface.sol\";\n\ninterface AggregatorV2V3Interface is AggregatorInterface, AggregatorV3Interface\n{\n}"},{"file_path":"contract/AggregatorV3Interface.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.7.0;\n\ninterface AggregatorV3Interface {\n\n  function decimals() external view returns (uint8);\n  function description() external view returns (string memory);\n  function version() external view returns (uint256);\n\n  function getRoundData(uint80 _roundId)\n    external\n    view\n    returns (\n      uint80 roundId,\n      int256 answer,\n      uint256 startedAt,\n      uint256 updatedAt,\n      uint80 answeredInRound\n    );\n  function latestRoundData()\n    external\n    view\n    returns (\n      uint80 roundId,\n      int256 answer,\n      uint256 startedAt,\n      uint256 updatedAt,\n      uint80 answeredInRound\n    );\n\n}\n"},{"file_path":"contract/AggregatorValidatorInterface.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.7.0;\n\ninterface AggregatorValidatorInterface {\n  function validate(\n    uint256 previousRoundId,\n    int256 previousAnswer,\n    uint256 currentRoundId,\n    int256 currentAnswer\n  ) external returns (bool);\n}"},{"file_path":"contract/LinkTokenInterface.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.7.0;\n\ninterface LinkTokenInterface {\n  function allowance(address owner, address spender) external view returns (uint256 remaining);\n  function approve(address spender, uint256 value) external returns (bool success);\n  function balanceOf(address owner) external view returns (uint256 balance);\n  function decimals() external view returns (uint8 decimalPlaces);\n  function decreaseApproval(address spender, uint256 addedValue) external returns (bool success);\n  function increaseApproval(address spender, uint256 subtractedValue) external;\n  function name() external view returns (string memory tokenName);\n  function symbol() external view returns (string memory tokenSymbol);\n  function totalSupply() external view returns (uint256 totalTokensIssued);\n  function transfer(address to, uint256 value) external returns (bool success);\n  function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool success);\n  function transferFrom(address from, address to, uint256 value) external returns (bool success);\n}\n"},{"file_path":"contract/OffchainAggregator.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.7.6;\n\nimport \"./AccessControllerInterface.sol\";\nimport \"./AggregatorV2V3Interface.sol\";\nimport \"./AggregatorValidatorInterface.sol\";\nimport \"./LinkTokenInterface.sol\";\nimport \"./Owned.sol\";\nimport \"./OffchainAggregatorBilling.sol\";\nimport \"./TypeAndVersionInterface.sol\";\n\n/**\n  * @notice Onchain verification of reports from the offchain reporting protocol\n\n  * @dev For details on its operation, see the offchain reporting protocol design\n  * @dev doc, which refers to this contract as simply the \"contract\".\n*/\ncontract OffchainAggregator is Owned, OffchainAggregatorBilling, AggregatorV2V3Interface, TypeAndVersionInterface {\n\n  uint256 constant private maxUint32 = (1 << 32) - 1;\n\n  // Storing these fields used on the hot path in a HotVars variable reduces the\n  // retrieval of all of them to a single SLOAD. If any further fields are\n  // added, make sure that storage of the struct still takes at most 32 bytes.\n  struct HotVars {\n    // Provides 128 bits of security against 2nd pre-image attacks, but only\n    // 64 bits against collisions. This is acceptable, since a malicious owner has\n    // easier way of messing up the protocol than to find hash collisions.\n    bytes16 latestConfigDigest;\n    uint40 latestEpochAndRound; // 32 most sig bits for epoch, 8 least sig bits for round\n    // Current bound assumed on number of faulty/dishonest oracles participating\n    // in the protocol, this value is referred to as f in the design\n    uint8 threshold;\n    // Chainlink Aggregators expose a roundId to consumers. The offchain reporting\n    // protocol does not use this id anywhere. We increment it whenever a new\n    // transmission is made to provide callers with contiguous ids for successive\n    // reports.\n    uint32 latestAggregatorRoundId;\n  }\n  HotVars internal s_hotVars;\n\n  // Transmission records the median answer from the transmit transaction at\n  // time timestamp\n  struct Transmission {\n    int192 answer; // 192 bits ought to be enough for anyone\n    uint64 timestamp;\n  }\n  mapping(uint32 /* aggregator round ID */ => Transmission) internal s_transmissions;\n\n  // incremented each time a new config is posted. This count is incorporated\n  // into the config digest, to prevent replay attacks.\n  uint32 internal s_configCount;\n  uint32 internal s_latestConfigBlockNumber; // makes it easier for offchain systems\n                                             // to extract config from logs.\n\n  // Lowest answer the system is allowed to report in response to transmissions\n  int192 immutable public minAnswer;\n  // Highest answer the system is allowed to report in response to transmissions\n  int192 immutable public maxAnswer;\n\n  /*\n   * @param _maximumGasPrice highest gas price for which transmitter will be compensated\n   * @param _reasonableGasPrice transmitter will receive reward for gas prices under this value\n   * @param _microLinkPerEth reimbursement per ETH of gas cost, in 1e-6LINK units\n   * @param _linkGweiPerObservation reward to oracle for contributing an observation to a successfully transmitted report, in 1e-9LINK units\n   * @param _linkGweiPerTransmission reward to transmitter of a successful report, in 1e-9LINK units\n   * @param _link address of the LINK contract\n   * @param _minAnswer lowest answer the median of a report is allowed to be\n   * @param _maxAnswer highest answer the median of a report is allowed to be\n   * @param _billingAccessController access controller for billing admin functions\n   * @param _requesterAccessController access controller for requesting new rounds\n   * @param _decimals answers are stored in fixed-point format, with this many digits of precision\n   * @param _description short human-readable description of observable this contract's answers pertain to\n   */\n  constructor(\n    uint32 _maximumGasPrice,\n    uint32 _reasonableGasPrice,\n    uint32 _microLinkPerEth,\n    uint32 _linkGweiPerObservation,\n    uint32 _linkGweiPerTransmission,\n    LinkTokenInterface _link,\n    int192 _minAnswer,\n    int192 _maxAnswer,\n    AccessControllerInterface _billingAccessController,\n    AccessControllerInterface _requesterAccessController,\n    uint8 _decimals,\n    string memory _description\n  )\n    OffchainAggregatorBilling(_maximumGasPrice, _reasonableGasPrice, _microLinkPerEth,\n      _linkGweiPerObservation, _linkGweiPerTransmission, _link,\n      _billingAccessController\n    )\n  {\n    decimals = _decimals;\n    s_description = _description;\n    setRequesterAccessController(_requesterAccessController);\n    setValidatorConfig(AggregatorValidatorInterface(0x0), 0);\n    minAnswer = _minAnswer;\n    maxAnswer = _maxAnswer;\n  }\n\n  /*\n   * Versioning\n   */\n  function typeAndVersion()\n    external\n    override\n    pure\n    virtual\n    returns (string memory)\n  {\n    return \"OffchainAggregator 4.0.0\";\n  }\n\n  /*\n   * Config logic\n   */\n\n  /**\n   * @notice triggers a new run of the offchain reporting protocol\n   * @param previousConfigBlockNumber block in which the previous config was set, to simplify historic analysis\n   * @param configCount ordinal number of this config setting among all config settings over the life of this contract\n   * @param signers ith element is address ith oracle uses to sign a report\n   * @param transmitters ith element is address ith oracle uses to transmit a report via the transmit method\n   * @param threshold maximum number of faulty/dishonest oracles the protocol can tolerate while still working correctly\n   * @param encodedConfigVersion version of the serialization format used for \"encoded\" parameter\n   * @param encoded serialized data used by oracles to configure their offchain operation\n   */\n  event ConfigSet(\n    uint32 previousConfigBlockNumber,\n    uint64 configCount,\n    address[] signers,\n    address[] transmitters,\n    uint8 threshold,\n    uint64 encodedConfigVersion,\n    bytes encoded\n  );\n\n  // Reverts transaction if config args are invalid\n  modifier checkConfigValid (\n    uint256 _numSigners, uint256 _numTransmitters, uint256 _threshold\n  ) {\n    require(_numSigners <= maxNumOracles, \"too many signers\");\n    require(_threshold > 0, \"threshold must be positive\");\n    require(\n      _numSigners == _numTransmitters,\n      \"oracle addresses out of registration\"\n    );\n    require(_numSigners > 3*_threshold, \"faulty-oracle threshold too high\");\n    _;\n  }\n\n  /**\n   * @notice sets offchain reporting protocol configuration incl. participating oracles\n   * @param _signers addresses with which oracles sign the reports\n   * @param _transmitters addresses oracles use to transmit the reports\n   * @param _threshold number of faulty oracles the system can tolerate\n   * @param _encodedConfigVersion version number for offchainEncoding schema\n   * @param _encoded encoded off-chain oracle configuration\n   */\n  function setConfig(\n    address[] calldata _signers,\n    address[] calldata _transmitters,\n    uint8 _threshold,\n    uint64 _encodedConfigVersion,\n    bytes calldata _encoded\n  )\n    external\n    checkConfigValid(_signers.length, _transmitters.length, _threshold)\n    onlyOwner()\n  {\n    while (s_signers.length != 0) { // remove any old signer/transmitter addresses\n      uint lastIdx = s_signers.length - 1;\n      address signer = s_signers[lastIdx];\n      address transmitter = s_transmitters[lastIdx];\n      payOracle(transmitter);\n      delete s_oracles[signer];\n      delete s_oracles[transmitter];\n      s_signers.pop();\n      s_transmitters.pop();\n    }\n\n    for (uint i = 0; i < _signers.length; i++) { // add new signer/transmitter addresses\n      require(\n        s_oracles[_signers[i]].role == Role.Unset,\n        \"repeated signer address\"\n      );\n      s_oracles[_signers[i]] = Oracle(uint8(i), Role.Signer);\n      require(s_payees[_transmitters[i]] != address(0), \"payee must be set\");\n      require(\n        s_oracles[_transmitters[i]].role == Role.Unset,\n        \"repeated transmitter address\"\n      );\n      s_oracles[_transmitters[i]] = Oracle(uint8(i), Role.Transmitter);\n      s_signers.push(_signers[i]);\n      s_transmitters.push(_transmitters[i]);\n    }\n    s_hotVars.threshold = _threshold;\n    uint32 previousConfigBlockNumber = s_latestConfigBlockNumber;\n    s_latestConfigBlockNumber = uint32(block.number);\n    s_configCount += 1;\n    uint64 configCount = s_configCount;\n    {\n      s_hotVars.latestConfigDigest = configDigestFromConfigData(\n        address(this),\n        configCount,\n        _signers,\n        _transmitters,\n        _threshold,\n        _encodedConfigVersion,\n        _encoded\n      );\n      s_hotVars.latestEpochAndRound = 0;\n    }\n    emit ConfigSet(\n      previousConfigBlockNumber,\n      configCount,\n      _signers,\n      _transmitters,\n      _threshold,\n      _encodedConfigVersion,\n      _encoded\n    );\n  }\n\n  function configDigestFromConfigData(\n    address _contractAddress,\n    uint64 _configCount,\n    address[] calldata _signers,\n    address[] calldata _transmitters,\n    uint8 _threshold,\n    uint64 _encodedConfigVersion,\n    bytes calldata _encodedConfig\n  ) internal pure returns (bytes16) {\n    return bytes16(keccak256(abi.encode(_contractAddress, _configCount,\n      _signers, _transmitters, _threshold, _encodedConfigVersion, _encodedConfig\n    )));\n  }\n\n  /**\n   * @notice information about current offchain reporting protocol configuration\n\n   * @return configCount ordinal number of current config, out of all configs applied to this contract so far\n   * @return blockNumber block at which this config was set\n   * @return configDigest domain-separation tag for current config (see configDigestFromConfigData)\n   */\n  function latestConfigDetails()\n    external\n    view\n    returns (\n      uint32 configCount,\n      uint32 blockNumber,\n      bytes16 configDigest\n    )\n  {\n    return (s_configCount, s_latestConfigBlockNumber, s_hotVars.latestConfigDigest);\n  }\n\n  /**\n   * @return list of addresses permitted to transmit reports to this contract\n\n   * @dev The list will match the order used to specify the transmitter during setConfig\n   */\n  function transmitters()\n    external\n    view\n    returns(address[] memory)\n  {\n      return s_transmitters;\n  }\n\n  /*\n   * On-chain validation logc\n   */\n\n  // Configuration for validator\n  struct ValidatorConfig {\n    AggregatorValidatorInterface validator;\n    uint32 gasLimit;\n  }\n  ValidatorConfig private s_validatorConfig;\n\n  /**\n   * @notice indicates that the validator configuration has been set\n   * @param previousValidator previous validator contract\n   * @param previousGasLimit previous gas limit for validate calls\n   * @param currentValidator current validator contract\n   * @param currentGasLimit current gas limit for validate calls\n   */\n  event ValidatorConfigSet(\n    AggregatorValidatorInterface indexed previousValidator,\n    uint32 previousGasLimit,\n    AggregatorValidatorInterface indexed currentValidator,\n    uint32 currentGasLimit\n  );\n\n  /**\n   * @notice validator configuration\n   * @return validator validator contract\n   * @return gasLimit gas limit for validate calls\n   */\n  function validatorConfig()\n    external\n    view\n    returns (AggregatorValidatorInterface validator, uint32 gasLimit)\n  {\n    ValidatorConfig memory vc = s_validatorConfig;\n    return (vc.validator, vc.gasLimit);\n  }\n\n  /**\n   * @notice sets validator configuration\n   * @dev set _newValidator to 0x0 to disable validate calls\n   * @param _newValidator address of the new validator contract\n   * @param _newGasLimit new gas limit for validate calls\n   */\n  function setValidatorConfig(AggregatorValidatorInterface _newValidator, uint32 _newGasLimit)\n    public\n    onlyOwner()\n  {\n    ValidatorConfig memory previous = s_validatorConfig;\n\n    if (previous.validator != _newValidator || previous.gasLimit != _newGasLimit) {\n      s_validatorConfig = ValidatorConfig({\n        validator: _newValidator,\n        gasLimit: _newGasLimit\n      });\n\n      emit ValidatorConfigSet(previous.validator, previous.gasLimit, _newValidator, _newGasLimit);\n    }\n  }\n\n  function validateAnswer(\n    uint32 _aggregatorRoundId,\n    int256 _answer\n  )\n    private\n  {\n    ValidatorConfig memory vc = s_validatorConfig;\n\n    if (address(vc.validator) == address(0)) {\n      return;\n    }\n\n    uint32 prevAggregatorRoundId = _aggregatorRoundId - 1;\n    int256 prevAggregatorRoundAnswer = s_transmissions[prevAggregatorRoundId].answer;\n    require(\n      callWithExactGasEvenIfTargetIsNoContract(\n        vc.gasLimit,\n        address(vc.validator),\n        abi.encodeWithSignature(\n          \"validate(uint256,int256,uint256,int256)\",\n          uint256(prevAggregatorRoundId),\n          prevAggregatorRoundAnswer,\n          uint256(_aggregatorRoundId),\n          _answer\n        )\n      ),\n      \"insufficient gas\"\n    );\n  }\n\n  uint256 private constant CALL_WITH_EXACT_GAS_CUSHION = 5_000;\n\n  /**\n   * @dev calls target address with exactly gasAmount gas and data as calldata\n   * or reverts if at least gasAmount gas is not available.\n   */\n  function callWithExactGasEvenIfTargetIsNoContract(\n    uint256 _gasAmount,\n    address _target,\n    bytes memory _data\n  )\n    private\n    returns (bool sufficientGas)\n  {\n    // solhint-disable-next-line no-inline-assembly\n    assembly {\n      let g := gas()\n      // Compute g -= CALL_WITH_EXACT_GAS_CUSHION and check for underflow. We\n      // need the cushion since the logic following the above call to gas also\n      // costs gas which we cannot account for exactly. So cushion is a\n      // conservative upper bound for the cost of this logic.\n      if iszero(lt(g, CALL_WITH_EXACT_GAS_CUSHION)) {\n        g := sub(g, CALL_WITH_EXACT_GAS_CUSHION)\n        // If g - g//64 <= _gasAmount, we don't have enough gas. (We subtract g//64\n        // because of EIP-150.)\n        if gt(sub(g, div(g, 64)), _gasAmount) {\n          // Call and ignore success/return data. Note that we did not check\n          // whether a contract actually exists at the _target address.\n          pop(call(_gasAmount, _target, 0, add(_data, 0x20), mload(_data), 0, 0))\n          sufficientGas := true\n        }\n      }\n    }\n  }\n\n  /*\n   * requestNewRound logic\n   */\n\n  AccessControllerInterface internal s_requesterAccessController;\n\n  /**\n   * @notice emitted when a new requester access controller contract is set\n   * @param old the address prior to the current setting\n   * @param current the address of the new access controller contract\n   */\n  event RequesterAccessControllerSet(AccessControllerInterface old, AccessControllerInterface current);\n\n  /**\n   * @notice emitted to immediately request a new round\n   * @param requester the address of the requester\n   * @param configDigest the latest transmission's configDigest\n   * @param epoch the latest transmission's epoch\n   * @param round the latest transmission's round\n   */\n  event RoundRequested(address indexed requester, bytes16 configDigest, uint32 epoch, uint8 round);\n\n  /**\n   * @notice address of the requester access controller contract\n   * @return requester access controller address\n   */\n  function requesterAccessController()\n    external\n    view\n    returns (AccessControllerInterface)\n  {\n    return s_requesterAccessController;\n  }\n\n  /**\n   * @notice sets the requester access controller\n   * @param _requesterAccessController designates the address of the new requester access controller\n   */\n  function setRequesterAccessController(AccessControllerInterface _requesterAccessController)\n    public\n    onlyOwner()\n  {\n    AccessControllerInterface oldController = s_requesterAccessController;\n    if (_requesterAccessController != oldController) {\n      s_requesterAccessController = AccessControllerInterface(_requesterAccessController);\n      emit RequesterAccessControllerSet(oldController, _requesterAccessController);\n    }\n  }\n\n  /**\n   * @notice immediately requests a new round\n   * @return the aggregatorRoundId of the next round. Note: The report for this round may have been\n   * transmitted (but not yet mined) *before* requestNewRound() was even called. There is *no*\n   * guarantee of causality between the request and the report at aggregatorRoundId.\n   */\n  function requestNewRound() external returns (uint80) {\n    require(msg.sender == owner || s_requesterAccessController.hasAccess(msg.sender, msg.data),\n      \"Only owner&requester can call\");\n\n    HotVars memory hotVars = s_hotVars;\n\n    emit RoundRequested(\n      msg.sender,\n      hotVars.latestConfigDigest,\n      uint32(s_hotVars.latestEpochAndRound >> 8),\n      uint8(s_hotVars.latestEpochAndRound)\n    );\n    return hotVars.latestAggregatorRoundId + 1;\n  }\n\n  /*\n   * Transmission logic\n   */\n\n  /**\n   * @notice indicates that a new report was transmitted\n   * @param aggregatorRoundId the round to which this report was assigned\n   * @param answer median of the observations attached this report\n   * @param transmitter address from which the report was transmitted\n   * @param observations observations transmitted with this report\n   * @param rawReportContext signature-replay-prevention domain-separation tag\n   */\n  event NewTransmission(\n    uint32 indexed aggregatorRoundId,\n    int192 answer,\n    address transmitter,\n    int192[] observations,\n    bytes observers,\n    bytes32 rawReportContext\n  );\n\n  // decodeReport is used to check that the solidity and go code are using the\n  // same format. See TestOffchainAggregator.testDecodeReport and TestReportParsing\n  function decodeReport(bytes memory _report)\n    internal\n    pure\n    returns (\n      bytes32 rawReportContext,\n      bytes32 rawObservers,\n      int192[] memory observations\n    )\n  {\n    (rawReportContext, rawObservers, observations) = abi.decode(_report,\n      (bytes32, bytes32, int192[]));\n  }\n\n  // Used to relieve stack pressure in transmit\n  struct ReportData {\n    HotVars hotVars; // Only read from storage once\n    bytes observers; // ith element is the index of the ith observer\n    int192[] observations; // ith element is the ith observation\n    bytes vs; // jth element is the v component of the jth signature\n    bytes32 rawReportContext;\n  }\n\n  /*\n   * @notice details about the most recent report\n\n   * @return configDigest domain separation tag for the latest report\n   * @return epoch epoch in which the latest report was generated\n   * @return round OCR round in which the latest report was generated\n   * @return latestAnswer median value from latest report\n   * @return latestTimestamp when the latest report was transmitted\n   */\n  function latestTransmissionDetails()\n    external\n    view\n    returns (\n      bytes16 configDigest,\n      uint32 epoch,\n      uint8 round,\n      int192 latestAnswer,\n      uint64 latestTimestamp\n    )\n  {\n    require(msg.sender == tx.origin, \"Only callable by EOA\");\n    return (\n      s_hotVars.latestConfigDigest,\n      uint32(s_hotVars.latestEpochAndRound >> 8),\n      uint8(s_hotVars.latestEpochAndRound),\n      s_transmissions[s_hotVars.latestAggregatorRoundId].answer,\n      s_transmissions[s_hotVars.latestAggregatorRoundId].timestamp\n    );\n  }\n\n  // The constant-length components of the msg.data sent to transmit.\n  // See the \"If we wanted to call sam\" example on for example reasoning\n  // https://solidity.readthedocs.io/en/v0.7.2/abi-spec.html\n  uint16 private constant TRANSMIT_MSGDATA_CONSTANT_LENGTH_COMPONENT =\n    4 + // function selector\n    32 + // word containing start location of abiencoded _report value\n    32 + // word containing location start of abiencoded  _rs value\n    32 + // word containing start location of abiencoded _ss value\n    32 + // _rawVs value\n    32 + // word containing length of _report\n    32 + // word containing length _rs\n    32 + // word containing length of _ss\n    0; // placeholder\n\n  function expectedMsgDataLength(\n    bytes calldata _report, bytes32[] calldata _rs, bytes32[] calldata _ss\n  ) private pure returns (uint256 length)\n  {\n    // calldata will never be big enough to make this overflow\n    return uint256(TRANSMIT_MSGDATA_CONSTANT_LENGTH_COMPONENT) +\n      _report.length + // one byte pure entry in _report\n      _rs.length * 32 + // 32 bytes per entry in _rs\n      _ss.length * 32 + // 32 bytes per entry in _ss\n      0; // placeholder\n  }\n\n  /**\n   * @notice transmit is called to post a new report to the contract\n   * @param _report serialized report, which the signatures are signing. See parsing code below for format. The ith element of the observers component must be the index in s_signers of the address for the ith signature\n   * @param _rs ith element is the R components of the ith signature on report. Must have at most maxNumOracles entries\n   * @param _ss ith element is the S components of the ith signature on report. Must have at most maxNumOracles entries\n   * @param _rawVs ith element is the the V component of the ith signature\n   */\n  function transmit(\n    // NOTE: If these parameters are changed, expectedMsgDataLength and/or\n    // TRANSMIT_MSGDATA_CONSTANT_LENGTH_COMPONENT need to be changed accordingly\n    bytes calldata _report,\n    bytes32[] calldata _rs, bytes32[] calldata _ss, bytes32 _rawVs // signatures\n  )\n    external\n  {\n    uint256 initialGas = gasleft(); // This line must come first\n    // Make sure the transmit message-length matches the inputs. Otherwise, the\n    // transmitter could append an arbitrarily long (up to gas-block limit)\n    // string of 0 bytes, which we would reimburse at a rate of 16 gas/byte, but\n    // which would only cost the transmitter 4 gas/byte. (Appendix G of the\n    // yellow paper, p. 25, for G_txdatazero and EIP 2028 for G_txdatanonzero.)\n    // This could amount to reimbursement profit of 36 million gas, given a 3MB\n    // zero tail.\n    require(msg.data.length == expectedMsgDataLength(_report, _rs, _ss),\n      \"transmit message too long\");\n    ReportData memory r; // Relieves stack pressure\n    {\n      r.hotVars = s_hotVars; // cache read from storage\n\n      bytes32 rawObservers;\n      (r.rawReportContext, rawObservers, r.observations) = abi.decode(\n        _report, (bytes32, bytes32, int192[])\n      );\n\n      // rawReportContext consists of:\n      // 11-byte zero padding\n      // 16-byte configDigest\n      // 4-byte epoch\n      // 1-byte round\n\n      bytes16 configDigest = bytes16(r.rawReportContext << 88);\n      require(\n        r.hotVars.latestConfigDigest == configDigest,\n        \"configDigest mismatch\"\n      );\n\n      uint40 epochAndRound = uint40(uint256(r.rawReportContext));\n\n      // direct numerical comparison works here, because\n      //\n      //   ((e,r) <= (e',r')) implies (epochAndRound <= epochAndRound')\n      //\n      // because alphabetic ordering implies e <= e', and if e = e', then r<=r',\n      // so e*256+r <= e'*256+r', because r, r' < 256\n      require(r.hotVars.latestEpochAndRound < epochAndRound, \"stale report\");\n\n      require(_rs.length > r.hotVars.threshold, \"not enough signatures\");\n      require(_rs.length <= maxNumOracles, \"too many signatures\");\n      require(_ss.length == _rs.length, \"signatures out of registration\");\n      require(r.observations.length <= maxNumOracles,\n              \"num observations out of bounds\");\n      require(r.observations.length > 2 * r.hotVars.threshold,\n              \"too few values to trust median\");\n\n      // Copy signature parities in bytes32 _rawVs to bytes r.v\n      r.vs = new bytes(_rs.length);\n      for (uint8 i = 0; i < _rs.length; i++) {\n        r.vs[i] = _rawVs[i];\n      }\n\n      // Copy observer identities in bytes32 rawObservers to bytes r.observers\n      r.observers = new bytes(r.observations.length);\n      bool[maxNumOracles] memory seen;\n      for (uint8 i = 0; i < r.observations.length; i++) {\n        uint8 observerIdx = uint8(rawObservers[i]);\n        require(!seen[observerIdx], \"observer index repeated\");\n        seen[observerIdx] = true;\n        r.observers[i] = rawObservers[i];\n      }\n\n      Oracle memory transmitter = s_oracles[msg.sender];\n      require( // Check that sender is authorized to report\n        transmitter.role == Role.Transmitter &&\n        msg.sender == s_transmitters[transmitter.index],\n        \"unauthorized transmitter\"\n      );\n      // record epochAndRound here, so that we don't have to carry the local\n      // variable in transmit. The change is reverted if something fails later.\n      r.hotVars.latestEpochAndRound = epochAndRound;\n    }\n\n    { // Verify signatures attached to report\n      bytes32 h = keccak256(_report);\n      bool[maxNumOracles] memory signed;\n\n      Oracle memory o;\n      for (uint i = 0; i < _rs.length; i++) {\n        address signer = ecrecover(h, uint8(r.vs[i])+27, _rs[i], _ss[i]);\n        o = s_oracles[signer];\n        require(o.role == Role.Signer, \"address not authorized to sign\");\n        require(!signed[o.index], \"non-unique signature\");\n        signed[o.index] = true;\n      }\n    }\n\n    { // Check the report contents, and record the result\n      for (uint i = 0; i < r.observations.length - 1; i++) {\n        bool inOrder = r.observations[i] <= r.observations[i+1];\n        require(inOrder, \"observations not sorted\");\n      }\n\n      int192 median = r.observations[r.observations.length/2];\n      require(minAnswer <= median && median <= maxAnswer, \"median is out of min-max range\");\n      r.hotVars.latestAggregatorRoundId++;\n      s_transmissions[r.hotVars.latestAggregatorRoundId] =\n        Transmission(median, uint64(block.timestamp));\n\n      emit NewTransmission(\n        r.hotVars.latestAggregatorRoundId,\n        median,\n        msg.sender,\n        r.observations,\n        r.observers,\n        r.rawReportContext\n      );\n      // Emit these for backwards compatability with offchain consumers\n      // that only support legacy events\n      emit NewRound(\n        r.hotVars.latestAggregatorRoundId,\n        address(0x0), // use zero address since we don't have anybody \"starting\" the round here\n        block.timestamp\n      );\n      emit AnswerUpdated(\n        median,\n        r.hotVars.latestAggregatorRoundId,\n        block.timestamp\n      );\n\n      validateAnswer(r.hotVars.latestAggregatorRoundId, median);\n    }\n    s_hotVars = r.hotVars;\n    assert(initialGas < maxUint32);\n    reimburseAndRewardOracles(uint32(initialGas), r.observers);\n  }\n\n  /*\n   * v2 Aggregator interface\n   */\n\n  /**\n   * @notice median from the most recent report\n   */\n  function latestAnswer()\n    public\n    override\n    view\n    virtual\n    returns (int256)\n  {\n    return s_transmissions[s_hotVars.latestAggregatorRoundId].answer;\n  }\n\n  /**\n   * @notice timestamp of block in which last report was transmitted\n   */\n  function latestTimestamp()\n    public\n    override\n    view\n    virtual\n    returns (uint256)\n  {\n    return s_transmissions[s_hotVars.latestAggregatorRoundId].timestamp;\n  }\n\n  /**\n   * @notice Aggregator round (NOT OCR round) in which last report was transmitted\n   */\n  function latestRound()\n    public\n    override\n    view\n    virtual\n    returns (uint256)\n  {\n    return s_hotVars.latestAggregatorRoundId;\n  }\n\n  /**\n   * @notice median of report from given aggregator round (NOT OCR round)\n   * @param _roundId the aggregator round of the target report\n   */\n  function getAnswer(uint256 _roundId)\n    public\n    override\n    view\n    virtual\n    returns (int256)\n  {\n    if (_roundId > 0xFFFFFFFF) { return 0; }\n    return s_transmissions[uint32(_roundId)].answer;\n  }\n\n  /**\n   * @notice timestamp of block in which report from given aggregator round was transmitted\n   * @param _roundId aggregator round (NOT OCR round) of target report\n   */\n  function getTimestamp(uint256 _roundId)\n    public\n    override\n    view\n    virtual\n    returns (uint256)\n  {\n    if (_roundId > 0xFFFFFFFF) { return 0; }\n    return s_transmissions[uint32(_roundId)].timestamp;\n  }\n\n  /*\n   * v3 Aggregator interface\n   */\n\n  string constant private V3_NO_DATA_ERROR = \"No data present\";\n\n  /**\n   * @return answers are stored in fixed-point format, with this many digits of precision\n   */\n  uint8 immutable public override decimals;\n\n  /**\n   * @notice aggregator contract version\n   */\n  uint256 constant public override version = 4;\n\n  string internal s_description;\n\n  /**\n   * @notice human-readable description of observable this contract is reporting on\n   */\n  function description()\n    public\n    override\n    view\n    virtual\n    returns (string memory)\n  {\n    return s_description;\n  }\n\n  /**\n   * @notice details for the given aggregator round\n   * @param _roundId target aggregator round (NOT OCR round). Must fit in uint32\n   * @return roundId _roundId\n   * @return answer median of report from given _roundId\n   * @return startedAt timestamp of block in which report from given _roundId was transmitted\n   * @return updatedAt timestamp of block in which report from given _roundId was transmitted\n   * @return answeredInRound _roundId\n   */\n  function getRoundData(uint80 _roundId)\n    public\n    override\n    view\n    virtual\n    returns (\n      uint80 roundId,\n      int256 answer,\n      uint256 startedAt,\n      uint256 updatedAt,\n      uint80 answeredInRound\n    )\n  {\n    require(_roundId <= 0xFFFFFFFF, V3_NO_DATA_ERROR);\n    Transmission memory transmission = s_transmissions[uint32(_roundId)];\n    return (\n      _roundId,\n      transmission.answer,\n      transmission.timestamp,\n      transmission.timestamp,\n      _roundId\n    );\n  }\n\n  /**\n   * @notice aggregator details for the most recently transmitted report\n   * @return roundId aggregator round of latest report (NOT OCR round)\n   * @return answer median of latest report\n   * @return startedAt timestamp of block containing latest report\n   * @return updatedAt timestamp of block containing latest report\n   * @return answeredInRound aggregator round of latest report\n   */\n  function latestRoundData()\n    public\n    override\n    view\n    virtual\n    returns (\n      uint80 roundId,\n      int256 answer,\n      uint256 startedAt,\n      uint256 updatedAt,\n      uint80 answeredInRound\n    )\n  {\n    roundId = s_hotVars.latestAggregatorRoundId;\n\n    // Skipped for compatability with existing FluxAggregator in which latestRoundData never reverts.\n    // require(roundId != 0, V3_NO_DATA_ERROR);\n\n    Transmission memory transmission = s_transmissions[uint32(roundId)];\n    return (\n      roundId,\n      transmission.answer,\n      transmission.timestamp,\n      transmission.timestamp,\n      roundId\n    );\n  }\n}\n"},{"file_path":"contract/OffchainAggregatorBilling.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.7.6;\n\nimport \"./AccessControllerInterface.sol\";\nimport \"./LinkTokenInterface.sol\";\nimport \"./Owned.sol\";\n\n/**\n * @notice tracks administration of oracle-reward and gas-reimbursement parameters.\n\n * @dev\n * If you read or change this, be sure to read or adjust the comments. They\n * track the units of the values under consideration, and are crucial to\n * the readability of the operations it specifies.\n\n * @notice\n * Trust Model:\n\n * Nothing in this contract prevents a billing admin from setting insane\n * values for the billing parameters in setBilling. Oracles\n * participating in this contract should regularly check that the\n * parameters make sense. Similarly, the outstanding obligations of this\n * contract to the oracles can exceed the funds held by the contract.\n * Oracles participating in this contract should regularly check that it\n * holds sufficient funds and stop interacting with it if funding runs\n * out.\n\n * This still leaves oracles with some risk due to TOCTOU issues.\n * However, since the sums involved are pretty small (Ethereum\n * transactions aren't that expensive in the end) and an oracle would\n * likely stop participating in a contract it repeatedly lost money on,\n * this risk is deemed acceptable. Oracles should also regularly\n * withdraw any funds in the contract to prevent issues where the\n * contract becomes underfunded at a later time, and different oracles\n * are competing for the left-over funds.\n\n * Finally, note that any change to the set of oracles or to the billing\n * parameters will trigger payout of all oracles first (using the old\n * parameters), a billing admin cannot take away funds that are already\n * marked for payment.\n*/\ncontract OffchainAggregatorBilling is Owned {\n\n  // Maximum number of oracles the offchain reporting protocol is designed for\n  uint256 constant internal maxNumOracles = 31;\n\n  // Parameters for oracle payments\n  struct Billing {\n\n    // Highest compensated gas price, in ETH-gwei uints\n    uint32 maximumGasPrice;\n\n    // If gas price is less (in ETH-gwei units), transmitter gets half the savings\n    uint32 reasonableGasPrice;\n\n    // Pay transmitter back this much LINK per unit eth spent on gas\n    // (1e-6LINK/ETH units)\n    uint32 microLinkPerEth;\n\n    // Fixed LINK reward for each observer, in LINK-gwei units\n    uint32 linkGweiPerObservation;\n\n    // Fixed reward for transmitter, in linkGweiPerObservation units\n    uint32 linkGweiPerTransmission;\n  }\n  Billing internal s_billing;\n\n  // We assume that the token contract is correct. This contract is not written\n  // to handle misbehaving ERC20 tokens!\n  LinkTokenInterface internal s_linkToken;\n\n  AccessControllerInterface internal s_billingAccessController;\n\n  // ith element is number of observation rewards due to ith process, plus one.\n  // This is expected to saturate after an oracle has submitted 65,535\n  // observations, or about 65535/(3*24*20) = 45 days, given a transmission\n  // every 3 minutes.\n  //\n  // This is always one greater than the actual value, so that when the value is\n  // reset to zero, we don't end up with a zero value in storage (which would\n  // result in a higher gas cost, the next time the value is incremented.)\n  // Calculations using this variable need to take that offset into account.\n  uint16[maxNumOracles] internal s_oracleObservationsCounts;\n\n  // Addresses at which oracles want to receive payments, by transmitter address\n  mapping (address /* transmitter */ => address /* payment address */)\n    internal\n    s_payees;\n\n  // Payee addresses which must be approved by the owner\n  mapping (address /* transmitter */ => address /* payment address */)\n    internal\n    s_proposedPayees;\n\n  // LINK-wei-denominated reimbursements for gas used by transmitters.\n  //\n  // This is always one greater than the actual value, so that when the value is\n  // reset to zero, we don't end up with a zero value in storage (which would\n  // result in a higher gas cost, the next time the value is incremented.)\n  // Calculations using this variable need to take that offset into account.\n  //\n  // Argument for overflow safety:\n  // We have the following maximum intermediate values:\n  // - 2**40 additions to this variable (epochAndRound is a uint40)\n  // - 2**32 gas price in ethgwei/gas\n  // - 1e9 ethwei/ethgwei\n  // - 2**32 gas since the block gas limit is at ~20 million\n  // - 2**32 (microlink/eth)\n  // And we have 2**40 * 2**32 * 1e9 * 2**32 * 2**32 < 2**166\n  // (we also divide in some places, but that only makes the value smaller)\n  // We can thus safely use uint256 intermediate values for the computation\n  // updating this variable.\n  uint256[maxNumOracles] internal s_gasReimbursementsLinkWei;\n\n  // Used for s_oracles[a].role, where a is an address, to track the purpose\n  // of the address, or to indicate that the address is unset.\n  enum Role {\n    // No oracle role has been set for address a\n    Unset,\n    // Signing address for the s_oracles[a].index'th oracle. I.e., report\n    // signatures from this oracle should ecrecover back to address a.\n    Signer,\n    // Transmission address for the s_oracles[a].index'th oracle. I.e., if a\n    // report is received by OffchainAggregator.transmit in which msg.sender is\n    // a, it is attributed to the s_oracles[a].index'th oracle.\n    Transmitter\n  }\n\n  struct Oracle {\n    uint8 index; // Index of oracle in s_signers/s_transmitters\n    Role role;   // Role of the address which mapped to this struct\n  }\n\n  mapping (address /* signer OR transmitter address */ => Oracle)\n    internal s_oracles;\n\n  // s_signers contains the signing address of each oracle\n  address[] internal s_signers;\n\n  // s_transmitters contains the transmission address of each oracle,\n  // i.e. the address the oracle actually sends transactions to the contract from\n  address[] internal s_transmitters;\n\n  uint256 constant private  maxUint16 = (1 << 16) - 1;\n  uint256 constant internal maxUint128 = (1 << 128) - 1;\n\n  constructor(\n    uint32 _maximumGasPrice,\n    uint32 _reasonableGasPrice,\n    uint32 _microLinkPerEth,\n    uint32 _linkGweiPerObservation,\n    uint32 _linkGweiPerTransmission,\n    LinkTokenInterface _link,\n    AccessControllerInterface _billingAccessController\n  )\n  {\n    setBillingInternal(_maximumGasPrice, _reasonableGasPrice, _microLinkPerEth,\n      _linkGweiPerObservation, _linkGweiPerTransmission);\n    s_linkToken = _link;\n    emit LinkTokenSet(LinkTokenInterface(address(0)), _link);\n    setBillingAccessControllerInternal(_billingAccessController);\n    uint16[maxNumOracles] memory counts; // See s_oracleObservationsCounts docstring\n    uint256[maxNumOracles] memory gas; // see s_gasReimbursementsLinkWei docstring\n    for (uint8 i = 0; i < maxNumOracles; i++) {\n      counts[i] = 1;\n      gas[i] = 1;\n    }\n    s_oracleObservationsCounts = counts;\n    s_gasReimbursementsLinkWei = gas;\n  }\n\n  /*\n   * @notice emitted when the LINK token contract is set\n   * @param _oldLinkToken the address of the old LINK token contract\n   * @param _newLinkToken the address of the new LINK token contract\n   */\n  event LinkTokenSet(\n    LinkTokenInterface indexed _oldLinkToken,\n    LinkTokenInterface indexed _newLinkToken\n  );\n\n  /*\n   * @notice sets the LINK token contract used for paying oracles\n   * @param _linkToken the address of the LINK token contract\n   * @param _recipient remaining funds from the previous token contract are transfered\n   * here\n   * @dev this function will return early (without an error) without changing any state\n   * if _linkToken equals getLinkToken().\n   * @dev this will trigger a payout so that a malicious owner cannot take from oracles\n   * what is already owed to them.\n   * @dev we assume that the token contract is correct. This contract is not written\n   * to handle misbehaving ERC20 tokens!\n   */\n  function setLinkToken(\n    LinkTokenInterface _linkToken,\n    address _recipient\n  ) external\n    onlyOwner()\n  {\n    LinkTokenInterface oldLinkToken = s_linkToken;\n    if (_linkToken == oldLinkToken) {\n      // No change, nothing to be done\n      return;\n    }\n    // call balanceOf as a sanity check on whether we're talking to a token\n    // contract\n    _linkToken.balanceOf(address(this));\n    // we break CEI here, but that's okay because we're dealing with a correct\n    // token contract (by assumption).\n    payOracles();\n    uint256 remainingBalance = oldLinkToken.balanceOf(address(this));\n    require(oldLinkToken.transfer(_recipient, remainingBalance), \"transfer remaining funds failed\");\n    s_linkToken = _linkToken;\n    emit LinkTokenSet(oldLinkToken, _linkToken);\n  }\n\n  /*\n   * @notice gets the LINK token contract used for paying oracles\n   * @return linkToken the address of the LINK token contract\n   */\n  function getLinkToken()\n    external\n    view\n    returns(LinkTokenInterface linkToken)\n  {\n    return s_linkToken;\n  }\n\n  /**\n   * @notice emitted when billing parameters are set\n   * @param maximumGasPrice highest gas price for which transmitter will be compensated\n   * @param reasonableGasPrice transmitter will receive reward for gas prices under this value\n   * @param microLinkPerEth reimbursement per ETH of gas cost, in 1e-6LINK units\n   * @param linkGweiPerObservation reward to oracle for contributing an observation to a successfully transmitted report, in 1e-9LINK units\n   * @param linkGweiPerTransmission reward to transmitter of a successful report, in 1e-9LINK units\n   */\n  event BillingSet(\n    uint32 maximumGasPrice,\n    uint32 reasonableGasPrice,\n    uint32 microLinkPerEth,\n    uint32 linkGweiPerObservation,\n    uint32 linkGweiPerTransmission\n  );\n\n  function setBillingInternal(\n    uint32 _maximumGasPrice,\n    uint32 _reasonableGasPrice,\n    uint32 _microLinkPerEth,\n    uint32 _linkGweiPerObservation,\n    uint32 _linkGweiPerTransmission\n  )\n    internal\n  {\n    s_billing = Billing(_maximumGasPrice, _reasonableGasPrice, _microLinkPerEth,\n      _linkGweiPerObservation, _linkGweiPerTransmission);\n    emit BillingSet(_maximumGasPrice, _reasonableGasPrice, _microLinkPerEth,\n      _linkGweiPerObservation, _linkGweiPerTransmission);\n  }\n\n  /**\n   * @notice sets billing parameters\n   * @param _maximumGasPrice highest gas price for which transmitter will be compensated\n   * @param _reasonableGasPrice transmitter will receive reward for gas prices under this value\n   * @param _microLinkPerEth reimbursement per ETH of gas cost, in 1e-6LINK units\n   * @param _linkGweiPerObservation reward to oracle for contributing an observation to a successfully transmitted report, in 1e-9LINK units\n   * @param _linkGweiPerTransmission reward to transmitter of a successful report, in 1e-9LINK units\n   * @dev access control provided by billingAccessController\n   */\n  function setBilling(\n    uint32 _maximumGasPrice,\n    uint32 _reasonableGasPrice,\n    uint32 _microLinkPerEth,\n    uint32 _linkGweiPerObservation,\n    uint32 _linkGweiPerTransmission\n  )\n    external\n  {\n    AccessControllerInterface access = s_billingAccessController;\n    require(msg.sender == owner || access.hasAccess(msg.sender, msg.data),\n      \"Only owner&billingAdmin can call\");\n    payOracles();\n    setBillingInternal(_maximumGasPrice, _reasonableGasPrice, _microLinkPerEth,\n      _linkGweiPerObservation, _linkGweiPerTransmission);\n  }\n\n  /**\n   * @notice gets billing parameters\n   * @param maximumGasPrice highest gas price for which transmitter will be compensated\n   * @param reasonableGasPrice transmitter will receive reward for gas prices under this value\n   * @param microLinkPerEth reimbursement per ETH of gas cost, in 1e-6LINK units\n   * @param linkGweiPerObservation reward to oracle for contributing an observation to a successfully transmitted report, in 1e-9LINK units\n   * @param linkGweiPerTransmission reward to transmitter of a successful report, in 1e-9LINK units\n   */\n  function getBilling()\n    external\n    view\n    returns (\n      uint32 maximumGasPrice,\n      uint32 reasonableGasPrice,\n      uint32 microLinkPerEth,\n      uint32 linkGweiPerObservation,\n      uint32 linkGweiPerTransmission\n    )\n  {\n    Billing memory billing = s_billing;\n    return (\n      billing.maximumGasPrice,\n      billing.reasonableGasPrice,\n      billing.microLinkPerEth,\n      billing.linkGweiPerObservation,\n      billing.linkGweiPerTransmission\n    );\n  }\n\n  /**\n   * @notice emitted when a new access-control contract is set\n   * @param old the address prior to the current setting\n   * @param current the address of the new access-control contract\n   */\n  event BillingAccessControllerSet(AccessControllerInterface old, AccessControllerInterface current);\n\n  function setBillingAccessControllerInternal(AccessControllerInterface _billingAccessController)\n    internal\n  {\n    AccessControllerInterface oldController = s_billingAccessController;\n    if (_billingAccessController != oldController) {\n      s_billingAccessController = _billingAccessController;\n      emit BillingAccessControllerSet(\n        oldController,\n        _billingAccessController\n      );\n    }\n  }\n\n  /**\n   * @notice sets billingAccessController\n   * @param _billingAccessController new billingAccessController contract address\n   * @dev only owner can call this\n   */\n  function setBillingAccessController(AccessControllerInterface _billingAccessController)\n    external\n    onlyOwner\n  {\n    setBillingAccessControllerInternal(_billingAccessController);\n  }\n\n  /**\n   * @notice gets billingAccessController\n   * @return address of billingAccessController contract\n   */\n  function billingAccessController()\n    external\n    view\n    returns (AccessControllerInterface)\n  {\n    return s_billingAccessController;\n  }\n\n  /**\n   * @notice withdraws an oracle's payment from the contract\n   * @param _transmitter the transmitter address of the oracle\n   * @dev must be called by oracle's payee address\n   */\n  function withdrawPayment(address _transmitter)\n    external\n  {\n    require(msg.sender == s_payees[_transmitter], \"Only payee can withdraw\");\n    payOracle(_transmitter);\n  }\n\n  /**\n   * @notice query an oracle's payment amount\n   * @param _transmitter the transmitter address of the oracle\n   */\n  function owedPayment(address _transmitter)\n    public\n    view\n    returns (uint256)\n  {\n    Oracle memory oracle = s_oracles[_transmitter];\n    if (oracle.role == Role.Unset) { return 0; }\n    Billing memory billing = s_billing;\n    uint256 linkWeiAmount =\n      uint256(s_oracleObservationsCounts[oracle.index] - 1) *\n      uint256(billing.linkGweiPerObservation) *\n      (1 gwei);\n    linkWeiAmount += s_gasReimbursementsLinkWei[oracle.index] - 1;\n    return linkWeiAmount;\n  }\n\n  /**\n   * @notice emitted when an oracle has been paid LINK\n   * @param transmitter address from which the oracle sends reports to the transmit method\n   * @param payee address to which the payment is sent\n   * @param amount amount of LINK sent\n   * @param linkToken address of the LINK token contract\n   */\n  event OraclePaid(\n    address indexed transmitter,\n    address indexed payee,\n    uint256 amount,\n    LinkTokenInterface indexed linkToken\n  );\n\n  // payOracle pays out _transmitter's balance to the corresponding payee, and zeros it out\n  function payOracle(address _transmitter)\n    internal\n  {\n    Oracle memory oracle = s_oracles[_transmitter];\n    uint256 linkWeiAmount = owedPayment(_transmitter);\n    if (linkWeiAmount > 0) {\n      address payee = s_payees[_transmitter];\n      // Poses no re-entrancy issues, because LINK.transfer does not yield\n      // control flow.\n      require(s_linkToken.transfer(payee, linkWeiAmount), \"insufficient funds\");\n      s_oracleObservationsCounts[oracle.index] = 1; // \"zero\" the counts. see var's docstring\n      s_gasReimbursementsLinkWei[oracle.index] = 1; // \"zero\" the counts. see var's docstring\n      emit OraclePaid(_transmitter, payee, linkWeiAmount, s_linkToken);\n    }\n  }\n\n  // payOracles pays out all transmitters, and zeros out their balances.\n  //\n  // It's much more gas-efficient to do this as a single operation, to avoid\n  // hitting storage too much.\n  function payOracles()\n    internal\n  {\n    Billing memory billing = s_billing;\n    LinkTokenInterface linkToken = s_linkToken;\n    uint16[maxNumOracles] memory observationsCounts = s_oracleObservationsCounts;\n    uint256[maxNumOracles] memory gasReimbursementsLinkWei =\n      s_gasReimbursementsLinkWei;\n    address[] memory transmitters = s_transmitters;\n    for (uint transmitteridx = 0; transmitteridx < transmitters.length; transmitteridx++) {\n      uint256 reimbursementAmountLinkWei = gasReimbursementsLinkWei[transmitteridx] - 1;\n      uint256 obsCount = observationsCounts[transmitteridx] - 1;\n      uint256 linkWeiAmount =\n        obsCount * uint256(billing.linkGweiPerObservation) * (1 gwei) + reimbursementAmountLinkWei;\n      if (linkWeiAmount > 0) {\n          address payee = s_payees[transmitters[transmitteridx]];\n          // Poses no re-entrancy issues, because LINK.transfer does not yield\n          // control flow.\n          require(linkToken.transfer(payee, linkWeiAmount), \"insufficient funds\");\n          observationsCounts[transmitteridx] = 1;       // \"zero\" the counts.\n          gasReimbursementsLinkWei[transmitteridx] = 1; // \"zero\" the counts.\n          emit OraclePaid(transmitters[transmitteridx], payee, linkWeiAmount, linkToken);\n        }\n    }\n    // \"Zero\" the accounting storage variables\n    s_oracleObservationsCounts = observationsCounts;\n    s_gasReimbursementsLinkWei = gasReimbursementsLinkWei;\n  }\n\n  function oracleRewards(\n    bytes memory observers,\n    uint16[maxNumOracles] memory observations\n  )\n    internal\n    pure\n    returns (uint16[maxNumOracles] memory)\n  {\n    // reward each observer-participant with the observer reward\n    for (uint obsIdx = 0; obsIdx < observers.length; obsIdx++) {\n      uint8 observer = uint8(observers[obsIdx]);\n      observations[observer] = saturatingAddUint16(observations[observer], 1);\n    }\n    return observations;\n  }\n\n  // This value needs to change if maxNumOracles is increased, or the accounting\n  // calculations at the bottom of reimburseAndRewardOracles change.\n  //\n  // To recalculate it, run the profiler as described in\n  // ../../profile/README.md, and add up the gas-usage values reported for the\n  // lines in reimburseAndRewardOracles following the \"gasLeft = gasleft()\"\n  // line. E.g., you will see output like this:\n  //\n  //      7        uint256 gasLeft = gasleft();\n  //     29        uint256 gasCostEthWei = transmitterGasCostEthWei(\n  //      9          uint256(initialGas),\n  //      3          gasPrice,\n  //      3          callDataGasCost,\n  //      3          gasLeft\n  //      .\n  //      .\n  //      .\n  //     59        uint256 gasCostLinkWei = (gasCostEthWei * billing.microLinkPerEth)/ 1e6;\n  //      .\n  //      .\n  //      .\n  //   5047        s_gasReimbursementsLinkWei[txOracle.index] =\n  //    856          s_gasReimbursementsLinkWei[txOracle.index] + gasCostLinkWei +\n  //     26          uint256(billing.linkGweiPerTransmission) * (1 gwei);\n  //\n  // If those were the only lines to be accounted for, you would add up\n  // 29+9+3+3+3+59+5047+856+26=6035.\n  uint256 internal constant accountingGasCost = 6035;\n\n  // Uncomment the following declaration to compute the remaining gas cost after\n  // above gasleft(). (This must exist in a base class to OffchainAggregator, so\n  // it can't go in TestOffchainAggregator.)\n  //\n  // uint256 public gasUsedInAccounting;\n\n  // Gas price at which the transmitter should be reimbursed, in ETH-gwei/gas\n  function impliedGasPrice(\n    uint256 txGasPrice,         // ETH-gwei/gas units\n    uint256 reasonableGasPrice, // ETH-gwei/gas units\n    uint256 maximumGasPrice     // ETH-gwei/gas units\n  )\n    internal\n    pure\n    returns (uint256)\n  {\n    // Reward the transmitter for choosing an efficient gas price: if they manage\n    // to come in lower than considered reasonable, give them half the savings.\n    //\n    // The following calculations are all in units of gwei/gas, i.e. 1e-9ETH/gas\n    uint256 gasPrice = txGasPrice;\n    if (txGasPrice < reasonableGasPrice) {\n      // Give transmitter half the savings for coming in under the reasonable gas price\n      gasPrice += (reasonableGasPrice - txGasPrice) / 2;\n    }\n    // Don't reimburse a gas price higher than maximumGasPrice\n    return min(gasPrice, maximumGasPrice);\n  }\n\n  // gas reimbursement due the transmitter, in ETH-wei\n  //\n  // If this function is changed, accountingGasCost needs to change, too. See\n  // its docstring\n  function transmitterGasCostEthWei(\n    uint256 initialGas,\n    uint256 gasPrice, // ETH-gwei/gas units\n    uint256 callDataCost, // gas units\n    uint256 gasLeft\n  )\n    internal\n    pure\n    returns (uint128 gasCostEthWei)\n  {\n    require(initialGas >= gasLeft, \"gasLeft cannot exceed initialGas\");\n    uint256 gasUsed = // gas units\n      initialGas - gasLeft + // observed gas usage\n      callDataCost + accountingGasCost; // estimated gas usage\n    // gasUsed is in gas units, gasPrice is in ETH-gwei/gas units; convert to ETH-wei\n    uint256 fullGasCostEthWei = gasUsed * gasPrice * (1 gwei);\n    assert(fullGasCostEthWei < maxUint128); // the entire ETH supply fits in a uint128...\n    return uint128(fullGasCostEthWei);\n  }\n\n  /**\n   * @notice withdraw any available funds left in the contract, up to _amount, after accounting for the funds due to participants in past reports\n   * @param _recipient address to send funds to\n   * @param _amount maximum amount to withdraw, denominated in LINK-wei.\n   * @dev access control provided by billingAccessController\n   */\n  function withdrawFunds(address _recipient, uint256 _amount)\n    external\n  {\n    require(msg.sender == owner || s_billingAccessController.hasAccess(msg.sender, msg.data),\n      \"Only owner&billingAdmin can call\");\n    uint256 linkDue = totalLINKDue();\n    uint256 linkBalance = s_linkToken.balanceOf(address(this));\n    require(linkBalance >= linkDue, \"insufficient balance\");\n    require(s_linkToken.transfer(_recipient, min(linkBalance - linkDue, _amount)), \"insufficient funds\");\n  }\n\n  // Total LINK due to participants in past reports.\n  function totalLINKDue()\n    internal\n    view\n    returns (uint256 linkDue)\n  {\n    // Argument for overflow safety: We do all computations in\n    // uint256s. The inputs to linkDue are:\n    // - the <= 31 observation rewards each of which has less than\n    //   64 bits (32 bits for billing.linkGweiPerObservation, 32 bits\n    //   for wei/gwei conversion). Hence 69 bits are sufficient for this part.\n    // - the <= 31 gas reimbursements, each of which consists of at most 166\n    //   bits (see s_gasReimbursementsLinkWei docstring). Hence 171 bits are\n    //   sufficient for this part\n    // In total, 172 bits are enough.\n    uint16[maxNumOracles] memory observationCounts = s_oracleObservationsCounts;\n    for (uint i = 0; i < maxNumOracles; i++) {\n      linkDue += observationCounts[i] - 1; // Stored value is one greater than actual value\n    }\n    Billing memory billing = s_billing;\n    // Convert linkGweiPerObservation to uint256, or this overflows!\n    linkDue *= uint256(billing.linkGweiPerObservation) * (1 gwei);\n    address[] memory transmitters = s_transmitters;\n    uint256[maxNumOracles] memory gasReimbursementsLinkWei =\n      s_gasReimbursementsLinkWei;\n    for (uint i = 0; i < transmitters.length; i++) {\n      linkDue += uint256(gasReimbursementsLinkWei[i]-1); // Stored value is one greater than actual value\n    }\n  }\n\n  /**\n   * @notice allows oracles to check that sufficient LINK balance is available\n   * @return availableBalance LINK available on this contract, after accounting for outstanding obligations. can become negative\n   */\n  function linkAvailableForPayment()\n    external\n    view\n    returns (int256 availableBalance)\n  {\n    // there are at most one billion LINK, so this cast is safe\n    int256 balance = int256(s_linkToken.balanceOf(address(this)));\n    // according to the argument in the definition of totalLINKDue,\n    // totalLINKDue is never greater than 2**172, so this cast is safe\n    int256 due = int256(totalLINKDue());\n    // safe from overflow according to above sizes\n    return int256(balance) - int256(due);\n  }\n\n  /**\n   * @notice number of observations oracle is due to be reimbursed for\n   * @param _signerOrTransmitter address used by oracle for signing or transmitting reports\n   */\n  function oracleObservationCount(address _signerOrTransmitter)\n    external\n    view\n    returns (uint16)\n  {\n    Oracle memory oracle = s_oracles[_signerOrTransmitter];\n    if (oracle.role == Role.Unset) { return 0; }\n    return s_oracleObservationsCounts[oracle.index] - 1;\n  }\n\n\n  function reimburseAndRewardOracles(\n    uint32 initialGas,\n    bytes memory observers\n  )\n    internal\n  {\n    Oracle memory txOracle = s_oracles[msg.sender];\n    Billing memory billing = s_billing;\n    // Reward oracles for providing observations. Oracles are not rewarded\n    // for providing signatures, because signing is essentially free.\n    s_oracleObservationsCounts =\n      oracleRewards(observers, s_oracleObservationsCounts);\n    // Reimburse transmitter of the report for gas usage\n    require(txOracle.role == Role.Transmitter,\n      \"sent by undesignated transmitter\"\n    );\n    uint256 gasPrice = impliedGasPrice(\n      tx.gasprice / (1 gwei), // convert to ETH-gwei units\n      billing.reasonableGasPrice,\n      billing.maximumGasPrice\n    );\n    // The following is only an upper bound, as it ignores the cheaper cost for\n    // 0 bytes. Safe from overflow, because calldata just isn't that long.\n    uint256 callDataGasCost = 16 * msg.data.length;\n    // If any changes are made to subsequent calculations, accountingGasCost\n    // needs to change, too.\n    uint256 gasLeft = gasleft();\n    uint256 gasCostEthWei = transmitterGasCostEthWei(\n      uint256(initialGas),\n      gasPrice,\n      callDataGasCost,\n      gasLeft\n    );\n\n    // microLinkPerEth is 1e-6LINK/ETH units, gasCostEthWei is 1e-18ETH units\n    // (ETH-wei), product is 1e-24LINK-wei units, dividing by 1e6 gives\n    // 1e-18LINK units, i.e. LINK-wei units\n    // Safe from over/underflow, since all components are non-negative,\n    // gasCostEthWei will always fit into uint128 and microLinkPerEth is a\n    // uint32 (128+32 < 256!).\n    uint256 gasCostLinkWei = (gasCostEthWei * billing.microLinkPerEth)/ 1e6;\n\n    // Safe from overflow, because gasCostLinkWei < 2**160 and\n    // billing.linkGweiPerTransmission * (1 gwei) < 2**64 and we increment\n    // s_gasReimbursementsLinkWei[txOracle.index] at most 2**40 times.\n    s_gasReimbursementsLinkWei[txOracle.index] =\n      s_gasReimbursementsLinkWei[txOracle.index] + gasCostLinkWei +\n      uint256(billing.linkGweiPerTransmission) * (1 gwei); // convert from linkGwei to linkWei\n\n    // Uncomment next line to compute the remaining gas cost after above gasleft().\n    // See OffchainAggregatorBilling.accountingGasCost docstring for more information.\n    //\n    // gasUsedInAccounting = gasLeft - gasleft();\n  }\n\n  /*\n   * Payee management\n   */\n\n  /**\n   * @notice emitted when a transfer of an oracle's payee address has been initiated\n   * @param transmitter address from which the oracle sends reports to the transmit method\n   * @param current the payeee address for the oracle, prior to this setting\n   * @param proposed the proposed new payee address for the oracle\n   */\n  event PayeeshipTransferRequested(\n    address indexed transmitter,\n    address indexed current,\n    address indexed proposed\n  );\n\n  /**\n   * @notice emitted when a transfer of an oracle's payee address has been completed\n   * @param transmitter address from which the oracle sends reports to the transmit method\n   * @param current the payeee address for the oracle, prior to this setting\n   */\n  event PayeeshipTransferred(\n    address indexed transmitter,\n    address indexed previous,\n    address indexed current\n  );\n\n  /**\n   * @notice sets the payees for transmitting addresses\n   * @param _transmitters addresses oracles use to transmit the reports\n   * @param _payees addresses of payees corresponding to list of transmitters\n   * @dev must be called by owner\n   * @dev cannot be used to change payee addresses, only to initially populate them\n   */\n  function setPayees(\n    address[] calldata _transmitters,\n    address[] calldata _payees\n  )\n    external\n    onlyOwner()\n  {\n    require(_transmitters.length == _payees.length, \"transmitters.size != payees.size\");\n\n    for (uint i = 0; i < _transmitters.length; i++) {\n      address transmitter = _transmitters[i];\n      address payee = _payees[i];\n      address currentPayee = s_payees[transmitter];\n      bool zeroedOut = currentPayee == address(0);\n      require(zeroedOut || currentPayee == payee, \"payee already set\");\n      s_payees[transmitter] = payee;\n\n      if (currentPayee != payee) {\n        emit PayeeshipTransferred(transmitter, currentPayee, payee);\n      }\n    }\n  }\n\n  /**\n   * @notice first step of payeeship transfer (safe transfer pattern)\n   * @param _transmitter transmitter address of oracle whose payee is changing\n   * @param _proposed new payee address\n   * @dev can only be called by payee address\n   */\n  function transferPayeeship(\n    address _transmitter,\n    address _proposed\n  )\n    external\n  {\n      require(msg.sender == s_payees[_transmitter], \"only current payee can update\");\n      require(msg.sender != _proposed, \"cannot transfer to self\");\n\n      address previousProposed = s_proposedPayees[_transmitter];\n      s_proposedPayees[_transmitter] = _proposed;\n\n      if (previousProposed != _proposed) {\n        emit PayeeshipTransferRequested(_transmitter, msg.sender, _proposed);\n      }\n  }\n\n  /**\n   * @notice second step of payeeship transfer (safe transfer pattern)\n   * @param _transmitter transmitter address of oracle whose payee is changing\n   * @dev can only be called by proposed new payee address\n   */\n  function acceptPayeeship(\n    address _transmitter\n  )\n    external\n  {\n    require(msg.sender == s_proposedPayees[_transmitter], \"only proposed payees can accept\");\n\n    address currentPayee = s_payees[_transmitter];\n    s_payees[_transmitter] = msg.sender;\n    s_proposedPayees[_transmitter] = address(0);\n\n    emit PayeeshipTransferred(_transmitter, currentPayee, msg.sender);\n  }\n\n  /*\n   * Helper functions\n   */\n\n  function saturatingAddUint16(uint16 _x, uint16 _y)\n    internal\n    pure\n    returns (uint16)\n  {\n    return uint16(min(uint256(_x)+uint256(_y), maxUint16));\n  }\n\n  function min(uint256 a, uint256 b)\n    internal\n    pure\n    returns (uint256)\n  {\n    if (a < b) { return a; }\n    return b;\n  }\n}\n"},{"file_path":"contract/Owned.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.7.6;\n\n/**\n * @title The Owned contract\n * @notice A contract with helpers for basic contract ownership.\n */\ncontract Owned {\n\n  address payable public owner;\n  address private pendingOwner;\n\n  event OwnershipTransferRequested(\n    address indexed from,\n    address indexed to\n  );\n  event OwnershipTransferred(\n    address indexed from,\n    address indexed to\n  );\n\n  constructor() {\n    owner = msg.sender;\n  }\n\n  /**\n   * @dev Allows an owner to begin transferring ownership to a new address,\n   * pending.\n   */\n  function transferOwnership(address _to)\n    external\n    onlyOwner()\n  {\n    pendingOwner = _to;\n\n    emit OwnershipTransferRequested(owner, _to);\n  }\n\n  /**\n   * @dev Allows an ownership transfer to be completed by the recipient.\n   */\n  function acceptOwnership()\n    external\n  {\n    require(msg.sender == pendingOwner, \"Must be proposed owner\");\n\n    address oldOwner = owner;\n    owner = msg.sender;\n    pendingOwner = address(0);\n\n    emit OwnershipTransferred(oldOwner, msg.sender);\n  }\n\n  /**\n   * @dev Reverts if called by anyone other than the contract owner.\n   */\n  modifier onlyOwner() {\n    require(msg.sender == owner, \"Only callable by owner\");\n    _;\n  }\n\n}\n"},{"file_path":"contract/SimpleReadAccessController.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.7.6;\n\nimport \"./SimpleWriteAccessController.sol\";\n\n/**\n * @title SimpleReadAccessController\n * @notice Gives access to:\n * - any externally owned account (note that offchain actors can always read\n * any contract storage regardless of onchain access control measures, so this\n * does not weaken the access control while improving usability)\n * - accounts explicitly added to an access list\n * @dev SimpleReadAccessController is not suitable for access controlling writes\n * since it grants any externally owned account access! See\n * SimpleWriteAccessController for that.\n */\ncontract SimpleReadAccessController is SimpleWriteAccessController {\n\n  /**\n   * @notice Returns the access of an address\n   * @param _user The address to query\n   */\n  function hasAccess(\n    address _user,\n    bytes memory _calldata\n  )\n    public\n    view\n    virtual\n    override\n    returns (bool)\n  {\n    return super.hasAccess(_user, _calldata) || _user == tx.origin;\n  }\n\n}\n"},{"file_path":"contract/SimpleWriteAccessController.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.7.6;\n\nimport \"./Owned.sol\";\nimport \"./AccessControllerInterface.sol\";\n\n/**\n * @title SimpleWriteAccessController\n * @notice Gives access to accounts explicitly added to an access list by the\n * controller's owner.\n * @dev does not make any special permissions for externally, see\n * SimpleReadAccessController for that.\n */\ncontract SimpleWriteAccessController is AccessControllerInterface, Owned {\n\n  bool public checkEnabled;\n  mapping(address => bool) internal accessList;\n\n  event AddedAccess(address user);\n  event RemovedAccess(address user);\n  event CheckAccessEnabled();\n  event CheckAccessDisabled();\n\n  constructor()\n  {\n    checkEnabled = true;\n  }\n\n  /**\n   * @notice Returns the access of an address\n   * @param _user The address to query\n   */\n  function hasAccess(\n    address _user,\n    bytes memory\n  )\n    public\n    view\n    virtual\n    override\n    returns (bool)\n  {\n    return accessList[_user] || !checkEnabled;\n  }\n\n  /**\n   * @notice Adds an address to the access list\n   * @param _user The address to add\n   */\n  function addAccess(address _user) external onlyOwner() {\n    addAccessInternal(_user);\n  }\n\n  function addAccessInternal(address _user) internal {\n    if (!accessList[_user]) {\n      accessList[_user] = true;\n      emit AddedAccess(_user);\n    }\n  }\n\n  /**\n   * @notice Removes an address from the access list\n   * @param _user The address to remove\n   */\n  function removeAccess(address _user)\n    external\n    onlyOwner()\n  {\n    if (accessList[_user]) {\n      accessList[_user] = false;\n\n      emit RemovedAccess(_user);\n    }\n  }\n\n  /**\n   * @notice makes the access check enforced\n   */\n  function enableAccessCheck()\n    external\n    onlyOwner()\n  {\n    if (!checkEnabled) {\n      checkEnabled = true;\n\n      emit CheckAccessEnabled();\n    }\n  }\n\n  /**\n   * @notice makes the access check unenforced\n   */\n  function disableAccessCheck()\n    external\n    onlyOwner()\n  {\n    if (checkEnabled) {\n      checkEnabled = false;\n\n      emit CheckAccessDisabled();\n    }\n  }\n\n  /**\n   * @dev reverts if the caller does not have access\n   */\n  modifier checkAccess() {\n    require(hasAccess(msg.sender, msg.data), \"No access\");\n    _;\n  }\n}\n"},{"file_path":"contract/TypeAndVersionInterface.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.7.0;\n\nabstract contract TypeAndVersionInterface{\n  function typeAndVersion()\n    external\n    pure\n    virtual\n    returns (string memory);\n}"}],"is_verified_via_sourcify":false,"can_be_visualized_via_sol2uml":true,"evm_version":"istanbul","language":"solidity","is_verified_via_eth_bytecode_db":true,"is_fully_verified":true,"license_type":"none","is_blueprint":false,"name":"AccessControlledOffchainAggregator","creation_bytecode":"0x60e06040523480156200001157600080fd5b50604051620059c5380380620059c583398181016040526101808110156200003857600080fd5b815160208301516040808501516060860151608087015160a088015160c089015160e08a01516101008b01516101208c01516101408d01516101608e0180519a519c9e9b9d999c989b979a969995989497939692959194939182019284640100000000821115620000a857600080fd5b908301906020820185811115620000be57600080fd5b8251640100000000811182820188101715620000d957600080fd5b82525081516020918201929091019080838360005b8381101562000108578181015183820152602001620000ee565b50505050905090810190601f168015620001365780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b03191633179055508b8b8b8b8b8b8b8b8b8b8b8b8b8b8b8b8b8b89620001718787878787620002ef565b600380546001600160a01b0319166001600160a01b0384169081179091556040516000907f4966a50c93f855342ccf6c5c0d358b85b91335b2acedc7da0932f691f351711a908290a3620001c581620003e1565b620001cf62000678565b620001d962000678565b60005b601f8160ff16101562000229576001838260ff16601f8110620001fb57fe5b61ffff909216602092909202015260018260ff8316601f81106200021b57fe5b6020020152600101620001dc565b5062000239600583601f62000697565b5062000249600982601f62000734565b505050505060f887901b7fff000000000000000000000000000000000000000000000000000000000000001660c052505083516200029293506030925060208501915062000765565b506200029e836200045a565b620002ab60008062000532565b50505050601791820b820b604090811b60805290820b90910b901b60a05250506031805460ff1916600117905550620007fe9e505050505050505050505050505050565b6040805160a0808201835263ffffffff88811680845288821660208086018290528984168688018190528985166060808901829052958a1660809889018190526002805463ffffffff1916871763ffffffff60201b191664010000000087021763ffffffff60401b19166801000000000000000085021763ffffffff60601b19166c0100000000000000000000000084021763ffffffff60801b1916600160801b830217905589519586529285019390935283880152928201529283015291517fd0d9486a2c673e2a4b57fc82e4c8a556b3e2b82dd5db07e2c04a920ca0f469b6929181900390910190a15050505050565b6004546001600160a01b0390811690821681146200045657600480546001600160a01b0319166001600160a01b03848116918217909255604080519284168352602083019190915280517f793cb73064f3c8cde7e187ae515511e6e56d1ee89bf08b82fa60fb70f8d489129281900390910190a15b5050565b6000546001600160a01b03163314620004ba576040805162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015290519081900360640190fd5b602f546001600160a01b0390811690821681146200045657602f80546001600160a01b0319166001600160a01b03848116918217909255604080519284168352602083019190915280517f27b89aede8b560578baaa25ee5ce3852c5eecad1e114b941bbd89e1eb4bae6349281900390910190a15050565b6000546001600160a01b0316331462000592576040805162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015290519081900360640190fd5b60408051808201909152602e546001600160a01b03808216808452600160a01b90920463ffffffff1660208401528416141580620005e057508163ffffffff16816020015163ffffffff1614155b1562000673576040805180820182526001600160a01b0385811680835263ffffffff8681166020948501819052602e80546001600160a01b031916841763ffffffff60a01b1916600160a01b8302179055865187860151875193168352948201528451919493909216927fb04e3a37abe9c0fcdfebdeae019a8e2b12ddf53f5d55ffb0caccc1bedaca1541928290030190a35b505050565b604051806103e00160405280601f906020820280368337509192915050565b600283019183908215620007225791602002820160005b83821115620006f057835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302620006ae565b8015620007205782816101000a81549061ffff0219169055600201602081600101049283019260010302620006f0565b505b5062000730929150620007e7565b5090565b82601f810192821562000722579160200282015b828111156200072257825182559160200191906001019062000748565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826200079d576000855562000722565b82601f10620007b857805160ff191683800117855562000722565b828001600101855582156200072257918201828111156200072257825182559160200191906001019062000748565b5b80821115620007305760008155600101620007e8565b60805160401c60a05160401c60c05160f81c6151876200083e60003980610e9e525080611a2a528061341c525080610e1952806133ef52506151876000f3fe608060405234801561001057600080fd5b506004361061028a5760003560e01c80638e0566de1161015c578063c1075329116100ce578063e76d516811610087578063e76d516814610b7e578063eb45716314610b86578063eb5dcd6c14610bb8578063f2fde38b14610be6578063fbffd2c114610c0c578063feaf968c14610c325761028a565b8063c1075329146109a6578063c9807539146109d2578063d09dc33914610ae0578063dc7f012414610ae8578063e4902f8214610af0578063e5fe457714610b2d5761028a565b80639e3ceeab116101205780639e3ceeab146108b5578063a118f249146108db578063b121e14714610901578063b5ab58dc14610927578063b633620c14610944578063bd824706146109615761028a565b80638e0566de1461073157806398e5b12a14610761578063996e8298146107855780639a6fc8f51461078d5780639c849b30146107f75761028a565b80636b14daf81161020057806381411834116101b9578063814118341461064457806381ff70481461069c5780638205bf6a146106d55780638823da6c146106dd5780638ac28d5a146107035780638da5cb5b146107295761028a565b80636b14daf81461053857806370da2f671461060057806370efdf2d146106085780637284e4161461062c57806379ba5097146106345780638038e4a11461063c5761028a565b8063313ce56711610252578063313ce567146103ae5780634fb17470146103cc57806350d25bcd146103fa57806354fd4d5014610402578063585aa7de1461040a578063668a0f02146105305761028a565b80630a7569831461028f5780630eafb25b14610299578063181f5a77146102d157806322adbc781461034e578063299372681461036d575b600080fd5b610297610c3a565b005b6102bf600480360360208110156102af57600080fd5b50356001600160a01b0316610cc8565b60408051918252519081900360200190f35b6102d9610df7565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103135781810151838201526020016102fb565b50505050905090810190601f1680156103405780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610356610e17565b6040805160179290920b8252519081900360200190f35b610375610e3b565b6040805163ffffffff96871681529486166020860152928516848401529084166060840152909216608082015290519081900360a00190f35b6103b6610e9c565b6040805160ff9092168252519081900360200190f35b610297600480360360408110156103e257600080fd5b506001600160a01b0381358116916020013516610ec0565b6102bf611148565b6102bf6111d5565b610297600480360360a081101561042057600080fd5b810190602081018135600160201b81111561043a57600080fd5b82018360208201111561044c57600080fd5b803590602001918460208302840111600160201b8311171561046d57600080fd5b919390929091602081019035600160201b81111561048a57600080fd5b82018360208201111561049c57600080fd5b803590602001918460208302840111600160201b831117156104bd57600080fd5b9193909260ff833516926001600160401b03602082013516929190606081019060400135600160201b8111156104f257600080fd5b82018360208201111561050457600080fd5b803590602001918460018302840111600160201b8311171561052557600080fd5b5090925090506111da565b6102bf611978565b6105ec6004803603604081101561054e57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561057857600080fd5b82018360208201111561058a57600080fd5b803590602001918460018302840111600160201b831117156105ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611a00945050505050565b604080519115158252519081900360200190f35b610356611a28565b610610611a4c565b604080516001600160a01b039092168252519081900360200190f35b6102d9611a5b565b610297611ae3565b610297611b92565b61064c611c21565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610688578181015183820152602001610670565b505050509050019250505060405180910390f35b6106a4611c83565b6040805163ffffffff94851681529290931660208301526001600160801b0319168183015290519081900360600190f35b6102bf611ca3565b610297600480360360208110156106f357600080fd5b50356001600160a01b0316611d2b565b6102976004803603602081101561071957600080fd5b50356001600160a01b0316611df2565b610610611e69565b610739611e78565b604080516001600160a01b03909316835263ffffffff90911660208301528051918290030190f35b610769611eab565b604080516001600160501b039092168252519081900360200190f35b61061061207e565b6107b3600480360360208110156107a357600080fd5b50356001600160501b031661208d565b60405180866001600160501b03168152602001858152602001848152602001838152602001826001600160501b031681526020019550505050505060405180910390f35b6102976004803603604081101561080d57600080fd5b810190602081018135600160201b81111561082757600080fd5b82018360208201111561083957600080fd5b803590602001918460208302840111600160201b8311171561085a57600080fd5b919390929091602081019035600160201b81111561087757600080fd5b82018360208201111561088957600080fd5b803590602001918460208302840111600160201b831117156108aa57600080fd5b50909250905061212e565b610297600480360360208110156108cb57600080fd5b50356001600160a01b0316612331565b610297600480360360208110156108f157600080fd5b50356001600160a01b03166123f5565b6102976004803603602081101561091757600080fd5b50356001600160a01b031661244b565b6102bf6004803603602081101561093d57600080fd5b503561252c565b6102bf6004803603602081101561095a57600080fd5b50356125b5565b610297600480360360a081101561097757600080fd5b5063ffffffff81358116916020810135821691604082013581169160608101358216916080909101351661263e565b610297600480360360408110156109bc57600080fd5b506001600160a01b03813516906020013561276d565b610297600480360360808110156109e857600080fd5b810190602081018135600160201b811115610a0257600080fd5b820183602082011115610a1457600080fd5b803590602001918460018302840111600160201b83111715610a3557600080fd5b919390929091602081019035600160201b811115610a5257600080fd5b820183602082011115610a6457600080fd5b803590602001918460208302840111600160201b83111715610a8557600080fd5b919390929091602081019035600160201b811115610aa257600080fd5b820183602082011115610ab457600080fd5b803590602001918460208302840111600160201b83111715610ad557600080fd5b919350915035612a30565b6102bf61377e565b6105ec61380f565b610b1660048036036020811015610b0657600080fd5b50356001600160a01b0316613818565b6040805161ffff9092168252519081900360200190f35b610b356138c5565b604080516001600160801b0319909616865263ffffffff909416602086015260ff9092168484015260170b60608401526001600160401b03166080830152519081900360a00190f35b610610613975565b61029760048036036040811015610b9c57600080fd5b5080356001600160a01b0316906020013563ffffffff16613984565b61029760048036036040811015610bce57600080fd5b506001600160a01b0381358116916020013516613ab5565b61029760048036036020811015610bfc57600080fd5b50356001600160a01b0316613bf8565b61029760048036036020811015610c2257600080fd5b50356001600160a01b0316613c96565b6107b3613cec565b6000546001600160a01b03163314610c87576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b60315460ff1615610cc6576031805460ff191690556040517f3be8a977a014527b50ae38adda80b56911c267328965c98ddc385d248f53963890600090a15b565b6001600160a01b03811660009081526028602090815260408083208151808301909252805460ff808216845285948401916101009004166002811115610d0a57fe5b6002811115610d1557fe5b9052509050600081602001516002811115610d2c57fe5b1415610d3c576000915050610df2565b6040805160a08101825260025463ffffffff8082168352600160201b820481166020840152600160401b8204811693830193909352600160601b8104831660608301819052600160801b90910490921660808201528251909160009160019060059060ff16601f8110610dab57fe5b601091828204019190066002029054906101000a900461ffff160361ffff1602633b9aca0002905060016009846000015160ff16601f8110610de957fe5b01540301925050505b919050565b60606040518060600160405280602881526020016150e660289139905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6040805160a08101825260025463ffffffff808216808452600160201b8304821660208501819052600160401b84048316958501869052600160601b8404831660608601819052600160801b90940490921660809094018490529490939290565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000546001600160a01b03163314610f0d576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b6003546001600160a01b03908116908316811415610f2b5750611144565b604080516370a0823160e01b815230600482015290516001600160a01b038516916370a08231916024808301926020929190829003018186803b158015610f7157600080fd5b505afa158015610f85573d6000803e3d6000fd5b505050506040513d6020811015610f9b57600080fd5b50610fa69050613d8b565b6000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610ff557600080fd5b505afa158015611009573d6000803e3d6000fd5b505050506040513d602081101561101f57600080fd5b50516040805163a9059cbb60e01b81526001600160a01b0386811660048301526024820184905291519293509084169163a9059cbb916044808201926020929091908290030181600087803b15801561107757600080fd5b505af115801561108b573d6000803e3d6000fd5b505050506040513d60208110156110a157600080fd5b50516110f4576040805162461bcd60e51b815260206004820152601f60248201527f7472616e736665722072656d61696e696e672066756e6473206661696c656400604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0386811691821790925560405190918416907f4966a50c93f855342ccf6c5c0d358b85b91335b2acedc7da0932f691f351711a90600090a350505b5050565b600061118b336000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a0092505050565b6111c8576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b6111d0614114565b905090565b600481565b868560ff8616601f831115611229576040805162461bcd60e51b815260206004820152601060248201526f746f6f206d616e79207369676e65727360801b604482015290519081900360640190fd5b6000811161127e576040805162461bcd60e51b815260206004820152601a60248201527f7468726573686f6c64206d75737420626520706f736974697665000000000000604482015290519081900360640190fd5b8183146112bc5760405162461bcd60e51b815260040180806020018281038252602481526020018061510e6024913960400191505060405180910390fd5b806003028311611313576040805162461bcd60e51b815260206004820181905260248201527f6661756c74792d6f7261636c65207468726573686f6c6420746f6f2068696768604482015290519081900360640190fd5b6000546001600160a01b03163314611360576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b6029541561145d57602980546000198101916000918390811061137f57fe5b6000918252602082200154602a80546001600160a01b03909216935090849081106113a657fe5b6000918252602090912001546001600160a01b031690506113c68161413d565b6001600160a01b03808316600090815260286020526040808220805461ffff199081169091559284168252902080549091169055602980548061140557fe5b600082815260209020810160001990810180546001600160a01b0319169055019055602a80548061143257fe5b600082815260209020810160001990810180546001600160a01b031916905501905550611360915050565b60005b8a8110156117b9576000602860008e8e8581811061147a57fe5b602090810292909201356001600160a01b031683525081019190915260400160002054610100900460ff1660028111156114b057fe5b14611502576040805162461bcd60e51b815260206004820152601760248201527f7265706561746564207369676e65722061646472657373000000000000000000604482015290519081900360640190fd5b6040805180820190915260ff8216815260016020820152602860008e8e8581811061152957fe5b602090810292909201356001600160a01b0316835250818101929092526040016000208251815460ff191660ff90911617808255918301519091829061ff00191661010083600281111561157957fe5b02179055506000915060079050818c8c8581811061159357fe5b6001600160a01b0360209182029390930135831684528301939093526040909101600020541691909114159050611605576040805162461bcd60e51b81526020600482015260116024820152701c185e5959481b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b6000602860008c8c8581811061161757fe5b602090810292909201356001600160a01b031683525081019190915260400160002054610100900460ff16600281111561164d57fe5b1461169f576040805162461bcd60e51b815260206004820152601c60248201527f7265706561746564207472616e736d6974746572206164647265737300000000604482015290519081900360640190fd5b6040805180820190915260ff8216815260026020820152602860008c8c858181106116c657fe5b602090810292909201356001600160a01b0316835250818101929092526040016000208251815460ff191660ff90911617808255918301519091829061ff00191661010083600281111561171657fe5b021790555090505060298c8c8381811061172c57fe5b835460018101855560009485526020948590200180546001600160a01b0319166001600160a01b039590920293909301359390931692909217905550602a8a8a8381811061177657fe5b835460018181018655600095865260209586902090910180546001600160a01b0319166001600160a01b0396909302949094013594909416179091555001611460565b50602b805460ff8916600160a81b0260ff60a81b19909116179055602d80544363ffffffff908116600160201b90810267ffffffff0000000019841617808316600101831663ffffffff1990911617938490559091048116911661182530828f8f8f8f8f8f8f8f614325565b602b60000160006101000a8154816001600160801b03021916908360801c02179055506000602b60000160106101000a81548164ffffffffff021916908364ffffffffff1602179055507f25d719d88a4512dd76c7442b910a83360845505894eb444ef299409e180f8fb982828f8f8f8f8f8f8f8f604051808b63ffffffff1681526020018a6001600160401b0316815260200180602001806020018760ff168152602001866001600160401b031681526020018060200184810384528c8c82818152602001925060200280828437600083820152601f01601f191690910185810384528a8152602090810191508b908b0280828437600083820152601f01601f191690910185810383528681526020019050868680828437600083820152604051601f909101601f19169092018290039f50909d5050505050505050505050505050a150505050505050505050505050565b60006119bb336000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a0092505050565b6119f8576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b6111d0614427565b6000611a0c838361443a565b80611a1f57506001600160a01b03831632145b90505b92915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b602f546001600160a01b031690565b6060611a9e336000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a0092505050565b611adb576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b6111d061446a565b6001546001600160a01b03163314611b3b576040805162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b604482015290519081900360640190fd5b60008054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6000546001600160a01b03163314611bdf576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b60315460ff16610cc6576031805460ff191660011790556040517faebf329500988c6488a0074e5a0a9ff304561fc5c6fc877aeb1d59c8282c348090600090a1565b6060602a805480602002602001604051908101604052809291908181526020018280548015611c7957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611c5b575b5050505050905090565b602d54602b5463ffffffff80831692600160201b9004169060801b909192565b6000611ce6336000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a0092505050565b611d23576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b6111d06144f7565b6000546001600160a01b03163314611d78576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526032602052604090205460ff1615611def576001600160a01b038116600081815260326020908152604091829020805460ff19169055815192835290517f3d68a6fce901d20453d1a7aa06bf3950302a735948037deb182a8db66df2a0d19281900390910190a15b50565b6001600160a01b03818116600090815260076020526040902054163314611e60576040805162461bcd60e51b815260206004820152601760248201527f4f6e6c792070617965652063616e207769746864726177000000000000000000604482015290519081900360640190fd5b611def8161413d565b6000546001600160a01b031681565b60408051808201909152602e546001600160a01b038116808352600160a01b90910463ffffffff16602090920182905291565b600080546001600160a01b0316331480611f6e5750602f5460408051630d629b5f60e31b815233600482018181526024830193845236604484018190526001600160a01b0390951694636b14daf894929360009391929190606401848480828437600083820152604051601f909101601f1916909201965060209550909350505081840390508186803b158015611f4157600080fd5b505afa158015611f55573d6000803e3d6000fd5b505050506040513d6020811015611f6b57600080fd5b50515b611fbf576040805162461bcd60e51b815260206004820152601d60248201527f4f6e6c79206f776e6572267265717565737465722063616e2063616c6c000000604482015290519081900360640190fd5b6040805160808082018352602b549081901b6001600160801b031916808352600160801b820464ffffffffff8116602080860191909152600160a81b840460ff90811686880152600160b01b90940463ffffffff9081166060808801919091528751948552600884901c909116918401919091529216818501529251919233927f3ea16a923ff4b1df6526e854c9e3a995c43385d70e73359e10623c74f0b52037929181900390910190a2806060015160010163ffffffff1691505090565b6004546001600160a01b031690565b60008060008060006120d6336000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a0092505050565b612113576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b61211c86614529565b939a9299509097509550909350915050565b6000546001600160a01b0316331461217b576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b8281146121cf576040805162461bcd60e51b815260206004820181905260248201527f7472616e736d6974746572732e73697a6520213d207061796565732e73697a65604482015290519081900360640190fd5b60005b8381101561232a5760008585838181106121e857fe5b905060200201356001600160a01b03169050600084848481811061220857fe5b6001600160a01b0385811660009081526007602090815260409091205492029390930135831693509091169050801580806122545750826001600160a01b0316826001600160a01b0316145b612299576040805162461bcd60e51b81526020600482015260116024820152701c185e595948185b1c9958591e481cd95d607a1b604482015290519081900360640190fd5b6001600160a01b03848116600090815260076020526040902080546001600160a01b0319168583169081179091559083161461231a57826001600160a01b0316826001600160a01b0316856001600160a01b03167f78af32efdcad432315431e9b03d27e6cd98fb79c405fdc5af7c1714d9c0f75b360405160405180910390a45b5050600190920191506121d29050565b5050505050565b6000546001600160a01b0316331461237e576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b602f546001600160a01b03908116908216811461114457602f80546001600160a01b0319166001600160a01b03848116918217909255604080519284168352602083019190915280517f27b89aede8b560578baaa25ee5ce3852c5eecad1e114b941bbd89e1eb4bae6349281900390910190a15050565b6000546001600160a01b03163314612442576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b611def8161464d565b6001600160a01b038181166000908152600860205260409020541633146124b9576040805162461bcd60e51b815260206004820152601f60248201527f6f6e6c792070726f706f736564207061796565732063616e2061636365707400604482015290519081900360640190fd5b6001600160a01b0381811660008181526007602090815260408083208054336001600160a01b031980831682179093556008909452828520805490921690915590519416939092849290917f78af32efdcad432315431e9b03d27e6cd98fb79c405fdc5af7c1714d9c0f75b39190a45050565b600061256f336000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a0092505050565b6125ac576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b611a22826146c8565b60006125f8336000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a0092505050565b612635576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b611a22826146fe565b6004546000546001600160a01b0391821691163314806126ff575060408051630d629b5f60e31b815233600482018181526024830193845236604484018190526001600160a01b03861694636b14daf8946000939190606401848480828437600083820152604051601f909101601f1916909201965060209550909350505081840390508186803b1580156126d257600080fd5b505afa1580156126e6573d6000803e3d6000fd5b505050506040513d60208110156126fc57600080fd5b50515b612750576040805162461bcd60e51b815260206004820181905260248201527f4f6e6c79206f776e65722662696c6c696e6741646d696e2063616e2063616c6c604482015290519081900360640190fd5b612758613d8b565b612765868686868661473d565b505050505050565b6000546001600160a01b031633148061282e57506004805460408051630d629b5f60e31b8152339381018481526024820192835236604483018190526001600160a01b0390941694636b14daf8949093600093919291606401848480828437600083820152604051601f909101601f1916909201965060209550909350505081840390508186803b15801561280157600080fd5b505afa158015612815573d6000803e3d6000fd5b505050506040513d602081101561282b57600080fd5b50515b61287f576040805162461bcd60e51b815260206004820181905260248201527f4f6e6c79206f776e65722662696c6c696e6741646d696e2063616e2063616c6c604482015290519081900360640190fd5b6000612889614826565b600354604080516370a0823160e01b815230600482015290519293506000926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b1580156128da57600080fd5b505afa1580156128ee573d6000803e3d6000fd5b505050506040513d602081101561290457600080fd5b5051905081811015612954576040805162461bcd60e51b8152602060048201526014602482015273696e73756666696369656e742062616c616e636560601b604482015290519081900360640190fd5b6003546001600160a01b031663a9059cbb85612972858503876149da565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156129b857600080fd5b505af11580156129cc573d6000803e3d6000fd5b505050506040513d60208110156129e257600080fd5b5051612a2a576040805162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e742066756e647360701b604482015290519081900360640190fd5b50505050565b60005a9050612a438888888888886149f1565b3614612a96576040805162461bcd60e51b815260206004820152601960248201527f7472616e736d6974206d65737361676520746f6f206c6f6e6700000000000000604482015290519081900360640190fd5b612a9e614f7b565b6040805160808082018352602b549081901b6001600160801b0319168252600160801b810464ffffffffff166020830152600160a81b810460ff1692820192909252600160b01b90910463ffffffff166060808301919091529082526000908a908a90811015612b0d57600080fd5b813591602081013591810190606081016040820135600160201b811115612b3357600080fd5b820183602082011115612b4557600080fd5b803590602001918460208302840111600160201b83111715612b6657600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050505060408801525050506080840182905283515190925060589190911b906001600160801b0319808316911614612c0d576040805162461bcd60e51b81526020600482015260156024820152740c6dedcccd2ce88d2cecae6e840dad2e6dac2e8c6d605b1b604482015290519081900360640190fd5b608083015183516020015164ffffffffff808316911610612c64576040805162461bcd60e51b815260206004820152600c60248201526b1cdd185b19481c995c1bdc9d60a21b604482015290519081900360640190fd5b83516040015160ff168911612cb8576040805162461bcd60e51b81526020600482015260156024820152746e6f7420656e6f756768207369676e61747572657360581b604482015290519081900360640190fd5b601f891115612d04576040805162461bcd60e51b8152602060048201526013602482015272746f6f206d616e79207369676e61747572657360681b604482015290519081900360640190fd5b868914612d58576040805162461bcd60e51b815260206004820152601e60248201527f7369676e617475726573206f7574206f6620726567697374726174696f6e0000604482015290519081900360640190fd5b601f8460400151511115612db3576040805162461bcd60e51b815260206004820152601e60248201527f6e756d206f62736572766174696f6e73206f7574206f6620626f756e64730000604482015290519081900360640190fd5b83600001516040015160020260ff1684604001515111612e1a576040805162461bcd60e51b815260206004820152601e60248201527f746f6f206665772076616c75657320746f207472757374206d656469616e0000604482015290519081900360640190fd5b886001600160401b0381118015612e3057600080fd5b506040519080825280601f01601f191660200182016040528015612e5b576020820181803683370190505b50606085015260005b60ff81168a1115612eb457868160ff1660208110612e7e57fe5b1a60f81b85606001518260ff1681518110612e9557fe5b60200101906001600160f81b031916908160001a905350600101612e64565b508360400151516001600160401b0381118015612ed057600080fd5b506040519080825280601f01601f191660200182016040528015612efb576020820181803683370190505b506020850152612f09614faf565b60005b8560400151518160ff161015612ff7576000858260ff1660208110612f2d57fe5b1a90508281601f8110612f3c57fe5b602002015115612f93576040805162461bcd60e51b815260206004820152601760248201527f6f6273657276657220696e646578207265706561746564000000000000000000604482015290519081900360640190fd5b6001838260ff16601f8110612fa457fe5b91151560209283029190910152869060ff8416908110612fc057fe5b1a60f81b87602001518360ff1681518110612fd757fe5b60200101906001600160f81b031916908160001a90535050600101612f0c565b503360009081526028602090815260408083208151808301909252805460ff8082168452929391929184019161010090910416600281111561303557fe5b600281111561304057fe5b905250905060028160200151600281111561305757fe5b14801561308b5750602a816000015160ff168154811061307357fe5b6000918252602090912001546001600160a01b031633145b6130dc576040805162461bcd60e51b815260206004820152601860248201527f756e617574686f72697a6564207472616e736d69747465720000000000000000604482015290519081900360640190fd5b5050835164ffffffffff90911660209091015250506040516000908a908a90808383808284376040519201829003909120945061311d9350614faf92505050565b613125614fce565b60005b898110156133155760006001858760600151848151811061314557fe5b60209101015160f81c601b018e8e8681811061315d57fe5b905060200201358d8d8781811061317057fe5b9050602002013560405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156131cb573d6000803e3d6000fd5b505060408051601f198101516001600160a01b03811660009081526028602090815290849020838501909452835460ff8082168552929650929450840191610100900416600281111561321a57fe5b600281111561322557fe5b905250925060018360200151600281111561323c57fe5b1461328e576040805162461bcd60e51b815260206004820152601e60248201527f61646472657373206e6f7420617574686f72697a656420746f207369676e0000604482015290519081900360640190fd5b8251849060ff16601f811061329f57fe5b6020020151156132ed576040805162461bcd60e51b81526020600482015260146024820152736e6f6e2d756e69717565207369676e617475726560601b604482015290519081900360640190fd5b600184846000015160ff16601f811061330257fe5b9115156020909202015250600101613128565b5050505060005b6001826040015151038110156133c65760008260400151826001018151811061334157fe5b602002602001015160170b8360400151838151811061335c57fe5b602002602001015160170b13159050806133bd576040805162461bcd60e51b815260206004820152601760248201527f6f62736572766174696f6e73206e6f7420736f72746564000000000000000000604482015290519081900360640190fd5b5060010161331c565b506040810151805160009190600281049081106133df57fe5b602002602001015190508060170b7f000000000000000000000000000000000000000000000000000000000000000060170b1315801561344557507f000000000000000000000000000000000000000000000000000000000000000060170b8160170b13155b613496576040805162461bcd60e51b815260206004820152601e60248201527f6d656469616e206973206f7574206f66206d696e2d6d61782072616e67650000604482015290519081900360640190fd5b81516060908101805163ffffffff60019091018116909152604080518082018252601785810b8083526001600160401b0342811660208086019182528a5189015188166000908152602c8252878120965187549351909416600160c01b029390950b6001600160c01b039081166001600160c01b03199093169290921790911691909117909355875186015184890151848a01516080808c015188519586523386890181905291860181905260a0988601898152845199870199909952835194909916997ff6a97944f31ea060dfde0566e4167c1a1082551e64b60ecb14d599a9d023d451998c999298949793969095909492939185019260c086019289820192909102908190849084905b838110156135ba5781810151838201526020016135a2565b50505050905001838103825285818151815260200191508051906020019080838360005b838110156135f65781810151838201526020016135de565b50505050905090810190601f1680156136235780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390a281516060015160408051428152905160009263ffffffff16917f0109fc6f55cf40689f02fbaad7af7fe7bbac8a3d2186600afc7d3e10cac60271919081900360200190a381600001516060015163ffffffff168160170b7f0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f426040518082815260200191505060405180910390a36136d88260000151606001518260170b614a09565b5080518051602b8054602084015160408501516060909501516001600160801b031990921660809490941c9390931764ffffffffff60801b1916600160801b64ffffffffff909416939093029290921760ff60a81b1916600160a81b60ff909416939093029290921763ffffffff60b01b1916600160b01b63ffffffff9283160217909155821061376557fe5b613773828260200151614b0f565b505050505050505050565b600354604080516370a0823160e01b8152306004820152905160009283926001600160a01b03909116916370a0823191602480820192602092909190829003018186803b1580156137ce57600080fd5b505afa1580156137e2573d6000803e3d6000fd5b505050506040513d60208110156137f857600080fd5b505190506000613806614826565b90910391505090565b60315460ff1681565b6001600160a01b03811660009081526028602090815260408083208151808301909252805460ff80821684528594840191610100900416600281111561385a57fe5b600281111561386557fe5b905250905060008160200151600281111561387c57fe5b141561388c576000915050610df2565b60016005826000015160ff16601f81106138a257fe5b601091828204019190066002029054906101000a900461ffff1603915050919050565b600080808080333214613916576040805162461bcd60e51b81526020600482015260146024820152734f6e6c792063616c6c61626c6520627920454f4160601b604482015290519081900360640190fd5b5050602b5463ffffffff600160b01b820481166000908152602c6020526040902054608083901b96600160801b909304600881901c909216955064ffffffffff9091169350601781900b9250600160c01b90046001600160401b031690565b6003546001600160a01b031690565b6000546001600160a01b031633146139d1576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b60408051808201909152602e546001600160a01b03808216808452600160a01b90920463ffffffff1660208401528416141580613a1e57508163ffffffff16816020015163ffffffff1614155b15613ab0576040805180820182526001600160a01b0385811680835263ffffffff8681166020948501819052602e80546001600160a01b031916841763ffffffff60a01b1916600160a01b8302179055865187860151875193168352948201528451919493909216927fb04e3a37abe9c0fcdfebdeae019a8e2b12ddf53f5d55ffb0caccc1bedaca1541928290030190a35b505050565b6001600160a01b03828116600090815260076020526040902054163314613b23576040805162461bcd60e51b815260206004820152601d60248201527f6f6e6c792063757272656e742070617965652063616e20757064617465000000604482015290519081900360640190fd5b336001600160a01b0382161415613b81576040805162461bcd60e51b815260206004820152601760248201527f63616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015290519081900360640190fd5b6001600160a01b03808316600090815260086020526040902080548383166001600160a01b031982168117909255909116908114613ab0576040516001600160a01b038084169133918616907f84f7c7c80bb8ed2279b4aab5f61cd05e6374073d38f46d7f32de8c30e9e3836790600090a4505050565b6000546001600160a01b03163314613c45576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000546001600160a01b03163314613ce3576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b611def81614d37565b6000806000806000613d35336000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a0092505050565b613d72576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b613d7a614dae565b945094509450945094509091929394565b6040805160a08101825260025463ffffffff8082168352600160201b820481166020840152600160401b8204811683850152600160601b820481166060840152600160801b90910416608082015260035482516103e081019384905291926001600160a01b0390911691600091600590601f908285855b82829054906101000a900461ffff1661ffff1681526020019060020190602082600101049283019260010382029150808411613e02575050604080516103e0810191829052959650600095945060099350601f9250905082845b815481526020019060010190808311613e5c57505050505090506000602a805480602002602001604051908101604052809291908181526020018280548015613ece57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613eb0575b5050505050905060005b81518110156140f857600060018483601f8110613ef157fe5b6020020151039050600060018684601f8110613f0957fe5b60200201510361ffff169050600082896060015163ffffffff168302633b9aca000201905060008111156140ed57600060076000878781518110613f4957fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160a01b03169050886001600160a01b031663a9059cbb82846040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015613fde57600080fd5b505af1158015613ff2573d6000803e3d6000fd5b505050506040513d602081101561400857600080fd5b5051614050576040805162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e742066756e647360701b604482015290519081900360640190fd5b60018886601f811061405e57fe5b61ffff909216602092909202015260018786601f811061407a57fe5b602002018181525050886001600160a01b0316816001600160a01b03168787815181106140a357fe5b60200260200101516001600160a01b03167fd0b1dac935d85bd54cf0a33b0d41d39f8cf53a968465fc7ea2377526b8ac712c856040518082815260200191505060405180910390a4505b505050600101613ed8565b50614106600584601f614fe5565b50612765600983601f61507b565b602b54600160b01b900463ffffffff166000908152602c6020526040902054601790810b900b90565b6001600160a01b03811660009081526028602090815260408083208151808301909252805460ff8082168452929391929184019161010090910416600281111561418357fe5b600281111561418e57fe5b9052509050600061419e83610cc8565b90508015613ab0576001600160a01b03808416600090815260076020908152604080832054600354825163a9059cbb60e01b8152918616600483018190526024830188905292519295169363a9059cbb9360448084019491939192918390030190829087803b15801561421057600080fd5b505af1158015614224573d6000803e3d6000fd5b505050506040513d602081101561423a57600080fd5b5051614282576040805162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e742066756e647360701b604482015290519081900360640190fd5b60016005846000015160ff16601f811061429857fe5b601091828204019190066002026101000a81548161ffff021916908361ffff16021790555060016009846000015160ff16601f81106142d357fe5b01556003546040805184815290516001600160a01b039283169284811692908816917fd0b1dac935d85bd54cf0a33b0d41d39f8cf53a968465fc7ea2377526b8ac712c9181900360200190a450505050565b60008a8a8a8a8a8a8a8a8a8a604051602001808b6001600160a01b031681526020018a6001600160401b0316815260200180602001806020018760ff168152602001866001600160401b031681526020018060200184810384528c8c82818152602001925060200280828437600083820152601f01601f191690910185810384528a8152602090810191508b908b0280828437600083820152601f01601f191690910185810383528681526020019050868680828437600081840152601f19601f8201169050808301925050509d50505050505050505050505050506040516020818303038152906040528051906020012090509a9950505050505050505050565b602b54600160b01b900463ffffffff1690565b6001600160a01b03821660009081526032602052604081205460ff1680611a1f57505060315460ff161592915050565b60308054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015611c795780601f106144cb57610100808354040283529160200191611c79565b820191906000526020600020905b8154815290600101906020018083116144d957509395945050505050565b602b54600160b01b900463ffffffff166000908152602c6020526040902054600160c01b90046001600160401b031690565b600080600080600063ffffffff866001600160501b031611156040518060400160405280600f81526020016e139bc819185d18481c1c995cd95b9d608a1b815250906145f35760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156145b85781810151838201526020016145a0565b50505050905090810190601f1680156145e55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5050505063ffffffff83166000908152602c6020908152604091829020825180840190935254601781810b810b810b808552600160c01b9092046001600160401b031693909201839052949594900b939092508291508490565b6001600160a01b03811660009081526032602052604090205460ff16611def576001600160a01b038116600081815260326020908152604091829020805460ff19166001179055815192835290517f87286ad1f399c8e82bf0c4ef4fcdc570ea2e1e92176e5c848b6413545b885db49281900390910190a150565b600063ffffffff8211156146de57506000610df2565b5063ffffffff166000908152602c6020526040902054601790810b900b90565b600063ffffffff82111561471457506000610df2565b5063ffffffff166000908152602c6020526040902054600160c01b90046001600160401b031690565b6040805160a0808201835263ffffffff88811680845288821660208086018290528984168688018190528985166060808901829052958a1660809889018190526002805463ffffffff1916871767ffffffff000000001916600160201b8702176bffffffff00000000000000001916600160401b85021763ffffffff60601b1916600160601b84021763ffffffff60801b1916600160801b830217905589519586529285019390935283880152928201529283015291517fd0d9486a2c673e2a4b57fc82e4c8a556b3e2b82dd5db07e2c04a920ca0f469b6929181900390910190a15050505050565b604080516103e0810191829052600091829190600590601f908285855b82829054906101000a900461ffff1661ffff16815260200190600201906020826001010492830192600103820291508084116148435790505050505050905060005b601f8110156148b35760018282601f811061489c57fe5b60200201510361ffff169290920191600101614885565b506040805160a08101825260025463ffffffff8082168352600160201b82048116602080850191909152600160401b8304821684860152600160601b8304821660608501819052600160801b9093049091166080840152602a805485518184028101840190965280865296909202633b9aca000295929360009390929183018282801561496957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161494b575b5050604080516103e0810191829052949550600094935060099250601f915082845b81548152602001906001019080831161498b575050505050905060005b82518110156149d25760018282601f81106149bf57fe5b60200201510395909501946001016149a8565b505050505090565b6000818310156149eb575081611a22565b50919050565b602083810286019082020160e4019695505050505050565b60408051808201909152602e546001600160a01b038116808352600160a01b90910463ffffffff166020830152614a405750611144565b600019830163ffffffff8181166000818152602c60209081526040918290205486820151875184516024810196909652601792830b90920b604486018190528a8716606487015260848087018b90528551808803909101815260a4909601909452918401805163beed9b5160e01b6001600160e01b039091161790529193614acb9391169190614e09565b61232a576040805162461bcd60e51b815260206004820152601060248201526f696e73756666696369656e742067617360801b604482015290519081900360640190fd5b3360009081526028602090815260408083208151808301909252805460ff80821684529293919291840191610100909104166002811115614b4c57fe5b6002811115614b5757fe5b9052506040805160a08101825260025463ffffffff8082168352600160201b820481166020840152600160401b8204811683850152600160601b820481166060840152600160801b90910416608082015281516103e081019283905292935091614c0b91859190600590601f90826000855b82829054906101000a900461ffff1661ffff1681526020019060020190602082600101049283019260010382029150808411614bc95790505050505050614e45565b614c1990600590601f614fe5565b50600282602001516002811115614c2c57fe5b14614c7e576040805162461bcd60e51b815260206004820181905260248201527f73656e7420627920756e64657369676e61746564207472616e736d6974746572604482015290519081900360640190fd5b6000614ca5633b9aca003a04836020015163ffffffff16846000015163ffffffff16614eba565b90506010360260005a90506000614cc48863ffffffff16858585614ee0565b6001600160801b031690506000620f4240866040015163ffffffff16830281614ce957fe5b049050856080015163ffffffff16633b9aca0002816009896000015160ff16601f8110614d1257fe5b015401016009886000015160ff16601f8110614d2a57fe5b0155505050505050505050565b6004546001600160a01b03908116908216811461114457600480546001600160a01b0319166001600160a01b03848116918217909255604080519284168352602083019190915280517f793cb73064f3c8cde7e187ae515511e6e56d1ee89bf08b82fa60fb70f8d489129281900390910190a15050565b602b54600160b01b900463ffffffff166000818152602c6020908152604091829020825180840190935254601781810b810b810b808552600160c01b9092046001600160401b031693909201839052929392900b9181908490565b60005a6113888110614e3d5761138881039050846040820482031115614e3d576000808451602086016000888af150600191505b509392505050565b614e4d614faf565b60005b8351811015614eb2576000848281518110614e6757fe5b016020015160f81c9050614e8c8482601f8110614e8057fe5b60200201516001614f63565b848260ff16601f8110614e9b57fe5b61ffff909216602092909202015250600101614e50565b509092915050565b60008383811015614ecd57600285850304015b614ed781846149da565b95945050505050565b600081851015614f37576040805162461bcd60e51b815260206004820181905260248201527f6761734c6566742063616e6e6f742065786365656420696e697469616c476173604482015290519081900360640190fd5b818503830161179301633b9aca00858202026001600160801b038110614f5957fe5b9695505050505050565b6000611a1f8261ffff168461ffff160161ffff6149da565b6040518060a00160405280614f8e6150a9565b81526060602082018190526040820181905280820152600060809091015290565b604051806103e00160405280601f906020820280368337509192915050565b604080518082019091526000808252602082015290565b60028301918390821561506b5791602002820160005b8382111561503b57835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302614ffb565b80156150695782816101000a81549061ffff021916905560020160208160010104928301926001030261503b565b505b506150779291506150d0565b5090565b82601f810192821561506b579160200282015b8281111561506b57825182559160200191906001019061508e565b60408051608081018252600080825260208201819052918101829052606081019190915290565b5b8082111561507757600081556001016150d156fe416363657373436f6e74726f6c6c65644f6666636861696e41676772656761746f7220342e302e306f7261636c6520616464726573736573206f7574206f6620726567697374726174696f6e4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000a26469706673582212202938f61342c36109a44868dd1c9a82c61c0c3b90ed86f8f0bd641bc4b1a217ee64736f6c63430007060033000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000008e97b00000000000000000000000000000000000000000000000000000000003578d5000000000000000000000000d07294e6e917e07dfdcee882dd1e2565085c2ae0000000000000000000000000000000000000000000000000000000000000000100000000000000000000ffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000097d989a2d12ab455dd0835b78ce728be5d199a7d000000000000000000000000fc83e9d632362f20f07e178efef0281190311f5d0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000094a5059202f205553440000000000000000000000000000000000000000000000","external_libraries":[],"proxy_type":null,"implementations":[],"verified_at":"2025-04-28T04:49:32.045666Z","is_verified_via_verifier_alliance":true,"compiler_version":"0.7.6+commit.7338295f","decoded_constructor_args":[["1",{"internalType":"uint32","name":"_maximumGasPrice","type":"uint32"}],["1",{"internalType":"uint32","name":"_reasonableGasPrice","type":"uint32"}],["1",{"internalType":"uint32","name":"_microLinkPerEth","type":"uint32"}],["584059",{"internalType":"uint32","name":"_linkGweiPerObservation","type":"uint32"}],["3504341",{"internalType":"uint32","name":"_linkGweiPerTransmission","type":"uint32"}],["0xd07294e6E917e07dfDcee882dd1e2565085C2ae0",{"internalType":"contract LinkTokenInterface","name":"_link","type":"address"}],["1",{"internalType":"int192","name":"_minAnswer","type":"int192"}],["95780971304118053647396689196894323976171195136475135",{"internalType":"int192","name":"_maxAnswer","type":"int192"}],["0x97d989A2D12Ab455dd0835B78cE728be5d199a7d",{"internalType":"contract AccessControllerInterface","name":"_billingAccessController","type":"address"}],["0xFc83E9D632362F20F07E178efEF0281190311F5D",{"internalType":"contract AccessControllerInterface","name":"_requesterAccessController","type":"address"}],["8",{"internalType":"uint8","name":"_decimals","type":"uint8"}],["JPY / USD",{"internalType":"string","name":"description","type":"string"}]],"sourcify_repo_url":null,"optimization_runs":200,"compiler_settings":{"evmVersion":"istanbul","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":true,"runs":200},"remappings":[]},"is_verified":true,"verified_twin_address_hash":null,"optimization_enabled":true,"deployed_bytecode":"0x608060405234801561001057600080fd5b506004361061028a5760003560e01c80638e0566de1161015c578063c1075329116100ce578063e76d516811610087578063e76d516814610b7e578063eb45716314610b86578063eb5dcd6c14610bb8578063f2fde38b14610be6578063fbffd2c114610c0c578063feaf968c14610c325761028a565b8063c1075329146109a6578063c9807539146109d2578063d09dc33914610ae0578063dc7f012414610ae8578063e4902f8214610af0578063e5fe457714610b2d5761028a565b80639e3ceeab116101205780639e3ceeab146108b5578063a118f249146108db578063b121e14714610901578063b5ab58dc14610927578063b633620c14610944578063bd824706146109615761028a565b80638e0566de1461073157806398e5b12a14610761578063996e8298146107855780639a6fc8f51461078d5780639c849b30146107f75761028a565b80636b14daf81161020057806381411834116101b9578063814118341461064457806381ff70481461069c5780638205bf6a146106d55780638823da6c146106dd5780638ac28d5a146107035780638da5cb5b146107295761028a565b80636b14daf81461053857806370da2f671461060057806370efdf2d146106085780637284e4161461062c57806379ba5097146106345780638038e4a11461063c5761028a565b8063313ce56711610252578063313ce567146103ae5780634fb17470146103cc57806350d25bcd146103fa57806354fd4d5014610402578063585aa7de1461040a578063668a0f02146105305761028a565b80630a7569831461028f5780630eafb25b14610299578063181f5a77146102d157806322adbc781461034e578063299372681461036d575b600080fd5b610297610c3a565b005b6102bf600480360360208110156102af57600080fd5b50356001600160a01b0316610cc8565b60408051918252519081900360200190f35b6102d9610df7565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103135781810151838201526020016102fb565b50505050905090810190601f1680156103405780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610356610e17565b6040805160179290920b8252519081900360200190f35b610375610e3b565b6040805163ffffffff96871681529486166020860152928516848401529084166060840152909216608082015290519081900360a00190f35b6103b6610e9c565b6040805160ff9092168252519081900360200190f35b610297600480360360408110156103e257600080fd5b506001600160a01b0381358116916020013516610ec0565b6102bf611148565b6102bf6111d5565b610297600480360360a081101561042057600080fd5b810190602081018135600160201b81111561043a57600080fd5b82018360208201111561044c57600080fd5b803590602001918460208302840111600160201b8311171561046d57600080fd5b919390929091602081019035600160201b81111561048a57600080fd5b82018360208201111561049c57600080fd5b803590602001918460208302840111600160201b831117156104bd57600080fd5b9193909260ff833516926001600160401b03602082013516929190606081019060400135600160201b8111156104f257600080fd5b82018360208201111561050457600080fd5b803590602001918460018302840111600160201b8311171561052557600080fd5b5090925090506111da565b6102bf611978565b6105ec6004803603604081101561054e57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561057857600080fd5b82018360208201111561058a57600080fd5b803590602001918460018302840111600160201b831117156105ab57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611a00945050505050565b604080519115158252519081900360200190f35b610356611a28565b610610611a4c565b604080516001600160a01b039092168252519081900360200190f35b6102d9611a5b565b610297611ae3565b610297611b92565b61064c611c21565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610688578181015183820152602001610670565b505050509050019250505060405180910390f35b6106a4611c83565b6040805163ffffffff94851681529290931660208301526001600160801b0319168183015290519081900360600190f35b6102bf611ca3565b610297600480360360208110156106f357600080fd5b50356001600160a01b0316611d2b565b6102976004803603602081101561071957600080fd5b50356001600160a01b0316611df2565b610610611e69565b610739611e78565b604080516001600160a01b03909316835263ffffffff90911660208301528051918290030190f35b610769611eab565b604080516001600160501b039092168252519081900360200190f35b61061061207e565b6107b3600480360360208110156107a357600080fd5b50356001600160501b031661208d565b60405180866001600160501b03168152602001858152602001848152602001838152602001826001600160501b031681526020019550505050505060405180910390f35b6102976004803603604081101561080d57600080fd5b810190602081018135600160201b81111561082757600080fd5b82018360208201111561083957600080fd5b803590602001918460208302840111600160201b8311171561085a57600080fd5b919390929091602081019035600160201b81111561087757600080fd5b82018360208201111561088957600080fd5b803590602001918460208302840111600160201b831117156108aa57600080fd5b50909250905061212e565b610297600480360360208110156108cb57600080fd5b50356001600160a01b0316612331565b610297600480360360208110156108f157600080fd5b50356001600160a01b03166123f5565b6102976004803603602081101561091757600080fd5b50356001600160a01b031661244b565b6102bf6004803603602081101561093d57600080fd5b503561252c565b6102bf6004803603602081101561095a57600080fd5b50356125b5565b610297600480360360a081101561097757600080fd5b5063ffffffff81358116916020810135821691604082013581169160608101358216916080909101351661263e565b610297600480360360408110156109bc57600080fd5b506001600160a01b03813516906020013561276d565b610297600480360360808110156109e857600080fd5b810190602081018135600160201b811115610a0257600080fd5b820183602082011115610a1457600080fd5b803590602001918460018302840111600160201b83111715610a3557600080fd5b919390929091602081019035600160201b811115610a5257600080fd5b820183602082011115610a6457600080fd5b803590602001918460208302840111600160201b83111715610a8557600080fd5b919390929091602081019035600160201b811115610aa257600080fd5b820183602082011115610ab457600080fd5b803590602001918460208302840111600160201b83111715610ad557600080fd5b919350915035612a30565b6102bf61377e565b6105ec61380f565b610b1660048036036020811015610b0657600080fd5b50356001600160a01b0316613818565b6040805161ffff9092168252519081900360200190f35b610b356138c5565b604080516001600160801b0319909616865263ffffffff909416602086015260ff9092168484015260170b60608401526001600160401b03166080830152519081900360a00190f35b610610613975565b61029760048036036040811015610b9c57600080fd5b5080356001600160a01b0316906020013563ffffffff16613984565b61029760048036036040811015610bce57600080fd5b506001600160a01b0381358116916020013516613ab5565b61029760048036036020811015610bfc57600080fd5b50356001600160a01b0316613bf8565b61029760048036036020811015610c2257600080fd5b50356001600160a01b0316613c96565b6107b3613cec565b6000546001600160a01b03163314610c87576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b60315460ff1615610cc6576031805460ff191690556040517f3be8a977a014527b50ae38adda80b56911c267328965c98ddc385d248f53963890600090a15b565b6001600160a01b03811660009081526028602090815260408083208151808301909252805460ff808216845285948401916101009004166002811115610d0a57fe5b6002811115610d1557fe5b9052509050600081602001516002811115610d2c57fe5b1415610d3c576000915050610df2565b6040805160a08101825260025463ffffffff8082168352600160201b820481166020840152600160401b8204811693830193909352600160601b8104831660608301819052600160801b90910490921660808201528251909160009160019060059060ff16601f8110610dab57fe5b601091828204019190066002029054906101000a900461ffff160361ffff1602633b9aca0002905060016009846000015160ff16601f8110610de957fe5b01540301925050505b919050565b60606040518060600160405280602881526020016150e660289139905090565b7f000000000000000000000000000000000000000000000000000000000000000181565b6040805160a08101825260025463ffffffff808216808452600160201b8304821660208501819052600160401b84048316958501869052600160601b8404831660608601819052600160801b90940490921660809094018490529490939290565b7f000000000000000000000000000000000000000000000000000000000000000881565b6000546001600160a01b03163314610f0d576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b6003546001600160a01b03908116908316811415610f2b5750611144565b604080516370a0823160e01b815230600482015290516001600160a01b038516916370a08231916024808301926020929190829003018186803b158015610f7157600080fd5b505afa158015610f85573d6000803e3d6000fd5b505050506040513d6020811015610f9b57600080fd5b50610fa69050613d8b565b6000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610ff557600080fd5b505afa158015611009573d6000803e3d6000fd5b505050506040513d602081101561101f57600080fd5b50516040805163a9059cbb60e01b81526001600160a01b0386811660048301526024820184905291519293509084169163a9059cbb916044808201926020929091908290030181600087803b15801561107757600080fd5b505af115801561108b573d6000803e3d6000fd5b505050506040513d60208110156110a157600080fd5b50516110f4576040805162461bcd60e51b815260206004820152601f60248201527f7472616e736665722072656d61696e696e672066756e6473206661696c656400604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0386811691821790925560405190918416907f4966a50c93f855342ccf6c5c0d358b85b91335b2acedc7da0932f691f351711a90600090a350505b5050565b600061118b336000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a0092505050565b6111c8576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b6111d0614114565b905090565b600481565b868560ff8616601f831115611229576040805162461bcd60e51b815260206004820152601060248201526f746f6f206d616e79207369676e65727360801b604482015290519081900360640190fd5b6000811161127e576040805162461bcd60e51b815260206004820152601a60248201527f7468726573686f6c64206d75737420626520706f736974697665000000000000604482015290519081900360640190fd5b8183146112bc5760405162461bcd60e51b815260040180806020018281038252602481526020018061510e6024913960400191505060405180910390fd5b806003028311611313576040805162461bcd60e51b815260206004820181905260248201527f6661756c74792d6f7261636c65207468726573686f6c6420746f6f2068696768604482015290519081900360640190fd5b6000546001600160a01b03163314611360576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b6029541561145d57602980546000198101916000918390811061137f57fe5b6000918252602082200154602a80546001600160a01b03909216935090849081106113a657fe5b6000918252602090912001546001600160a01b031690506113c68161413d565b6001600160a01b03808316600090815260286020526040808220805461ffff199081169091559284168252902080549091169055602980548061140557fe5b600082815260209020810160001990810180546001600160a01b0319169055019055602a80548061143257fe5b600082815260209020810160001990810180546001600160a01b031916905501905550611360915050565b60005b8a8110156117b9576000602860008e8e8581811061147a57fe5b602090810292909201356001600160a01b031683525081019190915260400160002054610100900460ff1660028111156114b057fe5b14611502576040805162461bcd60e51b815260206004820152601760248201527f7265706561746564207369676e65722061646472657373000000000000000000604482015290519081900360640190fd5b6040805180820190915260ff8216815260016020820152602860008e8e8581811061152957fe5b602090810292909201356001600160a01b0316835250818101929092526040016000208251815460ff191660ff90911617808255918301519091829061ff00191661010083600281111561157957fe5b02179055506000915060079050818c8c8581811061159357fe5b6001600160a01b0360209182029390930135831684528301939093526040909101600020541691909114159050611605576040805162461bcd60e51b81526020600482015260116024820152701c185e5959481b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b6000602860008c8c8581811061161757fe5b602090810292909201356001600160a01b031683525081019190915260400160002054610100900460ff16600281111561164d57fe5b1461169f576040805162461bcd60e51b815260206004820152601c60248201527f7265706561746564207472616e736d6974746572206164647265737300000000604482015290519081900360640190fd5b6040805180820190915260ff8216815260026020820152602860008c8c858181106116c657fe5b602090810292909201356001600160a01b0316835250818101929092526040016000208251815460ff191660ff90911617808255918301519091829061ff00191661010083600281111561171657fe5b021790555090505060298c8c8381811061172c57fe5b835460018101855560009485526020948590200180546001600160a01b0319166001600160a01b039590920293909301359390931692909217905550602a8a8a8381811061177657fe5b835460018181018655600095865260209586902090910180546001600160a01b0319166001600160a01b0396909302949094013594909416179091555001611460565b50602b805460ff8916600160a81b0260ff60a81b19909116179055602d80544363ffffffff908116600160201b90810267ffffffff0000000019841617808316600101831663ffffffff1990911617938490559091048116911661182530828f8f8f8f8f8f8f8f614325565b602b60000160006101000a8154816001600160801b03021916908360801c02179055506000602b60000160106101000a81548164ffffffffff021916908364ffffffffff1602179055507f25d719d88a4512dd76c7442b910a83360845505894eb444ef299409e180f8fb982828f8f8f8f8f8f8f8f604051808b63ffffffff1681526020018a6001600160401b0316815260200180602001806020018760ff168152602001866001600160401b031681526020018060200184810384528c8c82818152602001925060200280828437600083820152601f01601f191690910185810384528a8152602090810191508b908b0280828437600083820152601f01601f191690910185810383528681526020019050868680828437600083820152604051601f909101601f19169092018290039f50909d5050505050505050505050505050a150505050505050505050505050565b60006119bb336000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a0092505050565b6119f8576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b6111d0614427565b6000611a0c838361443a565b80611a1f57506001600160a01b03831632145b90505b92915050565b7f00000000000000000000ffffffffffffffffffffffffffffffffffffffffffff81565b602f546001600160a01b031690565b6060611a9e336000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a0092505050565b611adb576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b6111d061446a565b6001546001600160a01b03163314611b3b576040805162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b604482015290519081900360640190fd5b60008054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6000546001600160a01b03163314611bdf576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b60315460ff16610cc6576031805460ff191660011790556040517faebf329500988c6488a0074e5a0a9ff304561fc5c6fc877aeb1d59c8282c348090600090a1565b6060602a805480602002602001604051908101604052809291908181526020018280548015611c7957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611c5b575b5050505050905090565b602d54602b5463ffffffff80831692600160201b9004169060801b909192565b6000611ce6336000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a0092505050565b611d23576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b6111d06144f7565b6000546001600160a01b03163314611d78576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526032602052604090205460ff1615611def576001600160a01b038116600081815260326020908152604091829020805460ff19169055815192835290517f3d68a6fce901d20453d1a7aa06bf3950302a735948037deb182a8db66df2a0d19281900390910190a15b50565b6001600160a01b03818116600090815260076020526040902054163314611e60576040805162461bcd60e51b815260206004820152601760248201527f4f6e6c792070617965652063616e207769746864726177000000000000000000604482015290519081900360640190fd5b611def8161413d565b6000546001600160a01b031681565b60408051808201909152602e546001600160a01b038116808352600160a01b90910463ffffffff16602090920182905291565b600080546001600160a01b0316331480611f6e5750602f5460408051630d629b5f60e31b815233600482018181526024830193845236604484018190526001600160a01b0390951694636b14daf894929360009391929190606401848480828437600083820152604051601f909101601f1916909201965060209550909350505081840390508186803b158015611f4157600080fd5b505afa158015611f55573d6000803e3d6000fd5b505050506040513d6020811015611f6b57600080fd5b50515b611fbf576040805162461bcd60e51b815260206004820152601d60248201527f4f6e6c79206f776e6572267265717565737465722063616e2063616c6c000000604482015290519081900360640190fd5b6040805160808082018352602b549081901b6001600160801b031916808352600160801b820464ffffffffff8116602080860191909152600160a81b840460ff90811686880152600160b01b90940463ffffffff9081166060808801919091528751948552600884901c909116918401919091529216818501529251919233927f3ea16a923ff4b1df6526e854c9e3a995c43385d70e73359e10623c74f0b52037929181900390910190a2806060015160010163ffffffff1691505090565b6004546001600160a01b031690565b60008060008060006120d6336000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a0092505050565b612113576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b61211c86614529565b939a9299509097509550909350915050565b6000546001600160a01b0316331461217b576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b8281146121cf576040805162461bcd60e51b815260206004820181905260248201527f7472616e736d6974746572732e73697a6520213d207061796565732e73697a65604482015290519081900360640190fd5b60005b8381101561232a5760008585838181106121e857fe5b905060200201356001600160a01b03169050600084848481811061220857fe5b6001600160a01b0385811660009081526007602090815260409091205492029390930135831693509091169050801580806122545750826001600160a01b0316826001600160a01b0316145b612299576040805162461bcd60e51b81526020600482015260116024820152701c185e595948185b1c9958591e481cd95d607a1b604482015290519081900360640190fd5b6001600160a01b03848116600090815260076020526040902080546001600160a01b0319168583169081179091559083161461231a57826001600160a01b0316826001600160a01b0316856001600160a01b03167f78af32efdcad432315431e9b03d27e6cd98fb79c405fdc5af7c1714d9c0f75b360405160405180910390a45b5050600190920191506121d29050565b5050505050565b6000546001600160a01b0316331461237e576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b602f546001600160a01b03908116908216811461114457602f80546001600160a01b0319166001600160a01b03848116918217909255604080519284168352602083019190915280517f27b89aede8b560578baaa25ee5ce3852c5eecad1e114b941bbd89e1eb4bae6349281900390910190a15050565b6000546001600160a01b03163314612442576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b611def8161464d565b6001600160a01b038181166000908152600860205260409020541633146124b9576040805162461bcd60e51b815260206004820152601f60248201527f6f6e6c792070726f706f736564207061796565732063616e2061636365707400604482015290519081900360640190fd5b6001600160a01b0381811660008181526007602090815260408083208054336001600160a01b031980831682179093556008909452828520805490921690915590519416939092849290917f78af32efdcad432315431e9b03d27e6cd98fb79c405fdc5af7c1714d9c0f75b39190a45050565b600061256f336000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a0092505050565b6125ac576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b611a22826146c8565b60006125f8336000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a0092505050565b612635576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b611a22826146fe565b6004546000546001600160a01b0391821691163314806126ff575060408051630d629b5f60e31b815233600482018181526024830193845236604484018190526001600160a01b03861694636b14daf8946000939190606401848480828437600083820152604051601f909101601f1916909201965060209550909350505081840390508186803b1580156126d257600080fd5b505afa1580156126e6573d6000803e3d6000fd5b505050506040513d60208110156126fc57600080fd5b50515b612750576040805162461bcd60e51b815260206004820181905260248201527f4f6e6c79206f776e65722662696c6c696e6741646d696e2063616e2063616c6c604482015290519081900360640190fd5b612758613d8b565b612765868686868661473d565b505050505050565b6000546001600160a01b031633148061282e57506004805460408051630d629b5f60e31b8152339381018481526024820192835236604483018190526001600160a01b0390941694636b14daf8949093600093919291606401848480828437600083820152604051601f909101601f1916909201965060209550909350505081840390508186803b15801561280157600080fd5b505afa158015612815573d6000803e3d6000fd5b505050506040513d602081101561282b57600080fd5b50515b61287f576040805162461bcd60e51b815260206004820181905260248201527f4f6e6c79206f776e65722662696c6c696e6741646d696e2063616e2063616c6c604482015290519081900360640190fd5b6000612889614826565b600354604080516370a0823160e01b815230600482015290519293506000926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b1580156128da57600080fd5b505afa1580156128ee573d6000803e3d6000fd5b505050506040513d602081101561290457600080fd5b5051905081811015612954576040805162461bcd60e51b8152602060048201526014602482015273696e73756666696369656e742062616c616e636560601b604482015290519081900360640190fd5b6003546001600160a01b031663a9059cbb85612972858503876149da565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156129b857600080fd5b505af11580156129cc573d6000803e3d6000fd5b505050506040513d60208110156129e257600080fd5b5051612a2a576040805162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e742066756e647360701b604482015290519081900360640190fd5b50505050565b60005a9050612a438888888888886149f1565b3614612a96576040805162461bcd60e51b815260206004820152601960248201527f7472616e736d6974206d65737361676520746f6f206c6f6e6700000000000000604482015290519081900360640190fd5b612a9e614f7b565b6040805160808082018352602b549081901b6001600160801b0319168252600160801b810464ffffffffff166020830152600160a81b810460ff1692820192909252600160b01b90910463ffffffff166060808301919091529082526000908a908a90811015612b0d57600080fd5b813591602081013591810190606081016040820135600160201b811115612b3357600080fd5b820183602082011115612b4557600080fd5b803590602001918460208302840111600160201b83111715612b6657600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050505060408801525050506080840182905283515190925060589190911b906001600160801b0319808316911614612c0d576040805162461bcd60e51b81526020600482015260156024820152740c6dedcccd2ce88d2cecae6e840dad2e6dac2e8c6d605b1b604482015290519081900360640190fd5b608083015183516020015164ffffffffff808316911610612c64576040805162461bcd60e51b815260206004820152600c60248201526b1cdd185b19481c995c1bdc9d60a21b604482015290519081900360640190fd5b83516040015160ff168911612cb8576040805162461bcd60e51b81526020600482015260156024820152746e6f7420656e6f756768207369676e61747572657360581b604482015290519081900360640190fd5b601f891115612d04576040805162461bcd60e51b8152602060048201526013602482015272746f6f206d616e79207369676e61747572657360681b604482015290519081900360640190fd5b868914612d58576040805162461bcd60e51b815260206004820152601e60248201527f7369676e617475726573206f7574206f6620726567697374726174696f6e0000604482015290519081900360640190fd5b601f8460400151511115612db3576040805162461bcd60e51b815260206004820152601e60248201527f6e756d206f62736572766174696f6e73206f7574206f6620626f756e64730000604482015290519081900360640190fd5b83600001516040015160020260ff1684604001515111612e1a576040805162461bcd60e51b815260206004820152601e60248201527f746f6f206665772076616c75657320746f207472757374206d656469616e0000604482015290519081900360640190fd5b886001600160401b0381118015612e3057600080fd5b506040519080825280601f01601f191660200182016040528015612e5b576020820181803683370190505b50606085015260005b60ff81168a1115612eb457868160ff1660208110612e7e57fe5b1a60f81b85606001518260ff1681518110612e9557fe5b60200101906001600160f81b031916908160001a905350600101612e64565b508360400151516001600160401b0381118015612ed057600080fd5b506040519080825280601f01601f191660200182016040528015612efb576020820181803683370190505b506020850152612f09614faf565b60005b8560400151518160ff161015612ff7576000858260ff1660208110612f2d57fe5b1a90508281601f8110612f3c57fe5b602002015115612f93576040805162461bcd60e51b815260206004820152601760248201527f6f6273657276657220696e646578207265706561746564000000000000000000604482015290519081900360640190fd5b6001838260ff16601f8110612fa457fe5b91151560209283029190910152869060ff8416908110612fc057fe5b1a60f81b87602001518360ff1681518110612fd757fe5b60200101906001600160f81b031916908160001a90535050600101612f0c565b503360009081526028602090815260408083208151808301909252805460ff8082168452929391929184019161010090910416600281111561303557fe5b600281111561304057fe5b905250905060028160200151600281111561305757fe5b14801561308b5750602a816000015160ff168154811061307357fe5b6000918252602090912001546001600160a01b031633145b6130dc576040805162461bcd60e51b815260206004820152601860248201527f756e617574686f72697a6564207472616e736d69747465720000000000000000604482015290519081900360640190fd5b5050835164ffffffffff90911660209091015250506040516000908a908a90808383808284376040519201829003909120945061311d9350614faf92505050565b613125614fce565b60005b898110156133155760006001858760600151848151811061314557fe5b60209101015160f81c601b018e8e8681811061315d57fe5b905060200201358d8d8781811061317057fe5b9050602002013560405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156131cb573d6000803e3d6000fd5b505060408051601f198101516001600160a01b03811660009081526028602090815290849020838501909452835460ff8082168552929650929450840191610100900416600281111561321a57fe5b600281111561322557fe5b905250925060018360200151600281111561323c57fe5b1461328e576040805162461bcd60e51b815260206004820152601e60248201527f61646472657373206e6f7420617574686f72697a656420746f207369676e0000604482015290519081900360640190fd5b8251849060ff16601f811061329f57fe5b6020020151156132ed576040805162461bcd60e51b81526020600482015260146024820152736e6f6e2d756e69717565207369676e617475726560601b604482015290519081900360640190fd5b600184846000015160ff16601f811061330257fe5b9115156020909202015250600101613128565b5050505060005b6001826040015151038110156133c65760008260400151826001018151811061334157fe5b602002602001015160170b8360400151838151811061335c57fe5b602002602001015160170b13159050806133bd576040805162461bcd60e51b815260206004820152601760248201527f6f62736572766174696f6e73206e6f7420736f72746564000000000000000000604482015290519081900360640190fd5b5060010161331c565b506040810151805160009190600281049081106133df57fe5b602002602001015190508060170b7f000000000000000000000000000000000000000000000000000000000000000160170b1315801561344557507f00000000000000000000ffffffffffffffffffffffffffffffffffffffffffff60170b8160170b13155b613496576040805162461bcd60e51b815260206004820152601e60248201527f6d656469616e206973206f7574206f66206d696e2d6d61782072616e67650000604482015290519081900360640190fd5b81516060908101805163ffffffff60019091018116909152604080518082018252601785810b8083526001600160401b0342811660208086019182528a5189015188166000908152602c8252878120965187549351909416600160c01b029390950b6001600160c01b039081166001600160c01b03199093169290921790911691909117909355875186015184890151848a01516080808c015188519586523386890181905291860181905260a0988601898152845199870199909952835194909916997ff6a97944f31ea060dfde0566e4167c1a1082551e64b60ecb14d599a9d023d451998c999298949793969095909492939185019260c086019289820192909102908190849084905b838110156135ba5781810151838201526020016135a2565b50505050905001838103825285818151815260200191508051906020019080838360005b838110156135f65781810151838201526020016135de565b50505050905090810190601f1680156136235780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390a281516060015160408051428152905160009263ffffffff16917f0109fc6f55cf40689f02fbaad7af7fe7bbac8a3d2186600afc7d3e10cac60271919081900360200190a381600001516060015163ffffffff168160170b7f0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f426040518082815260200191505060405180910390a36136d88260000151606001518260170b614a09565b5080518051602b8054602084015160408501516060909501516001600160801b031990921660809490941c9390931764ffffffffff60801b1916600160801b64ffffffffff909416939093029290921760ff60a81b1916600160a81b60ff909416939093029290921763ffffffff60b01b1916600160b01b63ffffffff9283160217909155821061376557fe5b613773828260200151614b0f565b505050505050505050565b600354604080516370a0823160e01b8152306004820152905160009283926001600160a01b03909116916370a0823191602480820192602092909190829003018186803b1580156137ce57600080fd5b505afa1580156137e2573d6000803e3d6000fd5b505050506040513d60208110156137f857600080fd5b505190506000613806614826565b90910391505090565b60315460ff1681565b6001600160a01b03811660009081526028602090815260408083208151808301909252805460ff80821684528594840191610100900416600281111561385a57fe5b600281111561386557fe5b905250905060008160200151600281111561387c57fe5b141561388c576000915050610df2565b60016005826000015160ff16601f81106138a257fe5b601091828204019190066002029054906101000a900461ffff1603915050919050565b600080808080333214613916576040805162461bcd60e51b81526020600482015260146024820152734f6e6c792063616c6c61626c6520627920454f4160601b604482015290519081900360640190fd5b5050602b5463ffffffff600160b01b820481166000908152602c6020526040902054608083901b96600160801b909304600881901c909216955064ffffffffff9091169350601781900b9250600160c01b90046001600160401b031690565b6003546001600160a01b031690565b6000546001600160a01b031633146139d1576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b60408051808201909152602e546001600160a01b03808216808452600160a01b90920463ffffffff1660208401528416141580613a1e57508163ffffffff16816020015163ffffffff1614155b15613ab0576040805180820182526001600160a01b0385811680835263ffffffff8681166020948501819052602e80546001600160a01b031916841763ffffffff60a01b1916600160a01b8302179055865187860151875193168352948201528451919493909216927fb04e3a37abe9c0fcdfebdeae019a8e2b12ddf53f5d55ffb0caccc1bedaca1541928290030190a35b505050565b6001600160a01b03828116600090815260076020526040902054163314613b23576040805162461bcd60e51b815260206004820152601d60248201527f6f6e6c792063757272656e742070617965652063616e20757064617465000000604482015290519081900360640190fd5b336001600160a01b0382161415613b81576040805162461bcd60e51b815260206004820152601760248201527f63616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015290519081900360640190fd5b6001600160a01b03808316600090815260086020526040902080548383166001600160a01b031982168117909255909116908114613ab0576040516001600160a01b038084169133918616907f84f7c7c80bb8ed2279b4aab5f61cd05e6374073d38f46d7f32de8c30e9e3836790600090a4505050565b6000546001600160a01b03163314613c45576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000546001600160a01b03163314613ce3576040805162461bcd60e51b81526020600482015260166024820152600080516020615132833981519152604482015290519081900360640190fd5b611def81614d37565b6000806000806000613d35336000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a0092505050565b613d72576040805162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b604482015290519081900360640190fd5b613d7a614dae565b945094509450945094509091929394565b6040805160a08101825260025463ffffffff8082168352600160201b820481166020840152600160401b8204811683850152600160601b820481166060840152600160801b90910416608082015260035482516103e081019384905291926001600160a01b0390911691600091600590601f908285855b82829054906101000a900461ffff1661ffff1681526020019060020190602082600101049283019260010382029150808411613e02575050604080516103e0810191829052959650600095945060099350601f9250905082845b815481526020019060010190808311613e5c57505050505090506000602a805480602002602001604051908101604052809291908181526020018280548015613ece57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613eb0575b5050505050905060005b81518110156140f857600060018483601f8110613ef157fe5b6020020151039050600060018684601f8110613f0957fe5b60200201510361ffff169050600082896060015163ffffffff168302633b9aca000201905060008111156140ed57600060076000878781518110613f4957fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060009054906101000a90046001600160a01b03169050886001600160a01b031663a9059cbb82846040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015613fde57600080fd5b505af1158015613ff2573d6000803e3d6000fd5b505050506040513d602081101561400857600080fd5b5051614050576040805162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e742066756e647360701b604482015290519081900360640190fd5b60018886601f811061405e57fe5b61ffff909216602092909202015260018786601f811061407a57fe5b602002018181525050886001600160a01b0316816001600160a01b03168787815181106140a357fe5b60200260200101516001600160a01b03167fd0b1dac935d85bd54cf0a33b0d41d39f8cf53a968465fc7ea2377526b8ac712c856040518082815260200191505060405180910390a4505b505050600101613ed8565b50614106600584601f614fe5565b50612765600983601f61507b565b602b54600160b01b900463ffffffff166000908152602c6020526040902054601790810b900b90565b6001600160a01b03811660009081526028602090815260408083208151808301909252805460ff8082168452929391929184019161010090910416600281111561418357fe5b600281111561418e57fe5b9052509050600061419e83610cc8565b90508015613ab0576001600160a01b03808416600090815260076020908152604080832054600354825163a9059cbb60e01b8152918616600483018190526024830188905292519295169363a9059cbb9360448084019491939192918390030190829087803b15801561421057600080fd5b505af1158015614224573d6000803e3d6000fd5b505050506040513d602081101561423a57600080fd5b5051614282576040805162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e742066756e647360701b604482015290519081900360640190fd5b60016005846000015160ff16601f811061429857fe5b601091828204019190066002026101000a81548161ffff021916908361ffff16021790555060016009846000015160ff16601f81106142d357fe5b01556003546040805184815290516001600160a01b039283169284811692908816917fd0b1dac935d85bd54cf0a33b0d41d39f8cf53a968465fc7ea2377526b8ac712c9181900360200190a450505050565b60008a8a8a8a8a8a8a8a8a8a604051602001808b6001600160a01b031681526020018a6001600160401b0316815260200180602001806020018760ff168152602001866001600160401b031681526020018060200184810384528c8c82818152602001925060200280828437600083820152601f01601f191690910185810384528a8152602090810191508b908b0280828437600083820152601f01601f191690910185810383528681526020019050868680828437600081840152601f19601f8201169050808301925050509d50505050505050505050505050506040516020818303038152906040528051906020012090509a9950505050505050505050565b602b54600160b01b900463ffffffff1690565b6001600160a01b03821660009081526032602052604081205460ff1680611a1f57505060315460ff161592915050565b60308054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015611c795780601f106144cb57610100808354040283529160200191611c79565b820191906000526020600020905b8154815290600101906020018083116144d957509395945050505050565b602b54600160b01b900463ffffffff166000908152602c6020526040902054600160c01b90046001600160401b031690565b600080600080600063ffffffff866001600160501b031611156040518060400160405280600f81526020016e139bc819185d18481c1c995cd95b9d608a1b815250906145f35760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156145b85781810151838201526020016145a0565b50505050905090810190601f1680156145e55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5050505063ffffffff83166000908152602c6020908152604091829020825180840190935254601781810b810b810b808552600160c01b9092046001600160401b031693909201839052949594900b939092508291508490565b6001600160a01b03811660009081526032602052604090205460ff16611def576001600160a01b038116600081815260326020908152604091829020805460ff19166001179055815192835290517f87286ad1f399c8e82bf0c4ef4fcdc570ea2e1e92176e5c848b6413545b885db49281900390910190a150565b600063ffffffff8211156146de57506000610df2565b5063ffffffff166000908152602c6020526040902054601790810b900b90565b600063ffffffff82111561471457506000610df2565b5063ffffffff166000908152602c6020526040902054600160c01b90046001600160401b031690565b6040805160a0808201835263ffffffff88811680845288821660208086018290528984168688018190528985166060808901829052958a1660809889018190526002805463ffffffff1916871767ffffffff000000001916600160201b8702176bffffffff00000000000000001916600160401b85021763ffffffff60601b1916600160601b84021763ffffffff60801b1916600160801b830217905589519586529285019390935283880152928201529283015291517fd0d9486a2c673e2a4b57fc82e4c8a556b3e2b82dd5db07e2c04a920ca0f469b6929181900390910190a15050505050565b604080516103e0810191829052600091829190600590601f908285855b82829054906101000a900461ffff1661ffff16815260200190600201906020826001010492830192600103820291508084116148435790505050505050905060005b601f8110156148b35760018282601f811061489c57fe5b60200201510361ffff169290920191600101614885565b506040805160a08101825260025463ffffffff8082168352600160201b82048116602080850191909152600160401b8304821684860152600160601b8304821660608501819052600160801b9093049091166080840152602a805485518184028101840190965280865296909202633b9aca000295929360009390929183018282801561496957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161494b575b5050604080516103e0810191829052949550600094935060099250601f915082845b81548152602001906001019080831161498b575050505050905060005b82518110156149d25760018282601f81106149bf57fe5b60200201510395909501946001016149a8565b505050505090565b6000818310156149eb575081611a22565b50919050565b602083810286019082020160e4019695505050505050565b60408051808201909152602e546001600160a01b038116808352600160a01b90910463ffffffff166020830152614a405750611144565b600019830163ffffffff8181166000818152602c60209081526040918290205486820151875184516024810196909652601792830b90920b604486018190528a8716606487015260848087018b90528551808803909101815260a4909601909452918401805163beed9b5160e01b6001600160e01b039091161790529193614acb9391169190614e09565b61232a576040805162461bcd60e51b815260206004820152601060248201526f696e73756666696369656e742067617360801b604482015290519081900360640190fd5b3360009081526028602090815260408083208151808301909252805460ff80821684529293919291840191610100909104166002811115614b4c57fe5b6002811115614b5757fe5b9052506040805160a08101825260025463ffffffff8082168352600160201b820481166020840152600160401b8204811683850152600160601b820481166060840152600160801b90910416608082015281516103e081019283905292935091614c0b91859190600590601f90826000855b82829054906101000a900461ffff1661ffff1681526020019060020190602082600101049283019260010382029150808411614bc95790505050505050614e45565b614c1990600590601f614fe5565b50600282602001516002811115614c2c57fe5b14614c7e576040805162461bcd60e51b815260206004820181905260248201527f73656e7420627920756e64657369676e61746564207472616e736d6974746572604482015290519081900360640190fd5b6000614ca5633b9aca003a04836020015163ffffffff16846000015163ffffffff16614eba565b90506010360260005a90506000614cc48863ffffffff16858585614ee0565b6001600160801b031690506000620f4240866040015163ffffffff16830281614ce957fe5b049050856080015163ffffffff16633b9aca0002816009896000015160ff16601f8110614d1257fe5b015401016009886000015160ff16601f8110614d2a57fe5b0155505050505050505050565b6004546001600160a01b03908116908216811461114457600480546001600160a01b0319166001600160a01b03848116918217909255604080519284168352602083019190915280517f793cb73064f3c8cde7e187ae515511e6e56d1ee89bf08b82fa60fb70f8d489129281900390910190a15050565b602b54600160b01b900463ffffffff166000818152602c6020908152604091829020825180840190935254601781810b810b810b808552600160c01b9092046001600160401b031693909201839052929392900b9181908490565b60005a6113888110614e3d5761138881039050846040820482031115614e3d576000808451602086016000888af150600191505b509392505050565b614e4d614faf565b60005b8351811015614eb2576000848281518110614e6757fe5b016020015160f81c9050614e8c8482601f8110614e8057fe5b60200201516001614f63565b848260ff16601f8110614e9b57fe5b61ffff909216602092909202015250600101614e50565b509092915050565b60008383811015614ecd57600285850304015b614ed781846149da565b95945050505050565b600081851015614f37576040805162461bcd60e51b815260206004820181905260248201527f6761734c6566742063616e6e6f742065786365656420696e697469616c476173604482015290519081900360640190fd5b818503830161179301633b9aca00858202026001600160801b038110614f5957fe5b9695505050505050565b6000611a1f8261ffff168461ffff160161ffff6149da565b6040518060a00160405280614f8e6150a9565b81526060602082018190526040820181905280820152600060809091015290565b604051806103e00160405280601f906020820280368337509192915050565b604080518082019091526000808252602082015290565b60028301918390821561506b5791602002820160005b8382111561503b57835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302614ffb565b80156150695782816101000a81549061ffff021916905560020160208160010104928301926001030261503b565b505b506150779291506150d0565b5090565b82601f810192821561506b579160200282015b8281111561506b57825182559160200191906001019061508e565b60408051608081018252600080825260208201819052918101829052606081019190915290565b5b8082111561507757600081556001016150d156fe416363657373436f6e74726f6c6c65644f6666636861696e41676772656761746f7220342e302e306f7261636c6520616464726573736573206f7574206f6620726567697374726174696f6e4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000a26469706673582212202938f61342c36109a44868dd1c9a82c61c0c3b90ed86f8f0bd641bc4b1a217ee64736f6c63430007060033","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.7.6;\n\nimport \"./OffchainAggregator.sol\";\nimport \"./SimpleReadAccessController.sol\";\n\n/**\n * @notice Wrapper of OffchainAggregator which checks read access on Aggregator-interface methods\n */\ncontract AccessControlledOffchainAggregator is OffchainAggregator, SimpleReadAccessController {\n\n  constructor(\n    uint32 _maximumGasPrice,\n    uint32 _reasonableGasPrice,\n    uint32 _microLinkPerEth,\n    uint32 _linkGweiPerObservation,\n    uint32 _linkGweiPerTransmission,\n    LinkTokenInterface _link,\n    int192 _minAnswer,\n    int192 _maxAnswer,\n    AccessControllerInterface _billingAccessController,\n    AccessControllerInterface _requesterAccessController,\n    uint8 _decimals,\n    string memory description\n  )\n    OffchainAggregator(\n      _maximumGasPrice,\n      _reasonableGasPrice,\n      _microLinkPerEth,\n      _linkGweiPerObservation,\n      _linkGweiPerTransmission,\n      _link,\n      _minAnswer,\n      _maxAnswer,\n      _billingAccessController,\n      _requesterAccessController,\n      _decimals,\n      description\n    ) {\n    }\n\n  /*\n   * Versioning\n   */\n\n  function typeAndVersion()\n    external\n    override\n    pure\n    virtual\n    returns (string memory)\n  {\n    return \"AccessControlledOffchainAggregator 4.0.0\";\n  }\n\n\n  /*\n   * v2 Aggregator interface\n   */\n\n  /// @inheritdoc OffchainAggregator\n  function latestAnswer()\n    public\n    override\n    view\n    checkAccess()\n    returns (int256)\n  {\n    return super.latestAnswer();\n  }\n\n  /// @inheritdoc OffchainAggregator\n  function latestTimestamp()\n    public\n    override\n    view\n    checkAccess()\n    returns (uint256)\n  {\n    return super.latestTimestamp();\n  }\n\n  /// @inheritdoc OffchainAggregator\n  function latestRound()\n    public\n    override\n    view\n    checkAccess()\n    returns (uint256)\n  {\n    return super.latestRound();\n  }\n\n  /// @inheritdoc OffchainAggregator\n  function getAnswer(uint256 _roundId)\n    public\n    override\n    view\n    checkAccess()\n    returns (int256)\n  {\n    return super.getAnswer(_roundId);\n  }\n\n  /// @inheritdoc OffchainAggregator\n  function getTimestamp(uint256 _roundId)\n    public\n    override\n    view\n    checkAccess()\n    returns (uint256)\n  {\n    return super.getTimestamp(_roundId);\n  }\n\n  /*\n   * v3 Aggregator interface\n   */\n\n  /// @inheritdoc OffchainAggregator\n  function description()\n    public\n    override\n    view\n    checkAccess()\n    returns (string memory)\n  {\n    return super.description();\n  }\n\n  /// @inheritdoc OffchainAggregator\n  function getRoundData(uint80 _roundId)\n    public\n    override\n    view\n    checkAccess()\n    returns (\n      uint80 roundId,\n      int256 answer,\n      uint256 startedAt,\n      uint256 updatedAt,\n      uint80 answeredInRound\n    )\n  {\n    return super.getRoundData(_roundId);\n  }\n\n  /// @inheritdoc OffchainAggregator\n  function latestRoundData()\n    public\n    override\n    view\n    checkAccess()\n    returns (\n      uint80 roundId,\n      int256 answer,\n      uint256 startedAt,\n      uint256 updatedAt,\n      uint80 answeredInRound\n    )\n  {\n    return super.latestRoundData();\n  }\n\n}\n","creation_status":"success","file_path":"contract/AccessControlledOffchainAggregator.sol"}