This project demonstrates a basic Unirep application. It comes with a sample contract, a test for that contract, and a script that deploys that contract.
Try running some of the following tasks:
yarn build
yarn test
yarn contracts test ./test/SignupAndPost.test.ts
yarn contracts test ./test/Comment.test.ts
yarn hardhat node
and
yarn deploy
- latestPostId: A global variable to record the latest post ID.
- postCommentIndex:
- postId
uint256
=> commentIduint256
- To maintain & record the comment id for each post
- postId
- epochKeyCommentMap a 2-layer mapping:
- epochKey
uint256
=> ( postIduint256
=> commentIduint256
) - To store the epoch key for each post-comment pair
- epochKey
- proofNullifier
- proof
bytes32
=>bool
- To check if the same proof is used before.
- proof
- userRegistry
- userId
uint256
=>bool
- To check if same user id is used before.
- userId