Giter Site home page Giter Site logo

donation-using-zkpolygon's Introduction

Donation to Educator dApp

Backend

  1. Open the terminal (command line), create two new folders called donation-to-educator and backend. Go into the backend folder.
mkdir Donation-using-ZkPolygon
cd donation-using-ZkPolygon
mkdir backend
cd backend
  1. Set up a Hardhat project. Install the necessary libraries, by typing in the terminal:
npm init --yes
npm install --save-dev --save-exact [email protected]
npm install dotenv
  1. This library might be necessary to install as well, especially if you're a Windows user.
npm install --save-dev @nomicfoundation/hardhat-toolbox@3
  1. Make sure you are still in the backend directory. Now, create a sample contract project by typing in the terminal:
npx hardhat
  • Select Create a Javascript Project. Don't change anything in the Hardhat project root, just click enter. Yes, add a .gitignore.
  1. Open the backend folder and remove any present contracts inside the contracts folder. Insert your Donation contract.

  2. Now, inside the scripts folder, replace the contect of the deploy.js file with the [deploy.js code from this project]

  3. Create a .env file inside the backend folder. This will be used to store your wallet's private key.

  • Add this line inside the .env file, and update the content inside the quotation marks:
PRIVATE_KEY="your-wallet-private-key-goes-here-inside-the-quotation-marks"
  1. Open the hardhat.config.js file inside the backend folder and replace its content with the hardhat.config.js code from this project.

  2. Compile your Contract by going back to your terminal (ensure you are in the backend directory). And type:

npx hardhat compile
  • Every time you modify your contract, you will have to repeat the above compile step.
  1. With your contract compiled, now we can deploy it to the zkEVM testnet. In your terminal type:
npx hardhat run scripts/deploy.js --network zkEVM

Save the contract address that was printed out. Go to https://testnet-zkevm.polygonscan.com/ and insert the contract address into the Explorer input field. Take some time to explore the transaction details of your contract.

  • Save this address somewhere. Don't lose it!

donation-using-zkpolygon's People

Contributors

manugowda18 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.