This project showcases a basic Hardhat setup, including a sample contract, a test suite for the contract, and an Ignition module for contract deployment.
- Sample Contract: Includes a sample smart contract to demonstrate basic functionality.
- Contract Testing: Comes with tests for verifying the contract’s behavior.
- Deployment with Ignition: Utilizes the Hardhat Ignition module to deploy the contract.
This project requires several API keys for various services. Ensure you have the following environment variables configured:
-
ETHERSCAN_API_KEY: Used to interact with the Etherscan API for verifying and interacting with smart contracts on the Ethereum blockchain. You can get your API key from Etherscan.
npx hardhat vars set ETHERSCAN_API_KEY -
DEV_PRIVATE_KEY: The private key for the development account used in your Hardhat local environment. This key is used to deploy contracts and interact with the blockchain locally.
npx hardhat vars set DEV_PRIVATE_KEY -
INFURA_API_KEY: Used to connect to the Ethereum network via Infura. This key allows you to interact with Ethereum nodes and access the network for development and deployment purposes. Obtain your API key from Infura.
npx hardhat vars set INFURA_API_KEY
To get started with this project, you can try out some of the following tasks:
- Install Dependencies:
npm install
- Show available Hardhat tasks and options:
npx hardhat help - Run the contract tests:
npx hardhat test - Start a local Hardhat node for testing:
npx hardhat node
- Deploy the sample contract using the Ignition module:
npx hardhat ignition deploy ./ignition/modules/Crowdfunding.ts --network localhost
- Deploy Utils:
npx hardhat run scripts/deployUtils.ts --network localhost
- Hardhat Documentation: Get started with Hardhat to learn about its features and setup.
- Hardhat Ignition Documentation: Deploy contracts with Ignition for guidance on using the Ignition module.
- Hardhat GitHub Issues: Community support for reporting issues and finding solutions.
- Hardhat Discussion Forum: Join the discussion for questions and community advice.
If you encounter any issues or need further assistance, consult the resources listed above or seek help from the community forums.
Feel free to customize this setup according to your project needs.