Skip to content

Instantly share code, notes, and snippets.

@beshup
Created May 14, 2021 23:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beshup/9060296662a21449cd0e60569efd0fac to your computer and use it in GitHub Desktop.
Save beshup/9060296662a21449cd0e60569efd0fac to your computer and use it in GitHub Desktop.
not actually javascript
function requestDividendWorthyEntities(string memory request_uri) public onlyOwner {
Chainlink.Request memory request = buildChainlinkRequest(nba_JOBID, address(this), this.fulfill.selector);
// Set the URL to perform the request on
request.add("get", request_uri);
request.add("path", "to_send");
bytes32 reqID = sendChainlinkRequestTo(nba_ORACLE, request, fee);
jobIdMapping[reqID] = msg.sender;
}
function fulfill(bytes32 reqID, uint256 payout) public recordChainlinkFulfillment(reqID)
{
require(jobIdMapping[reqID] != address(0x0));
payable(jobIdMapping[reqID]).transfer(payout);
jobIdMapping[reqID] = address(0x0);
//payout to jobIdMapping[randomID]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment