Git Product home page Git Product logo

airdropforall's Introduction

Implement an airdrop in 20 minutes with Polygon ID

Tutorial: https://0xpolygonid.github.io/tutorials/verifier/on-chain-verification/overview/

This tutorial uses Hardhat as a development environment and Polygon Mumbai testnet as the network.

Polygon ID Wallet setup

  1. Download the Polygon ID mobile app on the Google Play or Apple app store

  2. Open the app and set a pin for security

  3. Follow the Issue a Polygon ID claim doc to issue yourself a KYC Age Credential attesting your date of birth.

Instructions to compile and deploy the smart contract

  1. Create a .env file in the root of this repo. Copy in .env.sample to add keys touch .env

  2. Install dependencies npm i

  3. Compile smart contracts npx hardhat compile

  4. Deploy smart contracts npx hardhat run --network mumbai scripts/deploy.js

  • Drop Token deployed to: 0x34cb10Ec8b300821943112c73e81191784c19C93
  • ERC20Verifier contract hash: 0xf7d67448132bfBdBE496Ef1633fD62f0D342f9a8
  • FactoryContract hash: 0xAC70A6c866328e6283A787FDE99B6d8860cB517D
  1. Update the ERC20VerifierAddress variable in scripts/set-request.js with your deployed contract address

  2. Run set-request to send the zk request to the smart contract npx hardhat run --network matic scripts/deploy.js

Claim airdrop from a frontend

  1. Design a proof request (see my example in qrValueProofRequestExample.json) and more info in the docs: Query Based Requests

    • Update the contract_address field to your deployed contract address
  2. Create a frontend with a QR code to the proof request. Codesandbox example A user should be able to scan the QR code from the Polygon ID app and trustlessly prove that they are old enough to claim the ERC20 airdrop without revealing their actual birthday.

airdropforall's People

Contributors

firehawk010 avatar adal-wolf 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.