Created
April 12, 2025 17:13
-
-
Save extropyCoder/a1252f1d0eb701cb60d18e333b27a1fd to your computer and use it in GitHub Desktop.
Revisions
-
extropyCoder created this gist
Apr 12, 2025 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ //SPDX-License-Identifier: MIT pragma solidity ^0.8.23; import "@semaphore-protocol/contracts/interfaces/ISemaphore.sol"; contract Feedback { ISemaphore public semaphore; uint256 public groupId; constructor(address semaphoreAddress) { semaphore = ISemaphore(semaphoreAddress); groupId = semaphore.createGroup(address(this)); } function joinGroup(uint256 identityCommitment) external { semaphore.addMember(groupId, identityCommitment); } function sendFeedback( uint256 merkleTreeDepth, uint256 merkleTreeRoot, uint256 nullifier, uint256 feedback, uint256[8] calldata points ) external { ISemaphore.SemaphoreProof memory proof = ISemaphore.SemaphoreProof( merkleTreeDepth, merkleTreeRoot, nullifier, feedback, groupId, points ); semaphore.validateProof(groupId, proof); } }