Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NM Audit Fixes #118

Merged
merged 5 commits into from
Sep 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/WorldIDIdentityManagerImplV1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ contract WorldIDIdentityManagerImplV1 is WorldIDImpl, IWorldID {
/// group.
uint256 internal rootHistoryExpiry;

/// @notice Represents the initial leaf in an empty merkle tree.
/// @dev Prevents the empty leaf from being inserted into the root history.
uint256 internal constant EMPTY_LEAF = uint256(0);

/// @notice The `r` for the finite field `Fr` under which arithmetic is done on the proof input.
/// @dev Used internally to ensure that the proof input is scaled to within the field `Fr`.
uint256 internal constant SNARK_SCALAR_FIELD =
Expand Down Expand Up @@ -333,7 +329,7 @@ contract WorldIDIdentityManagerImplV1 is WorldIDImpl, IWorldID {
///////////////////////////////////////////////////////////////////////////////

/// @notice Registers identities into the WorldID system.
/// @dev Can only be called by the owner.
/// @dev Can only be called by the identity operator.
/// @dev Registration is performed off-chain and verified on-chain via the `insertionProof`.
/// This saves gas and time over inserting identities one at a time.
///
Expand Down Expand Up @@ -440,7 +436,7 @@ contract WorldIDIdentityManagerImplV1 is WorldIDImpl, IWorldID {
}

/// @notice Updates identities in the WorldID system.
/// @dev Can only be called by the owner.
/// @dev Can only be called by the identity operator.
/// @dev The update is performed off-chain and verified on-chain via the `updateProof`. This
/// saves gas and time over removing identities one at a time.
/// @dev This function can perform arbitrary identity alterations and does not require any
Expand Down Expand Up @@ -845,6 +841,8 @@ contract WorldIDIdentityManagerImplV1 is WorldIDImpl, IWorldID {
}
}

/// @notice Validates that an array of identity commitments is within bounds of the SNARK_SCALAR_FIELD
/// @param identityCommitments The array of identity commitments to be validated.
function validateArrayIsInReducedForm(uint256[] calldata identityCommitments)
internal
view
Expand Down
Loading