This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route('/to_send_per_entity/<int:entity_id>/<int:shares_owned>/<int:shares_in_circulation>/<int:dividend_fund>', methods=['GET']) | |
@cross_origin() | |
def to_send(entity_id, shares_owned, shares_in_circulation, dividend_fund): | |
if entity_id > LEAGUE_SIZE: | |
entity_id -= LEAGUE_SIZE | |
league = league_data() | |
entity_held_score = float(league[entity_id - 1]['fantasy_points']) | |
sum_scores = 0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function giveDividendPerPlayer(string memory request_uri) public hasSeasonStarted { | |
require(lastDividendWithdrawn[msg.sender] < currWeekStart); | |
lastDividendWithdrawn[msg.sender] = block.timestamp; | |
requestDividendWorthyEntities(request_uri); | |
} |
NewerOlder