Skip to content

Commit

Permalink
add auth validators
Browse files Browse the repository at this point in the history
  • Loading branch information
daveroga committed Nov 26, 2024
1 parent 779513f commit 8da12c7
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions contracts/verifiers/UniversalVerifierMultiQuery.sol
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ contract UniversalVerifierMultiQuery is Ownable2StepUpgradeable {
// Information linked between users and their addresses
mapping(address userAddress => uint256 userID) _user_address_to_id;
mapping(uint256 userID => address userAddress) _id_to_user_address; // check address[] to allow multiple addresses for the same userID?

Check failure on line 88 in contracts/verifiers/UniversalVerifierMultiQuery.sol

View workflow job for this annotation

GitHub Actions / solhint

Line length must be no more than 120 but current length is 143

Check failure on line 89 in contracts/verifiers/UniversalVerifierMultiQuery.sol

View workflow job for this annotation

GitHub Actions / solhint

Delete ⏎····
// Information about auth validators
mapping(uint256 authID => address authValidator) _auth_validators;
uint256[] _authIds;
}

// keccak256(abi.encode(uint256(keccak256("iden3.storage.UniversalVerifierMultiQuery")) - 1)) & ~bytes32(uint256(0xff));

Check failure on line 95 in contracts/verifiers/UniversalVerifierMultiQuery.sol

View workflow job for this annotation

GitHub Actions / solhint

Line length must be no more than 120 but current length is 124
Expand Down Expand Up @@ -282,4 +286,24 @@ contract UniversalVerifierMultiQuery is Ownable2StepUpgradeable {
proof.blockNumber = block.number;
proof.blockTimestamp = block.timestamp;
}

/**
* @dev Adds an auth validator
* @param authID The Id of the auth validator
* @param authValidator The auth validator address
*/
function addAuthValidator(uint256 authID, address authValidator) public onlyOwner {
UniversalVerifierMultiQueryStorage storage $ = _getUniversalVerifierMultiQueryStorage();
$._auth_validators[authID] = authValidator;
$._authIds.push(authID);
}

/**
* @dev Gets an auth validator
* @param authID The Id of the auth validator
* @return The auth validator address
*/
function getAuthValidator(uint256 authID) public view returns (address) {
return _getUniversalVerifierMultiQueryStorage()._auth_validators[authID];
}
}

0 comments on commit 8da12c7

Please sign in to comment.