Contract
0x28227B230d3945e580eD3B1c6c8ea1df658A7AA9
8
Contract Overview
Balance:
0 ETH
Token:
My Name Tag:
Not Available
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
Feedback
Compiler Version
v0.8.4+commit.c7e474f2
Contract Source Code (Solidity)
/** *Submitted for verification at Arbiscan.io on 2023-04-11 */ //SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @title Semaphore contract interface. interface ISemaphore { error Semaphore__CallerIsNotTheGroupAdmin(); error Semaphore__MerkleTreeDepthIsNotSupported(); error Semaphore__MerkleTreeRootIsExpired(); error Semaphore__MerkleTreeRootIsNotPartOfTheGroup(); error Semaphore__YouAreUsingTheSameNillifierTwice(); /// It defines all the group parameters, in addition to those in the Merkle tree. struct Group { address admin; uint256 merkleTreeDuration; mapping(uint256 => uint256) merkleRootCreationDates; mapping(uint256 => bool) nullifierHashes; } /// @dev Emitted when an admin is assigned to a group. /// @param groupId: Id of the group. /// @param oldAdmin: Old admin of the group. /// @param newAdmin: New admin of the group. event GroupAdminUpdated(uint256 indexed groupId, address indexed oldAdmin, address indexed newAdmin); /// @dev Emitted when the Merkle tree duration of a group is updated. /// @param groupId: Id of the group. /// @param oldMerkleTreeDuration: Old Merkle tree duration of the group. /// @param newMerkleTreeDuration: New Merkle tree duration of the group. event GroupMerkleTreeDurationUpdated( uint256 indexed groupId, uint256 oldMerkleTreeDuration, uint256 newMerkleTreeDuration ); /// @dev Emitted when a Semaphore proof is verified. /// @param groupId: Id of the group. /// @param merkleTreeRoot: Root of the Merkle tree. /// @param nullifierHash: Nullifier hash. /// @param externalNullifier: External nullifier. /// @param signal: Semaphore signal. event ProofVerified( uint256 indexed groupId, uint256 indexed merkleTreeRoot, uint256 nullifierHash, uint256 indexed externalNullifier, uint256 signal ); /// @dev Saves the nullifier hash to avoid double signaling and emits an event /// if the zero-knowledge proof is valid. /// @param groupId: Id of the group. /// @param merkleTreeRoot: Root of the Merkle tree. /// @param signal: Semaphore signal. /// @param nullifierHash: Nullifier hash. /// @param externalNullifier: External nullifier. /// @param proof: Zero-knowledge proof. function verifyProof( uint256 groupId, uint256 merkleTreeRoot, uint256 signal, uint256 nullifierHash, uint256 externalNullifier, uint256[8] calldata proof ) external; /// @dev Creates a new group. Only the admin will be able to add or remove members. /// @param groupId: Id of the group. /// @param depth: Depth of the tree. /// @param admin: Admin of the group. function createGroup(uint256 groupId, uint256 depth, address admin) external; /// @dev Creates a new group. Only the admin will be able to add or remove members. /// @param groupId: Id of the group. /// @param depth: Depth of the tree. /// @param admin: Admin of the group. /// @param merkleTreeRootDuration: Time before the validity of a root expires. function createGroup(uint256 groupId, uint256 depth, address admin, uint256 merkleTreeRootDuration) external; /// @dev Updates the group admin. /// @param groupId: Id of the group. /// @param newAdmin: New admin of the group. function updateGroupAdmin(uint256 groupId, address newAdmin) external; /// @dev Updates the group Merkle tree duration. /// @param groupId: Id of the group. /// @param newMerkleTreeDuration: New Merkle tree duration. function updateGroupMerkleTreeDuration(uint256 groupId, uint256 newMerkleTreeDuration) external; /// @dev Adds a new member to an existing group. /// @param groupId: Id of the group. /// @param identityCommitment: New identity commitment. function addMember(uint256 groupId, uint256 identityCommitment) external; /// @dev Adds new members to an existing group. /// @param groupId: Id of the group. /// @param identityCommitments: New identity commitments. function addMembers(uint256 groupId, uint256[] calldata identityCommitments) external; /// @dev Updates an identity commitment of an existing group. A proof of membership is /// needed to check if the node to be updated is part of the tree. /// @param groupId: Id of the group. /// @param identityCommitment: Existing identity commitment to be updated. /// @param newIdentityCommitment: New identity commitment. /// @param proofSiblings: Array of the sibling nodes of the proof of membership. /// @param proofPathIndices: Path of the proof of membership. function updateMember( uint256 groupId, uint256 identityCommitment, uint256 newIdentityCommitment, uint256[] calldata proofSiblings, uint8[] calldata proofPathIndices ) external; /// @dev Removes a member from an existing group. A proof of membership is /// needed to check if the node to be removed is part of the tree. /// @param groupId: Id of the group. /// @param identityCommitment: Identity commitment to be removed. /// @param proofSiblings: Array of the sibling nodes of the proof of membership. /// @param proofPathIndices: Path of the proof of membership. function removeMember( uint256 groupId, uint256 identityCommitment, uint256[] calldata proofSiblings, uint8[] calldata proofPathIndices ) external; } contract Feedback { ISemaphore public semaphore; uint256 public groupId; constructor(address semaphoreAddress, uint256 _groupId) { semaphore = ISemaphore(semaphoreAddress); groupId = _groupId; semaphore.createGroup(groupId, 20, address(this)); } function joinGroup(uint256 identityCommitment) external { semaphore.addMember(groupId, identityCommitment); } function sendFeedback( uint256 feedback, uint256 merkleTreeRoot, uint256 nullifierHash, uint256[8] calldata proof ) external { semaphore.verifyProof(groupId, merkleTreeRoot, feedback, nullifierHash, groupId, proof); } }
[{"inputs":[{"internalType":"address","name":"semaphoreAddress","type":"address"},{"internalType":"uint256","name":"_groupId","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"groupId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"identityCommitment","type":"uint256"}],"name":"joinGroup","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"semaphore","outputs":[{"internalType":"contract ISemaphore","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"feedback","type":"uint256"},{"internalType":"uint256","name":"merkleTreeRoot","type":"uint256"},{"internalType":"uint256","name":"nullifierHash","type":"uint256"},{"internalType":"uint256[8]","name":"proof","type":"uint256[8]"}],"name":"sendFeedback","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506040516106e13803806106e18339818101604052810190610032919061013c565b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060018190555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c1121416001546014306040518463ffffffff1660e01b81526004016100d9939291906101a5565b600060405180830381600087803b1580156100f357600080fd5b505af1158015610107573d6000803e3d6000fd5b505050505050610258565b6000815190506101218161022a565b92915050565b60008151905061013681610241565b92915050565b6000806040838503121561014f57600080fd5b600061015d85828601610112565b925050602061016e85828601610127565b9150509250929050565b610181816101dc565b82525050565b61019081610218565b82525050565b61019f8161020e565b82525050565b60006060820190506101ba6000830186610196565b6101c76020830185610187565b6101d46040830184610178565b949350505050565b60006101e7826101ee565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006102238261020e565b9050919050565b610233816101dc565b811461023e57600080fd5b50565b61024a8161020e565b811461025557600080fd5b50565b61047a806102676000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80637b5d253414610051578063a0f44c921461006f578063d18ed1e91461008d578063eed02e4b146100a9575b600080fd5b6100596100c5565b604051610066919061030f565b60405180910390f35b6100776100e9565b604051610084919061032a565b60405180910390f35b6100a760048036038101906100a2919061027c565b6100ef565b005b6100c360048036038101906100be9190610253565b61018e565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633bc778e3600154858786600154876040518763ffffffff1660e01b81526004016101569695949392919061036e565b600060405180830381600087803b15801561017057600080fd5b505af1158015610184573d6000803e3d6000fd5b5050505050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631783efc3600154836040518363ffffffff1660e01b81526004016101eb929190610345565b600060405180830381600087803b15801561020557600080fd5b505af1158015610219573d6000803e3d6000fd5b5050505050565b60008190508260206008028201111561023857600080fd5b92915050565b60008135905061024d8161042d565b92915050565b60006020828403121561026557600080fd5b60006102738482850161023e565b91505092915050565b600080600080610160858703121561029357600080fd5b60006102a18782880161023e565b94505060206102b28782880161023e565b93505060406102c38782880161023e565b92505060606102d487828801610220565b91505092959194509250565b6102ed610100838361041e565b5050565b6102fa816103fa565b82525050565b610309816103f0565b82525050565b600060208201905061032460008301846102f1565b92915050565b600060208201905061033f6000830184610300565b92915050565b600060408201905061035a6000830185610300565b6103676020830184610300565b9392505050565b60006101a0820190506103846000830189610300565b6103916020830188610300565b61039e6040830187610300565b6103ab6060830186610300565b6103b86080830185610300565b6103c560a08301846102e0565b979650505050505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006104058261040c565b9050919050565b6000610417826103d0565b9050919050565b82818337600083830152505050565b610436816103f0565b811461044157600080fd5b5056fea26469706673582212208e2fb42744b3aeff06bf682e2f66f36f8c4828c51a8cc1a07ff58048bfb2297964736f6c634300080400330000000000000000000000003889927f0b5eb1a02c6e2c20b39a1bd4ead76131000000000000000000000000000000000000000000000000000000000000002a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000003889927f0b5eb1a02c6e2c20b39a1bd4ead76131000000000000000000000000000000000000000000000000000000000000002a
-----Decoded View---------------
Arg [0] : semaphoreAddress (address): 0x3889927f0b5eb1a02c6e2c20b39a1bd4ead76131
Arg [1] : _groupId (uint256): 42
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000003889927f0b5eb1a02c6e2c20b39a1bd4ead76131
Arg [1] : 000000000000000000000000000000000000000000000000000000000000002a
Deployed ByteCode Sourcemap
5642:712:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5667:27;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;5703:22;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;6079:272;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;5948:123;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;5667:27;;;;;;;;;;;;:::o;5703:22::-;;;;:::o;6079:272::-;6256:9;;;;;;;;;;:21;;;6278:7;;6287:14;6303:8;6313:13;6328:7;;6337:5;6256:87;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6079:272;;;;:::o;5948:123::-;6015:9;;;;;;;;;;:19;;;6035:7;;6044:18;6015:48;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5948:123;:::o;25:182:1:-;96:8;127:6;115:18;;180:3;172:4;166;162:15;152:8;148:30;145:39;142:2;;;197:1;194;187:12;142:2;105:102;;;;:::o;213:139::-;259:5;297:6;284:20;275:29;;313:33;340:5;313:33;:::i;:::-;265:87;;;;:::o;358:262::-;417:6;466:2;454:9;445:7;441:23;437:32;434:2;;;482:1;479;472:12;434:2;525:1;550:53;595:7;586:6;575:9;571:22;550:53;:::i;:::-;540:63;;496:117;424:196;;;;:::o;626:748::-;737:6;745;753;761;810:3;798:9;789:7;785:23;781:33;778:2;;;827:1;824;817:12;778:2;870:1;895:53;940:7;931:6;920:9;916:22;895:53;:::i;:::-;885:63;;841:117;997:2;1023:53;1068:7;1059:6;1048:9;1044:22;1023:53;:::i;:::-;1013:63;;968:118;1125:2;1151:53;1196:7;1187:6;1176:9;1172:22;1151:53;:::i;:::-;1141:63;;1096:118;1253:2;1279:78;1349:7;1340:6;1329:9;1325:22;1279:78;:::i;:::-;1269:88;;1224:143;768:606;;;;;;;:::o;1412:172::-;1535:43;1571:6;1566:3;1559:5;1535:43;:::i;:::-;1525:59;;:::o;1590:167::-;1695:55;1744:5;1695:55;:::i;:::-;1690:3;1683:68;1673:84;;:::o;1763:118::-;1850:24;1868:5;1850:24;:::i;:::-;1845:3;1838:37;1828:53;;:::o;1887:258::-;1998:4;2036:2;2025:9;2021:18;2013:26;;2049:89;2135:1;2124:9;2120:17;2111:6;2049:89;:::i;:::-;2003:142;;;;:::o;2151:222::-;2244:4;2282:2;2271:9;2267:18;2259:26;;2295:71;2363:1;2352:9;2348:17;2339:6;2295:71;:::i;:::-;2249:124;;;;:::o;2379:332::-;2500:4;2538:2;2527:9;2523:18;2515:26;;2551:71;2619:1;2608:9;2604:17;2595:6;2551:71;:::i;:::-;2632:72;2700:2;2689:9;2685:18;2676:6;2632:72;:::i;:::-;2505:206;;;;;:::o;2717:871::-;2998:4;3036:3;3025:9;3021:19;3013:27;;3050:71;3118:1;3107:9;3103:17;3094:6;3050:71;:::i;:::-;3131:72;3199:2;3188:9;3184:18;3175:6;3131:72;:::i;:::-;3213;3281:2;3270:9;3266:18;3257:6;3213:72;:::i;:::-;3295;3363:2;3352:9;3348:18;3339:6;3295:72;:::i;:::-;3377:73;3445:3;3434:9;3430:19;3421:6;3377:73;:::i;:::-;3460:121;3576:3;3565:9;3561:19;3552:6;3460:121;:::i;:::-;3003:585;;;;;;;;;:::o;3594:126::-;3631:7;3671:42;3664:5;3660:54;3649:65;;3639:81;;;:::o;3726:77::-;3763:7;3792:5;3781:16;;3771:32;;;:::o;3809:162::-;3877:9;3910:55;3959:5;3910:55;:::i;:::-;3897:68;;3887:84;;;:::o;3977:131::-;4045:9;4078:24;4096:5;4078:24;:::i;:::-;4065:37;;4055:53;;;:::o;4114:154::-;4198:6;4193:3;4188;4175:30;4260:1;4251:6;4246:3;4242:16;4235:27;4165:103;;;:::o;4274:122::-;4347:24;4365:5;4347:24;:::i;:::-;4340:5;4337:35;4327:2;;4386:1;4383;4376:12;4327:2;4317:79;:::o
Metadata Hash
8e2fb42744b3aeff06bf682e2f66f36f8c4828c51a8cc1a07ff58048bfb22979
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|