This repository contains the smart contracts for the Bitcoin Price Research Dataset
Serves as a helper to fetch the Bitcoin price only once at a specific timestamp. This functionality is crucial for determining the winner of the Bitcoin Price Research Dataset, where the user closest to the price wins the prize. Fetches and stores the latest price of a specified coin pair, in this case BTC/USD pair using Chainlink Data Feeds.
In addition, the contract ensures that the fetch operation can only be executed once to prevent duplicate price fetching and it's triggered by using a time-based upkeep contract from Chainlink Automation.
To install all the dependencies of this repo, execute the following command:
yarn
or
yarn install
To compile contracts, export ABIs, and generate TypeScript interfaces, execute the following command:
yarn build
To remove cached and temporary files, execute the following command:
yarn clean
To run all unit tests, execute the following command:
yarn test
To generate a coverage report, execute the following command:
yarn coverage
To generate a contracts size report, execute the following command:
yarn contract-size
To run linting on all configured source files (*.sol
, *.ts
, *.js
, *.json
), execute the following command:
yarn lint
Smart Contract | Description |
---|---|
CoinPriceOneTimeFetch |
Generic contract that fetches and store the latest price of a specified coin pair using Chainlink Data Feeds and can be fetched only once |