This project is to showcase quick solidity smart contract snippets for beginners to start working on solidity language or to take references from.
This repository contains a collection of simple Solidity smart contracts implemented using the Hardhat development environment. The goal of this project is to provide concise examples of various Solidity contracts for educational purposes and quick reference.
To get started with this project, you should have Node.js and npm (Node Package Manager) installed on your machine.
-
Clone this repository to your local machine:
git clone https://github.com/your-username/smart-contract-snippets.git
-
Change into the project directory:
cd hardhat-simple-storage-fcc
-
Install the project dependencies:
npm install
-
Running Tests You can run the provided tests for the Solidity contracts using the following command:
npx hardhat test
-
Compiling Contracts To compile the Solidity contracts in the contracts/ directory, use the following command:
npx hardhat compile
-
Deploying Contracts / Running Deploy Scripts You can deploy contracts to a local Hardhat network or a live Ethereum network. Modify the deployment script in scripts/deploy.js as needed and then use the following command to deploy:
npx hardhat run .\scripts\<script-location> --network <network-name>
For running on Loccalhost :
npx hardhat run .\scripts\<script-location> --network localhost
Rohit Roy
This repository is open to contributions. You can add a solidity code snippet and a test for that contract using the given setup (Hardhat + EthersJS). Once everything is checked on your local setup, you can make a PR to my repository and I'll merge it into the main branch after a thorough review.