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:
yarnor
yarn installTo compile contracts, export ABIs, and generate TypeScript interfaces, execute the following command:
yarn buildTo remove cached and temporary files, execute the following command:
yarn cleanTo run all unit tests, execute the following command:
yarn testTo generate a coverage report, execute the following command:
yarn coverageTo generate a contracts size report, execute the following command:
yarn contract-sizeTo 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 |