DHK dao snapshot-self plugin prototype
- Self: https://self.xyz
- docs: https://docs.self.xyz/
- Self Developer Tools: https://tools.self.xyz/
Snapshot
Getting Celo Alfajores testnet token
- Get Celo Alfajores testnet token at: learnweb3
- Get LINK testnet token: https://faucets.chain.link/celo-alfajores-testnet
- Swap for Celo native tokens: https://app.mento.org/
-
Before deploying the verification contract on Celo network, make sure to run DeploySelfVerification script in simulation mode, get the contract deployment address, and use the Self Developer Tools to generate the correct scope value and set it to SELF_SCOPE inside
.env
file. -
frontend: https://dhkdao-self.vercel.app
-
SelfVerification: Celo Alfajores Testnet:
0x0Ea37D3264b940C94D68DA1EB34C291D62Ba8Ab5
To test it out yourself, in the Self mobile app, add a Mock passport to scan. As Self contracts on testnet only support mock passport, while contracts on Celo mainnet support real passport.
To generate a mock passport in Self, goto Settings > Manage ID documents > press Add New Document at the bottom, and choose mock passport.
The verification flow is as follow:
-
Showing the Self QR code. The QR Code is configured here.
-
On-chain verification happens in the smart contract, with the callback function implemented at customVerificationHook(), emitting the VerificationCompleted event.
-
Front-end listens to VerificationCompleted event. Upon event emitted, it will call backend
/api/verify-successful
route. -
The backend checks the user DHK token balance >= 1, and other logics (e.g. check for subname), and return a JSON corresponding if a user satisfy all the conditions.