Credibly predict oracles. Project for Chainlink Hackathon Spring 2022
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.
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
In the truffle folder you need two files to locally configure authentication credentials.
- create a
.envfile to holdINFURA_PROJECT_IDandETHERSCAN_API_KEY. - create a
.secretfild to hold mnenomics (space-separated words, typically 12 of them) that generate your HDWallet.
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 thePredictionRecorderaddress, 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
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.