This repository contains an example decentralized application (dapp) for World ID. With Mesha Airdrop test airdropping an ERC-20 token validating a single person can only claim a token once.
World ID is a mechanism to verify a single human has performed a specific action only once without exposing any personal information.
This repository contains the frontend dapp example. Please check [this repository][smartcontract] for the smart contract example.
The Javascript integration is the simplest way to integrate World ID. The package currently supports web applications and requires only a few lines of code.
You can test this dApp right away with our deployed smart contract in the Polygon Mumbai Testnet (address 0x330C8452C879506f313D1565702560435b0fee4C
). This deployed contract uses the World ID Test Network for verified identities.
- Install dependencies.
npm install
- Run app (will open browser automatically).
npm run deva
- Go to Usage instructions.
To test this dApp in the Polygon Mumbai Testnet, follow these steps:
- Prepare a wallet that has access to the Mumbai Testnet. We recommend using Metamask mobile (you will need to add the Mumbai network manually). Our docs contain more detailed instructions on how to do this. Alternatively, there's instructions for how to use the WalletConnect Test Wallet.
- Fund the wallet with some
MATIC
. You can use the official faucet or any other faucet. - Launch the mockWLD app (app that holds World ID identities and generates ZKPs) at: https://mock-app.id.worldcoin.org & follow instructions to generate/fetch your identity and add it to the list of verified identities.
And you're good to go! The airdrop app will guide you through the process:
- You'll first connect your wallet (e.g. Metamask).
- You will then do the World ID verification process.
- You will then execute the smart contract transaction with your wallet.
Follow these steps if you want to use your own smart contract and/or use a different network.
- Deploy your own smart contract using the Airdrop smart contract from [this repository][smartcontract].
- Set the contract address using the
WLD_CONTRACT_ADDRESS
env var (or editconst.tsx
directly). - Update the contract's ABI in
const.tsx
(if you changed the contract'sclaim
function).