@semaphore-protocol/contracts 4.0.0-alpha.1 → 4.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/base/SemaphoreGroups.sol +5 -0
- package/interfaces/ISemaphoreGroups.sol +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<img src="https://img.shields.io/badge/project-Semaphore-blue.svg?style=flat-square">
|
|
11
11
|
</a>
|
|
12
12
|
<a href="https://github.com/semaphore-protocol/semaphore/blob/main/LICENSE">
|
|
13
|
-
<img alt="
|
|
13
|
+
<img alt="NPM license" src="https://img.shields.io/npm/l/%40semaphore-protocol%2Fcontracts?style=flat-square">
|
|
14
14
|
</a>
|
|
15
15
|
<a href="https://www.npmjs.com/package/@semaphore-protocol/contracts">
|
|
16
16
|
<img alt="NPM version" src="https://img.shields.io/npm/v/@semaphore-protocol/contracts?style=flat-square" />
|
package/base/SemaphoreGroups.sol
CHANGED
|
@@ -123,6 +123,11 @@ abstract contract SemaphoreGroups is ISemaphoreGroups {
|
|
|
123
123
|
emit MemberRemoved(groupId, index, identityCommitment, merkleTreeRoot);
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
/// @dev See {ISemaphoreGroups-getGroupAdmin}.
|
|
127
|
+
function getGroupAdmin(uint256 groupId) public view virtual override returns (address) {
|
|
128
|
+
return admins[groupId];
|
|
129
|
+
}
|
|
130
|
+
|
|
126
131
|
/// @dev See {ISemaphoreGroups-hasMember}.
|
|
127
132
|
function hasMember(uint256 groupId, uint256 identityCommitment) public view virtual override returns (bool) {
|
|
128
133
|
return merkleTrees[groupId]._has(identityCommitment);
|
|
@@ -57,6 +57,11 @@ interface ISemaphoreGroups {
|
|
|
57
57
|
/// @param merkleTreeRoot: New root hash of the tree.
|
|
58
58
|
event MemberRemoved(uint256 indexed groupId, uint256 index, uint256 identityCommitment, uint256 merkleTreeRoot);
|
|
59
59
|
|
|
60
|
+
/// @dev Returns the address of the group admin.
|
|
61
|
+
/// @param groupId: Id of the group.
|
|
62
|
+
/// @return Address of the group admin.
|
|
63
|
+
function getGroupAdmin(uint256 groupId) external view returns (address);
|
|
64
|
+
|
|
60
65
|
/// @dev Returns true if a member exists in a group.
|
|
61
66
|
/// @param groupId: Id of the group.
|
|
62
67
|
/// @param identityCommitment: Identity commitment.
|