Skip to content

Latest commit

 

History

History
68 lines (46 loc) · 1.42 KB

README.md

File metadata and controls

68 lines (46 loc) · 1.42 KB

EDUFund Contracts Backend

EDUFund Contracts Backend

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.

Some other important files to note

  • 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.

Setup

  1. Clone the repository.
git clone https://github.com/ArshilHapani/EduFund_Public
  1. Install the dependencies
cd contracts_backend &&
npm install
  1. 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.

  1. Run the tests
npx hardhat test
  1. Start the hardhat node
npx hardhat node
  1. Deploy the contract (on another terminal)
npx hardhat run scripts/deploy.js --network localhost

That's it! You are ready to go. 🚀