ETH Price: $2,728.95 (+0.35%)
Gas: 0.68 Gwei

Contract

0x2285AC429cCCAaE7cC1E27BfBe617bC626B443CF
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer Ownersh...187711402023-12-12 15:56:59436 days ago1702396619IN
0x2285AC42...626B443CF
0 ETH0.0018345264.09705104
Toggle Manual Ve...187711332023-12-12 15:55:35436 days ago1702396535IN
0x2285AC42...626B443CF
0 ETH0.0013719855.20640203
Execute Manual V...187711322023-12-12 15:55:23436 days ago1702396523IN
0x2285AC42...626B443CF
0 ETH0.0044820357.39358888
Execute Manual V...187429022023-12-08 17:02:23440 days ago1702054943IN
0x2285AC42...626B443CF
0 ETH0.0041298152.88334279
Request Update187428752023-12-08 16:56:59440 days ago1702054619IN
0x2285AC42...626B443CF
0 ETH0.0061133343.4124177
Perform Upkeep187427902023-12-08 16:39:47440 days ago1702053587IN
0x2285AC42...626B443CF
0 ETH0.0033115748.12354427
Execute Manual V...187289162023-12-06 17:58:35442 days ago1701885515IN
0x2285AC42...626B443CF
0 ETH0.0051201465.56472784
Request Update187288572023-12-06 17:46:47442 days ago1701884807IN
0x2285AC42...626B443CF
0 ETH0.0090901264.55136243
Perform Upkeep187287562023-12-06 17:26:11442 days ago1701883571IN
0x2285AC42...626B443CF
0 ETH0.0048606770.63491191
Execute Manual V...186802232023-11-29 22:23:35449 days ago1701296615IN
0x2285AC42...626B443CF
0 ETH0.0031055139.7668973
Request Update186801672023-11-29 22:12:23449 days ago1701295943IN
0x2285AC42...626B443CF
0 ETH0.0074835353.14257455
Cancel Request186801492023-11-29 22:08:47449 days ago1701295727IN
0x2285AC42...626B443CF
0 ETH0.0024479550.17124852
Cancel Request186800302023-11-29 21:44:23449 days ago1701294263IN
0x2285AC42...626B443CF
0 ETH0.001827437.45304488
Execute Manual V...186294012023-11-22 19:35:59456 days ago1700681759IN
0x2285AC42...626B443CF
0 ETH0.0067773452.37799596
Perform Upkeep186293002023-11-22 19:15:35456 days ago1700680535IN
0x2285AC42...626B443CF
0 ETH0.0101211872.49558682
Perform Upkeep186292132023-11-22 18:58:11456 days ago1700679491IN
0x2285AC42...626B443CF
0 ETH0.0049515457.63376926
Set Chainlink Pa...186287482023-11-22 17:24:59456 days ago1700673899IN
0x2285AC42...626B443CF
0 ETH0.002605852.21940764

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DistributionOracle

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 19 : DistributionOracle.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.15;

import "@chainlink/contracts/src/v0.8/ChainlinkClient.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

import "../interfaces/IPriorityPool.sol";
import "../interfaces/IStakingPool.sol";

contract DistributionOracle is ChainlinkClient, Ownable {
    using Chainlink for Chainlink.Request;

    enum UpkeepType {
        PAUSE,
        REQUEST
    }

    struct UpdateStatus {
        uint64 timeOfLastUpdate;
        uint64 pausedAtBlockNumber;
        uint128 requestInProgress;
    }

    struct UpdateData {
        bytes32 merkleRoot;
        bytes32 ipfsHash;
        uint256 amountDistributed;
        uint256 sharesAmountDistributed;
    }

    IPriorityPool public immutable priorityPool;

    bytes32 public jobId;
    uint256 public fee;

    uint64 public minTimeBetweenUpdates;
    uint64 public minBlockConfirmations;
    uint128 public minDepositsSinceLastUpdate;

    UpdateStatus public updateStatus;

    uint128 public manualVerificationRequired;
    uint128 public awaitingManualVerification;
    UpdateData public updateData;

    event SetUpdateParams(uint64 minTimeBetweenUpdates, uint128 minDepositsSinceLastUpdate, uint64 minBlockConfirmations);
    event SetChainlinkParams(bytes32 jobId, uint256 fee);
    event ToggleManualVerification(uint128 manualVerificationRequired);

    error NotPaused();
    error InsufficientBlockConfirmations();
    error InsufficientBalance();
    error UpdateConditionsNotMet();
    error InvalidUpkeepType();
    error RequestInProgress();
    error NoVerificationPending();
    error AwaitingManualVerification();

    /**
     * @notice Initialize the contract
     * @param _chainlinkToken address of LINK token
     * @param _chainlinkOracle address of operator contract
     * @param _jobId id of job
     * @param _fee fee charged for each request paid in LINK
     * @param _minTimeBetweenUpdates min amount of seconds between updates
     * @param _minDepositsSinceLastUpdate min amount of deposits from the priority pool to the
     *         staking pool needed to request update
     * @param _minBlockConfirmations min # of blocks to wait to request update after pausing priority pool
     * @param _priorityPool address of priority pool
     */
    constructor(
        address _chainlinkToken,
        address _chainlinkOracle,
        bytes32 _jobId,
        uint256 _fee,
        uint64 _minTimeBetweenUpdates,
        uint128 _minDepositsSinceLastUpdate,
        uint64 _minBlockConfirmations,
        address _priorityPool
    ) {
        setChainlinkToken(_chainlinkToken);
        setChainlinkOracle(_chainlinkOracle);
        jobId = _jobId;
        fee = _fee;
        minTimeBetweenUpdates = _minTimeBetweenUpdates;
        minDepositsSinceLastUpdate = _minDepositsSinceLastUpdate;
        minBlockConfirmations = _minBlockConfirmations;
        priorityPool = IPriorityPool(_priorityPool);
        manualVerificationRequired = 1;
    }

    /**
     * @notice returns whether a call should be made to performUpkeep to pause or request an update
     * @dev used by chainlink keepers
     * @return upkeepNeeded whether or not to pause or request update
     * @return performData abi encoded upkeep type to perform
     */
    function checkUpkeep(bytes calldata) external view returns (bool, bytes memory) {
        bool shouldPauseForUpdate = !priorityPool.paused() &&
            awaitingManualVerification == 0 &&
            (block.timestamp >= updateStatus.timeOfLastUpdate + minTimeBetweenUpdates) &&
            priorityPool.depositsSinceLastUpdate() >= minDepositsSinceLastUpdate;

        if (shouldPauseForUpdate) {
            return (true, abi.encode(UpkeepType.PAUSE));
        }

        bool shouldRequestUpdate = priorityPool.paused() &&
            awaitingManualVerification == 0 &&
            updateStatus.requestInProgress == 0 &&
            (block.number >= updateStatus.pausedAtBlockNumber + minBlockConfirmations);

        if (shouldRequestUpdate) {
            return (true, abi.encode(UpkeepType.REQUEST));
        }

        return (false, bytes(""));
    }

    /**
     * @notice deposits queued tokens into the staking pool
     * @dev used by chainlink keepers
     * @param _performData abi encoded upkeep type to perform
     */
    function performUpkeep(bytes calldata _performData) external {
        UpkeepType upkeepType = abi.decode(_performData, (UpkeepType));

        if (upkeepType == UpkeepType.PAUSE) {
            if (priorityPool.depositsSinceLastUpdate() < minDepositsSinceLastUpdate) revert UpdateConditionsNotMet();
            _pauseForUpdate();
        } else if (upkeepType == UpkeepType.REQUEST) {
            _requestUpdate();
        } else {
            revert InvalidUpkeepType();
        }
    }

    /**
     * @notice Pauses the priority pool so a new merkle tree can be calculated
     * @dev must always be called before requestUpdate()
     */
    function pauseForUpdate() external onlyOwner {
        _pauseForUpdate();
    }

    /**
     * @notice Requests a new update which will calculate a new merkle tree, post the data to IPFS, and update
     * the priority pool
     * @dev pauseForUpdate() must be called before calling this function
     */
    function requestUpdate() external onlyOwner {
        _requestUpdate();
    }

    /**
     * @notice Fulfills an update request
     * @param _requestId id of the request to fulfill
     * @param _merkleRoot new merkle root for the distribution tree
     * @param _ipfsHash new ipfs hash for the distribution tree (CIDv0, no prefix - only hash)
     * @param _amountDistributed amount of LSD tokens distributed in this distribution
     * @param _sharesAmountDistributed amount of LSD shares distributed in this distribution
     */
    function fulfillRequest(
        bytes32 _requestId,
        bytes32 _merkleRoot,
        bytes32 _ipfsHash,
        uint256 _amountDistributed,
        uint256 _sharesAmountDistributed
    ) public recordChainlinkFulfillment(_requestId) {
        if (manualVerificationRequired == 1) {
            updateData = UpdateData(_merkleRoot, _ipfsHash, _amountDistributed, _sharesAmountDistributed);
            awaitingManualVerification = 1;
        } else {
            priorityPool.updateDistribution(_merkleRoot, _ipfsHash, _amountDistributed, _sharesAmountDistributed);
        }
        updateStatus.requestInProgress = 0;
    }

    /**
     * @notice Executes a manual verification update request
     * */
    function executeManualVerification() external onlyOwner {
        if (awaitingManualVerification == 0) revert NoVerificationPending();
        awaitingManualVerification = 0;

        priorityPool.updateDistribution(
            updateData.merkleRoot,
            updateData.ipfsHash,
            updateData.amountDistributed,
            updateData.sharesAmountDistributed
        );
    }

    /**
     * @notice Rejects a manual verification update request and requests a new update
     * */
    function rejectManualVerificationAndRetry() external onlyOwner {
        if (awaitingManualVerification == 0) revert NoVerificationPending();
        awaitingManualVerification = 0;
        _requestUpdate();
    }

    /**
     * @notice Cancels a request if it has not been fulfilled
     * @param _requestId request ID
     * @param _expiration time of the expiration for the request
     */
    function cancelRequest(bytes32 _requestId, uint256 _expiration) external onlyOwner {
        cancelChainlinkRequest(_requestId, fee, this.fulfillRequest.selector, _expiration);
        updateStatus.requestInProgress = 0;
    }

    /**
     * @notice Withdraws LINK tokens
     * @param _amount amount to withdraw
     */
    function withdrawLink(uint256 _amount) external onlyOwner {
        LinkTokenInterface link = LinkTokenInterface(chainlinkTokenAddress());
        if (link.transfer(msg.sender, _amount) != true) revert InsufficientBalance();
    }

    /**
     * @notice Sets the params used to determine update frequency
     * @param _minTimeBetweenUpdates min amount of seconds between updates
     * @param _minDepositsSinceLastUpdate min amount of deposits from the priority pool to the
     *         staking pool needed to request update
     * @param _minBlockConfirmations min # of blocks to wait to request update after pausing priority pool
     * */
    function setUpdateParams(
        uint64 _minTimeBetweenUpdates,
        uint128 _minDepositsSinceLastUpdate,
        uint64 _minBlockConfirmations
    ) external onlyOwner {
        minTimeBetweenUpdates = _minTimeBetweenUpdates;
        minDepositsSinceLastUpdate = _minDepositsSinceLastUpdate;
        minBlockConfirmations = _minBlockConfirmations;
        emit SetUpdateParams(_minTimeBetweenUpdates, _minDepositsSinceLastUpdate, _minBlockConfirmations);
    }

    /**
     * @notice Toggles whether manual verification is required for updates
     * */
    function toggleManualVerification() external onlyOwner {
        manualVerificationRequired = manualVerificationRequired == 1 ? 0 : 1;
        emit ToggleManualVerification(manualVerificationRequired);
    }

    /**
     * @notice Sets the params related to Chainlink requests
     * @param _jobId id of job
     * @param _fee fee charged for each request paid in LINK
     * */
    function setChainlinkParams(bytes32 _jobId, uint256 _fee) external onlyOwner {
        jobId = _jobId;
        fee = _fee;
        emit SetChainlinkParams(_jobId, _fee);
    }

    /**
     * @notice Pauses the priority pool so a new merkle tree can be calculated
     * @dev must always be called before requestUpdate()
     */
    function _pauseForUpdate() private {
        if (block.timestamp < updateStatus.timeOfLastUpdate + minTimeBetweenUpdates) revert UpdateConditionsNotMet();
        if (awaitingManualVerification == 1) revert AwaitingManualVerification();
        priorityPool.pauseForUpdate();
        updateStatus = UpdateStatus(uint64(block.timestamp), uint64(block.number), 0);
    }

    /**
     * @notice Requests a new update which will calculate a new merkle tree, post the data to IPFS, and update
     * the priority pool
     * @dev pauseForUpdate() must be called before calling this function
     */
    function _requestUpdate() private {
        UpdateStatus memory status = updateStatus;

        if (!priorityPool.paused()) revert NotPaused();
        if (block.number < status.pausedAtBlockNumber + minBlockConfirmations) revert InsufficientBlockConfirmations();
        if (status.requestInProgress == 1) revert RequestInProgress();
        if (awaitingManualVerification == 1) revert AwaitingManualVerification();

        updateStatus.requestInProgress = 1;

        Chainlink.Request memory req = buildChainlinkRequest(jobId, address(this), this.fulfillRequest.selector);
        req.addUint("blockNumber", status.pausedAtBlockNumber);
        sendChainlinkRequest(req, fee);
    }
}

File 2 of 19 : IStakingPool.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.15;

import "./IStakingRewardsPool.sol";

interface IStakingPool is IStakingRewardsPool {
    function deposit(address _account, uint256 _amount) external;

    function withdraw(
        address _account,
        address _receiver,
        uint256 _amount
    ) external;

    function strategyDeposit(uint256 _index, uint256 _amount) external;

    function strategyWithdraw(uint256 _index, uint256 _amount) external;

    function updateStrategyRewards(uint256[] memory _strategyIdxs, bytes memory _data) external;

    function getMaxDeposits() external view returns (uint256);

    function addStrategy(address _strategy) external;

    function removeStrategy(uint256 _index) external;

    function reorderStrategies(uint256[] calldata _newOrder) external;

    function getStrategies() external view returns (address[] memory);

    function setPoolIndex(uint16 _poolIndex) external;

    function canDeposit() external view returns (uint256);

    function token() external view returns (address);

    function poolIndex() external view returns (uint16);

    function canWithdraw() external view returns (uint256);

    function getStrategyDepositRoom() external view returns (uint256);

    function getUnusedDeposits() external view returns (uint256);
}

File 3 of 19 : IPriorityPool.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.15;

interface IPriorityPool {
    function paused() external view returns (bool);

    function depositsSinceLastUpdate() external view returns (uint256);

    function pauseForUpdate() external;

    function updateDistribution(
        bytes32 _merkleRoot,
        bytes32 _ipfsHash,
        uint256 _amountDistributed,
        uint256 _sharesAmountDistributed
    ) external;
}

File 4 of 19 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 5 of 19 : ChainlinkClient.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./Chainlink.sol";
import "./interfaces/ENSInterface.sol";
import "./interfaces/LinkTokenInterface.sol";
import "./interfaces/ChainlinkRequestInterface.sol";
import "./interfaces/OperatorInterface.sol";
import "./interfaces/PointerInterface.sol";
import {ENSResolver as ENSResolver_Chainlink} from "./vendor/ENSResolver.sol";

/**
 * @title The ChainlinkClient contract
 * @notice Contract writers can inherit this contract in order to create requests for the
 * Chainlink network
 */
abstract contract ChainlinkClient {
  using Chainlink for Chainlink.Request;

  uint256 internal constant LINK_DIVISIBILITY = 10**18;
  uint256 private constant AMOUNT_OVERRIDE = 0;
  address private constant SENDER_OVERRIDE = address(0);
  uint256 private constant ORACLE_ARGS_VERSION = 1;
  uint256 private constant OPERATOR_ARGS_VERSION = 2;
  bytes32 private constant ENS_TOKEN_SUBNAME = keccak256("link");
  bytes32 private constant ENS_ORACLE_SUBNAME = keccak256("oracle");
  address private constant LINK_TOKEN_POINTER = 0xC89bD4E1632D3A43CB03AAAd5262cbe4038Bc571;

  ENSInterface private s_ens;
  bytes32 private s_ensNode;
  LinkTokenInterface private s_link;
  OperatorInterface private s_oracle;
  uint256 private s_requestCount = 1;
  mapping(bytes32 => address) private s_pendingRequests;

  event ChainlinkRequested(bytes32 indexed id);
  event ChainlinkFulfilled(bytes32 indexed id);
  event ChainlinkCancelled(bytes32 indexed id);

  /**
   * @notice Creates a request that can hold additional parameters
   * @param specId The Job Specification ID that the request will be created for
   * @param callbackAddr address to operate the callback on
   * @param callbackFunctionSignature function signature to use for the callback
   * @return A Chainlink Request struct in memory
   */
  function buildChainlinkRequest(
    bytes32 specId,
    address callbackAddr,
    bytes4 callbackFunctionSignature
  ) internal pure returns (Chainlink.Request memory) {
    Chainlink.Request memory req;
    return req.initialize(specId, callbackAddr, callbackFunctionSignature);
  }

  /**
   * @notice Creates a request that can hold additional parameters
   * @param specId The Job Specification ID that the request will be created for
   * @param callbackFunctionSignature function signature to use for the callback
   * @return A Chainlink Request struct in memory
   */
  function buildOperatorRequest(bytes32 specId, bytes4 callbackFunctionSignature)
    internal
    view
    returns (Chainlink.Request memory)
  {
    Chainlink.Request memory req;
    return req.initialize(specId, address(this), callbackFunctionSignature);
  }

  /**
   * @notice Creates a Chainlink request to the stored oracle address
   * @dev Calls `chainlinkRequestTo` with the stored oracle address
   * @param req The initialized Chainlink Request
   * @param payment The amount of LINK to send for the request
   * @return requestId The request ID
   */
  function sendChainlinkRequest(Chainlink.Request memory req, uint256 payment) internal returns (bytes32) {
    return sendChainlinkRequestTo(address(s_oracle), req, payment);
  }

  /**
   * @notice Creates a Chainlink request to the specified oracle address
   * @dev Generates and stores a request ID, increments the local nonce, and uses `transferAndCall` to
   * send LINK which creates a request on the target oracle contract.
   * Emits ChainlinkRequested event.
   * @param oracleAddress The address of the oracle for the request
   * @param req The initialized Chainlink Request
   * @param payment The amount of LINK to send for the request
   * @return requestId The request ID
   */
  function sendChainlinkRequestTo(
    address oracleAddress,
    Chainlink.Request memory req,
    uint256 payment
  ) internal returns (bytes32 requestId) {
    uint256 nonce = s_requestCount;
    s_requestCount = nonce + 1;
    bytes memory encodedRequest = abi.encodeWithSelector(
      ChainlinkRequestInterface.oracleRequest.selector,
      SENDER_OVERRIDE, // Sender value - overridden by onTokenTransfer by the requesting contract's address
      AMOUNT_OVERRIDE, // Amount value - overridden by onTokenTransfer by the actual amount of LINK sent
      req.id,
      address(this),
      req.callbackFunctionId,
      nonce,
      ORACLE_ARGS_VERSION,
      req.buf.buf
    );
    return _rawRequest(oracleAddress, nonce, payment, encodedRequest);
  }

  /**
   * @notice Creates a Chainlink request to the stored oracle address
   * @dev This function supports multi-word response
   * @dev Calls `sendOperatorRequestTo` with the stored oracle address
   * @param req The initialized Chainlink Request
   * @param payment The amount of LINK to send for the request
   * @return requestId The request ID
   */
  function sendOperatorRequest(Chainlink.Request memory req, uint256 payment) internal returns (bytes32) {
    return sendOperatorRequestTo(address(s_oracle), req, payment);
  }

  /**
   * @notice Creates a Chainlink request to the specified oracle address
   * @dev This function supports multi-word response
   * @dev Generates and stores a request ID, increments the local nonce, and uses `transferAndCall` to
   * send LINK which creates a request on the target oracle contract.
   * Emits ChainlinkRequested event.
   * @param oracleAddress The address of the oracle for the request
   * @param req The initialized Chainlink Request
   * @param payment The amount of LINK to send for the request
   * @return requestId The request ID
   */
  function sendOperatorRequestTo(
    address oracleAddress,
    Chainlink.Request memory req,
    uint256 payment
  ) internal returns (bytes32 requestId) {
    uint256 nonce = s_requestCount;
    s_requestCount = nonce + 1;
    bytes memory encodedRequest = abi.encodeWithSelector(
      OperatorInterface.operatorRequest.selector,
      SENDER_OVERRIDE, // Sender value - overridden by onTokenTransfer by the requesting contract's address
      AMOUNT_OVERRIDE, // Amount value - overridden by onTokenTransfer by the actual amount of LINK sent
      req.id,
      req.callbackFunctionId,
      nonce,
      OPERATOR_ARGS_VERSION,
      req.buf.buf
    );
    return _rawRequest(oracleAddress, nonce, payment, encodedRequest);
  }

  /**
   * @notice Make a request to an oracle
   * @param oracleAddress The address of the oracle for the request
   * @param nonce used to generate the request ID
   * @param payment The amount of LINK to send for the request
   * @param encodedRequest data encoded for request type specific format
   * @return requestId The request ID
   */
  function _rawRequest(
    address oracleAddress,
    uint256 nonce,
    uint256 payment,
    bytes memory encodedRequest
  ) private returns (bytes32 requestId) {
    requestId = keccak256(abi.encodePacked(this, nonce));
    s_pendingRequests[requestId] = oracleAddress;
    emit ChainlinkRequested(requestId);
    require(s_link.transferAndCall(oracleAddress, payment, encodedRequest), "unable to transferAndCall to oracle");
  }

  /**
   * @notice Allows a request to be cancelled if it has not been fulfilled
   * @dev Requires keeping track of the expiration value emitted from the oracle contract.
   * Deletes the request from the `pendingRequests` mapping.
   * Emits ChainlinkCancelled event.
   * @param requestId The request ID
   * @param payment The amount of LINK sent for the request
   * @param callbackFunc The callback function specified for the request
   * @param expiration The time of the expiration for the request
   */
  function cancelChainlinkRequest(
    bytes32 requestId,
    uint256 payment,
    bytes4 callbackFunc,
    uint256 expiration
  ) internal {
    OperatorInterface requested = OperatorInterface(s_pendingRequests[requestId]);
    delete s_pendingRequests[requestId];
    emit ChainlinkCancelled(requestId);
    requested.cancelOracleRequest(requestId, payment, callbackFunc, expiration);
  }

  /**
   * @notice the next request count to be used in generating a nonce
   * @dev starts at 1 in order to ensure consistent gas cost
   * @return returns the next request count to be used in a nonce
   */
  function getNextRequestCount() internal view returns (uint256) {
    return s_requestCount;
  }

  /**
   * @notice Sets the stored oracle address
   * @param oracleAddress The address of the oracle contract
   */
  function setChainlinkOracle(address oracleAddress) internal {
    s_oracle = OperatorInterface(oracleAddress);
  }

  /**
   * @notice Sets the LINK token address
   * @param linkAddress The address of the LINK token contract
   */
  function setChainlinkToken(address linkAddress) internal {
    s_link = LinkTokenInterface(linkAddress);
  }

  /**
   * @notice Sets the Chainlink token address for the public
   * network as given by the Pointer contract
   */
  function setPublicChainlinkToken() internal {
    setChainlinkToken(PointerInterface(LINK_TOKEN_POINTER).getAddress());
  }

  /**
   * @notice Retrieves the stored address of the LINK token
   * @return The address of the LINK token
   */
  function chainlinkTokenAddress() internal view returns (address) {
    return address(s_link);
  }

  /**
   * @notice Retrieves the stored address of the oracle contract
   * @return The address of the oracle contract
   */
  function chainlinkOracleAddress() internal view returns (address) {
    return address(s_oracle);
  }

  /**
   * @notice Allows for a request which was created on another contract to be fulfilled
   * on this contract
   * @param oracleAddress The address of the oracle contract that will fulfill the request
   * @param requestId The request ID used for the response
   */
  function addChainlinkExternalRequest(address oracleAddress, bytes32 requestId) internal notPendingRequest(requestId) {
    s_pendingRequests[requestId] = oracleAddress;
  }

  /**
   * @notice Sets the stored oracle and LINK token contracts with the addresses resolved by ENS
   * @dev Accounts for subnodes having different resolvers
   * @param ensAddress The address of the ENS contract
   * @param node The ENS node hash
   */
  function useChainlinkWithENS(address ensAddress, bytes32 node) internal {
    s_ens = ENSInterface(ensAddress);
    s_ensNode = node;
    bytes32 linkSubnode = keccak256(abi.encodePacked(s_ensNode, ENS_TOKEN_SUBNAME));
    ENSResolver_Chainlink resolver = ENSResolver_Chainlink(s_ens.resolver(linkSubnode));
    setChainlinkToken(resolver.addr(linkSubnode));
    updateChainlinkOracleWithENS();
  }

  /**
   * @notice Sets the stored oracle contract with the address resolved by ENS
   * @dev This may be called on its own as long as `useChainlinkWithENS` has been called previously
   */
  function updateChainlinkOracleWithENS() internal {
    bytes32 oracleSubnode = keccak256(abi.encodePacked(s_ensNode, ENS_ORACLE_SUBNAME));
    ENSResolver_Chainlink resolver = ENSResolver_Chainlink(s_ens.resolver(oracleSubnode));
    setChainlinkOracle(resolver.addr(oracleSubnode));
  }

  /**
   * @notice Ensures that the fulfillment is valid for this contract
   * @dev Use if the contract developer prefers methods instead of modifiers for validation
   * @param requestId The request ID for fulfillment
   */
  function validateChainlinkCallback(bytes32 requestId)
    internal
    recordChainlinkFulfillment(requestId)
  // solhint-disable-next-line no-empty-blocks
  {

  }

  /**
   * @dev Reverts if the sender is not the oracle of the request.
   * Emits ChainlinkFulfilled event.
   * @param requestId The request ID for fulfillment
   */
  modifier recordChainlinkFulfillment(bytes32 requestId) {
    require(msg.sender == s_pendingRequests[requestId], "Source must be the oracle of the request");
    delete s_pendingRequests[requestId];
    emit ChainlinkFulfilled(requestId);
    _;
  }

  /**
   * @dev Reverts if the request is already pending
   * @param requestId The request ID for fulfillment
   */
  modifier notPendingRequest(bytes32 requestId) {
    require(s_pendingRequests[requestId] == address(0), "Request is already pending");
    _;
  }
}

File 6 of 19 : IStakingRewardsPool.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.15;

import "./IERC677.sol";

interface IStakingRewardsPool is IERC677 {
    /**
     * @notice returns an account's share balance
     * @param _account account to return balance for
     * @return account's share balance
     **/
    function sharesOf(address _account) external view returns (uint256);

    /**
     * @notice returns the amount of shares that corresponds to a staked amount
     * @param _amount staked amount
     * @return amount of shares
     **/
    function getSharesByStake(uint256 _amount) external view returns (uint256);

    /**
     * @notice returns the amount of stake that corresponds to an amount of shares
     * @param _amount shares amount
     * @return amount of stake
     **/
    function getStakeByShares(uint256 _amount) external view returns (uint256);

    function totalShares() external view returns (uint256);
}

File 7 of 19 : IERC677.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.15;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IERC677 is IERC20 {
    function transferAndCall(
        address _to,
        uint256 _value,
        bytes calldata _data
    ) external returns (bool success);
}

File 8 of 19 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 9 of 19 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 10 of 19 : Chainlink.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {CBORChainlink} from "./vendor/CBORChainlink.sol";
import {BufferChainlink} from "./vendor/BufferChainlink.sol";

/**
 * @title Library for common Chainlink functions
 * @dev Uses imported CBOR library for encoding to buffer
 */
library Chainlink {
  uint256 internal constant defaultBufferSize = 256; // solhint-disable-line const-name-snakecase

  using CBORChainlink for BufferChainlink.buffer;

  struct Request {
    bytes32 id;
    address callbackAddress;
    bytes4 callbackFunctionId;
    uint256 nonce;
    BufferChainlink.buffer buf;
  }

  /**
   * @notice Initializes a Chainlink request
   * @dev Sets the ID, callback address, and callback function signature on the request
   * @param self The uninitialized request
   * @param jobId The Job Specification ID
   * @param callbackAddr The callback address
   * @param callbackFunc The callback function signature
   * @return The initialized request
   */
  function initialize(
    Request memory self,
    bytes32 jobId,
    address callbackAddr,
    bytes4 callbackFunc
  ) internal pure returns (Chainlink.Request memory) {
    BufferChainlink.init(self.buf, defaultBufferSize);
    self.id = jobId;
    self.callbackAddress = callbackAddr;
    self.callbackFunctionId = callbackFunc;
    return self;
  }

  /**
   * @notice Sets the data for the buffer without encoding CBOR on-chain
   * @dev CBOR can be closed with curly-brackets {} or they can be left off
   * @param self The initialized request
   * @param data The CBOR data
   */
  function setBuffer(Request memory self, bytes memory data) internal pure {
    BufferChainlink.init(self.buf, data.length);
    BufferChainlink.append(self.buf, data);
  }

  /**
   * @notice Adds a string value to the request with a given key name
   * @param self The initialized request
   * @param key The name of the key
   * @param value The string value to add
   */
  function add(
    Request memory self,
    string memory key,
    string memory value
  ) internal pure {
    self.buf.encodeString(key);
    self.buf.encodeString(value);
  }

  /**
   * @notice Adds a bytes value to the request with a given key name
   * @param self The initialized request
   * @param key The name of the key
   * @param value The bytes value to add
   */
  function addBytes(
    Request memory self,
    string memory key,
    bytes memory value
  ) internal pure {
    self.buf.encodeString(key);
    self.buf.encodeBytes(value);
  }

  /**
   * @notice Adds a int256 value to the request with a given key name
   * @param self The initialized request
   * @param key The name of the key
   * @param value The int256 value to add
   */
  function addInt(
    Request memory self,
    string memory key,
    int256 value
  ) internal pure {
    self.buf.encodeString(key);
    self.buf.encodeInt(value);
  }

  /**
   * @notice Adds a uint256 value to the request with a given key name
   * @param self The initialized request
   * @param key The name of the key
   * @param value The uint256 value to add
   */
  function addUint(
    Request memory self,
    string memory key,
    uint256 value
  ) internal pure {
    self.buf.encodeString(key);
    self.buf.encodeUInt(value);
  }

  /**
   * @notice Adds an array of strings to the request with a given key name
   * @param self The initialized request
   * @param key The name of the key
   * @param values The array of string values to add
   */
  function addStringArray(
    Request memory self,
    string memory key,
    string[] memory values
  ) internal pure {
    self.buf.encodeString(key);
    self.buf.startArray();
    for (uint256 i = 0; i < values.length; i++) {
      self.buf.encodeString(values[i]);
    }
    self.buf.endSequence();
  }
}

File 11 of 19 : LinkTokenInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface LinkTokenInterface {
  function allowance(address owner, address spender) external view returns (uint256 remaining);

  function approve(address spender, uint256 value) external returns (bool success);

  function balanceOf(address owner) external view returns (uint256 balance);

  function decimals() external view returns (uint8 decimalPlaces);

  function decreaseApproval(address spender, uint256 addedValue) external returns (bool success);

  function increaseApproval(address spender, uint256 subtractedValue) external;

  function name() external view returns (string memory tokenName);

  function symbol() external view returns (string memory tokenSymbol);

  function totalSupply() external view returns (uint256 totalTokensIssued);

  function transfer(address to, uint256 value) external returns (bool success);

  function transferAndCall(
    address to,
    uint256 value,
    bytes calldata data
  ) external returns (bool success);

  function transferFrom(
    address from,
    address to,
    uint256 value
  ) external returns (bool success);
}

File 12 of 19 : ENSInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface ENSInterface {
  // Logged when the owner of a node assigns a new owner to a subnode.
  event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);

  // Logged when the owner of a node transfers ownership to a new account.
  event Transfer(bytes32 indexed node, address owner);

  // Logged when the resolver for a node changes.
  event NewResolver(bytes32 indexed node, address resolver);

  // Logged when the TTL of a node changes
  event NewTTL(bytes32 indexed node, uint64 ttl);

  function setSubnodeOwner(
    bytes32 node,
    bytes32 label,
    address owner
  ) external;

  function setResolver(bytes32 node, address resolver) external;

  function setOwner(bytes32 node, address owner) external;

  function setTTL(bytes32 node, uint64 ttl) external;

  function owner(bytes32 node) external view returns (address);

  function resolver(bytes32 node) external view returns (address);

  function ttl(bytes32 node) external view returns (uint64);
}

File 13 of 19 : ChainlinkRequestInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface ChainlinkRequestInterface {
  function oracleRequest(
    address sender,
    uint256 requestPrice,
    bytes32 serviceAgreementID,
    address callbackAddress,
    bytes4 callbackFunctionId,
    uint256 nonce,
    uint256 dataVersion,
    bytes calldata data
  ) external;

  function cancelOracleRequest(
    bytes32 requestId,
    uint256 payment,
    bytes4 callbackFunctionId,
    uint256 expiration
  ) external;
}

File 14 of 19 : OperatorInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./OracleInterface.sol";
import "./ChainlinkRequestInterface.sol";

interface OperatorInterface is OracleInterface, ChainlinkRequestInterface {
  function operatorRequest(
    address sender,
    uint256 payment,
    bytes32 specId,
    bytes4 callbackFunctionId,
    uint256 nonce,
    uint256 dataVersion,
    bytes calldata data
  ) external;

  function fulfillOracleRequest2(
    bytes32 requestId,
    uint256 payment,
    address callbackAddress,
    bytes4 callbackFunctionId,
    uint256 expiration,
    bytes calldata data
  ) external returns (bool);

  function ownerTransferAndCall(
    address to,
    uint256 value,
    bytes calldata data
  ) external returns (bool success);

  function distributeFunds(address payable[] calldata receivers, uint256[] calldata amounts) external payable;

  function getAuthorizedSenders() external returns (address[] memory);

  function setAuthorizedSenders(address[] calldata senders) external;

  function getForwarder() external returns (address);
}

File 15 of 19 : PointerInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface PointerInterface {
  function getAddress() external view returns (address);
}

File 16 of 19 : ENSResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

abstract contract ENSResolver {
  function addr(bytes32 node) public view virtual returns (address);
}

File 17 of 19 : CBORChainlink.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.19;

import {BufferChainlink} from "./BufferChainlink.sol";

library CBORChainlink {
  using BufferChainlink for BufferChainlink.buffer;

  uint8 private constant MAJOR_TYPE_INT = 0;
  uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;
  uint8 private constant MAJOR_TYPE_BYTES = 2;
  uint8 private constant MAJOR_TYPE_STRING = 3;
  uint8 private constant MAJOR_TYPE_ARRAY = 4;
  uint8 private constant MAJOR_TYPE_MAP = 5;
  uint8 private constant MAJOR_TYPE_TAG = 6;
  uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;

  uint8 private constant TAG_TYPE_BIGNUM = 2;
  uint8 private constant TAG_TYPE_NEGATIVE_BIGNUM = 3;

  function encodeFixedNumeric(BufferChainlink.buffer memory buf, uint8 major, uint64 value) private pure {
    if(value <= 23) {
      buf.appendUint8(uint8((major << 5) | value));
    } else if (value <= 0xFF) {
      buf.appendUint8(uint8((major << 5) | 24));
      buf.appendInt(value, 1);
    } else if (value <= 0xFFFF) {
      buf.appendUint8(uint8((major << 5) | 25));
      buf.appendInt(value, 2);
    } else if (value <= 0xFFFFFFFF) {
      buf.appendUint8(uint8((major << 5) | 26));
      buf.appendInt(value, 4);
    } else {
      buf.appendUint8(uint8((major << 5) | 27));
      buf.appendInt(value, 8);
    }
  }

  function encodeIndefiniteLengthType(BufferChainlink.buffer memory buf, uint8 major) private pure {
    buf.appendUint8(uint8((major << 5) | 31));
  }

  function encodeUInt(BufferChainlink.buffer memory buf, uint value) internal pure {
    if(value > 0xFFFFFFFFFFFFFFFF) {
      encodeBigNum(buf, value);
    } else {
      encodeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(value));
    }
  }

  function encodeInt(BufferChainlink.buffer memory buf, int value) internal pure {
    if(value < -0x10000000000000000) {
      encodeSignedBigNum(buf, value);
    } else if(value > 0xFFFFFFFFFFFFFFFF) {
      encodeBigNum(buf, uint(value));
    } else if(value >= 0) {
      encodeFixedNumeric(buf, MAJOR_TYPE_INT, uint64(uint256(value)));
    } else {
      encodeFixedNumeric(buf, MAJOR_TYPE_NEGATIVE_INT, uint64(uint256(-1 - value)));
    }
  }

  function encodeBytes(BufferChainlink.buffer memory buf, bytes memory value) internal pure {
    encodeFixedNumeric(buf, MAJOR_TYPE_BYTES, uint64(value.length));
    buf.append(value);
  }

  function encodeBigNum(BufferChainlink.buffer memory buf, uint value) internal pure {
    buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_BIGNUM));
    encodeBytes(buf, abi.encode(value));
  }

  function encodeSignedBigNum(BufferChainlink.buffer memory buf, int input) internal pure {
    buf.appendUint8(uint8((MAJOR_TYPE_TAG << 5) | TAG_TYPE_NEGATIVE_BIGNUM));
    encodeBytes(buf, abi.encode(uint256(-1 - input)));
  }

  function encodeString(BufferChainlink.buffer memory buf, string memory value) internal pure {
    encodeFixedNumeric(buf, MAJOR_TYPE_STRING, uint64(bytes(value).length));
    buf.append(bytes(value));
  }

  function startArray(BufferChainlink.buffer memory buf) internal pure {
    encodeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);
  }

  function startMap(BufferChainlink.buffer memory buf) internal pure {
    encodeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);
  }

  function endSequence(BufferChainlink.buffer memory buf) internal pure {
    encodeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);
  }
}

File 18 of 19 : BufferChainlink.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/**
 * @dev A library for working with mutable byte buffers in Solidity.
 *
 * Byte buffers are mutable and expandable, and provide a variety of primitives
 * for writing to them. At any time you can fetch a bytes object containing the
 * current contents of the buffer. The bytes object should not be stored between
 * operations, as it may change due to resizing of the buffer.
 */
library BufferChainlink {
  /**
   * @dev Represents a mutable buffer. Buffers have a current value (buf) and
   *      a capacity. The capacity may be longer than the current value, in
   *      which case it can be extended without the need to allocate more memory.
   */
  struct buffer {
    bytes buf;
    uint256 capacity;
  }

  /**
   * @dev Initializes a buffer with an initial capacity.
   * @param buf The buffer to initialize.
   * @param capacity The number of bytes of space to allocate the buffer.
   * @return The buffer, for chaining.
   */
  function init(buffer memory buf, uint256 capacity) internal pure returns (buffer memory) {
    if (capacity % 32 != 0) {
      capacity += 32 - (capacity % 32);
    }
    // Allocate space for the buffer data
    buf.capacity = capacity;
    assembly {
      let ptr := mload(0x40)
      mstore(buf, ptr)
      mstore(ptr, 0)
      mstore(0x40, add(32, add(ptr, capacity)))
    }
    return buf;
  }

  /**
   * @dev Initializes a new buffer from an existing bytes object.
   *      Changes to the buffer may mutate the original value.
   * @param b The bytes object to initialize the buffer with.
   * @return A new buffer.
   */
  function fromBytes(bytes memory b) internal pure returns (buffer memory) {
    buffer memory buf;
    buf.buf = b;
    buf.capacity = b.length;
    return buf;
  }

  function resize(buffer memory buf, uint256 capacity) private pure {
    bytes memory oldbuf = buf.buf;
    init(buf, capacity);
    append(buf, oldbuf);
  }

  function max(uint256 a, uint256 b) private pure returns (uint256) {
    if (a > b) {
      return a;
    }
    return b;
  }

  /**
   * @dev Sets buffer length to 0.
   * @param buf The buffer to truncate.
   * @return The original buffer, for chaining..
   */
  function truncate(buffer memory buf) internal pure returns (buffer memory) {
    assembly {
      let bufptr := mload(buf)
      mstore(bufptr, 0)
    }
    return buf;
  }

  /**
   * @dev Writes a byte string to a buffer. Resizes if doing so would exceed
   *      the capacity of the buffer.
   * @param buf The buffer to append to.
   * @param off The start offset to write to.
   * @param data The data to append.
   * @param len The number of bytes to copy.
   * @return The original buffer, for chaining.
   */
  function write(
    buffer memory buf,
    uint256 off,
    bytes memory data,
    uint256 len
  ) internal pure returns (buffer memory) {
    require(len <= data.length);

    if (off + len > buf.capacity) {
      resize(buf, max(buf.capacity, len + off) * 2);
    }

    uint256 dest;
    uint256 src;
    assembly {
      // Memory address of the buffer data
      let bufptr := mload(buf)
      // Length of existing buffer data
      let buflen := mload(bufptr)
      // Start address = buffer address + offset + sizeof(buffer length)
      dest := add(add(bufptr, 32), off)
      // Update buffer length if we're extending it
      if gt(add(len, off), buflen) {
        mstore(bufptr, add(len, off))
      }
      src := add(data, 32)
    }

    // Copy word-length chunks while possible
    for (; len >= 32; len -= 32) {
      assembly {
        mstore(dest, mload(src))
      }
      dest += 32;
      src += 32;
    }

    // Copy remaining bytes
    unchecked {
      uint256 mask = (256**(32 - len)) - 1;
      assembly {
        let srcpart := and(mload(src), not(mask))
        let destpart := and(mload(dest), mask)
        mstore(dest, or(destpart, srcpart))
      }
    }

    return buf;
  }

  /**
   * @dev Appends a byte string to a buffer. Resizes if doing so would exceed
   *      the capacity of the buffer.
   * @param buf The buffer to append to.
   * @param data The data to append.
   * @param len The number of bytes to copy.
   * @return The original buffer, for chaining.
   */
  function append(
    buffer memory buf,
    bytes memory data,
    uint256 len
  ) internal pure returns (buffer memory) {
    return write(buf, buf.buf.length, data, len);
  }

  /**
   * @dev Appends a byte string to a buffer. Resizes if doing so would exceed
   *      the capacity of the buffer.
   * @param buf The buffer to append to.
   * @param data The data to append.
   * @return The original buffer, for chaining.
   */
  function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {
    return write(buf, buf.buf.length, data, data.length);
  }

  /**
   * @dev Writes a byte to the buffer. Resizes if doing so would exceed the
   *      capacity of the buffer.
   * @param buf The buffer to append to.
   * @param off The offset to write the byte at.
   * @param data The data to append.
   * @return The original buffer, for chaining.
   */
  function writeUint8(
    buffer memory buf,
    uint256 off,
    uint8 data
  ) internal pure returns (buffer memory) {
    if (off >= buf.capacity) {
      resize(buf, buf.capacity * 2);
    }

    assembly {
      // Memory address of the buffer data
      let bufptr := mload(buf)
      // Length of existing buffer data
      let buflen := mload(bufptr)
      // Address = buffer address + sizeof(buffer length) + off
      let dest := add(add(bufptr, off), 32)
      mstore8(dest, data)
      // Update buffer length if we extended it
      if eq(off, buflen) {
        mstore(bufptr, add(buflen, 1))
      }
    }
    return buf;
  }

  /**
   * @dev Appends a byte to the buffer. Resizes if doing so would exceed the
   *      capacity of the buffer.
   * @param buf The buffer to append to.
   * @param data The data to append.
   * @return The original buffer, for chaining.
   */
  function appendUint8(buffer memory buf, uint8 data) internal pure returns (buffer memory) {
    return writeUint8(buf, buf.buf.length, data);
  }

  /**
   * @dev Writes up to 32 bytes to the buffer. Resizes if doing so would
   *      exceed the capacity of the buffer.
   * @param buf The buffer to append to.
   * @param off The offset to write at.
   * @param data The data to append.
   * @param len The number of bytes to write (left-aligned).
   * @return The original buffer, for chaining.
   */
  function write(
    buffer memory buf,
    uint256 off,
    bytes32 data,
    uint256 len
  ) private pure returns (buffer memory) {
    if (len + off > buf.capacity) {
      resize(buf, (len + off) * 2);
    }

    unchecked {
      uint256 mask = (256**len) - 1;
      // Right-align data
      data = data >> (8 * (32 - len));
      assembly {
        // Memory address of the buffer data
        let bufptr := mload(buf)
        // Address = buffer address + sizeof(buffer length) + off + len
        let dest := add(add(bufptr, off), len)
        mstore(dest, or(and(mload(dest), not(mask)), data))
        // Update buffer length if we extended it
        if gt(add(off, len), mload(bufptr)) {
          mstore(bufptr, add(off, len))
        }
      }
    }
    return buf;
  }

  /**
   * @dev Writes a bytes20 to the buffer. Resizes if doing so would exceed the
   *      capacity of the buffer.
   * @param buf The buffer to append to.
   * @param off The offset to write at.
   * @param data The data to append.
   * @return The original buffer, for chaining.
   */
  function writeBytes20(
    buffer memory buf,
    uint256 off,
    bytes20 data
  ) internal pure returns (buffer memory) {
    return write(buf, off, bytes32(data), 20);
  }

  /**
   * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed
   *      the capacity of the buffer.
   * @param buf The buffer to append to.
   * @param data The data to append.
   * @return The original buffer, for chhaining.
   */
  function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {
    return write(buf, buf.buf.length, bytes32(data), 20);
  }

  /**
   * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed
   *      the capacity of the buffer.
   * @param buf The buffer to append to.
   * @param data The data to append.
   * @return The original buffer, for chaining.
   */
  function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {
    return write(buf, buf.buf.length, data, 32);
  }

  /**
   * @dev Writes an integer to the buffer. Resizes if doing so would exceed
   *      the capacity of the buffer.
   * @param buf The buffer to append to.
   * @param off The offset to write at.
   * @param data The data to append.
   * @param len The number of bytes to write (right-aligned).
   * @return The original buffer, for chaining.
   */
  function writeInt(
    buffer memory buf,
    uint256 off,
    uint256 data,
    uint256 len
  ) private pure returns (buffer memory) {
    if (len + off > buf.capacity) {
      resize(buf, (len + off) * 2);
    }

    uint256 mask = (256**len) - 1;
    assembly {
      // Memory address of the buffer data
      let bufptr := mload(buf)
      // Address = buffer address + off + sizeof(buffer length) + len
      let dest := add(add(bufptr, off), len)
      mstore(dest, or(and(mload(dest), not(mask)), data))
      // Update buffer length if we extended it
      if gt(add(off, len), mload(bufptr)) {
        mstore(bufptr, add(off, len))
      }
    }
    return buf;
  }

  /**
   * @dev Appends a byte to the end of the buffer. Resizes if doing so would
   * exceed the capacity of the buffer.
   * @param buf The buffer to append to.
   * @param data The data to append.
   * @return The original buffer.
   */
  function appendInt(
    buffer memory buf,
    uint256 data,
    uint256 len
  ) internal pure returns (buffer memory) {
    return writeInt(buf, buf.buf.length, data, len);
  }
}

File 19 of 19 : OracleInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface OracleInterface {
  function fulfillOracleRequest(
    bytes32 requestId,
    uint256 payment,
    address callbackAddress,
    bytes4 callbackFunctionId,
    uint256 expiration,
    bytes32 data
  ) external returns (bool);

  function isAuthorizedSender(address node) external view returns (bool);

  function withdraw(address recipient, uint256 amount) external;

  function withdrawable() external view returns (uint256);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_chainlinkToken","type":"address"},{"internalType":"address","name":"_chainlinkOracle","type":"address"},{"internalType":"bytes32","name":"_jobId","type":"bytes32"},{"internalType":"uint256","name":"_fee","type":"uint256"},{"internalType":"uint64","name":"_minTimeBetweenUpdates","type":"uint64"},{"internalType":"uint128","name":"_minDepositsSinceLastUpdate","type":"uint128"},{"internalType":"uint64","name":"_minBlockConfirmations","type":"uint64"},{"internalType":"address","name":"_priorityPool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AwaitingManualVerification","type":"error"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"InsufficientBlockConfirmations","type":"error"},{"inputs":[],"name":"InvalidUpkeepType","type":"error"},{"inputs":[],"name":"NoVerificationPending","type":"error"},{"inputs":[],"name":"NotPaused","type":"error"},{"inputs":[],"name":"RequestInProgress","type":"error"},{"inputs":[],"name":"UpdateConditionsNotMet","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"ChainlinkCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"ChainlinkFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"ChainlinkRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"jobId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"SetChainlinkParams","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"minTimeBetweenUpdates","type":"uint64"},{"indexed":false,"internalType":"uint128","name":"minDepositsSinceLastUpdate","type":"uint128"},{"indexed":false,"internalType":"uint64","name":"minBlockConfirmations","type":"uint64"}],"name":"SetUpdateParams","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint128","name":"manualVerificationRequired","type":"uint128"}],"name":"ToggleManualVerification","type":"event"},{"inputs":[],"name":"awaitingManualVerification","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"internalType":"uint256","name":"_expiration","type":"uint256"}],"name":"cancelRequest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"checkUpkeep","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"executeManualVerification","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"},{"internalType":"bytes32","name":"_ipfsHash","type":"bytes32"},{"internalType":"uint256","name":"_amountDistributed","type":"uint256"},{"internalType":"uint256","name":"_sharesAmountDistributed","type":"uint256"}],"name":"fulfillRequest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"jobId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manualVerificationRequired","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minBlockConfirmations","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minDepositsSinceLastUpdate","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minTimeBetweenUpdates","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pauseForUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_performData","type":"bytes"}],"name":"performUpkeep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"priorityPool","outputs":[{"internalType":"contract IPriorityPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rejectManualVerificationAndRetry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requestUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_jobId","type":"bytes32"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setChainlinkParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_minTimeBetweenUpdates","type":"uint64"},{"internalType":"uint128","name":"_minDepositsSinceLastUpdate","type":"uint128"},{"internalType":"uint64","name":"_minBlockConfirmations","type":"uint64"}],"name":"setUpdateParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toggleManualVerification","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updateData","outputs":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"bytes32","name":"ipfsHash","type":"bytes32"},{"internalType":"uint256","name":"amountDistributed","type":"uint256"},{"internalType":"uint256","name":"sharesAmountDistributed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"updateStatus","outputs":[{"internalType":"uint64","name":"timeOfLastUpdate","type":"uint64"},{"internalType":"uint64","name":"pausedAtBlockNumber","type":"uint64"},{"internalType":"uint128","name":"requestInProgress","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawLink","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a060405260016004553480156200001657600080fd5b506040516200219a3803806200219a83398101604081905262000039916200018f565b620000443362000108565b600280546001600160a01b0319166001600160a01b038a16179055600380546001600160a01b0319166001600160a01b038916179055600795909555600893909355600980546001600160401b039485166801000000000000000002600160401b600160801b03196001600160801b03909416600160801b026fffffffffffffffff0000000000000000909216959094169490941793909317161790556001600160a01b03166080525050600b80546001600160801b031916600117905562000233565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b03811681146200017257600080fd5b919050565b80516001600160401b03811681146200017257600080fd5b600080600080600080600080610100898b031215620001ad57600080fd5b620001b8896200015a565b9750620001c860208a016200015a565b96506040890151955060608901519450620001e660808a0162000177565b60a08a01519094506001600160801b03811681146200020457600080fd5b92506200021460c08a0162000177565b91506200022460e08a016200015a565b90509295985092959890939650565b608051611f136200028760003960008181610356015281816104b8015281816106eb0152818161076f015281816108640152818161092001528181610ae801528181610eff015261101b0152611f136000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c80638da5cb5b116100de578063c2939d9711610097578063ddca3f4311610071578063ddca3f43146103c4578063ec8eadbe146103cd578063f2fde38b146103d5578063f5ca2b6c146103e857600080fd5b8063c2939d9714610392578063c51df75d146103a9578063cfbf915b146103bc57600080fd5b80638da5cb5b146102d45780638e00a2bb146102f95780639c312cfd1461032f578063ae1bcfc114610337578063b5169e5314610351578063b919e7081461037857600080fd5b80635f60f485116101305780635f60f4851461021d5780636e04ff0d1461027d578063707072e21461029e578063715018a6146102a65780637a8042bd146102ae5780637b4c1648146102c157600080fd5b80630b9259271461017857806319a6e9e6146101825780633109f576146101b25780633b89581f146101e45780634585e33b146101f7578063499a2dea1461020a575b600080fd5b6101806103fb565b005b600954610195906001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b6009546101cc90600160801b90046001600160801b031681565b6040516001600160801b0390911681526020016101a9565b600b546101cc906001600160801b031681565b610180610205366004611a27565b61046e565b610180610218366004611a98565b61059e565b600a5461024e906001600160401b0380821691600160401b810490911690600160801b90046001600160801b031683565b604080516001600160401b0394851681529390921660208401526001600160801b0316908201526060016101a9565b61029061028b366004611a27565b610767565b6040516101a9929190611b20565b610180610a69565b610180610b4e565b6101806102bc366004611b3b565b610b62565b6101806102cf366004611b54565b610c18565b6006546001600160a01b03165b6040516001600160a01b0390911681526020016101a9565b600c54600d54600e54600f5461030f9392919084565b6040805194855260208501939093529183015260608201526080016101a9565b610180610c67565b600b546101cc90600160801b90046001600160801b031681565b6102e17f000000000000000000000000000000000000000000000000000000000000000081565b60095461019590600160401b90046001600160401b031681565b61039b60075481565b6040519081526020016101a9565b6101806103b7366004611b92565b610c77565b610180610d20565b61039b60085481565b610180610d30565b6101806103e3366004611be3565b610d82565b6101806103f6366004611b54565b610dfb565b610403610e2b565b600b546001600160801b031660011461041d576001610420565b60005b600b80546001600160801b03191660ff9290921691821790556040519081527f57599e5c77554b728e2e26fb1ab59dd5a6c62ebcb96a87585f8bad46f64ceb009060200160405180910390a1565b600061047c82840184611c13565b9050600081600181111561049257610492611c34565b0361056457600960109054906101000a90046001600160801b03166001600160801b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638945621b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610514573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105389190611c4a565b101561055757604051637e8b026360e01b815260040160405180910390fd5b61055f610e85565b505050565b600181600181111561057857610578611c34565b036105855761055f610fc9565b604051630b77359760e41b815260040160405180910390fd5b60008581526005602052604090205485906001600160a01b0316331461061c5760405162461bcd60e51b815260206004820152602860248201527f536f75726365206d75737420626520746865206f7261636c65206f6620746865604482015267081c995c5d595cdd60c21b60648201526084015b60405180910390fd5b60008181526005602052604080822080546001600160a01b03191690555182917f7cc135e0cebb02c3480ae5d74d377283180a2601f8f644edf7987b009316c63a91a2600b546001600160801b03166001036106c0576040805160808101825286815260208101869052908101849052606001829052600c859055600d849055600e839055600f829055600b80546001600160801b0316600160801b179055610750565b60405163661d208160e01b8152600481018690526024810185905260448101849052606481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063661d208190608401600060405180830381600087803b15801561073757600080fd5b505af115801561074b573d6000803e3d6000fd5b505050505b5050600a80546001600160801b0316905550505050565b6000606060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ef9190611c63565b15801561080c5750600b54600160801b90046001600160801b0316155b801561083c5750600954600a5461082f916001600160401b039081169116611c9b565b6001600160401b03164210155b80156108e75750600960109054906101000a90046001600160801b03166001600160801b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638945621b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e49190611c4a565b10155b9050801561091c57600160006040516020016109039190611cc6565b6040516020818303038152906040529250925050610a62565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561097c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a09190611c63565b80156109bc5750600b54600160801b90046001600160801b0316155b80156109d85750600a54600160801b90046001600160801b0316155b8015610a145750600954600a54610a07916001600160401b03600160401b918290048116929190910416611c9b565b6001600160401b03164310155b90508015610a4957600180604051602001610a2f9190611cc6565b604051602081830303815290604052935093505050610a62565b6000604051806020016040528060008152509350935050505b9250929050565b610a71610e2b565b600b54600160801b90046001600160801b0316600003610aa457604051633d75612960e01b815260040160405180910390fd5b600b80546001600160801b03169055600c54600d54600e54600f5460405163661d208160e01b815260048101949094526024840192909252604483015260648201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063661d208190608401600060405180830381600087803b158015610b3457600080fd5b505af1158015610b48573d6000803e3d6000fd5b50505050565b610b56610e2b565b610b6060006111d9565b565b610b6a610e2b565b6000610b7e6002546001600160a01b031690565b60405163a9059cbb60e01b8152336004820152602481018490529091506001600160a01b0382169063a9059cbb906044016020604051808303816000875af1158015610bce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf29190611c63565b1515600114610c1457604051631e9acf1760e31b815260040160405180910390fd5b5050565b610c20610e2b565b6007829055600881905560408051838152602081018390527f4901a18e5855c65d9ec4cccdb426e660eb091a27964eb80e36c5e6fd35dd98a3910160405180910390a15050565b610c6f610e2b565b610b60610fc9565b610c7f610e2b565b600980546001600160401b038581166fffffffffffffffff00000000000000009092168217600160801b6001600160801b038716908102919091176fffffffffffffffff00000000000000001916600160401b928616928302179093556040805192835260208301939093528183015290517fe53e10d563efbcf1ade8dcd90d15edb3425b24ed7e76c9c909feaa80a1ff88d89181900360600190a1505050565b610d28610e2b565b610b60610e85565b610d38610e2b565b600b54600160801b90046001600160801b0316600003610d6b57604051633d75612960e01b815260040160405180910390fd5b600b80546001600160801b03169055610b60610fc9565b610d8a610e2b565b6001600160a01b038116610def5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610613565b610df8816111d9565b50565b610e03610e2b565b610e188260085463499a2dea60e01b8461122b565b5050600a80546001600160801b03169055565b6006546001600160a01b03163314610b605760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610613565b600954600a54610ea1916001600160401b039081169116611c9b565b6001600160401b0316421015610eca57604051637e8b026360e01b815260040160405180910390fd5b600b54600160801b90046001600160801b0316600103610efd57604051635bca6cb960e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663cfbf915b6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610f5857600080fd5b505af1158015610f6c573d6000803e3d6000fd5b5050604080516060810182526001600160401b03428116808352439091166020830181905260009290930191909152600a8054600160401b9093026001600160801b0319909316909117919091176001600160801b031690555050565b60408051606081018252600a546001600160401b038082168352600160401b820416602080840191909152600160801b9091046001600160801b0316828401528251635c975abb60e01b8152925191927f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031692635c975abb926004808401939192918290030181865afa15801561106c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110909190611c63565b6110ad57604051636cd6020160e01b815260040160405180910390fd5b60095460208201516110cf91600160401b90046001600160401b031690611c9b565b6001600160401b03164310156110f857604051630ba86cd360e31b815260040160405180910390fd5b80604001516001600160801b0316600103611126576040516303ead14560e11b815260040160405180910390fd5b600b54600160801b90046001600160801b031660010361115957604051635bca6cb960e01b815260040160405180910390fd5b600a80546001600160801b0316600160801b17905560075460009061118690306324cd16f560e11b6112fd565b90506111cd6040518060400160405280600b81526020016a313637b1b5a73ab6b132b960a91b81525083602001516001600160401b0316836113229092919063ffffffff16565b61055f81600854611340565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008481526005602052604080822080546001600160a01b0319811690915590516001600160a01b039091169186917fe1fe3afa0f7f761ff0a8b89086790efd5140d2907ebd5b7ff6bfcb5e075fd4c59190a2604051636ee4d55360e01b815260048101869052602481018590526001600160e01b031984166044820152606481018390526001600160a01b03821690636ee4d55390608401600060405180830381600087803b1580156112de57600080fd5b505af11580156112f2573d6000803e3d6000fd5b505050505050505050565b6113056119ec565b61130d6119ec565b61131981868686611363565b95945050505050565b608083015161133190836113a9565b608083015161055f90826113c0565b60035460009061135a906001600160a01b031684846113e5565b90505b92915050565b61136b6119ec565b61137b8560800151610100611478565b50508284526001600160a01b03821660208501526001600160e01b031981166040850152835b949350505050565b6113b682600383516114dd565b61055f82826115e4565b6001600160401b038111156113d957610c14828261160b565b610c14826000836114dd565b6004546000906113f6816001611cee565b600455835160408086015160808701515191516000936320214ca360e11b9361142e9386938493923092918a91600191602401611d06565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152905061146e86838684611642565b9695505050505050565b604080518082019091526060815260006020820152611498602083611d6e565b156114c0576114a8602083611d6e565b6114b3906020611d90565b6114bd9083611cee565b91505b506020828101829052604080518085526000815290920101905290565b6017816001600160401b03161161150157610b488360e0600585901b1683176117a0565b60ff816001600160401b03161161153d57611527836018611fe0600586901b16176117a0565b50610b48836001600160401b03831660016117c5565b61ffff816001600160401b03161161157a57611564836019611fe0600586901b16176117a0565b50610b48836001600160401b03831660026117c5565b63ffffffff816001600160401b0316116115b9576115a383601a611fe0600586901b16176117a0565b50610b48836001600160401b03831660046117c5565b6115ce83601b611fe0600586901b16176117a0565b50610b48836001600160401b03831660086117c5565b60408051808201909152606081526000602082015261135a838460000151518485516117eb565b6116168260c26117a0565b50610c14828260405160200161162e91815260200190565b6040516020818303038152906040526118d5565b6040516bffffffffffffffffffffffff193060601b1660208201526034810184905260009060540160408051808303601f1901815282825280516020918201206000818152600590925291812080546001600160a01b0319166001600160a01b038a1617905590925082917fb5e6e01e79f91267dc17b4e6314d5d4d03593d2ceee0fbb452b750bd70ea5af99190a2600254604051630200057560e51b81526001600160a01b0390911690634000aea09061170590889087908790600401611da7565b6020604051808303816000875af1158015611724573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117489190611c63565b6113a15760405162461bcd60e51b815260206004820152602360248201527f756e61626c6520746f207472616e73666572416e6443616c6c20746f206f7261604482015262636c6560e81b6064820152608401610613565b60408051808201909152606081526000602082015261135a83846000015151846118e2565b6040805180820190915260608152600060208201526113a184856000015151858561193d565b604080518082019091526060815260006020820152825182111561180e57600080fd5b602085015161181d8386611cee565b111561185057611850856118408760200151878661183b9190611cee565b6119be565b61184b906002611dce565b6119d5565b60008086518051876020830101935080888701111561186f5787860182525b505050602084015b602084106118af578051825261188e602083611cee565b915061189b602082611cee565b90506118a8602085611d90565b9350611877565b51815160001960208690036101000a019081169019919091161790525083949350505050565b6113b682600283516114dd565b6040805180820190915260608152600060208201528360200151831061191757611917848560200151600261184b9190611dce565b8351805160208583010184815350808503611933576001810182525b5093949350505050565b60408051808201909152606081526000602082015260208501516119618584611cee565b111561197557611975856118408685611cee565b6000600161198584610100611ed1565b61198f9190611d90565b90508551838682010185831982511617815250805184870111156119b35783860181525b509495945050505050565b6000818311156119cf57508161135d565b50919050565b81516119e18383611478565b50610b4883826115e4565b6040805160a0810182526000808252602080830182905282840182905260608084018390528451808601909552845283015290608082015290565b60008060208385031215611a3a57600080fd5b82356001600160401b0380821115611a5157600080fd5b818501915085601f830112611a6557600080fd5b813581811115611a7457600080fd5b866020828501011115611a8657600080fd5b60209290920196919550909350505050565b600080600080600060a08688031215611ab057600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b6000815180845260005b81811015611af957602081850181015186830182015201611add565b81811115611b0b576000602083870101525b50601f01601f19169290920160200192915050565b82151581526040602082015260006113a16040830184611ad3565b600060208284031215611b4d57600080fd5b5035919050565b60008060408385031215611b6757600080fd5b50508035926020909101359150565b80356001600160401b0381168114611b8d57600080fd5b919050565b600080600060608486031215611ba757600080fd5b611bb084611b76565b925060208401356001600160801b0381168114611bcc57600080fd5b9150611bda60408501611b76565b90509250925092565b600060208284031215611bf557600080fd5b81356001600160a01b0381168114611c0c57600080fd5b9392505050565b600060208284031215611c2557600080fd5b813560028110611c0c57600080fd5b634e487b7160e01b600052602160045260246000fd5b600060208284031215611c5c57600080fd5b5051919050565b600060208284031215611c7557600080fd5b81518015158114611c0c57600080fd5b634e487b7160e01b600052601160045260246000fd5b60006001600160401b03808316818516808303821115611cbd57611cbd611c85565b01949350505050565b6020810160028310611ce857634e487b7160e01b600052602160045260246000fd5b91905290565b60008219821115611d0157611d01611c85565b500190565b6001600160a01b0389811682526020820189905260408201889052861660608201526001600160e01b03198516608082015260a0810184905260c0810183905261010060e08201819052600090611d5f83820185611ad3565b9b9a5050505050505050505050565b600082611d8b57634e487b7160e01b600052601260045260246000fd5b500690565b600082821015611da257611da2611c85565b500390565b60018060a01b03841681528260208201526060604082015260006113196060830184611ad3565b6000816000190483118215151615611de857611de8611c85565b500290565b600181815b80851115611e28578160001904821115611e0e57611e0e611c85565b80851615611e1b57918102915b93841c9390800290611df2565b509250929050565b600082611e3f5750600161135d565b81611e4c5750600061135d565b8160018114611e625760028114611e6c57611e88565b600191505061135d565b60ff841115611e7d57611e7d611c85565b50506001821b61135d565b5060208310610133831016604e8410600b8410161715611eab575081810a61135d565b611eb58383611ded565b8060001904821115611ec957611ec9611c85565b029392505050565b600061135a8383611e3056fea2646970667358221220570b60317028e5c56f7f6441d73059b652c10cbd04cae1951c30554986626a9d64736f6c634300080f0033000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca0000000000000000000000001152c76a0b3acc9856b1d8ee9ebdf2a2d0a01cc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001518000000000000000000000000000000000000000000000003635c9adc5dea00000000000000000000000000000000000000000000000000000000000000000004b000000000000000000000000ddc796a66e8b83d0bccd97df33a6ccfba8fd60ea

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101735760003560e01c80638da5cb5b116100de578063c2939d9711610097578063ddca3f4311610071578063ddca3f43146103c4578063ec8eadbe146103cd578063f2fde38b146103d5578063f5ca2b6c146103e857600080fd5b8063c2939d9714610392578063c51df75d146103a9578063cfbf915b146103bc57600080fd5b80638da5cb5b146102d45780638e00a2bb146102f95780639c312cfd1461032f578063ae1bcfc114610337578063b5169e5314610351578063b919e7081461037857600080fd5b80635f60f485116101305780635f60f4851461021d5780636e04ff0d1461027d578063707072e21461029e578063715018a6146102a65780637a8042bd146102ae5780637b4c1648146102c157600080fd5b80630b9259271461017857806319a6e9e6146101825780633109f576146101b25780633b89581f146101e45780634585e33b146101f7578063499a2dea1461020a575b600080fd5b6101806103fb565b005b600954610195906001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b6009546101cc90600160801b90046001600160801b031681565b6040516001600160801b0390911681526020016101a9565b600b546101cc906001600160801b031681565b610180610205366004611a27565b61046e565b610180610218366004611a98565b61059e565b600a5461024e906001600160401b0380821691600160401b810490911690600160801b90046001600160801b031683565b604080516001600160401b0394851681529390921660208401526001600160801b0316908201526060016101a9565b61029061028b366004611a27565b610767565b6040516101a9929190611b20565b610180610a69565b610180610b4e565b6101806102bc366004611b3b565b610b62565b6101806102cf366004611b54565b610c18565b6006546001600160a01b03165b6040516001600160a01b0390911681526020016101a9565b600c54600d54600e54600f5461030f9392919084565b6040805194855260208501939093529183015260608201526080016101a9565b610180610c67565b600b546101cc90600160801b90046001600160801b031681565b6102e17f000000000000000000000000ddc796a66e8b83d0bccd97df33a6ccfba8fd60ea81565b60095461019590600160401b90046001600160401b031681565b61039b60075481565b6040519081526020016101a9565b6101806103b7366004611b92565b610c77565b610180610d20565b61039b60085481565b610180610d30565b6101806103e3366004611be3565b610d82565b6101806103f6366004611b54565b610dfb565b610403610e2b565b600b546001600160801b031660011461041d576001610420565b60005b600b80546001600160801b03191660ff9290921691821790556040519081527f57599e5c77554b728e2e26fb1ab59dd5a6c62ebcb96a87585f8bad46f64ceb009060200160405180910390a1565b600061047c82840184611c13565b9050600081600181111561049257610492611c34565b0361056457600960109054906101000a90046001600160801b03166001600160801b03167f000000000000000000000000ddc796a66e8b83d0bccd97df33a6ccfba8fd60ea6001600160a01b0316638945621b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610514573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105389190611c4a565b101561055757604051637e8b026360e01b815260040160405180910390fd5b61055f610e85565b505050565b600181600181111561057857610578611c34565b036105855761055f610fc9565b604051630b77359760e41b815260040160405180910390fd5b60008581526005602052604090205485906001600160a01b0316331461061c5760405162461bcd60e51b815260206004820152602860248201527f536f75726365206d75737420626520746865206f7261636c65206f6620746865604482015267081c995c5d595cdd60c21b60648201526084015b60405180910390fd5b60008181526005602052604080822080546001600160a01b03191690555182917f7cc135e0cebb02c3480ae5d74d377283180a2601f8f644edf7987b009316c63a91a2600b546001600160801b03166001036106c0576040805160808101825286815260208101869052908101849052606001829052600c859055600d849055600e839055600f829055600b80546001600160801b0316600160801b179055610750565b60405163661d208160e01b8152600481018690526024810185905260448101849052606481018390527f000000000000000000000000ddc796a66e8b83d0bccd97df33a6ccfba8fd60ea6001600160a01b03169063661d208190608401600060405180830381600087803b15801561073757600080fd5b505af115801561074b573d6000803e3d6000fd5b505050505b5050600a80546001600160801b0316905550505050565b6000606060007f000000000000000000000000ddc796a66e8b83d0bccd97df33a6ccfba8fd60ea6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ef9190611c63565b15801561080c5750600b54600160801b90046001600160801b0316155b801561083c5750600954600a5461082f916001600160401b039081169116611c9b565b6001600160401b03164210155b80156108e75750600960109054906101000a90046001600160801b03166001600160801b03167f000000000000000000000000ddc796a66e8b83d0bccd97df33a6ccfba8fd60ea6001600160a01b0316638945621b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e49190611c4a565b10155b9050801561091c57600160006040516020016109039190611cc6565b6040516020818303038152906040529250925050610a62565b60007f000000000000000000000000ddc796a66e8b83d0bccd97df33a6ccfba8fd60ea6001600160a01b0316635c975abb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561097c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a09190611c63565b80156109bc5750600b54600160801b90046001600160801b0316155b80156109d85750600a54600160801b90046001600160801b0316155b8015610a145750600954600a54610a07916001600160401b03600160401b918290048116929190910416611c9b565b6001600160401b03164310155b90508015610a4957600180604051602001610a2f9190611cc6565b604051602081830303815290604052935093505050610a62565b6000604051806020016040528060008152509350935050505b9250929050565b610a71610e2b565b600b54600160801b90046001600160801b0316600003610aa457604051633d75612960e01b815260040160405180910390fd5b600b80546001600160801b03169055600c54600d54600e54600f5460405163661d208160e01b815260048101949094526024840192909252604483015260648201527f000000000000000000000000ddc796a66e8b83d0bccd97df33a6ccfba8fd60ea6001600160a01b03169063661d208190608401600060405180830381600087803b158015610b3457600080fd5b505af1158015610b48573d6000803e3d6000fd5b50505050565b610b56610e2b565b610b6060006111d9565b565b610b6a610e2b565b6000610b7e6002546001600160a01b031690565b60405163a9059cbb60e01b8152336004820152602481018490529091506001600160a01b0382169063a9059cbb906044016020604051808303816000875af1158015610bce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf29190611c63565b1515600114610c1457604051631e9acf1760e31b815260040160405180910390fd5b5050565b610c20610e2b565b6007829055600881905560408051838152602081018390527f4901a18e5855c65d9ec4cccdb426e660eb091a27964eb80e36c5e6fd35dd98a3910160405180910390a15050565b610c6f610e2b565b610b60610fc9565b610c7f610e2b565b600980546001600160401b038581166fffffffffffffffff00000000000000009092168217600160801b6001600160801b038716908102919091176fffffffffffffffff00000000000000001916600160401b928616928302179093556040805192835260208301939093528183015290517fe53e10d563efbcf1ade8dcd90d15edb3425b24ed7e76c9c909feaa80a1ff88d89181900360600190a1505050565b610d28610e2b565b610b60610e85565b610d38610e2b565b600b54600160801b90046001600160801b0316600003610d6b57604051633d75612960e01b815260040160405180910390fd5b600b80546001600160801b03169055610b60610fc9565b610d8a610e2b565b6001600160a01b038116610def5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610613565b610df8816111d9565b50565b610e03610e2b565b610e188260085463499a2dea60e01b8461122b565b5050600a80546001600160801b03169055565b6006546001600160a01b03163314610b605760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610613565b600954600a54610ea1916001600160401b039081169116611c9b565b6001600160401b0316421015610eca57604051637e8b026360e01b815260040160405180910390fd5b600b54600160801b90046001600160801b0316600103610efd57604051635bca6cb960e01b815260040160405180910390fd5b7f000000000000000000000000ddc796a66e8b83d0bccd97df33a6ccfba8fd60ea6001600160a01b031663cfbf915b6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610f5857600080fd5b505af1158015610f6c573d6000803e3d6000fd5b5050604080516060810182526001600160401b03428116808352439091166020830181905260009290930191909152600a8054600160401b9093026001600160801b0319909316909117919091176001600160801b031690555050565b60408051606081018252600a546001600160401b038082168352600160401b820416602080840191909152600160801b9091046001600160801b0316828401528251635c975abb60e01b8152925191927f000000000000000000000000ddc796a66e8b83d0bccd97df33a6ccfba8fd60ea6001600160a01b031692635c975abb926004808401939192918290030181865afa15801561106c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110909190611c63565b6110ad57604051636cd6020160e01b815260040160405180910390fd5b60095460208201516110cf91600160401b90046001600160401b031690611c9b565b6001600160401b03164310156110f857604051630ba86cd360e31b815260040160405180910390fd5b80604001516001600160801b0316600103611126576040516303ead14560e11b815260040160405180910390fd5b600b54600160801b90046001600160801b031660010361115957604051635bca6cb960e01b815260040160405180910390fd5b600a80546001600160801b0316600160801b17905560075460009061118690306324cd16f560e11b6112fd565b90506111cd6040518060400160405280600b81526020016a313637b1b5a73ab6b132b960a91b81525083602001516001600160401b0316836113229092919063ffffffff16565b61055f81600854611340565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008481526005602052604080822080546001600160a01b0319811690915590516001600160a01b039091169186917fe1fe3afa0f7f761ff0a8b89086790efd5140d2907ebd5b7ff6bfcb5e075fd4c59190a2604051636ee4d55360e01b815260048101869052602481018590526001600160e01b031984166044820152606481018390526001600160a01b03821690636ee4d55390608401600060405180830381600087803b1580156112de57600080fd5b505af11580156112f2573d6000803e3d6000fd5b505050505050505050565b6113056119ec565b61130d6119ec565b61131981868686611363565b95945050505050565b608083015161133190836113a9565b608083015161055f90826113c0565b60035460009061135a906001600160a01b031684846113e5565b90505b92915050565b61136b6119ec565b61137b8560800151610100611478565b50508284526001600160a01b03821660208501526001600160e01b031981166040850152835b949350505050565b6113b682600383516114dd565b61055f82826115e4565b6001600160401b038111156113d957610c14828261160b565b610c14826000836114dd565b6004546000906113f6816001611cee565b600455835160408086015160808701515191516000936320214ca360e11b9361142e9386938493923092918a91600191602401611d06565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152905061146e86838684611642565b9695505050505050565b604080518082019091526060815260006020820152611498602083611d6e565b156114c0576114a8602083611d6e565b6114b3906020611d90565b6114bd9083611cee565b91505b506020828101829052604080518085526000815290920101905290565b6017816001600160401b03161161150157610b488360e0600585901b1683176117a0565b60ff816001600160401b03161161153d57611527836018611fe0600586901b16176117a0565b50610b48836001600160401b03831660016117c5565b61ffff816001600160401b03161161157a57611564836019611fe0600586901b16176117a0565b50610b48836001600160401b03831660026117c5565b63ffffffff816001600160401b0316116115b9576115a383601a611fe0600586901b16176117a0565b50610b48836001600160401b03831660046117c5565b6115ce83601b611fe0600586901b16176117a0565b50610b48836001600160401b03831660086117c5565b60408051808201909152606081526000602082015261135a838460000151518485516117eb565b6116168260c26117a0565b50610c14828260405160200161162e91815260200190565b6040516020818303038152906040526118d5565b6040516bffffffffffffffffffffffff193060601b1660208201526034810184905260009060540160408051808303601f1901815282825280516020918201206000818152600590925291812080546001600160a01b0319166001600160a01b038a1617905590925082917fb5e6e01e79f91267dc17b4e6314d5d4d03593d2ceee0fbb452b750bd70ea5af99190a2600254604051630200057560e51b81526001600160a01b0390911690634000aea09061170590889087908790600401611da7565b6020604051808303816000875af1158015611724573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117489190611c63565b6113a15760405162461bcd60e51b815260206004820152602360248201527f756e61626c6520746f207472616e73666572416e6443616c6c20746f206f7261604482015262636c6560e81b6064820152608401610613565b60408051808201909152606081526000602082015261135a83846000015151846118e2565b6040805180820190915260608152600060208201526113a184856000015151858561193d565b604080518082019091526060815260006020820152825182111561180e57600080fd5b602085015161181d8386611cee565b111561185057611850856118408760200151878661183b9190611cee565b6119be565b61184b906002611dce565b6119d5565b60008086518051876020830101935080888701111561186f5787860182525b505050602084015b602084106118af578051825261188e602083611cee565b915061189b602082611cee565b90506118a8602085611d90565b9350611877565b51815160001960208690036101000a019081169019919091161790525083949350505050565b6113b682600283516114dd565b6040805180820190915260608152600060208201528360200151831061191757611917848560200151600261184b9190611dce565b8351805160208583010184815350808503611933576001810182525b5093949350505050565b60408051808201909152606081526000602082015260208501516119618584611cee565b111561197557611975856118408685611cee565b6000600161198584610100611ed1565b61198f9190611d90565b90508551838682010185831982511617815250805184870111156119b35783860181525b509495945050505050565b6000818311156119cf57508161135d565b50919050565b81516119e18383611478565b50610b4883826115e4565b6040805160a0810182526000808252602080830182905282840182905260608084018390528451808601909552845283015290608082015290565b60008060208385031215611a3a57600080fd5b82356001600160401b0380821115611a5157600080fd5b818501915085601f830112611a6557600080fd5b813581811115611a7457600080fd5b866020828501011115611a8657600080fd5b60209290920196919550909350505050565b600080600080600060a08688031215611ab057600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b6000815180845260005b81811015611af957602081850181015186830182015201611add565b81811115611b0b576000602083870101525b50601f01601f19169290920160200192915050565b82151581526040602082015260006113a16040830184611ad3565b600060208284031215611b4d57600080fd5b5035919050565b60008060408385031215611b6757600080fd5b50508035926020909101359150565b80356001600160401b0381168114611b8d57600080fd5b919050565b600080600060608486031215611ba757600080fd5b611bb084611b76565b925060208401356001600160801b0381168114611bcc57600080fd5b9150611bda60408501611b76565b90509250925092565b600060208284031215611bf557600080fd5b81356001600160a01b0381168114611c0c57600080fd5b9392505050565b600060208284031215611c2557600080fd5b813560028110611c0c57600080fd5b634e487b7160e01b600052602160045260246000fd5b600060208284031215611c5c57600080fd5b5051919050565b600060208284031215611c7557600080fd5b81518015158114611c0c57600080fd5b634e487b7160e01b600052601160045260246000fd5b60006001600160401b03808316818516808303821115611cbd57611cbd611c85565b01949350505050565b6020810160028310611ce857634e487b7160e01b600052602160045260246000fd5b91905290565b60008219821115611d0157611d01611c85565b500190565b6001600160a01b0389811682526020820189905260408201889052861660608201526001600160e01b03198516608082015260a0810184905260c0810183905261010060e08201819052600090611d5f83820185611ad3565b9b9a5050505050505050505050565b600082611d8b57634e487b7160e01b600052601260045260246000fd5b500690565b600082821015611da257611da2611c85565b500390565b60018060a01b03841681528260208201526060604082015260006113196060830184611ad3565b6000816000190483118215151615611de857611de8611c85565b500290565b600181815b80851115611e28578160001904821115611e0e57611e0e611c85565b80851615611e1b57918102915b93841c9390800290611df2565b509250929050565b600082611e3f5750600161135d565b81611e4c5750600061135d565b8160018114611e625760028114611e6c57611e88565b600191505061135d565b60ff841115611e7d57611e7d611c85565b50506001821b61135d565b5060208310610133831016604e8410600b8410161715611eab575081810a61135d565b611eb58383611ded565b8060001904821115611ec957611ec9611c85565b029392505050565b600061135a8383611e3056fea2646970667358221220570b60317028e5c56f7f6441d73059b652c10cbd04cae1951c30554986626a9d64736f6c634300080f0033

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

000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca0000000000000000000000001152c76a0b3acc9856b1d8ee9ebdf2a2d0a01cc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001518000000000000000000000000000000000000000000000003635c9adc5dea00000000000000000000000000000000000000000000000000000000000000000004b000000000000000000000000ddc796a66e8b83d0bccd97df33a6ccfba8fd60ea

-----Decoded View---------------
Arg [0] : _chainlinkToken (address): 0x514910771AF9Ca656af840dff83E8264EcF986CA
Arg [1] : _chainlinkOracle (address): 0x1152c76A0B3acC9856B1d8ee9EbDf2A2d0a01cC3
Arg [2] : _jobId (bytes32): 0x0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : _fee (uint256): 0
Arg [4] : _minTimeBetweenUpdates (uint64): 86400
Arg [5] : _minDepositsSinceLastUpdate (uint128): 1000000000000000000000
Arg [6] : _minBlockConfirmations (uint64): 75
Arg [7] : _priorityPool (address): 0xDdC796a66E8b83d0BcCD97dF33A6CcFBA8fd60eA

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca
Arg [1] : 0000000000000000000000001152c76a0b3acc9856b1d8ee9ebdf2a2d0a01cc3
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [4] : 0000000000000000000000000000000000000000000000000000000000015180
Arg [5] : 00000000000000000000000000000000000000000000003635c9adc5dea00000
Arg [6] : 000000000000000000000000000000000000000000000000000000000000004b
Arg [7] : 000000000000000000000000ddc796a66e8b83d0bccd97df33a6ccfba8fd60ea


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

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