Contract 0x898fef163ec73cebcb4546d15556115ae98d2d23 3

 
 
Txn Hash
Method
Block
From
To
Value [Txn Fee]
0xebc25e8f96f987bb3f18135e57d694224798eb6d2ad3b6ea41f11212949a8859Withdraw361306632022-11-27 11:56:30310 days 21 hrs ago0xe228c1d22cd951ec63fcf9bcbe7d43a5d3c1d04e IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.002336075087 35.953444974
0x76b0f9250959ccc3f24cb15302f2b956eec4696712cb13ed2ffaee1a1de37b6eFulfill Oracle R...361277312022-11-27 10:09:26310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00088086432
0xe332c0d10038e002462be3aecbd7cf5a32dfb4f7f5f4afaa0dc2395f4814630eFulfill Oracle R...361277222022-11-27 10:09:06310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153513632
0xd72835696c1da22b0348c2f843902c19300ef5d0e80288fd7b8f52e6eebc04f9Fulfill Oracle R...361277222022-11-27 10:09:06310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153484832
0xc231dfcf045530fe7a7a5e93eae0a6ba0014ccc1f9f0218f87f9346569f25c75Fulfill Oracle R...361277222022-11-27 10:09:06310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153513632
0x3b47694796c780bf4fea5f08dc002e3b21edafa4d076b8571ba60b9d9b56c08fFulfill Oracle R...361277222022-11-27 10:09:06310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153452832
0xe38b9983dbd75c600885a6ec1ec2cf71a462e249df0dff0c501f9ec1c4959229Fulfill Oracle R...361277222022-11-27 10:09:06310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00088124832
0xca2314bb83cd15ae59a0e1f7b68d9e2f93c8a76adddfdc2f94f80daf6a63d1b9Fulfill Oracle R...361277222022-11-27 10:09:06310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153513632
0x89f001e6aa4592f220ad552c2e45d6b8943a663b966f7e7358947ab05bc416b0Fulfill Oracle R...361277222022-11-27 10:09:06310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153484832
0x801dbe97204fdb54e227813b709246a82690ad1b4c8f39d5e8b9457061de6953Fulfill Oracle R...361277222022-11-27 10:09:06310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153513632
0xbfcf0dd2b44c024fd3b5149e8a7605cb9deccd13fd7c255a90f9655bdca88ed0Fulfill Oracle R...361277222022-11-27 10:09:06310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153513632
0x5a9408577738092ade812fe8eec880906bd1263c1c84ee19bdfacab9d78e4cbaFulfill Oracle R...361277222022-11-27 10:09:06310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153513632
0x313ebe64f9c8b52b9266971dc8909191f750e310485138f6f63b25fa4e707278Fulfill Oracle R...361277222022-11-27 10:09:06310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153513632
0x70cb6fe2a0d26808a4d3819c7c4b7e88617d41547131d2253eea02bbb6bd99bfFulfill Oracle R...361277222022-11-27 10:09:06310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153513632
0xcde07bf45fc2b60ee45e6b27347f8611484cccaa5450fc435ee1fd92a0a176fdFulfill Oracle R...361277222022-11-27 10:09:06310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153513632
0x1743eda1a7edfc1e850ea020857954d7aecb77fcafe5cdf3727dce08e4295980Fulfill Oracle R...361277222022-11-27 10:09:06310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153513632
0xa1b4720fc5a819b2162ef2595a51bfe86f05d2c2dd1d105a140bbbb8330bc308Fulfill Oracle R...361277212022-11-27 10:09:04310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153513632
0x5ad57f82061ebbf595510ef65b473893416f59a0987fb92f549bf05457800369Fulfill Oracle R...361277212022-11-27 10:09:04310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153513632
0xd32c1f93baaaa714b6283731d6fc914c39551e7f5bb691343c919fb7feb05079Fulfill Oracle R...361277212022-11-27 10:09:04310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153513632
0x969b50e9c92011d0c046d12bfced73bc6fbd304e5dbbf038d3824d7d584e86f9Fulfill Oracle R...361277212022-11-27 10:09:04310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153513632
0x42a282956b2dd0527b35215ec70618ca57a14c4863676d64dfaef14614658e26Fulfill Oracle R...361277212022-11-27 10:09:04310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153452832
0xcca427af7d10ad6af83482039d1354dd969e4376c3fbcd9505e08ac2ea28aaf9Fulfill Oracle R...361277212022-11-27 10:09:04310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153513632
0xb1025ba7da6a43545e304e9b8f76040b160c3239f09e8eb350df106dbf6360c1Fulfill Oracle R...361277212022-11-27 10:09:04310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153513632
0x97a6be67db863bbd5d53f40aa8c40966357620c63756005f5340a8d656128ef6Fulfill Oracle R...361277212022-11-27 10:09:04310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153513632
0xb01a2d0dbfc5335e0b33aa952b82753c8bc5641bc7e808d03cf1eff0e33d2aeeFulfill Oracle R...361277192022-11-27 10:09:00310 days 23 hrs ago0x0593f5dec67c490d9421943878ff130f39b059ac IN  0x898fef163ec73cebcb4546d15556115ae98d2d230 MATIC0.00153484832
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Similar Match Source Code
This contract matches the deployed ByteCode of the Source Code for Contract 0x3e2d29C646949019fd8F077b4854417C27dEeb6B
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
Oracle

Compiler Version
v0.6.6+commit.6c089d02

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 8 : Oracle.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.6;

import "./LinkTokenReceiver.sol";
import "./interfaces/ChainlinkRequestInterface.sol";
import "./interfaces/OracleInterface.sol";
import "./interfaces/LinkTokenInterface.sol";
import "./interfaces/WithdrawalInterface.sol";
import "./vendor/Ownable.sol";
import "./vendor/SafeMathChainlink.sol";

/**
 * @title The Chainlink Oracle contract
 * @notice Node operators can deploy this contract to fulfill requests sent to them
 */
contract Oracle is ChainlinkRequestInterface, OracleInterface, Ownable, LinkTokenReceiver, WithdrawalInterface {
  using SafeMathChainlink for uint256;

  uint256 constant public EXPIRY_TIME = 5 minutes;
  uint256 constant private MINIMUM_CONSUMER_GAS_LIMIT = 400000;
  // We initialize fields to 1 instead of 0 so that the first invocation
  // does not cost more gas.
  uint256 constant private ONE_FOR_CONSISTENT_GAS_COST = 1;

  LinkTokenInterface internal LinkToken;
  mapping(bytes32 => bytes32) private commitments;
  mapping(address => bool) private authorizedNodes;
  uint256 private withdrawableTokens = ONE_FOR_CONSISTENT_GAS_COST;

  event OracleRequest(
    bytes32 indexed specId,
    address requester,
    bytes32 requestId,
    uint256 payment,
    address callbackAddr,
    bytes4 callbackFunctionId,
    uint256 cancelExpiration,
    uint256 dataVersion,
    bytes data
  );

  event CancelOracleRequest(
    bytes32 indexed requestId
  );

  /**
   * @notice Deploy with the address of the LINK token
   * @dev Sets the LinkToken address for the imported LinkTokenInterface
   * @param _link The address of the LINK token
   */
  constructor(address _link)
    public
    Ownable()
  {
    LinkToken = LinkTokenInterface(_link); // external but already deployed and unalterable
  }

  /**
   * @notice Creates the Chainlink request
   * @dev Stores the hash of the params as the on-chain commitment for the request.
   * Emits OracleRequest event for the Chainlink node to detect.
   * @param _sender The sender of the request
   * @param _payment The amount of payment given (specified in wei)
   * @param _specId The Job Specification ID
   * @param _callbackAddress The callback address for the response
   * @param _callbackFunctionId The callback function ID for the response
   * @param _nonce The nonce sent by the requester
   * @param _dataVersion The specified data version
   * @param _data The CBOR payload of the request
   */
  function oracleRequest(
    address _sender,
    uint256 _payment,
    bytes32 _specId,
    address _callbackAddress,
    bytes4 _callbackFunctionId,
    uint256 _nonce,
    uint256 _dataVersion,
    bytes calldata _data
  )
    external
    override
    onlyLINK()
    checkCallbackAddress(_callbackAddress)
  {
    bytes32 requestId = keccak256(abi.encodePacked(_sender, _nonce));
    require(commitments[requestId] == 0, "Must use a unique ID");
    // solhint-disable-next-line not-rely-on-time
    uint256 expiration = now.add(EXPIRY_TIME);

    commitments[requestId] = keccak256(
      abi.encodePacked(
        _payment,
        _callbackAddress,
        _callbackFunctionId,
        expiration
      )
    );

    emit OracleRequest(
      _specId,
      _sender,
      requestId,
      _payment,
      _callbackAddress,
      _callbackFunctionId,
      expiration,
      _dataVersion,
      _data);
  }

  /**
   * @notice Called by the Chainlink node to fulfill requests
   * @dev Given params must hash back to the commitment stored from `oracleRequest`.
   * Will call the callback address' callback function without bubbling up error
   * checking in a `require` so that the node can get paid.
   * @param _requestId The fulfillment request ID that must match the requester's
   * @param _payment The payment amount that will be released for the oracle (specified in wei)
   * @param _callbackAddress The callback address to call for fulfillment
   * @param _callbackFunctionId The callback function ID to use for fulfillment
   * @param _expiration The expiration that the node should respond by before the requester can cancel
   * @param _data The data to return to the consuming contract
   * @return Status if the external call was successful
   */
  function fulfillOracleRequest(
    bytes32 _requestId,
    uint256 _payment,
    address _callbackAddress,
    bytes4 _callbackFunctionId,
    uint256 _expiration,
    bytes32 _data
  )
    external
    onlyAuthorizedNode
    override
    isValidRequest(_requestId)
    returns (bool)
  {
    bytes32 paramsHash = keccak256(
      abi.encodePacked(
        _payment,
        _callbackAddress,
        _callbackFunctionId,
        _expiration
      )
    );
    require(commitments[_requestId] == paramsHash, "Params do not match request ID");
    withdrawableTokens = withdrawableTokens.add(_payment);
    delete commitments[_requestId];
    require(gasleft() >= MINIMUM_CONSUMER_GAS_LIMIT, "Must provide consumer enough gas");
    // All updates to the oracle's fulfillment should come before calling the
    // callback(addr+functionId) as it is untrusted.
    // See: https://solidity.readthedocs.io/en/develop/security-considerations.html#use-the-checks-effects-interactions-pattern
    (bool success, ) = _callbackAddress.call(abi.encodeWithSelector(_callbackFunctionId, _requestId, _data)); // solhint-disable-line avoid-low-level-calls
    return success;
  }

  /**
   * @notice Use this to check if a node is authorized for fulfilling requests
   * @param _node The address of the Chainlink node
   * @return The authorization status of the node
   */
  function getAuthorizationStatus(address _node)
    external
    view
    override
    returns (bool)
  {
    return authorizedNodes[_node];
  }

  /**
   * @notice Sets the fulfillment permission for a given node. Use `true` to allow, `false` to disallow.
   * @param _node The address of the Chainlink node
   * @param _allowed Bool value to determine if the node can fulfill requests
   */
  function setFulfillmentPermission(address _node, bool _allowed)
    external
    override
    onlyOwner()
  {
    authorizedNodes[_node] = _allowed;
  }

  /**
   * @notice Allows the node operator to withdraw earned LINK to a given address
   * @dev The owner of the contract can be another wallet and does not have to be a Chainlink node
   * @param _recipient The address to send the LINK token to
   * @param _amount The amount to send (specified in wei)
   */
  function withdraw(address _recipient, uint256 _amount)
    external
    override(OracleInterface, WithdrawalInterface)
    onlyOwner
    hasAvailableFunds(_amount)
  {
    withdrawableTokens = withdrawableTokens.sub(_amount);
    assert(LinkToken.transfer(_recipient, _amount));
  }

  /**
   * @notice Displays the amount of LINK that is available for the node operator to withdraw
   * @dev We use `ONE_FOR_CONSISTENT_GAS_COST` in place of 0 in storage
   * @return The amount of withdrawable LINK on the contract
   */
  function withdrawable()
    external
    view
    override(OracleInterface, WithdrawalInterface)
    onlyOwner()
    returns (uint256)
  {
    return withdrawableTokens.sub(ONE_FOR_CONSISTENT_GAS_COST);
  }

  /**
   * @notice Allows requesters to cancel requests sent to this oracle contract. Will transfer the LINK
   * sent for the request back to the requester's address.
   * @dev Given params must hash to a commitment stored on the contract in order for the request to be valid
   * Emits CancelOracleRequest event.
   * @param _requestId The request ID
   * @param _payment The amount of payment given (specified in wei)
   * @param _callbackFunc The requester's specified callback address
   * @param _expiration The time of the expiration for the request
   */
  function cancelOracleRequest(
    bytes32 _requestId,
    uint256 _payment,
    bytes4 _callbackFunc,
    uint256 _expiration
  )
    external
    override
  {
    bytes32 paramsHash = keccak256(
      abi.encodePacked(
        _payment,
        msg.sender,
        _callbackFunc,
        _expiration)
    );
    require(paramsHash == commitments[_requestId], "Params do not match request ID");
    // solhint-disable-next-line not-rely-on-time
    require(_expiration <= now, "Request is not expired");

    delete commitments[_requestId];
    emit CancelOracleRequest(_requestId);

    assert(LinkToken.transfer(msg.sender, _payment));
  }

  /**
   * @notice Returns the address of the LINK token
   * @dev This is the public implementation for chainlinkTokenAddress, which is
   * an internal method of the ChainlinkClient contract
   */
  function getChainlinkToken()
    public
    view
    override
    returns (address)
  {
    return address(LinkToken);
  }

  // MODIFIERS

  /**
   * @dev Reverts if amount requested is greater than withdrawable balance
   * @param _amount The given amount to compare to `withdrawableTokens`
   */
  modifier hasAvailableFunds(uint256 _amount) {
    require(withdrawableTokens >= _amount.add(ONE_FOR_CONSISTENT_GAS_COST), "Amount requested is greater than withdrawable balance");
    _;
  }

  /**
   * @dev Reverts if request ID does not exist
   * @param _requestId The given request ID to check in stored `commitments`
   */
  modifier isValidRequest(bytes32 _requestId) {
    require(commitments[_requestId] != 0, "Must have a valid requestId");
    _;
  }

  /**
   * @dev Reverts if `msg.sender` is not authorized to fulfill requests
   */
  modifier onlyAuthorizedNode() {
    require(authorizedNodes[msg.sender] || msg.sender == owner(), "Not an authorized node to fulfill requests");
    _;
  }

  /**
   * @dev Reverts if the callback address is the LINK token
   * @param _to The callback address
   */
  modifier checkCallbackAddress(address _to) {
    require(_to != address(LinkToken), "Cannot callback to LINK");
    _;
  }

}

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

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

    return c;
  }

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

    return c;
  }

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

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

    return c;
  }

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

    return c;
  }

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

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

/**
 * @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.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be aplied to your functions to restrict their use to
 * the owner.
 *
 * This contract has been modified to remove the revokeOwnership function
 */
contract Ownable {
  address private _owner;

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

  /**
   * @dev Initializes the contract setting the deployer as the initial owner.
   */
  constructor () internal {
    _owner = msg.sender;
    emit OwnershipTransferred(address(0), _owner);
  }

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

  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(isOwner(), "Ownable: caller is not the owner");
    _;
  }

  /**
   * @dev Returns true if the caller is the current owner.
   */
  function isOwner() public view returns (bool) {
    return msg.sender == _owner;
  }

  /**
   * @dev Transfers ownership of the contract to a new account (`newOwner`).
   * Can only be called by the current owner.
   */
  function transferOwnership(address newOwner) public onlyOwner {
    _transferOwnership(newOwner);
  }

  /**
   * @dev Transfers ownership of the contract to a new account (`newOwner`).
   */
  function _transferOwnership(address newOwner) internal {
    require(newOwner != address(0), "Ownable: new owner is the zero address");
    emit OwnershipTransferred(_owner, newOwner);
    _owner = newOwner;
  }
}

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

interface WithdrawalInterface {
  /**
   * @notice transfer LINK held by the contract belonging to msg.sender to
   * another address
   * @param recipient is the address to send the LINK to
   * @param amount is the amount of LINK to send
   */
  function withdraw(address recipient, uint256 amount) external;

  /**
   * @notice query the available amount of LINK to withdraw by msg.sender
   */
  function withdrawable() external view returns (uint256);
}

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

interface OracleInterface {
  function fulfillOracleRequest(
    bytes32 requestId,
    uint256 payment,
    address callbackAddress,
    bytes4 callbackFunctionId,
    uint256 expiration,
    bytes32 data
  ) external returns (bool);
  function getAuthorizationStatus(address node) external view returns (bool);
  function setFulfillmentPermission(address node, bool allowed) external;
  function withdraw(address recipient, uint256 amount) external;
  function withdrawable() external view returns (uint256);
}

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

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

File 7 of 8 : ChainlinkRequestInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.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 8 : LinkTokenReceiver.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;

abstract contract LinkTokenReceiver {

  bytes4 constant private ORACLE_REQUEST_SELECTOR = 0x40429946;
  uint256 constant private SELECTOR_LENGTH = 4;
  uint256 constant private EXPECTED_REQUEST_WORDS = 2;
  uint256 constant private MINIMUM_REQUEST_LENGTH = SELECTOR_LENGTH + (32 * EXPECTED_REQUEST_WORDS);
  /**
   * @notice Called when LINK is sent to the contract via `transferAndCall`
   * @dev The data payload's first 2 words will be overwritten by the `_sender` and `_amount`
   * values to ensure correctness. Calls oracleRequest.
   * @param _sender Address of the sender
   * @param _amount Amount of LINK sent (specified in wei)
   * @param _data Payload of the transaction
   */
  function onTokenTransfer(
    address _sender,
    uint256 _amount,
    bytes memory _data
  )
    public
    onlyLINK
    validRequestLength(_data)
    permittedFunctionsForLINK(_data)
  {
    assembly {
      // solhint-disable-next-line avoid-low-level-calls
      mstore(add(_data, 36), _sender) // ensure correct sender is passed
      // solhint-disable-next-line avoid-low-level-calls
      mstore(add(_data, 68), _amount)    // ensure correct amount is passed
    }
    // solhint-disable-next-line avoid-low-level-calls
    (bool success, ) = address(this).delegatecall(_data); // calls oracleRequest
    require(success, "Unable to create request");
  }

  function getChainlinkToken() public view virtual returns (address);

  /**
   * @dev Reverts if not sent from the LINK token
   */
  modifier onlyLINK() {
    require(msg.sender == getChainlinkToken(), "Must use LINK token");
    _;
  }

  /**
   * @dev Reverts if the given data does not begin with the `oracleRequest` function selector
   * @param _data The data payload of the request
   */
  modifier permittedFunctionsForLINK(bytes memory _data) {
    bytes4 funcSelector;
    assembly {
      // solhint-disable-next-line avoid-low-level-calls
      funcSelector := mload(add(_data, 32))
    }
    require(funcSelector == ORACLE_REQUEST_SELECTOR, "Must use whitelisted functions");
    _;
  }

  /**
   * @dev Reverts if the given payload is less than needed to create a request
   * @param _data The request payload
   */
  modifier validRequestLength(bytes memory _data) {
    require(_data.length >= MINIMUM_REQUEST_LENGTH, "Invalid request length");
    _;
  }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_link","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"requestId","type":"bytes32"}],"name":"CancelOracleRequest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"specId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"requester","type":"address"},{"indexed":false,"internalType":"bytes32","name":"requestId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"payment","type":"uint256"},{"indexed":false,"internalType":"address","name":"callbackAddr","type":"address"},{"indexed":false,"internalType":"bytes4","name":"callbackFunctionId","type":"bytes4"},{"indexed":false,"internalType":"uint256","name":"cancelExpiration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"dataVersion","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"OracleRequest","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"},{"inputs":[],"name":"EXPIRY_TIME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"internalType":"uint256","name":"_payment","type":"uint256"},{"internalType":"bytes4","name":"_callbackFunc","type":"bytes4"},{"internalType":"uint256","name":"_expiration","type":"uint256"}],"name":"cancelOracleRequest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_requestId","type":"bytes32"},{"internalType":"uint256","name":"_payment","type":"uint256"},{"internalType":"address","name":"_callbackAddress","type":"address"},{"internalType":"bytes4","name":"_callbackFunctionId","type":"bytes4"},{"internalType":"uint256","name":"_expiration","type":"uint256"},{"internalType":"bytes32","name":"_data","type":"bytes32"}],"name":"fulfillOracleRequest","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_node","type":"address"}],"name":"getAuthorizationStatus","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getChainlinkToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"onTokenTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"},{"internalType":"uint256","name":"_payment","type":"uint256"},{"internalType":"bytes32","name":"_specId","type":"bytes32"},{"internalType":"address","name":"_callbackAddress","type":"address"},{"internalType":"bytes4","name":"_callbackFunctionId","type":"bytes4"},{"internalType":"uint256","name":"_nonce","type":"uint256"},{"internalType":"uint256","name":"_dataVersion","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"oracleRequest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_node","type":"address"},{"internalType":"bool","name":"_allowed","type":"bool"}],"name":"setFulfillmentPermission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

6080604052600160045534801561001557600080fd5b506040516113363803806113368339818101604052602081101561003857600080fd5b5051600080546001600160a01b03191633178082556040516001600160a01b039190911691907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3600180546001600160a01b0319166001600160a01b0392909216919091179055611284806100b26000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c80637fcd56db1161008c578063a4c0ed3611610066578063a4c0ed36146102a6578063d3e9c31414610361578063f2fde38b14610387578063f3fef3a3146103ad576100cf565b80637fcd56db146102685780638da5cb5b146102965780638f32d59b1461029e576100cf565b8063165d35e1146100d457806340429946146100f85780634ab0d190146101ab5780634b6022821461020d57806350188301146102275780636ee4d5531461022f575b600080fd5b6100dc6103d9565b604080516001600160a01b039092168252519081900360200190f35b6101a9600480360361010081101561010f57600080fd5b6001600160a01b038235811692602081013592604082013592606083013516916001600160e01b03196080820135169160a08201359160c081013591810190610100810160e082013564010000000081111561016a57600080fd5b82018360208201111561017c57600080fd5b8035906020019184600183028401116401000000008311171561019e57600080fd5b5090925090506103e8565b005b6101f9600480360360c08110156101c157600080fd5b508035906020810135906001600160a01b03604082013516906001600160e01b03196060820135169060808101359060a001356106be565b604080519115158252519081900360200190f35b6102156109b8565b60408051918252519081900360200190f35b6102156109be565b6101a96004803603608081101561024557600080fd5b508035906020810135906001600160e01b03196040820135169060600135610a20565b6101a96004803603604081101561027e57600080fd5b506001600160a01b0381351690602001351515610bda565b6100dc610c4c565b6101f9610c5b565b6101a9600480360360608110156102bc57600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156102ec57600080fd5b8201836020820111156102fe57600080fd5b8035906020019184600183028401116401000000008311171561032057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610c6c945050505050565b6101f96004803603602081101561037757600080fd5b50356001600160a01b0316610e99565b6101a96004803603602081101561039d57600080fd5b50356001600160a01b0316610eb7565b6101a9600480360360408110156103c357600080fd5b506001600160a01b038135169060200135610f0a565b6001546001600160a01b031690565b6103f06103d9565b6001600160a01b0316336001600160a01b03161461044b576040805162461bcd60e51b815260206004820152601360248201527226bab9ba103ab9b2902624a725903a37b5b2b760691b604482015290519081900360640190fd5b60015486906001600160a01b03808316911614156104b0576040805162461bcd60e51b815260206004820152601760248201527f43616e6e6f742063616c6c6261636b20746f204c494e4b000000000000000000604482015290519081900360640190fd5b604080516bffffffffffffffffffffffff1960608d901b166020808301919091526034808301899052835180840390910181526054909201835281519181019190912060008181526002909252919020541561054a576040805162461bcd60e51b8152602060048201526014602482015273135d5cdd081d5cd94818481d5b9a5c5d5948125160621b604482015290519081900360640190fd5b600061055e4261012c63ffffffff61104b16565b90508a89898360405160200180858152602001846001600160a01b03166001600160a01b031660601b8152601401836001600160e01b0319166001600160e01b0319168152600401828152602001945050505050604051602081830303815290604052805190602001206002600084815260200190815260200160002081905550897fd8d7ecc4800d25fa53ce0372f13a416d98907a7ef3d8d3bdd79cf4fe75529c658d848e8d8d878d8d8d604051808a6001600160a01b03166001600160a01b03168152602001898152602001888152602001876001600160a01b03166001600160a01b03168152602001866001600160e01b0319166001600160e01b0319168152602001858152602001848152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039c50909a5050505050505050505050a2505050505050505050505050565b3360009081526003602052604081205460ff16806106f457506106df610c4c565b6001600160a01b0316336001600160a01b0316145b61072f5760405162461bcd60e51b815260040180806020018281038252602a815260200180611205602a913960400191505060405180910390fd5b6000878152600260205260409020548790610791576040805162461bcd60e51b815260206004820152601b60248201527f4d757374206861766520612076616c6964207265717565737449640000000000604482015290519081900360640190fd5b6040805160208082018a90526bffffffffffffffffffffffff1960608a901b16828401526001600160e01b0319881660548301526058808301889052835180840390910181526078909201835281519181019190912060008b81526002909252919020548114610848576040805162461bcd60e51b815260206004820152601e60248201527f506172616d7320646f206e6f74206d6174636820726571756573742049440000604482015290519081900360640190fd5b60045461085b908963ffffffff61104b16565b60045560008981526002602052604081205562061a805a10156108c5576040805162461bcd60e51b815260206004820181905260248201527f4d7573742070726f7669646520636f6e73756d657220656e6f75676820676173604482015290519081900360640190fd5b60408051602481018b9052604480820187905282518083039091018152606490910182526020810180516001600160e01b03166001600160e01b03198a16178152915181516000936001600160a01b038c169392918291908083835b602083106109405780518252601f199092019160209182019101610921565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146109a2576040519150601f19603f3d011682016040523d82523d6000602084013e6109a7565b606091505b50909b9a5050505050505050505050565b61012c81565b60006109c8610c5b565b610a07576040805162461bcd60e51b8152602060048201819052602482015260008051602061122f833981519152604482015290519081900360640190fd5b600454610a1b90600163ffffffff6110ac16565b905090565b6040805160208082018690523360601b828401526001600160e01b0319851660548301526058808301859052835180840390910181526078909201835281519181019190912060008781526002909252919020548114610ac7576040805162461bcd60e51b815260206004820152601e60248201527f506172616d7320646f206e6f74206d6174636820726571756573742049440000604482015290519081900360640190fd5b42821115610b15576040805162461bcd60e51b815260206004820152601660248201527514995c5d595cdd081a5cc81b9bdd08195e1c1a5c995960521b604482015290519081900360640190fd5b6000858152600260205260408082208290555186917fa7842b9ec549398102c0d91b1b9919b2f20558aefdadf57528a95c6cd3292e9391a26001546040805163a9059cbb60e01b81523360048201526024810187905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b158015610ba157600080fd5b505af1158015610bb5573d6000803e3d6000fd5b505050506040513d6020811015610bcb57600080fd5b5051610bd357fe5b5050505050565b610be2610c5b565b610c21576040805162461bcd60e51b8152602060048201819052602482015260008051602061122f833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152600360205260409020805460ff1916911515919091179055565b6000546001600160a01b031690565b6000546001600160a01b0316331490565b610c746103d9565b6001600160a01b0316336001600160a01b031614610ccf576040805162461bcd60e51b815260206004820152601360248201527226bab9ba103ab9b2902624a725903a37b5b2b760691b604482015290519081900360640190fd5b8051819060441115610d21576040805162461bcd60e51b8152602060048201526016602482015275092dcecc2d8d2c840e4cae2eacae6e840d8cadccee8d60531b604482015290519081900360640190fd5b602082015182906001600160e01b031981166320214ca360e11b14610d8d576040805162461bcd60e51b815260206004820152601e60248201527f4d757374207573652077686974656c69737465642066756e6374696f6e730000604482015290519081900360640190fd5b8560248501528460448501526000306001600160a01b0316856040518082805190602001908083835b60208310610dd55780518252601f199092019160209182019101610db6565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610e35576040519150601f19603f3d011682016040523d82523d6000602084013e610e3a565b606091505b5050905080610e90576040805162461bcd60e51b815260206004820152601860248201527f556e61626c6520746f2063726561746520726571756573740000000000000000604482015290519081900360640190fd5b50505050505050565b6001600160a01b031660009081526003602052604090205460ff1690565b610ebf610c5b565b610efe576040805162461bcd60e51b8152602060048201819052602482015260008051602061122f833981519152604482015290519081900360640190fd5b610f0781611109565b50565b610f12610c5b565b610f51576040805162461bcd60e51b8152602060048201819052602482015260008051602061122f833981519152604482015290519081900360640190fd5b80610f6381600163ffffffff61104b16565b6004541015610fa35760405162461bcd60e51b81526004018080602001828103825260358152602001806111d06035913960400191505060405180910390fd5b600454610fb6908363ffffffff6110ac16565b60049081556001546040805163a9059cbb60e01b81526001600160a01b0387811694820194909452602481018690529051929091169163a9059cbb916044808201926020929091908290030181600087803b15801561101457600080fd5b505af1158015611028573d6000803e3d6000fd5b505050506040513d602081101561103e57600080fd5b505161104657fe5b505050565b6000828201838110156110a5576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600082821115611103576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6001600160a01b03811661114e5760405162461bcd60e51b81526004018080602001828103825260268152602001806111aa6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b039290921691909117905556fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416d6f756e74207265717565737465642069732067726561746572207468616e20776974686472617761626c652062616c616e63654e6f7420616e20617574686f72697a6564206e6f646520746f2066756c66696c6c2072657175657374734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220fda98e69ad52e03daca4bb89b8cab8aef1110220419f0d0cb8e4490839530e1464736f6c63430006060033000000000000000000000000b0897686c545045afc77cf20ec7a532e3120e0f1

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