Goerli Testnet

Contract

0x14953ab06bA217Bc5DE7b7ADB48C88D7c0095f5e
Source Code

Overview

ETH Balance

0 ETH

Token Holdings

Multi Chain

Multichain Addresses

Transaction Hash
Method
Block
From
To
Value
Request Matchup76275802022-09-20 13:22:00371 days 18 hrs ago1663680120IN
0x14953a...c0095f5e
0 ETH0.000135361.00000001
Request Meta Dat...75915002022-09-14 16:37:12377 days 15 hrs ago1663173432IN
0x14953a...c0095f5e
0 ETH0.000334472.66891351
Request Results75794182022-09-12 17:31:00379 days 14 hrs ago1663003860IN
0x14953a...c0095f5e
0 ETH0.000134731.00000001
Request Matchup75794082022-09-12 17:28:24379 days 14 hrs ago1663003704IN
0x14953a...c0095f5e
0 ETH0.000135361.00000001
Request Results75793802022-09-12 17:22:00379 days 14 hrs ago1663003320IN
0x14953a...c0095f5e
0 ETH0.000133831.00000001
Request Matchup75793732022-09-12 17:20:24379 days 14 hrs ago1663003224IN
0x14953a...c0095f5e
0 ETH0.000135361.00000001
Request Matchup75777082022-09-12 10:46:00379 days 21 hrs ago1662979560IN
0x14953a...c0095f5e
0 ETH0.000135361.00000001
Request Matchup75579372022-09-09 6:57:00383 days 1 hr ago1662706620IN
0x14953a...c0095f5e
0 ETH0.000135361.00000001
Request Meta Dat...75579332022-09-09 6:55:36383 days 1 hr ago1662706536IN
0x14953a...c0095f5e
0 ETH0.000125341.00000001
0x6080604075578482022-09-09 6:36:24383 days 1 hr ago1662705384IN
 Create: ApexConsumerOld
0 ETH0.000184780.10000001

Latest 15 internal transactions

Advanced mode:
Parent Txn Hash Block From To Value
76275802022-09-20 13:22:00371 days 18 hrs ago1663680120
0x14953a...c0095f5e
0 ETH
75915032022-09-14 16:37:48377 days 15 hrs ago1663173468
0x14953a...c0095f5e
0 ETH
75915002022-09-14 16:37:12377 days 15 hrs ago1663173432
0x14953a...c0095f5e
0 ETH
75794222022-09-12 17:31:48379 days 14 hrs ago1663003908
0x14953a...c0095f5e
0 ETH
75794182022-09-12 17:31:00379 days 14 hrs ago1663003860
0x14953a...c0095f5e
0 ETH
75794112022-09-12 17:29:00379 days 14 hrs ago1663003740
0x14953a...c0095f5e
0 ETH
75794082022-09-12 17:28:24379 days 14 hrs ago1663003704
0x14953a...c0095f5e
0 ETH
75793802022-09-12 17:22:00379 days 14 hrs ago1663003320
0x14953a...c0095f5e
0 ETH
75793772022-09-12 17:21:12379 days 14 hrs ago1663003272
0x14953a...c0095f5e
0 ETH
75793732022-09-12 17:20:24379 days 14 hrs ago1663003224
0x14953a...c0095f5e
0 ETH
75777082022-09-12 10:46:00379 days 21 hrs ago1662979560
0x14953a...c0095f5e
0 ETH
75579412022-09-09 6:58:12383 days 1 hr ago1662706692
0x14953a...c0095f5e
0 ETH
75579372022-09-09 6:57:00383 days 1 hr ago1662706620
0x14953a...c0095f5e
0 ETH
75579362022-09-09 6:56:24383 days 1 hr ago1662706584
0x14953a...c0095f5e
0 ETH
75579332022-09-09 6:55:36383 days 1 hr ago1662706536
0x14953a...c0095f5e
0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ApexConsumerOld

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 15 : ApexConsumerOld.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@chainlink/contracts/src/v0.8/ChainlinkClient.sol";
import "@chainlink/contracts/src/v0.8/ConfirmedOwner.sol";

/*
 * **** Data Conversions ****
 *
 * Decimals to integers
 * ---------------------------------------------------
 * Value                           Conversion
 * ---------------------------------------------------
 * probability A                multiplied by 10000
 * probability B                multiplied by 10000
 * probability C                multiplied by 10000
 * probability D                multiplied by 10000
 *
 */

//Event meta data (to get event id): 8ffc516f1f024cf990e2a57ae08e58b3
//● Pre (or Post)-Qualifying Probabilities: 32e909bce3c649ce98a6d4bad8fa0307
//● Results: 4ef5150682ec4c2d8e69a94ded14cf3b
//Oracle Address: 0x28e2A3DAC71fd88d43D0EFcde8e14385c725F032

contract ApexConsumerOld is ChainlinkClient, ConfirmedOwner {
    using Chainlink for Chainlink.Request;

    /* ========== CONSUMER STATE VARIABLES ========== */

    uint256 private constant ORACLE_PAYMENT = (1 * LINK_DIVISIBILITY) / 1e2;
    string public event_id;
    string public bet_type;
    string public event_name;
    uint256 public qualifying_start_time;
    uint256 public race_start_time;

    uint256 public timestamp;

    string public betDetail1;
    string public betDetail2;
    uint256 public probabilityA;
    uint256 public probabilityB;
    uint256 public timeStamp;

    string public results;
    string public resultsDetail;

    /* ========== CONSTRUCTOR ========== */

    constructor() ConfirmedOwner(msg.sender) {
        //        setPublicChainlinkToken();
        // use the function for Goerli calls.
        setChainlinkToken(0x326C977E6efc84E512bB9C30f76E30c160eD06FB);
    }

    /* ========== CONSUMER REQUEST FUNCTIONS ========== */

    // no parameters needed, just an automiatc get call
    function requestMetaData(
        address _oracle,
        string memory _jobId,
        string memory sports
    ) public onlyOwner {
        Chainlink.Request memory req = buildChainlinkRequest(
            stringToBytes32(_jobId),
            address(this),
            this.fulfillMetaData.selector
        );
        req.add("sports", sports);
        sendChainlinkRequestTo(_oracle, req, ORACLE_PAYMENT);
    }

    function requestMatchup(
        address _oracle,
        string memory _jobId,
        string memory eventID,
        string memory betType
    ) public onlyOwner {
        Chainlink.Request memory req = buildChainlinkRequest(
            stringToBytes32(_jobId),
            address(this),
            this.fulfillMatchup.selector
        );
        req.add("event_id", eventID); // example data points
        req.add("qualifying_status", "pre");
        req.add("bet_type", betType);
        req.add("stage_level", "null");
        sendChainlinkRequestTo(_oracle, req, ORACLE_PAYMENT);
    }

    function requestResults(
        address _oracle,
        string memory _jobId,
        string memory eventID,
        string memory betType,
        string memory resultType
    ) public onlyOwner {
        Chainlink.Request memory req = buildChainlinkRequest(
            stringToBytes32(_jobId),
            address(this),
            this.fulfillResults.selector
        );
        req.add("event_id", eventID);
        req.add("result_type", resultType);
        req.add("bet_type", betType);
        sendChainlinkRequestTo(_oracle, req, ORACLE_PAYMENT);
    }

    /* ========== CONSUMER FULFILL FUNCTIONS ========== */

    /**
     * @notice Consumes the data returned by the node job on a particular request.
     * @param _requestId the request ID for fulfillment
     */
    function fulfillMetaData(
        bytes32 _requestId,
        string memory _event_id,
        string memory _bet_type,
        string memory _event_name,
        uint256 _qualifying_start_time,
        uint256 _race_start_time
    ) public recordChainlinkFulfillment(_requestId) {
        emit RequestMetaDataFulfilled(
            _requestId,
            _event_id,
            _bet_type,
            _event_name,
            _qualifying_start_time,
            _race_start_time
        );
        event_id = _event_id;
        bet_type = _bet_type;
        event_name = _event_name;
        qualifying_start_time = _qualifying_start_time;
        race_start_time = _race_start_time;
    }

    /**
     * @notice Consumes the data returned by the node job on a particular request.
     * @param _requestId the request ID for fulfillment
     * @param _betTypeDetail1 Team/Category/Rider A identifier, returned as string.
     * @param _betTypeDetail2 Team/Category/Rider B identifier, returned as string.
     * @param _probA: Probability for Team/Category/Rider A, returned as uint256.
     * @param _probB: Probability for Team/Category/Rider B, returned as uint256.
     * @param _timeStamp: Timestamp this probability was sent, returned as uint256.
     */

    function fulfillMatchup(
        bytes32 _requestId,
        string calldata _betTypeDetail1,
        string calldata _betTypeDetail2,
        uint256 _probA,
        uint256 _probB,
        uint256 _timeStamp
    ) public recordChainlinkFulfillment(_requestId) {
        betDetail1 = _betTypeDetail1;
        betDetail2 = _betTypeDetail2;
        probabilityA = _probA;
        probabilityB = _probB;
        timestamp = _timeStamp;
        emit RequestProbabilitiesFulfilled(_requestId, _betTypeDetail1, _betTypeDetail2, _probA, _probB, _timeStamp);
    }

    /**
     * @notice Consumes the data returned by the node job on a particular request.
     * @param _requestId the request ID for fulfillment
     * @param _result win/loss for the matchup.
     * @param _resultDetails ranking/timing data to elaborate on win/loss
     */
    function fulfillResults(
        bytes32 _requestId,
        string memory _result,
        string memory _resultDetails
    ) public recordChainlinkFulfillment(_requestId) {
        emit RequestResultsFulfilled(_requestId, _result, _resultDetails);
        results = _result;
        resultsDetail = _resultDetails;
    }

    /* ========== OTHER FUNCTIONS ========== */
    function getOracleAddress() external view returns (address) {
        return chainlinkOracleAddress();
    }

    function setOracle(address _oracle) external {
        setChainlinkOracle(_oracle);
    }

    function getChainlinkToken() public view returns (address) {
        return chainlinkTokenAddress();
    }

    function withdrawLink() public onlyOwner {
        LinkTokenInterface link = LinkTokenInterface(chainlinkTokenAddress());
        require(link.transfer(msg.sender, link.balanceOf(address(this))), "Unable to transfer");
    }

    function setLink(address _link) external onlyOwner {
        require(_link != address(0), "Invalid address");
        setChainlinkToken(_link);
    }

    function cancelRequest(
        bytes32 _requestId,
        uint256 _payment,
        bytes4 _callbackFunctionId,
        uint256 _expiration
    ) public onlyOwner {
        cancelChainlinkRequest(_requestId, _payment, _callbackFunctionId, _expiration);
    }

    function stringToBytes32(string memory source) private pure returns (bytes32 result) {
        bytes memory tempEmptyStringTest = bytes(source);
        if (tempEmptyStringTest.length == 0) {
            return 0x0;
        }
        assembly {
            // solhint-disable-line no-inline-assembly
            result := mload(add(source, 32))
        }
    }

    event RequestMetaDataFulfilled(
        bytes32 indexed requestId,
        string event_id,
        string bet_type,
        string event_name,
        uint256 qualifying_start_time,
        uint256 race_start_time
    );

    event RequestProbabilitiesFulfilled(
        bytes32 indexed requestId,
        string betTypeDetail1,
        string betTypeDetail2,
        uint256 probA,
        uint256 probB,
        uint256 timeStamp
    );

    event RequestResultsFulfilled(bytes32 indexed requestId, string result, string resultDetails);
}

File 2 of 15 : 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 3 of 15 : ConfirmedOwner.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./ConfirmedOwnerWithProposal.sol";

/**
 * @title The ConfirmedOwner contract
 * @notice A contract with helpers for basic contract ownership.
 */
contract ConfirmedOwner is ConfirmedOwnerWithProposal {
  constructor(address newOwner) ConfirmedOwnerWithProposal(newOwner, address(0)) {}
}

File 4 of 15 : 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 5 of 15 : 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 6 of 15 : 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 7 of 15 : 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 8 of 15 : 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 9 of 15 : PointerInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

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

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

File 11 of 15 : 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 12 of 15 : 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 13 of 15 : 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);
}

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

import "./interfaces/OwnableInterface.sol";

/**
 * @title The ConfirmedOwner contract
 * @notice A contract with helpers for basic contract ownership.
 */
contract ConfirmedOwnerWithProposal is OwnableInterface {
  address private s_owner;
  address private s_pendingOwner;

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

  constructor(address newOwner, address pendingOwner) {
    require(newOwner != address(0), "Cannot set owner to zero");

    s_owner = newOwner;
    if (pendingOwner != address(0)) {
      _transferOwnership(pendingOwner);
    }
  }

  /**
   * @notice Allows an owner to begin transferring ownership to a new address,
   * pending.
   */
  function transferOwnership(address to) public override onlyOwner {
    _transferOwnership(to);
  }

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

    address oldOwner = s_owner;
    s_owner = msg.sender;
    s_pendingOwner = address(0);

    emit OwnershipTransferred(oldOwner, msg.sender);
  }

  /**
   * @notice Get the current owner
   */
  function owner() public view override returns (address) {
    return s_owner;
  }

  /**
   * @notice validate, transfer ownership, and emit relevant events
   */
  function _transferOwnership(address to) private {
    require(to != msg.sender, "Cannot transfer to self");

    s_pendingOwner = to;

    emit OwnershipTransferRequested(s_owner, to);
  }

  /**
   * @notice validate access
   */
  function _validateOwnership() internal view {
    require(msg.sender == s_owner, "Only callable by owner");
  }

  /**
   * @notice Reverts if called by anyone other than the contract owner.
   */
  modifier onlyOwner() {
    _validateOwnership();
    _;
  }
}

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

interface OwnableInterface {
  function owner() external returns (address);

  function transferOwnership(address recipient) external;

  function acceptOwnership() external;
}

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

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"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":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"OwnershipTransferRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"requestId","type":"bytes32"},{"indexed":false,"internalType":"string","name":"event_id","type":"string"},{"indexed":false,"internalType":"string","name":"bet_type","type":"string"},{"indexed":false,"internalType":"string","name":"event_name","type":"string"},{"indexed":false,"internalType":"uint256","name":"qualifying_start_time","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"race_start_time","type":"uint256"}],"name":"RequestMetaDataFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"requestId","type":"bytes32"},{"indexed":false,"internalType":"string","name":"betTypeDetail1","type":"string"},{"indexed":false,"internalType":"string","name":"betTypeDetail2","type":"string"},{"indexed":false,"internalType":"uint256","name":"probA","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"probB","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timeStamp","type":"uint256"}],"name":"RequestProbabilitiesFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"requestId","type":"bytes32"},{"indexed":false,"internalType":"string","name":"result","type":"string"},{"indexed":false,"internalType":"string","name":"resultDetails","type":"string"}],"name":"RequestResultsFulfilled","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"betDetail1","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"betDetail2","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bet_type","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"internalType":"uint256","name":"_payment","type":"uint256"},{"internalType":"bytes4","name":"_callbackFunctionId","type":"bytes4"},{"internalType":"uint256","name":"_expiration","type":"uint256"}],"name":"cancelRequest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"event_id","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"event_name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"internalType":"string","name":"_betTypeDetail1","type":"string"},{"internalType":"string","name":"_betTypeDetail2","type":"string"},{"internalType":"uint256","name":"_probA","type":"uint256"},{"internalType":"uint256","name":"_probB","type":"uint256"},{"internalType":"uint256","name":"_timeStamp","type":"uint256"}],"name":"fulfillMatchup","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"internalType":"string","name":"_event_id","type":"string"},{"internalType":"string","name":"_bet_type","type":"string"},{"internalType":"string","name":"_event_name","type":"string"},{"internalType":"uint256","name":"_qualifying_start_time","type":"uint256"},{"internalType":"uint256","name":"_race_start_time","type":"uint256"}],"name":"fulfillMetaData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"internalType":"string","name":"_result","type":"string"},{"internalType":"string","name":"_resultDetails","type":"string"}],"name":"fulfillResults","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getChainlinkToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOracleAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"probabilityA","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"probabilityB","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"qualifying_start_time","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"race_start_time","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_oracle","type":"address"},{"internalType":"string","name":"_jobId","type":"string"},{"internalType":"string","name":"eventID","type":"string"},{"internalType":"string","name":"betType","type":"string"}],"name":"requestMatchup","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oracle","type":"address"},{"internalType":"string","name":"_jobId","type":"string"},{"internalType":"string","name":"sports","type":"string"}],"name":"requestMetaData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oracle","type":"address"},{"internalType":"string","name":"_jobId","type":"string"},{"internalType":"string","name":"eventID","type":"string"},{"internalType":"string","name":"betType","type":"string"},{"internalType":"string","name":"resultType","type":"string"}],"name":"requestResults","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"results","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"resultsDetail","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_link","type":"address"}],"name":"setLink","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oracle","type":"address"}],"name":"setOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timeStamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"timestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawLink","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405260016004553480156200001657600080fd5b5033806000816200006e5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600680546001600160a01b0319166001600160a01b0384811691909117909155811615620000a157620000a181620000cf565b505050620000c973326c977e6efc84e512bb9c30f76e30c160ed06fb6200017c60201b60201c565b6200019e565b6001600160a01b0381163314156200012a5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000065565b600780546001600160a01b0319166001600160a01b03838116918217909255600654604051919216907fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae127890600090a350565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b611f2580620001ae6000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c80637adbf973116100f9578063b18b78dd11610097578063cfc4355e11610071578063cfc4355e14610342578063d77e817d1461034a578063ec65d0f814610353578063f2fde38b1461036657600080fd5b8063b18b78dd14610328578063b76e4b4c14610330578063b80777ea1461033957600080fd5b806391039dee116100d357806391039dee146102f257806394547fcc146102fa578063a48bdb7c1461030d578063a68f54211461031557600080fd5b80637adbf973146102ad5780638da5cb5b146102d95780638dc654a2146102ea57600080fd5b806343d3f2671161016657806359efd5c11161014057806359efd5c1146102775780635ab8f50f1461028a57806376521edc1461029d57806379ba5097146102a557600080fd5b806343d3f267146102545780634d0cdc5b1461025c578063508306a21461026f57600080fd5b8063165d35e1116101a2578063165d35e1146102035780632695ae8a1461022357806335ee05411461022c57806341dc58df1461024157600080fd5b80630ab0df87146101c95780630e03e633146101e55780630f00ef76146101fa575b600080fd5b6101d260125481565b6040519081526020015b60405180910390f35b6101f86101f33660046119fe565b610379565b005b6101d260115481565b61020b610489565b6040516001600160a01b0390911681526020016101dc565b6101d2600c5481565b6102346104a2565b6040516101dc9190611c49565b6101f861024f366004611868565b610530565b61023461060d565b6101f861026a3660046117d4565b61061a565b610234610766565b6101f8610285366004611940565b610773565b6101f8610298366004611764565b610868565b6102346108d9565b6101f86108e6565b6101f86102bb36600461174a565b600380546001600160a01b0319166001600160a01b03831617905550565b6006546001600160a01b031661020b565b6101f8610997565b610234610af6565b6101f861030836600461174a565b610b03565b610234610b71565b6101f86103233660046119cd565b610b7e565b61020b610c5a565b6101d260105481565b6101d2600d5481565b610234610c6e565b6101d2600b5481565b6101f8610361366004611a9d565b610c7b565b6101f861037436600461174a565b610c95565b60008681526005602052604090205486906001600160a01b031633146103ba5760405162461bcd60e51b81526004016103b190611ccf565b60405180910390fd5b60008181526005602052604080822080546001600160a01b03191690555182917f7cc135e0cebb02c3480ae5d74d377283180a2601f8f644edf7987b009316c63a91a2867fef6fd8c793d7da2db09e58e674eb4e11bca76bbd1b0f2f83e610f15a1ab131188787878787604051610435959493929190611c81565b60405180910390a2855161045090600890602089019061151a565b50845161046490600990602088019061151a565b50835161047890600a90602087019061151a565b5050600b91909155600c5550505050565b600061049d6002546001600160a01b031690565b905090565b601480546104af90611e64565b80601f01602080910402602001604051908101604052809291908181526020018280546104db90611e64565b80156105285780601f106104fd57610100808354040283529160200191610528565b820191906000526020600020905b81548152906001019060200180831161050b57829003601f168201915b505050505081565b610538610ca6565b600061055461054686610cfb565b3063a68f542160e01b610d18565b604080518082019091526008815267195d995b9d17da5960c21b602082015290915061058290829086610d3d565b60408051808201909152600b81526a726573756c745f7479706560a81b60208201526105b090829084610d3d565b6040805180820190915260088152676265745f7479706560c01b60208201526105db90829085610d3d565b610604868260646105f5670de0b6b3a76400006001611e2e565b6105ff9190611d2f565b610d60565b50505050505050565b600980546104af90611e64565b610622610ca6565b600061063e61063085610cfb565b306359efd5c160e01b610d18565b604080518082019091526008815267195d995b9d17da5960c21b602082015290915061066c90829085610d3d565b6106c5604051806040016040528060118152602001707175616c696679696e675f73746174757360781b8152506040518060400160405280600381526020016270726560e81b81525083610d3d9092919063ffffffff16565b6040805180820190915260088152676265745f7479706560c01b60208201526106f090829084610d3d565b6107446040518060400160405280600b81526020016a1cdd1859d957db195d995b60aa1b815250604051806040016040528060048152602001631b9d5b1b60e21b81525083610d3d9092919063ffffffff16565b61075e858260646105f5670de0b6b3a76400006001611e2e565b505050505050565b600f80546104af90611e64565b60008881526005602052604090205488906001600160a01b031633146107ab5760405162461bcd60e51b81526004016103b190611ccf565b60008181526005602052604080822080546001600160a01b03191690555182917f7cc135e0cebb02c3480ae5d74d377283180a2601f8f644edf7987b009316c63a91a26107fa600e898961159e565b50610807600f878761159e565b5060108490556011839055600d82905560405189907f3aa17cc00e00965f56d788fecf65eb46521c8797990013199a22f35a8ac4f73f90610855908b908b908b908b908b908b908b90611c02565b60405180910390a2505050505050505050565b610870610ca6565b600061088c61087e84610cfb565b30630e03e63360e01b610d18565b60408051808201909152600681526573706f72747360d01b60208201529091506108b890829084610d3d565b6108d2848260646105f5670de0b6b3a76400006001611e2e565b5050505050565b600e80546104af90611e64565b6007546001600160a01b031633146109395760405162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b60448201526064016103b1565b600680546001600160a01b0319808216339081179093556007805490911690556040516001600160a01b03909116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b50565b61099f610ca6565b60006109b36002546001600160a01b031690565b6040516370a0823160e01b81523060048201529091506001600160a01b0382169063a9059cbb90339083906370a082319060240160206040518083038186803b1580156109ff57600080fd5b505afa158015610a13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a379190611ae7565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b158015610a7d57600080fd5b505af1158015610a91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab59190611920565b6109945760405162461bcd60e51b81526020600482015260126024820152712ab730b13632903a37903a3930b739b332b960711b60448201526064016103b1565b600880546104af90611e64565b610b0b610ca6565b6001600160a01b038116610b535760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b60448201526064016103b1565b600280546001600160a01b0319166001600160a01b03831617905550565b601380546104af90611e64565b60008381526005602052604090205483906001600160a01b03163314610bb65760405162461bcd60e51b81526004016103b190611ccf565b60008181526005602052604080822080546001600160a01b03191690555182917f7cc135e0cebb02c3480ae5d74d377283180a2601f8f644edf7987b009316c63a91a2837fff9bb2e0082918ec748280e236d92c16f5c4565ccfe84ab7e9aa463b75f83b278484604051610c2b929190611c5c565b60405180910390a28251610c4690601390602086019061151a565b5081516108d290601490602085019061151a565b600061049d6003546001600160a01b031690565b600a80546104af90611e64565b610c83610ca6565b610c8f84848484610df3565b50505050565b610c9d610ca6565b61099481610ec5565b6006546001600160a01b03163314610cf95760405162461bcd60e51b815260206004820152601660248201527527b7363c9031b0b63630b1363290313c9037bbb732b960511b60448201526064016103b1565b565b80516000908290610d0f5750600092915050565b50506020015190565b610d20611612565b610d28611612565b610d3481868686610f70565b95945050505050565b6080830151610d4c9083610fb6565b6080830151610d5b9082610fb6565b505050565b600454600090610d71816001611d17565b600455835160408086015160808701515191516000936320214ca360e11b93610da99386938493923092918a91600191602401611b73565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091529050610de986838684610fcd565b9695505050505050565b60008481526005602052604080822080546001600160a01b0319811690915590516001600160a01b039091169186917fe1fe3afa0f7f761ff0a8b89086790efd5140d2907ebd5b7ff6bfcb5e075fd4c59190a2604051636ee4d55360e01b815260048101869052602481018590526001600160e01b031984166044820152606481018390526001600160a01b03821690636ee4d55390608401600060405180830381600087803b158015610ea657600080fd5b505af1158015610eba573d6000803e3d6000fd5b505050505050505050565b6001600160a01b038116331415610f1e5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016103b1565b600780546001600160a01b0319166001600160a01b03838116918217909255600654604051919216907fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae127890600090a350565b610f78611612565b610f88856080015161010061113a565b50508284526001600160a01b03821660208501526001600160e01b031981166040850152835b949350505050565b610fc382600383516111a5565b610d5b82826112ac565b6040516bffffffffffffffffffffffff193060601b1660208201526034810184905260009060540160408051808303601f1901815282825280516020918201206000818152600590925291812080546001600160a01b0319166001600160a01b038a1617905590925082917fb5e6e01e79f91267dc17b4e6314d5d4d03593d2ceee0fbb452b750bd70ea5af99190a2600254604051630200057560e51b81526001600160a01b0390911690634000aea09061109090889087908790600401611bdb565b602060405180830381600087803b1580156110aa57600080fd5b505af11580156110be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e29190611920565b610fae5760405162461bcd60e51b815260206004820152602360248201527f756e61626c6520746f207472616e73666572416e6443616c6c20746f206f7261604482015262636c6560e81b60648201526084016103b1565b60408051808201909152606081526000602082015261115a602083611e99565b156111825761116a602083611e99565b611175906020611e4d565b61117f9083611d17565b91505b506020808301829052604080518085526000815283019091019052815b92915050565b6017816001600160401b0316116111c957610c8f8360e0600585901b1683176112da565b60ff816001600160401b031611611205576111ef836018611fe0600586901b16176112da565b50610c8f836001600160401b03831660016112ff565b61ffff816001600160401b0316116112425761122c836019611fe0600586901b16176112da565b50610c8f836001600160401b03831660026112ff565b63ffffffff816001600160401b0316116112815761126b83601a611fe0600586901b16176112da565b50610c8f836001600160401b03831660046112ff565b61129683601b611fe0600586901b16176112da565b50610c8f836001600160401b03831660086112ff565b6040805180820190915260608152600060208201526112d383846000015151848551611325565b9392505050565b6040805180820190915260608152600060208201526112d3838460000151518461140f565b604080518082019091526060815260006020820152610fae84856000015151858561146b565b604080518082019091526060815260006020820152825182111561134857600080fd5b60208501516113578386611d17565b111561138a5761138a8561137a876020015187866113759190611d17565b6114ec565b611385906002611e2e565b611503565b6000808651805187602083010193508088870111156113a95787860182525b505050602084015b602084106113e957805182526113c8602083611d17565b91506113d5602082611d17565b90506113e2602085611e4d565b93506113b1565b51815160001960208690036101000a019081169019919091161790525083949350505050565b604080518082019091526060815260006020820152836020015183106114445761144484856020015160026113859190611e2e565b835180516020858301018481535080851415611461576001810182525b5093949350505050565b604080518082019091526060815260006020820152602085015161148f8584611d17565b11156114a3576114a38561137a8685611d17565b600060016114b384610100611d86565b6114bd9190611e4d565b90508551838682010185831982511617815250805184870111156114e15783860181525b509495945050505050565b6000818311156114fd57508161119f565b50919050565b815161150f838361113a565b50610c8f83826112ac565b82805461152690611e64565b90600052602060002090601f016020900481019282611548576000855561158e565b82601f1061156157805160ff191683800117855561158e565b8280016001018555821561158e579182015b8281111561158e578251825591602001919060010190611573565b5061159a92915061164d565b5090565b8280546115aa90611e64565b90600052602060002090601f0160209004810192826115cc576000855561158e565b82601f106115e55782800160ff1982351617855561158e565b8280016001018555821561158e579182015b8281111561158e5782358255916020019190600101906115f7565b6040805160a0810182526000808252602080830182905282840182905260608084018390528451808601909552845283015290608082015290565b5b8082111561159a576000815560010161164e565b80356001600160a01b038116811461167957600080fd5b919050565b60008083601f84011261168f578182fd5b5081356001600160401b038111156116a5578182fd5b6020830191508360208285010111156116bd57600080fd5b9250929050565b600082601f8301126116d4578081fd5b81356001600160401b03808211156116ee576116ee611ed9565b604051601f8301601f19908116603f0116810190828211818310171561171657611716611ed9565b8160405283815286602085880101111561172e578485fd5b8360208701602083013792830160200193909352509392505050565b60006020828403121561175b578081fd5b6112d382611662565b600080600060608486031215611778578182fd5b61178184611662565b925060208401356001600160401b038082111561179c578384fd5b6117a8878388016116c4565b935060408601359150808211156117bd578283fd5b506117ca868287016116c4565b9150509250925092565b600080600080608085870312156117e9578081fd5b6117f285611662565b935060208501356001600160401b038082111561180d578283fd5b611819888389016116c4565b9450604087013591508082111561182e578283fd5b61183a888389016116c4565b9350606087013591508082111561184f578283fd5b5061185c878288016116c4565b91505092959194509250565b600080600080600060a0868803121561187f578081fd5b61188886611662565b945060208601356001600160401b03808211156118a3578283fd5b6118af89838a016116c4565b955060408801359150808211156118c4578283fd5b6118d089838a016116c4565b945060608801359150808211156118e5578283fd5b6118f189838a016116c4565b93506080880135915080821115611906578283fd5b50611913888289016116c4565b9150509295509295909350565b600060208284031215611931578081fd5b815180151581146112d3578182fd5b60008060008060008060008060c0898b03121561195b578283fd5b8835975060208901356001600160401b0380821115611978578485fd5b6119848c838d0161167e565b909950975060408b013591508082111561199c578485fd5b506119a98b828c0161167e565b999c989b5096999698976060880135976080810135975060a0013595509350505050565b6000806000606084860312156119e1578283fd5b8335925060208401356001600160401b038082111561179c578384fd5b60008060008060008060c08789031215611a16578182fd5b8635955060208701356001600160401b0380821115611a33578384fd5b611a3f8a838b016116c4565b96506040890135915080821115611a54578384fd5b611a608a838b016116c4565b95506060890135915080821115611a75578384fd5b50611a8289828a016116c4565b9350506080870135915060a087013590509295509295509295565b60008060008060808587031215611ab2578384fd5b843593506020850135925060408501356001600160e01b031981168114611ad7578283fd5b9396929550929360600135925050565b600060208284031215611af8578081fd5b5051919050565b60008151808452815b81811015611b2457602081850181015186830182015201611b08565b81811115611b355782602083870101525b50601f01601f19169290920160200192915050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b0389811682526020820189905260408201889052861660608201526001600160e01b03198516608082015260a0810184905260c0810183905261010060e08201819052600090611bcc83820185611aff565b9b9a5050505050505050505050565b60018060a01b0384168152826020820152606060408201526000610d346060830184611aff565b60a081526000611c1660a08301898b611b4a565b8281036020840152611c2981888a611b4a565b604084019690965250506060810192909252608090910152949350505050565b6020815260006112d36020830184611aff565b604081526000611c6f6040830185611aff565b8281036020840152610d348185611aff565b60a081526000611c9460a0830188611aff565b8281036020840152611ca68188611aff565b90508281036040840152611cba8187611aff565b60608401959095525050608001529392505050565b60208082526028908201527f536f75726365206d75737420626520746865206f7261636c65206f6620746865604082015267081c995c5d595cdd60c21b606082015260800190565b60008219821115611d2a57611d2a611ead565b500190565b600082611d3e57611d3e611ec3565b500490565b600181815b80851115611d7e578160001904821115611d6457611d64611ead565b80851615611d7157918102915b93841c9390800290611d48565b509250929050565b60006112d38383600082611d9c5750600161119f565b81611da95750600061119f565b8160018114611dbf5760028114611dc957611de5565b600191505061119f565b60ff841115611dda57611dda611ead565b50506001821b61119f565b5060208310610133831016604e8410600b8410161715611e08575081810a61119f565b611e128383611d43565b8060001904821115611e2657611e26611ead565b029392505050565b6000816000190483118215151615611e4857611e48611ead565b500290565b600082821015611e5f57611e5f611ead565b500390565b600181811c90821680611e7857607f821691505b602082108114156114fd57634e487b7160e01b600052602260045260246000fd5b600082611ea857611ea8611ec3565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea264697066735822122002c949cb9b020c30d9e6a4afb14f76674b5f5ded444394a6bec44f956c3ba6ce64736f6c63430008040033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80637adbf973116100f9578063b18b78dd11610097578063cfc4355e11610071578063cfc4355e14610342578063d77e817d1461034a578063ec65d0f814610353578063f2fde38b1461036657600080fd5b8063b18b78dd14610328578063b76e4b4c14610330578063b80777ea1461033957600080fd5b806391039dee116100d357806391039dee146102f257806394547fcc146102fa578063a48bdb7c1461030d578063a68f54211461031557600080fd5b80637adbf973146102ad5780638da5cb5b146102d95780638dc654a2146102ea57600080fd5b806343d3f2671161016657806359efd5c11161014057806359efd5c1146102775780635ab8f50f1461028a57806376521edc1461029d57806379ba5097146102a557600080fd5b806343d3f267146102545780634d0cdc5b1461025c578063508306a21461026f57600080fd5b8063165d35e1116101a2578063165d35e1146102035780632695ae8a1461022357806335ee05411461022c57806341dc58df1461024157600080fd5b80630ab0df87146101c95780630e03e633146101e55780630f00ef76146101fa575b600080fd5b6101d260125481565b6040519081526020015b60405180910390f35b6101f86101f33660046119fe565b610379565b005b6101d260115481565b61020b610489565b6040516001600160a01b0390911681526020016101dc565b6101d2600c5481565b6102346104a2565b6040516101dc9190611c49565b6101f861024f366004611868565b610530565b61023461060d565b6101f861026a3660046117d4565b61061a565b610234610766565b6101f8610285366004611940565b610773565b6101f8610298366004611764565b610868565b6102346108d9565b6101f86108e6565b6101f86102bb36600461174a565b600380546001600160a01b0319166001600160a01b03831617905550565b6006546001600160a01b031661020b565b6101f8610997565b610234610af6565b6101f861030836600461174a565b610b03565b610234610b71565b6101f86103233660046119cd565b610b7e565b61020b610c5a565b6101d260105481565b6101d2600d5481565b610234610c6e565b6101d2600b5481565b6101f8610361366004611a9d565b610c7b565b6101f861037436600461174a565b610c95565b60008681526005602052604090205486906001600160a01b031633146103ba5760405162461bcd60e51b81526004016103b190611ccf565b60405180910390fd5b60008181526005602052604080822080546001600160a01b03191690555182917f7cc135e0cebb02c3480ae5d74d377283180a2601f8f644edf7987b009316c63a91a2867fef6fd8c793d7da2db09e58e674eb4e11bca76bbd1b0f2f83e610f15a1ab131188787878787604051610435959493929190611c81565b60405180910390a2855161045090600890602089019061151a565b50845161046490600990602088019061151a565b50835161047890600a90602087019061151a565b5050600b91909155600c5550505050565b600061049d6002546001600160a01b031690565b905090565b601480546104af90611e64565b80601f01602080910402602001604051908101604052809291908181526020018280546104db90611e64565b80156105285780601f106104fd57610100808354040283529160200191610528565b820191906000526020600020905b81548152906001019060200180831161050b57829003601f168201915b505050505081565b610538610ca6565b600061055461054686610cfb565b3063a68f542160e01b610d18565b604080518082019091526008815267195d995b9d17da5960c21b602082015290915061058290829086610d3d565b60408051808201909152600b81526a726573756c745f7479706560a81b60208201526105b090829084610d3d565b6040805180820190915260088152676265745f7479706560c01b60208201526105db90829085610d3d565b610604868260646105f5670de0b6b3a76400006001611e2e565b6105ff9190611d2f565b610d60565b50505050505050565b600980546104af90611e64565b610622610ca6565b600061063e61063085610cfb565b306359efd5c160e01b610d18565b604080518082019091526008815267195d995b9d17da5960c21b602082015290915061066c90829085610d3d565b6106c5604051806040016040528060118152602001707175616c696679696e675f73746174757360781b8152506040518060400160405280600381526020016270726560e81b81525083610d3d9092919063ffffffff16565b6040805180820190915260088152676265745f7479706560c01b60208201526106f090829084610d3d565b6107446040518060400160405280600b81526020016a1cdd1859d957db195d995b60aa1b815250604051806040016040528060048152602001631b9d5b1b60e21b81525083610d3d9092919063ffffffff16565b61075e858260646105f5670de0b6b3a76400006001611e2e565b505050505050565b600f80546104af90611e64565b60008881526005602052604090205488906001600160a01b031633146107ab5760405162461bcd60e51b81526004016103b190611ccf565b60008181526005602052604080822080546001600160a01b03191690555182917f7cc135e0cebb02c3480ae5d74d377283180a2601f8f644edf7987b009316c63a91a26107fa600e898961159e565b50610807600f878761159e565b5060108490556011839055600d82905560405189907f3aa17cc00e00965f56d788fecf65eb46521c8797990013199a22f35a8ac4f73f90610855908b908b908b908b908b908b908b90611c02565b60405180910390a2505050505050505050565b610870610ca6565b600061088c61087e84610cfb565b30630e03e63360e01b610d18565b60408051808201909152600681526573706f72747360d01b60208201529091506108b890829084610d3d565b6108d2848260646105f5670de0b6b3a76400006001611e2e565b5050505050565b600e80546104af90611e64565b6007546001600160a01b031633146109395760405162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b60448201526064016103b1565b600680546001600160a01b0319808216339081179093556007805490911690556040516001600160a01b03909116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b50565b61099f610ca6565b60006109b36002546001600160a01b031690565b6040516370a0823160e01b81523060048201529091506001600160a01b0382169063a9059cbb90339083906370a082319060240160206040518083038186803b1580156109ff57600080fd5b505afa158015610a13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a379190611ae7565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b158015610a7d57600080fd5b505af1158015610a91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab59190611920565b6109945760405162461bcd60e51b81526020600482015260126024820152712ab730b13632903a37903a3930b739b332b960711b60448201526064016103b1565b600880546104af90611e64565b610b0b610ca6565b6001600160a01b038116610b535760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b60448201526064016103b1565b600280546001600160a01b0319166001600160a01b03831617905550565b601380546104af90611e64565b60008381526005602052604090205483906001600160a01b03163314610bb65760405162461bcd60e51b81526004016103b190611ccf565b60008181526005602052604080822080546001600160a01b03191690555182917f7cc135e0cebb02c3480ae5d74d377283180a2601f8f644edf7987b009316c63a91a2837fff9bb2e0082918ec748280e236d92c16f5c4565ccfe84ab7e9aa463b75f83b278484604051610c2b929190611c5c565b60405180910390a28251610c4690601390602086019061151a565b5081516108d290601490602085019061151a565b600061049d6003546001600160a01b031690565b600a80546104af90611e64565b610c83610ca6565b610c8f84848484610df3565b50505050565b610c9d610ca6565b61099481610ec5565b6006546001600160a01b03163314610cf95760405162461bcd60e51b815260206004820152601660248201527527b7363c9031b0b63630b1363290313c9037bbb732b960511b60448201526064016103b1565b565b80516000908290610d0f5750600092915050565b50506020015190565b610d20611612565b610d28611612565b610d3481868686610f70565b95945050505050565b6080830151610d4c9083610fb6565b6080830151610d5b9082610fb6565b505050565b600454600090610d71816001611d17565b600455835160408086015160808701515191516000936320214ca360e11b93610da99386938493923092918a91600191602401611b73565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091529050610de986838684610fcd565b9695505050505050565b60008481526005602052604080822080546001600160a01b0319811690915590516001600160a01b039091169186917fe1fe3afa0f7f761ff0a8b89086790efd5140d2907ebd5b7ff6bfcb5e075fd4c59190a2604051636ee4d55360e01b815260048101869052602481018590526001600160e01b031984166044820152606481018390526001600160a01b03821690636ee4d55390608401600060405180830381600087803b158015610ea657600080fd5b505af1158015610eba573d6000803e3d6000fd5b505050505050505050565b6001600160a01b038116331415610f1e5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016103b1565b600780546001600160a01b0319166001600160a01b03838116918217909255600654604051919216907fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae127890600090a350565b610f78611612565b610f88856080015161010061113a565b50508284526001600160a01b03821660208501526001600160e01b031981166040850152835b949350505050565b610fc382600383516111a5565b610d5b82826112ac565b6040516bffffffffffffffffffffffff193060601b1660208201526034810184905260009060540160408051808303601f1901815282825280516020918201206000818152600590925291812080546001600160a01b0319166001600160a01b038a1617905590925082917fb5e6e01e79f91267dc17b4e6314d5d4d03593d2ceee0fbb452b750bd70ea5af99190a2600254604051630200057560e51b81526001600160a01b0390911690634000aea09061109090889087908790600401611bdb565b602060405180830381600087803b1580156110aa57600080fd5b505af11580156110be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e29190611920565b610fae5760405162461bcd60e51b815260206004820152602360248201527f756e61626c6520746f207472616e73666572416e6443616c6c20746f206f7261604482015262636c6560e81b60648201526084016103b1565b60408051808201909152606081526000602082015261115a602083611e99565b156111825761116a602083611e99565b611175906020611e4d565b61117f9083611d17565b91505b506020808301829052604080518085526000815283019091019052815b92915050565b6017816001600160401b0316116111c957610c8f8360e0600585901b1683176112da565b60ff816001600160401b031611611205576111ef836018611fe0600586901b16176112da565b50610c8f836001600160401b03831660016112ff565b61ffff816001600160401b0316116112425761122c836019611fe0600586901b16176112da565b50610c8f836001600160401b03831660026112ff565b63ffffffff816001600160401b0316116112815761126b83601a611fe0600586901b16176112da565b50610c8f836001600160401b03831660046112ff565b61129683601b611fe0600586901b16176112da565b50610c8f836001600160401b03831660086112ff565b6040805180820190915260608152600060208201526112d383846000015151848551611325565b9392505050565b6040805180820190915260608152600060208201526112d3838460000151518461140f565b604080518082019091526060815260006020820152610fae84856000015151858561146b565b604080518082019091526060815260006020820152825182111561134857600080fd5b60208501516113578386611d17565b111561138a5761138a8561137a876020015187866113759190611d17565b6114ec565b611385906002611e2e565b611503565b6000808651805187602083010193508088870111156113a95787860182525b505050602084015b602084106113e957805182526113c8602083611d17565b91506113d5602082611d17565b90506113e2602085611e4d565b93506113b1565b51815160001960208690036101000a019081169019919091161790525083949350505050565b604080518082019091526060815260006020820152836020015183106114445761144484856020015160026113859190611e2e565b835180516020858301018481535080851415611461576001810182525b5093949350505050565b604080518082019091526060815260006020820152602085015161148f8584611d17565b11156114a3576114a38561137a8685611d17565b600060016114b384610100611d86565b6114bd9190611e4d565b90508551838682010185831982511617815250805184870111156114e15783860181525b509495945050505050565b6000818311156114fd57508161119f565b50919050565b815161150f838361113a565b50610c8f83826112ac565b82805461152690611e64565b90600052602060002090601f016020900481019282611548576000855561158e565b82601f1061156157805160ff191683800117855561158e565b8280016001018555821561158e579182015b8281111561158e578251825591602001919060010190611573565b5061159a92915061164d565b5090565b8280546115aa90611e64565b90600052602060002090601f0160209004810192826115cc576000855561158e565b82601f106115e55782800160ff1982351617855561158e565b8280016001018555821561158e579182015b8281111561158e5782358255916020019190600101906115f7565b6040805160a0810182526000808252602080830182905282840182905260608084018390528451808601909552845283015290608082015290565b5b8082111561159a576000815560010161164e565b80356001600160a01b038116811461167957600080fd5b919050565b60008083601f84011261168f578182fd5b5081356001600160401b038111156116a5578182fd5b6020830191508360208285010111156116bd57600080fd5b9250929050565b600082601f8301126116d4578081fd5b81356001600160401b03808211156116ee576116ee611ed9565b604051601f8301601f19908116603f0116810190828211818310171561171657611716611ed9565b8160405283815286602085880101111561172e578485fd5b8360208701602083013792830160200193909352509392505050565b60006020828403121561175b578081fd5b6112d382611662565b600080600060608486031215611778578182fd5b61178184611662565b925060208401356001600160401b038082111561179c578384fd5b6117a8878388016116c4565b935060408601359150808211156117bd578283fd5b506117ca868287016116c4565b9150509250925092565b600080600080608085870312156117e9578081fd5b6117f285611662565b935060208501356001600160401b038082111561180d578283fd5b611819888389016116c4565b9450604087013591508082111561182e578283fd5b61183a888389016116c4565b9350606087013591508082111561184f578283fd5b5061185c878288016116c4565b91505092959194509250565b600080600080600060a0868803121561187f578081fd5b61188886611662565b945060208601356001600160401b03808211156118a3578283fd5b6118af89838a016116c4565b955060408801359150808211156118c4578283fd5b6118d089838a016116c4565b945060608801359150808211156118e5578283fd5b6118f189838a016116c4565b93506080880135915080821115611906578283fd5b50611913888289016116c4565b9150509295509295909350565b600060208284031215611931578081fd5b815180151581146112d3578182fd5b60008060008060008060008060c0898b03121561195b578283fd5b8835975060208901356001600160401b0380821115611978578485fd5b6119848c838d0161167e565b909950975060408b013591508082111561199c578485fd5b506119a98b828c0161167e565b999c989b5096999698976060880135976080810135975060a0013595509350505050565b6000806000606084860312156119e1578283fd5b8335925060208401356001600160401b038082111561179c578384fd5b60008060008060008060c08789031215611a16578182fd5b8635955060208701356001600160401b0380821115611a33578384fd5b611a3f8a838b016116c4565b96506040890135915080821115611a54578384fd5b611a608a838b016116c4565b95506060890135915080821115611a75578384fd5b50611a8289828a016116c4565b9350506080870135915060a087013590509295509295509295565b60008060008060808587031215611ab2578384fd5b843593506020850135925060408501356001600160e01b031981168114611ad7578283fd5b9396929550929360600135925050565b600060208284031215611af8578081fd5b5051919050565b60008151808452815b81811015611b2457602081850181015186830182015201611b08565b81811115611b355782602083870101525b50601f01601f19169290920160200192915050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b0389811682526020820189905260408201889052861660608201526001600160e01b03198516608082015260a0810184905260c0810183905261010060e08201819052600090611bcc83820185611aff565b9b9a5050505050505050505050565b60018060a01b0384168152826020820152606060408201526000610d346060830184611aff565b60a081526000611c1660a08301898b611b4a565b8281036020840152611c2981888a611b4a565b604084019690965250506060810192909252608090910152949350505050565b6020815260006112d36020830184611aff565b604081526000611c6f6040830185611aff565b8281036020840152610d348185611aff565b60a081526000611c9460a0830188611aff565b8281036020840152611ca68188611aff565b90508281036040840152611cba8187611aff565b60608401959095525050608001529392505050565b60208082526028908201527f536f75726365206d75737420626520746865206f7261636c65206f6620746865604082015267081c995c5d595cdd60c21b606082015260800190565b60008219821115611d2a57611d2a611ead565b500190565b600082611d3e57611d3e611ec3565b500490565b600181815b80851115611d7e578160001904821115611d6457611d64611ead565b80851615611d7157918102915b93841c9390800290611d48565b509250929050565b60006112d38383600082611d9c5750600161119f565b81611da95750600061119f565b8160018114611dbf5760028114611dc957611de5565b600191505061119f565b60ff841115611dda57611dda611ead565b50506001821b61119f565b5060208310610133831016604e8410600b8410161715611e08575081810a61119f565b611e128383611d43565b8060001904821115611e2657611e26611ead565b029392505050565b6000816000190483118215151615611e4857611e48611ead565b500290565b600082821015611e5f57611e5f611ead565b500390565b600181811c90821680611e7857607f821691505b602082108114156114fd57634e487b7160e01b600052602260045260246000fd5b600082611ea857611ea8611ec3565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea264697066735822122002c949cb9b020c30d9e6a4afb14f76674b5f5ded444394a6bec44f956c3ba6ce64736f6c63430008040033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ 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.