change modifier onlyVerified to onlyValidProof and unit tests#14
Merged
Dprof-in-tech merged 1 commit intodewdrop-labs:mainfrom Mar 3, 2025
mnusurov:main
Merged
change modifier onlyVerified to onlyValidProof and unit tests#14Dprof-in-tech merged 1 commit intodewdrop-labs:mainfrom mnusurov:main
Dprof-in-tech merged 1 commit intodewdrop-labs:mainfrom
mnusurov:main
Conversation
Author
|
closes #1 |
Author
|
hey @Dprof-in-tech friendly reminder ) |
Dprof-in-tech
approved these changes
Mar 3, 2025
Contributor
Dprof-in-tech
left a comment
There was a problem hiding this comment.
This is beautiful work. Also I'm sorry for the time taken to review this. I've been away for a while
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description
This PR introduces several key updates and improvements to enhance the security and functionality of our wallet system, with a particular focus on integrating zero-knowledge (ZK) proof verification. The changes span across the wallet contract, its related tests, and the World ID interface.
Changes
Wallet Contract (
src/Wallet.sol)Changed
ownerandworldIDtoimmutablefor improved efficiency.Introduced the
nullifierHashesmapping to store used nullifier hashes.Replaced the
onlyVerifiedmodifier withonlyValidProofto ensure that a valid ZK proof is provided.Modified the
transferfunction to accept a ZK proof as an additional parameter.Removed the
createWorldIdfunction since it was empty.Removed the
usdtstate variable and added USDT as a supported token in the constructor.Wallet Test (
test/Wallet.t.sol)Renamed
worldIDtomockWorldIDfor clarity.Updated the
setUpfunction to usemockWorldID.transferfunction.Wallet Factory Test (
test/WalletFactory.t.sol)Changed
mockWorldIDto a hardcoded address.Updated the
test_CreateWalletfunction to use the new hardcodedmockWorldIDaddress.Transfer Test (
test/Transfer.t.sol)Removed the
MockWorldIDContractand replaced it withMockWorldID.transferfunction.Mock World ID (
test/mocks/MockWorldID.sol)Implemented the
verifyProofandgenerateZkProoffunctions to simulate ZK proof verification and generation.World ID Interface (
src/IWorldID.sol)Updated the interface to include the
verifyProoffunction, ensuring compatibility with the new ZK proof verification process.Summary
This PR improves the wallet contract by:
Please review the changes and provide any feedback or suggestions for further improvement.