A sample project demonstrating a basic Hardhat use case for blockchain development. This repository is designed as a hands-on learning tool for the Blockchain Developer Bootcamp curriculum and includes sample smart contracts, deployment scripts, tests, and an optional front-end integration—all built using Hardhat.
- Overview
- Prerequisites
- Installation
- Project Structure
- Usage
- Testing
- Deployment
- Contributing
- License
- Acknowledgements
This repository serves as a practical introduction for blockchain developers. It demonstrates a simple Hardhat project that includes:
- Smart Contracts: Sample contracts written in Solidity.
- Deployment Scripts: Scripts to deploy contracts on a local or test network.
- Testing Suite: Unit tests to verify contract functionality.
- Front-End Integration (Optional): A basic front-end setup (located in the
publicandsrcfolders) to interact with the deployed contracts.
Ensure you have the following installed before getting started:
-
Clone the repository:
git clone https://github.com/nevets512/blockchain-developer-bootcamp.git cd blockchain-developer-bootcamp -
Install dependencies:
npm install
Or, if you prefer using yarn:
yarn install
- contracts/: Contains Solidity smart contracts.
- scripts/: Deployment scripts for automating contract deployment.
- test/: Unit tests to ensure contract functionality.
- src/: (Optional) Source code for front-end integration.
- public/: (Optional) Static assets for the front-end application.
- hardhat.config.js: Hardhat configuration file.
- package.json: Project dependencies and scripts.
- .gitignore: Specifies intentionally untracked files (e.g., environment variables).
You can run various Hardhat tasks using npm scripts:
- Display Help:
npx hardhat help - Run Tests:
npx hardhat test - Run Tests with Gas Reporting:
REPORT_GAS=true npx hardhat test - Start a Local Hardhat Node:
npx hardhat node
- Deploy Contracts:
npx hardhat run scripts/deploy.js
After deploying the contracts (locally or on a test network), you can interact with them via Hardhat or through the front-end (if applicable):
- Deploy the contracts.
- If using the front-end, you have two options:
- Local Development: Serve the static files from the
publicfolder using a tool like live-server or any other web server of your choice. - Production/Decentralized Hosting: Deploy your front-end on Fleek, which hosts your static files on IPFS/Filecoin, providing a distributed and censorship-resistant experience.
- Local Development: Serve the static files from the
To verify the smart contracts, run the provided tests with:
npx hardhat testDeploy the contracts to your desired network using:
npx hardhat run scripts/deploy.jsThis command deploys your contracts to the network specified in your Hardhat configuration.
Contributions are welcome! If you would like to contribute:
- Fork this repository.
- Create a new branch for your feature or bug fix.
- Commit your changes and push your branch.
- Open a pull request with a detailed description of your changes.
For major changes, please open an issue first to discuss your proposed modifications.
This project is open source and available under the MIT License.
- Hardhat – An excellent development environment for Ethereum.
- Ethereum – The decentralized platform that powers smart contracts.
- All contributors and educators involved in the Blockchain Developer Bootcamp.