Skip to content

Commit

Permalink
refactor(contracts): optimize gas
Browse files Browse the repository at this point in the history
  • Loading branch information
vplasencia committed Jan 16, 2024
1 parent dd1e3a1 commit b0f40ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/contracts/contracts/base/SemaphoreGroups.sol
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ abstract contract SemaphoreGroups is ISemaphoreGroups {
uint256 groupId,
uint256 identityCommitment
) internal virtual onlyExistingGroup(groupId) onlyGroupAdmin(groupId) {
uint256 leafIndex = getMerkleTreeSize(groupId);
uint256 merkleTreeRoot = merkleTrees[groupId]._insert(identityCommitment);
uint256 leafIndex = getMerkleTreeSize(groupId) - 1;

emit MemberAdded(groupId, leafIndex, identityCommitment, merkleTreeRoot);
}
Expand Down

0 comments on commit b0f40ef

Please sign in to comment.