Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Feeds Hardhat Getting Started Guide #52

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

khadni
Copy link
Contributor

@khadni khadni commented Mar 22, 2024


Below is a summarization created by an LLM (gpt-4-turbo). Be mindful of hallucinations and verify accuracy.

Why

The changes introduce configuration files and a new contract for setting up a Hardhat project with Chainlink Data Feeds, aiming to streamline smart contract development and deployment processes, particularly for fetching data from external price feeds.

What

  • data-feeds/getting-started/hardhat/.prettierrc: Added a Prettier configuration file to enforce consistent code formatting rules.
    • "tabWidth": 4 and "useTabs": false set tab behavior.
    • "semi": false and "singleQuote": false set punctuation preferences.
    • "printWidth": 100 with overrides for Solidity files to have a narrower printWidth of 80.
  • data-feeds/getting-started/hardhat/.solhint.json: Added a Solhint configuration file to define linting rules for Solidity.
    • "extends": "solhint:recommended" applies recommended linting rules.
    • Custom rules like "compiler-version" and "func-visibility" are specified.
  • data-feeds/getting-started/hardhat/.solhintignore: Added a file to specify directories to be ignored by Solhint, specifically node_modules.
  • data-feeds/getting-started/hardhat/README.md: Added a detailed README to guide users through using the project, including setup and deployment instructions.
  • data-feeds/getting-started/hardhat/contracts/DataConsumerV3.sol: Added a new Solidity contract which integrates with Chainlink to fetch the latest data from a BTC/USD price feed.
    • Uses AggregatorV3Interface for fetching data.
    • Includes a function getChainlinkDataFeedLatestAnswer to retrieve the latest price.
  • data-feeds/getting-started/hardhat/hardhat.config.js: Configured Hardhat with necessary plugins and settings.
    • Includes custom network settings for the Ethereum Sepolia testnet.
    • Compiler settings optimized for production.
  • data-feeds/getting-started/hardhat/package.json: Defines project dependencies and scripts for building and linting.
    • Dependencies include Hardhat tools and Chainlink contracts.
    • Scripts for compilation and linting are provided.
  • data-feeds/getting-started/hardhat/tasks/deploy.js: Added a deploy script for the DataConsumerV3 contract.
    • Uses Hardhat's task system to simplify the deployment process.
  • data-feeds/getting-started/hardhat/tasks/getChainlinkDataFeedLatestAnswer.js: Script to fetch the latest price feed answer using the deployed contract.
  • data-feeds/getting-started/hardhat/tasks/index.js, utils/index.js, utils/spin.js: Utility scripts and task aggregator to enhance the development workflow.

@aelmanaa aelmanaa closed this Apr 11, 2024
@aelmanaa aelmanaa reopened this Apr 11, 2024
@aelmanaa aelmanaa closed this Apr 11, 2024
@aelmanaa aelmanaa reopened this Apr 11, 2024
@aelmanaa aelmanaa closed this Apr 11, 2024
@aelmanaa aelmanaa reopened this Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants