Skip to content

Credict: credible prediction records. Project for Chainlink Hackathon Spring 2022.

License

Notifications You must be signed in to change notification settings

phurwicz/credict-chainlink-spring22

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

credict-chainlink-spring22

Credibly predict oracles. Project for Chainlink Hackathon Spring 2022

Getting started

Interact with existing contract instances

PredictionRecorder: stores prediction data in a trust-worthy way

InvitationalBet: a showcase application that reads prediction data and oracle rounds to bet

This work is mostly a single Solidity file: PredictionRecorder.sol. You can deploy two contracts and verify their source codes. Then you can interact with the deployed contracts using any Web3 provider.

Deploy and verify new instances

Dependencies

hdwallet-provider is for authentication and truffle-plugin-verify is for verifying source codes that contain imports.

npm install @truffle/hdwallet-provider
npm install -D truffle-plugin-verify

Environment variables

In the truffle folder you need two files to locally configure authentication credentials.

  • create a .env file to hold INFURA_PROJECT_ID and ETHERSCAN_API_KEY.
  • create a .secret fild to hold mnenomics (space-separated words, typically 12 of them) that generate your HDWallet.

Deploy!

To deploy PredictionRecorder or InvitationalBet, modify the comments in migrations.js.

  • for PredictionRecorder, you need to set the target oracle address. Note that this can vary between different networks.
  • for InvitationalBet, you need to set the PredictionRecorder address, invited participants, and timeframe / watermark parameters.

When your deployment parameters are ready, do

truffle deploy --network rinkeby
truffle run verify <either-PredictionRecorder-or-InvitationalBet> --network rinkeby

Optional Python API

Secure original predictions need encryption, decryption, and watermarks, which we suggest managing programmatically. For instance, you can consider taking a look at the python folder to use credict-py. It takes care of RSA encryption and watermarks.

About

Credict: credible prediction records. Project for Chainlink Hackathon Spring 2022.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published