It uses hardhat as the contract development framework.
It contains majorly three contract files:
contracts/EDUFund.sol
: The main contract file.contracts/Errors.sol
: The error codes for the contract.contracts/Events.sol
: The events for the contract.
scripts/deploy.js
: The deployment script.scripts/restoreState.ts
: This script is used after deployment of the contract using previous file (deploy.js). It is used for following task:- Create campaigns
- Donate the campaigns
- Propose transactions
- Voting campaigns
- After running this script you can view the campaigns which are ready to finalize on the frontend.
- Clone the repository.
git clone https://github.com/ArshilHapani/EduFund_Public
- Install the dependencies
cd contracts_backend &&
npm install
- Create a
.env
file in the root directory and add the following:
cp .env.example .env
Add the required environment variables in the .env
file.
- Run the tests
npx hardhat test
- Start the hardhat node
npx hardhat node
- Deploy the contract (on another terminal)
npx hardhat run scripts/deploy.js --network localhost
That's it! You are ready to go. 🚀