Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 1.15 KB

File metadata and controls

41 lines (28 loc) · 1.15 KB

Simple ROFL Oracle Contract

For the ROFL Oracle smart contract deployment you will need the following information:

  • the ROFL app ID (rofl1...)
  • the deployer's private key
  • the network you're deploying to (sapphire-testnet, sapphire-localnet, sapphire)

First install dependencies and compile the smart contract:

npm install
npx hardhat compile

Then, prepare your hex-encoded private key for paying the deployment gas fee and store it as an environment variable:

export PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80

Finally, deploy the contract, provide the ROFL App ID and the network:

npx hardhat deploy rofl1qqn9xndja7e2pnxhttktmecvwzz0yqwxsquqyxdf --network sapphire-localnet

Once your Oracle ROFL is running, it will submit the observations to the smart contract deployed above. You can fetch the data stored on-chain by running:

npx hardhat oracle-query 0x5FbDB2315678afecb367f032d93F642f64180aa3 --network sapphire-localnet

For more information check out the ROFL tutorial.