{"id":19107365,"url":"https://github.com/smartcontractkit/prediction-game","last_synced_at":"2025-07-13T17:33:43.718Z","repository":{"id":197595910,"uuid":"698164720","full_name":"smartcontractkit/prediction-game","owner":"smartcontractkit","description":"Rugby prediction game using Chainlink Functions, Automation, and CCIP.","archived":false,"fork":false,"pushed_at":"2024-05-22T21:23:08.000Z","size":1550,"stargazers_count":62,"open_issues_count":1,"forks_count":41,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-14T16:47:58.646Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://rugby-demo.app/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smartcontractkit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-29T09:54:14.000Z","updated_at":"2025-02-27T01:04:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"7752b4ba-20ce-4775-be59-2c4a800d9a3f","html_url":"https://github.com/smartcontractkit/prediction-game","commit_stats":null,"previous_names":["smartcontractkit/prediction-game"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/smartcontractkit/prediction-game","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartcontractkit%2Fprediction-game","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartcontractkit%2Fprediction-game/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartcontractkit%2Fprediction-game/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartcontractkit%2Fprediction-game/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smartcontractkit","download_url":"https://codeload.github.com/smartcontractkit/prediction-game/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartcontractkit%2Fprediction-game/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265179125,"owners_count":23723410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T04:12:21.146Z","updated_at":"2025-07-13T17:33:43.684Z","avatar_url":"https://github.com/smartcontractkit.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rugby Prediction Game\n\n\u003e **Note**\n\u003e\n\u003e _This demo represents an educational example to use a Chainlink system, product, or service and is provided to demonstrate how to interact with Chainlink’s systems, products, and services to integrate them into your own. This template is provided “AS IS” and “AS AVAILABLE” without warranties of any kind, it has not been audited, and it may be missing key checks or error handling to make the usage of the system, product or service more clear. Do not use the code in this example in a production environment without completing your own audits and application of best practices. Neither Chainlink Labs, the Chainlink Foundation, nor Chainlink node operators are responsible for unintended outputs that are generated due to errors in code._\n\nThis project has been developed for educational purposes only and is not meant to be used for gambling.\n\nThis project demostrates how to build a smart contract based application using real time sports data via [Chainlink Functions](https://docs.chain.link/chainlink-functions).\n\nAdditionally, the project showcases how to send automatic payouts using [Chainlink Automation](https://chain.link/automation) and how to transfer tokens cross-chain using [Chainlink CCIP](https://chain.link/cross-chain).\n\n## Requirements\n\n- Node.js version [18](https://nodejs.org/en/download/) or higher\n\n## Getting Started\n\nClone the repo:\n\n```bash\ngit clone https://github.com/smartcontractkit/prediction-game\n```\n\nIt contains two separate projects:\n\n- [`contracts`](./contracts/) - the smart contracts\n- [`app`](./app/) - the frontend\n\nNavigate to each directory and follow the instructions in their respective README files, starting with the contracts.\n\n## Solution Overview\n\n\u003cimg src=\"./solution-diagram.png\" alt=\"Solution\" width=\"100%\"/\u003e\u003cbr\u003e\n\nCode references:\n\n1. Predict game result: [PredictionGame.sol#L116](./contracts/contracts/SportsPredictionGame.sol#L116)\n2. Check for finished games: [PredictionGame.sol#379](./contracts/contracts/SportsPredictionGame.sol#L379)\n3. Request game result: [ResultsConsumer.sol#L65](./contracts/contracts/ResultsConsumer.sol#L65)\n4. Fetch game result: [sports-api.js#L63](./contracts/sports-api.js#L63)\n5. Fulfill game result request [ResultsConsumer.sol#L105](./contracts/contracts/ResultsConsumer.sol#L105)\n6. Claim winnings [SportsPredictionGame.sol#L151](./contracts/contracts/SportsPredictionGame.sol#L151)\u003cbr\u003e\n   6.1 Transfer winnings [NativeTokenSender.sol#L66](./contracts/contracts/ccip/NativeTokenSender.sol#L66)\n\n## Resources\n\n- [Chainlink Functions Docs](https://docs.chain.link/chainlink-functions)\n- [Chainlink Automation Docs](https://docs.chain.link/chainlink-automation/introduction)\n- [Chainlink CCIP Docs](https://docs.chain.link/ccip)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartcontractkit%2Fprediction-game","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartcontractkit%2Fprediction-game","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartcontractkit%2Fprediction-game/lists"}