Skip to content

Commit

Permalink
fix: set correct index value
Browse files Browse the repository at this point in the history
Former-commit-id: cf3e877
  • Loading branch information
cedoor committed Sep 14, 2022
1 parent 65fbd73 commit 9487de5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contracts/base/SemaphoreGroups.sol
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ abstract contract SemaphoreGroups is Context, ISemaphoreGroups {
groups[groupId].insert(identityCommitment);

uint256 merkleTreeRoot = getMerkleTreeRoot(groupId);
uint256 index = getNumberOfMerkleTreeLeaves(groupId);
uint256 index = getNumberOfMerkleTreeLeaves(groupId) - 1;

emit MemberAdded(groupId, index - 1, identityCommitment, merkleTreeRoot);
emit MemberAdded(groupId, index, identityCommitment, merkleTreeRoot);
}

/// @dev Updates an identity commitment of an existing group. A proof of membership is
Expand Down

0 comments on commit 9487de5

Please sign in to comment.