Skip to content

Commit

Permalink
Merge pull request #167 from semaphore-protocol/fix/merkle-root-creat…
Browse files Browse the repository at this point in the history
…ion-dates

Merkle roots for any tree update
  • Loading branch information
cedoor committed Nov 20, 2022
2 parents 7061785 + be4165a commit 583311f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/contracts/contracts/Semaphore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ contract Semaphore is ISemaphore, SemaphoreGroups {
uint8[] calldata proofPathIndices
) external override onlyGroupAdmin(groupId) {
_updateMember(groupId, identityCommitment, newIdentityCommitment, proofSiblings, proofPathIndices);

uint256 merkleTreeRoot = getMerkleTreeRoot(groupId);

groups[groupId].merkleRootCreationDates[merkleTreeRoot] = block.timestamp;
}

/// @dev See {ISemaphore-removeMember}.
Expand All @@ -121,6 +125,10 @@ contract Semaphore is ISemaphore, SemaphoreGroups {
uint8[] calldata proofPathIndices
) external override onlyGroupAdmin(groupId) {
_removeMember(groupId, identityCommitment, proofSiblings, proofPathIndices);

uint256 merkleTreeRoot = getMerkleTreeRoot(groupId);

groups[groupId].merkleRootCreationDates[merkleTreeRoot] = block.timestamp;
}

/// @dev See {ISemaphore-verifyProof}.
Expand Down

0 comments on commit 583311f

Please sign in to comment.