feat: Add user verification query view functions (getUserVerification, getVerificationLevel, getUserType) to IIdentityManagerV2
#70
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR extends the
IIdentityManagerV2interface with three new external view functions that enable on-chain access to user verification metadata, verification level, and user type.These additions enhance contract interoperability and improve front-end and analytics integrations by exposing granular identity state data directly through the interface.
Changes Overview
🧩 Added External View Functions
1.
getUserVerification(address user)Description:
Returns the complete
UserVerificationstruct for a given user, containing all relevant verification data.Returns:
UserVerificationstruct including:isVerified— Current verification statuslevel— VerificationLevel (e.g., NONE, DEVICE, ORB)userType— UserType (e.g., STUDENT, INSTITUTION, VERIFIER, ADMIN)verificationTimestamp— Timestamp of last verificationexpirationTimestamp— Expiration time of current verificationnullifierHash— Hash identifier used for zero-knowledge validationmetadata— Optional metadata string for contextual informationPurpose:
2.
getVerificationLevel(address user)Description:
Returns the current
VerificationLevelenum value for a specified user.Returns:
VerificationLevel— Enum representing the verification tier (e.g.,NONE,DEVICE,ORB).Purpose:
3.
getUserType(address user)Description:
Returns the
UserTypeenum value for the provided user address.Returns:
UserType— Enum representing the user’s category (e.g.,STUDENT,INSTITUTION,VERIFIER,ADMIN).Purpose:
Motivation
These additions make
IIdentityManagerV2a more complete and developer-friendly identity interface by exposing key read-only utilities needed by external contracts, dApps, and off-chain systems.The goal is to improve transparency, modularity, and accessibility of user verification data across the ecosystem.
Implementation Notes
external view— ensuring no gas costs for read-only calls.forge fmt) for consistent code style.Next Steps
IdentityManagerV2implementation contract.Result:
This PR enhances on-chain identity introspection capabilities by adding structured, efficient view functions to
IIdentityManagerV2, making verification and user-type data more transparent and accessible across smart contracts and front-end applications.