Search
⌃K

Verification Contract

Purpose

The verification contract manages verifiers and users verified by them. It allows:
  • Management (addition and removal) of verifiers by the admin
  • Management of user verification by verifiers
It helps to think of each verification as a separate identity of the user, similar to how one would have multiple digital accounts like Twitter, Github, or Youtube. Each identity can thus be thought of as There is an associated master address, to which additional child addresses can be linked (this is an important feature since oftentimes users utilize multiple wallet addresses actively).

Roles

Admin

Assignment

  • by deploying the contract
  • gaining ownership from previous owner

Permissions

  • Can transfer ownership to another admin
  • Can update contract implementation addresses

Verifier

Assignment

  • Onboarded by admin

Permissions

  • Can register, unregister user addresses to their verification method

Functionality

Adding a verifier

Adding a verifier is akin to adding a new verification method. The verifier handles all aspects of the registration process related to their verification method. Currently, new verifiers can only be added via admin.

Function

function addVerifier(address _verifier) external onlyOwner {

Approvals

  • None

Restrictions

  • Only admin can call this function for now
  • Every verifier needs to be unique

Arguments

  • _verifier: address of the verifier for the new verification method

Registering a new user

Registering a user involves adding their address to the verifier's mapping. This simply involves setting masterAddresses[_masterAddress][msg.sender] as true to indicate _masterAddress is verified by msg.sender.

Function

function registerMasterAddress(address _masterAddress, bool _isMasterLinked)
external override onlyVerifier {

Approvals

  • None

Restrictions

  • _masterAddress mustn't already be registered with msg.sender

Arguments

  • _masterAddress: Address of the user being verified
  • _isMasterLinked: if true, _masterAddress will be usable to perform other functions (such as identifying users registered with a verifier). If false _masterAddress will purely be considered for registering the user. Further addresses associated with the _masterAddress via linkAddress() will only be considered for any activities pertaining to verification.