https://github.com/antoncoding/epuesta
Decentralized betting framework on football. With Ethereum and ChainLink.
https://github.com/antoncoding/epuesta
Last synced: 24 days ago
JSON representation
Decentralized betting framework on football. With Ethereum and ChainLink.
- Host: GitHub
- URL: https://github.com/antoncoding/epuesta
- Owner: antoncoding
- Created: 2019-09-15T08:54:51.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-13T09:47:33.000Z (almost 6 years ago)
- Last Synced: 2025-04-03T12:22:16.858Z (3 months ago)
- Language: Solidity
- Homepage:
- Size: 48.8 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Epuesta
Epuesta is a decentralized betting broker framework built with ChainLink.

Everyone can create a new contract with our framework on Ethereum as a broker for a specific match, you can customize your need and offer different deals with the contract.
The finality of a match is provided by Chainlink nodes in an decentralized manner, and result is distributed fairly with the contract.
## Integration for Node Operators
### Add New Bridge - apifootball
Currently using [Apifootball](https://apifootball.com/documentation/) as our data source.
A sample RESTful API external adopter can be found at [this repo](https://github.com/antoncoding/apifootball-adopter).Run it yourself or use our heroku server, then create a new **apifootball** Bridge with the adopter url.
Our adopter is deployed at:
```url
https://apifootball-adopter.herokuapp.com/
```
### Add New Jobs
With our current design, a chainlink node has to add two jobs in order to be capable of being Epuesta data source oracle.
The job specs can be found in `jobs/`

## Contract Creator
### Request Team Score
```solidity
Chainlink.Request memory req = buildChainlinkRequest(stringToBytes32(MATCH_SCORE_JOBID), this, this.callbackHometeamScore.selector);
req.add("match_id", matchId);
req.add("copyPath", "match_hometeam_score");
sendChainlinkRequestTo(oracle, req, ORACLE_PAYMENT);
```Response in `uint256`
### Verify Match Data
**Check Match Live**
```solidity
Chainlink.Request memory req = buildChainlinkRequest(stringToBytes32(MATCH_STATUS_JOBID), this, this.callbackMatchStarted.selector);
req.add("match_id", matchId);
req.add("copyPath", "match_live");
req.add("operator", "eq");
req.add("value", "1");
sendChainlinkRequestTo(oracle, req, ORACLE_PAYMENT);
```Response in `boolean`