mirror of
https://github.com/selfxyz/self.git
synced 2026-01-07 22:04:03 -05:00
Feat/update contract scripts (#1212)
* chore: add a verifier script * chore: remove expirty and add update registry script * chore: change script to the new aadhaar contract * chore: add new deployed addresses * fix: tests * feat: add scripts for registries and the hub * feat: add aadhaar registry * feat: add more scripts * chore: rm logs * fix: hardhat config * update scripts * fix: test * accept proofs 1 day in the future * fix: prettier formatting issues in contracts and circuits --------- Co-authored-by: ayman <aymanshaik1015@gmail.com> Co-authored-by: Ayman Mohammed <ayman@Aymans-MacBook-Pro.local>
This commit is contained in:
@@ -17,7 +17,7 @@ OUTPUT_DIR="build/${CIRCUIT_TYPE}"
|
||||
CIRCUITS=(
|
||||
# "vc_and_disclose:20:true"
|
||||
# "vc_and_disclose_id:20:true"
|
||||
"vc_and_disclose_aadhaar:20:true"
|
||||
"vc_and_disclose_aadhaar:17:true"
|
||||
)
|
||||
|
||||
build_circuits "$CIRCUIT_TYPE" "$OUTPUT_DIR" "${CIRCUITS[@]}"
|
||||
|
||||
@@ -1,49 +1,5 @@
|
||||
export const pubkeys = [
|
||||
`-----BEGIN CERTIFICATE-----
|
||||
MIIHwjCCBqqgAwIBAgIEU5laMzANBgkqhkiG9w0BAQsFADCB/DELMAkGA1UEBhMC
|
||||
SU4xQTA/BgNVBAoTOEd1amFyYXQgTmFybWFkYSBWYWxsZXkgRmVydGlsaXplcnMg
|
||||
YW5kIENoZW1pY2FscyBMaW1pdGVkMR0wGwYDVQQLExRDZXJ0aWZ5aW5nIEF1dGhv
|
||||
cml0eTEPMA0GA1UEERMGMzgwMDU0MRAwDgYDVQQIEwdHdWphcmF0MSYwJAYDVQQJ
|
||||
Ex1Cb2Rha2RldiwgUyBHIFJvYWQsIEFobWVkYWJhZDEcMBoGA1UEMxMTMzAxLCBH
|
||||
TkZDIEluZm90b3dlcjEiMCAGA1UEAxMZKG4pQ29kZSBTb2x1dGlvbnMgQ0EgMjAx
|
||||
NDAeFw0yMTAyMjYxMTU0MjRaFw0yNDAyMj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
||||
ayQQs6AUzDvsH1yBSBjsaZo3fwBgQUIMaNKdKSrRI0eOTDqilizldHqj113f4eUz
|
||||
U2j4okcNSF7TxQWMjxwyM86QsQ6vxZK7arhBhVjwp443+pxfSIdFUu428K6yH4JB
|
||||
GhZSzWuqD6GNhOhDzS+sS23MkwHFq0GX4erhVfN/W7XLeSjzF4zmjg+O77vTySCN
|
||||
e2VRYDrfFS8EAOcO4q7szc7+6xdg8RlgzoZHoRG/GqUp9inpJUn7OIzhHi2e8Mll
|
||||
aMdtXo0nbr150tMe8ZSvY2fMiTCY1w==
|
||||
-----END CERTIFICATE-----`,
|
||||
`-----BEGIN CERTIFICATE-----
|
||||
MIIHCjCCBfKgAwIBAgIEYklh9TANBgkqhkiG9w0BAQsFADCBkTELMAkGA1UEBhMC
|
||||
SU4xQTA/BgNVBAoTOEd1amFyYXQgTmFybWFkYSBWYWxsZXkgRmVydGlsaXplcnMg
|
||||
YW5kIENoZW1pY2FscyBMaW1pdGVkMQ8wDQYDVQQLEwZTdWItQ0ExLjAsBgNVBAMT
|
||||
@@ -122,6 +78,51 @@ d5PKhaNTJUCnoF6djlW8cf6eten7l21iBtFNAvKBfikmBOMZXe6cB+9ShOCOKz5zSzUwW+eZHSM4
|
||||
3qCQ9G39img=
|
||||
-----END CERTIFICATE-----`,
|
||||
`-----BEGIN CERTIFICATE-----
|
||||
MIIHwjCCBqqgAwIBAgIEU5laMzANBgkqhkiG9w0BAQsFADCB/DELMAkGA1UEBhMC
|
||||
SU4xQTA/BgNVBAoTOEd1amFyYXQgTmFybWFkYSBWYWxsZXkgRmVydGlsaXplcnMg
|
||||
YW5kIENoZW1pY2FscyBMaW1pdGVkMR0wGwYDVQQLExRDZXJ0aWZ5aW5nIEF1dGhv
|
||||
cml0eTEPMA0GA1UEERMGMzgwMDU0MRAwDgYDVQQIEwdHdWphcmF0MSYwJAYDVQQJ
|
||||
Ex1Cb2Rha2RldiwgUyBHIFJvYWQsIEFobWVkYWJhZDEcMBoGA1UE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AZBgkqhkiG9n0HQQAEDDAKGwRWOC4xAwIDKDANBgkqhkiG9w0BAQsF
|
||||
AAOCAQEAbTlOC4sonzb44+u5+VZ3wGz3OFg0uJGsufbBu5efh7kO2DlYnx7okdEf
|
||||
ayQQs6AUzDvsH1yBSBjsaZo3fwBgQUIMaNKdKSrRI0eOTDqilizldHqj113f4eUz
|
||||
U2j4okcNSF7TxQWMjxwyM86QsQ6vxZK7arhBhVjwp443+pxfSIdFUu428K6yH4JB
|
||||
GhZSzWuqD6GNhOhDzS+sS23MkwHFq0GX4erhVfN/W7XLeSjzF4zmjg+O77vTySCN
|
||||
e2VRYDrfFS8EAOcO4q7szc7+6xdg8RlgzoZHoRG/GqUp9inpJUn7OIzhHi2e8Mll
|
||||
aMdtXo0nbr150tMe8ZSvY2fMiTCY1w==
|
||||
-----END CERTIFICATE-----
|
||||
`,
|
||||
`-----BEGIN CERTIFICATE-----
|
||||
MIIHbjCCBlagAwIBAgIEU2dtwjANBgkqhkiG9w0BAQsFADCB/DELMAkGA1UEBhMCSU4xQTA/BgNV
|
||||
BAoTOEd1amFyYXQgTmFybWFkYSBWYWxsZXkgRmVydGlsaXplcnMgYW5kIENoZW1pY2FscyBMaW1p
|
||||
dGVkMR0wGwYDVQQLExRDZXJ0aWZ5aW5nIEF1dGhvcml0eTEPMA0GA1UEERMGMzgwMDU0MRAwDgYD
|
||||
@@ -158,4 +159,33 @@ Mr+7aekDj/As2OJW793WNdJ6Xx4hPQt5TYsS1UvL9Q6ykuIXd9njj/KjMsw1RvJ5prvugdPqNOMp
|
||||
Rf63zec3hTCKWm5YI7NBirwrBd1K14DVBQ==
|
||||
-----END CERTIFICATE-----
|
||||
`,
|
||||
`-----BEGIN CERTIFICATE-----
|
||||
MIIF+jCCBOKgAwIBAgIEANbI0DANBgkqhkiG9w0BAQsFADCBkzELMAkGA1UEBhMCSU4xKjAoBgNV
|
||||
BAoTIWVNdWRocmEgQ29uc3VtZXIgU2VydmljZXMgTGltaXRlZDEdMB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 import { bufferToHex, Uint8ArrayToCharArray } from '@zk-email/helpers/dist/binar
|
||||
import { convertBigIntToByteArray, decompressByteArray, splitToWords } from '@anon-aadhaar/core';
|
||||
import assert from 'assert';
|
||||
import { customHasher } from '@selfxyz/common/utils/hash';
|
||||
import forge from 'node-forge';
|
||||
import {
|
||||
prepareAadhaarRegisterTestData,
|
||||
generateTestData,
|
||||
@@ -184,8 +185,19 @@ describe('REGISTER AADHAAR Circuit Tests', function () {
|
||||
const w = await circuit.calculateWitness(inputs);
|
||||
await circuit.checkConstraints(w);
|
||||
|
||||
const out = await circuit.getOutput(w, ['nullifier', 'commitment']);
|
||||
const out = await circuit.getOutput(w, ['nullifier', 'commitment', 'pubKeyHash']);
|
||||
assert(BigInt(out.nullifier) === BigInt(nullifier));
|
||||
assert(BigInt(out.commitment) === BigInt(commitment));
|
||||
});
|
||||
|
||||
it.skip('should log all pubkey commitments', async function () {
|
||||
this.timeout(0);
|
||||
for (const cert of pubkeys) {
|
||||
const certObj = forge.pki.certificateFromPem(cert);
|
||||
const modulusHex = (certObj.publicKey as forge.pki.rsa.PublicKey).n.toString(16);
|
||||
const pubkey = BigInt('0x' + modulusHex);
|
||||
const pubkeyCommitment = customHasher(splitToWords(pubkey, BigInt(121), BigInt(17)));
|
||||
console.log(pubkeyCommitment);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
9
contracts/.gitignore
vendored
9
contracts/.gitignore
vendored
@@ -12,10 +12,17 @@ ignition/deployed_addresses.json
|
||||
ignition/parameters.json
|
||||
|
||||
# Ignore all deployment folders except important ones
|
||||
ignition/deployments/*
|
||||
!ignition/deployments/prod/
|
||||
!ignition/deployments/staging/
|
||||
|
||||
# For chain-11142220, keep only essential files
|
||||
ignition/deployments/chain-11142220/*
|
||||
!ignition/deployments/chain-11142220/deployed_addresses.json
|
||||
|
||||
# For chain-42220, keep only essential files
|
||||
ignition/deployments/chain-42220/*
|
||||
!ignition/deployments/chain-42220/deployed_addresses.json
|
||||
|
||||
# For important environments, keep only essential files
|
||||
ignition/deployments/{prod,staging}/*
|
||||
!ignition/deployments/{prod,staging}/deployed_addresses.json
|
||||
|
||||
@@ -44,6 +44,9 @@ contract IdentityVerificationHubImplV2 is ImplRoot {
|
||||
bytes32 private constant IDENTITYVERIFICATIONHUBV2_STORAGE_LOCATION =
|
||||
0xf9b5980dcec1a8b0609576a1f453bb2cad4732a0ea02bb89154d44b14a306c00;
|
||||
|
||||
/// @notice The AADHAAR registration window around the current block timestamp.
|
||||
uint256 public AADHAAR_REGISTRATION_WINDOW = 20;
|
||||
|
||||
/**
|
||||
* @notice Returns the storage struct for the main IdentityVerificationHub.
|
||||
* @dev Uses ERC-7201 storage pattern for upgradeable contracts.
|
||||
@@ -197,7 +200,7 @@ contract IdentityVerificationHubImplV2 is ImplRoot {
|
||||
|
||||
/// @notice Thrown when the timestamp is invalid.
|
||||
/// @dev Ensures that the timestamp is within 20 minutes of the current block timestamp.
|
||||
error InvalidUidaiTimestamp();
|
||||
error InvalidUidaiTimestamp(uint256 blockTimestamp, uint256 timestamp);
|
||||
|
||||
/// @notice Thrown when the attestationId in the proof doesn't match the header.
|
||||
/// @dev Ensures that the attestationId in the proof matches the header.
|
||||
@@ -225,12 +228,12 @@ contract IdentityVerificationHubImplV2 is ImplRoot {
|
||||
// ====================================================
|
||||
|
||||
/**
|
||||
* @notice Initializes the Identity Verification Hub V2 contract.
|
||||
* @notice Initializes the Identity Verification Hub V2 contract for upgrade.
|
||||
* @dev Sets up the contract state including circuit version and emits initialization event.
|
||||
* This function can only be called once due to the initializer modifier.
|
||||
* This function is used when upgrading from V1 to V2, hence uses reinitializer(2).
|
||||
* The circuit version is set to 2 for V2 hub compatibility.
|
||||
*/
|
||||
function initialize() external initializer {
|
||||
function initialize() external reinitializer(11) {
|
||||
__ImplRoot_init();
|
||||
|
||||
// Initialize circuit version to 2 for V2 hub
|
||||
@@ -322,6 +325,14 @@ contract IdentityVerificationHubImplV2 is ImplRoot {
|
||||
emit VerificationConfigV2Set(configId, config);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notice Updates the AADHAAR registration window.
|
||||
* @param window The new AADHAAR registration window.
|
||||
*/
|
||||
function setAadhaarRegistrationWindow(uint256 window) external virtual onlyProxy onlyOwner {
|
||||
AADHAAR_REGISTRATION_WINDOW = window;
|
||||
}
|
||||
|
||||
/**
|
||||
* @notice Main verification function with new structured input format.
|
||||
* @dev Orchestrates the complete verification process including proof validation and result handling.
|
||||
@@ -751,12 +762,11 @@ contract IdentityVerificationHubImplV2 is ImplRoot {
|
||||
}
|
||||
} else if (attestationId == AttestationId.AADHAAR) {
|
||||
uint256 timestamp = registerCircuitProof.pubSignals[CircuitConstantsV2.AADHAAR_TIMESTAMP_INDEX];
|
||||
if (timestamp < (block.timestamp - 20 minutes)) {
|
||||
revert InvalidUidaiTimestamp();
|
||||
if (timestamp < (block.timestamp - (AADHAAR_REGISTRATION_WINDOW * 1 minutes))) {
|
||||
revert InvalidUidaiTimestamp(block.timestamp, timestamp);
|
||||
}
|
||||
|
||||
if (timestamp > (block.timestamp + 20 minutes)) {
|
||||
revert InvalidUidaiTimestamp();
|
||||
if (timestamp > (block.timestamp + (AADHAAR_REGISTRATION_WINDOW * 1 minutes))) {
|
||||
revert InvalidUidaiTimestamp(block.timestamp, timestamp);
|
||||
}
|
||||
|
||||
if (
|
||||
@@ -984,8 +994,9 @@ contract IdentityVerificationHubImplV2 is ImplRoot {
|
||||
|
||||
uint256 currentTimestamp = Formatter.proofDateToUnixTimestamp(dateNum);
|
||||
uint256 startOfDay = _getStartOfDayTimestamp();
|
||||
uint256 endOfDay = startOfDay + 1 days - 1;
|
||||
|
||||
if (currentTimestamp < startOfDay - 1 days + 1 || currentTimestamp > startOfDay + 1 days - 1) {
|
||||
if (currentTimestamp < startOfDay - 1 days + 1 || currentTimestamp > endOfDay + 1 days) {
|
||||
revert CurrentDateNotInValidRange();
|
||||
}
|
||||
}
|
||||
@@ -1002,8 +1013,9 @@ contract IdentityVerificationHubImplV2 is ImplRoot {
|
||||
|
||||
uint256 currentTimestamp = Formatter.proofDateToUnixTimestampNumeric(dateNum);
|
||||
uint256 startOfDay = _getStartOfDayTimestamp();
|
||||
uint256 endOfDay = startOfDay + 1 days - 1;
|
||||
|
||||
if (currentTimestamp < startOfDay - 1 days + 1 || currentTimestamp > startOfDay + 1 days - 1) {
|
||||
if (currentTimestamp < startOfDay - 1 days + 1 || currentTimestamp > endOfDay + 1 days) {
|
||||
revert CurrentDateNotInValidRange();
|
||||
}
|
||||
}
|
||||
@@ -1232,6 +1244,12 @@ contract IdentityVerificationHubImplV2 is ImplRoot {
|
||||
}
|
||||
aadhaarOutput.revealedDataPacked = Formatter.fieldElementsToBytesAadhaar(revealedDataPacked);
|
||||
|
||||
for (uint256 i = 0; i < 4; i++) {
|
||||
aadhaarOutput.forbiddenCountriesListPacked[i] = vcAndDiscloseProof.pubSignals[
|
||||
indices.forbiddenCountriesListPackedIndex + i
|
||||
];
|
||||
}
|
||||
|
||||
return abi.encode(aadhaarOutput);
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,6 @@ interface IIdentityRegistryAadhaarV1 {
|
||||
* @notice Registers a new UIDAI pubkey commitment.
|
||||
* @dev Must be called by the identity verification hub. Reverts if the UIDAI pubkey commitment is already registered.
|
||||
* @param commitment The UIDAI pubkey commitment to register.
|
||||
* @param expiryTimestamp The expiry timestamp of the commitment.
|
||||
*/
|
||||
function registerUidaiPubkeyCommitment(uint256 commitment, uint256 expiryTimestamp) external;
|
||||
function registerUidaiPubkeyCommitment(uint256 commitment) external;
|
||||
}
|
||||
|
||||
@@ -56,8 +56,8 @@ abstract contract IdentityRegistryAadhaarStorageV1 is ImplRoot {
|
||||
/// @notice Mapping from nullifier to a boolean indicating registration.
|
||||
mapping(uint256 => bool) internal _nullifiers;
|
||||
|
||||
/// @notice Mapping from UIDAI pubkey to the expirty timestamp.
|
||||
mapping(uint256 => uint256) internal _uidaiPubkeyExpiryTimestamps;
|
||||
/// @notice Mapping from UIDAI pubkey to a boolean indicating registration.
|
||||
mapping(uint256 => bool) internal _uidaiPubkeyCommitments;
|
||||
|
||||
/// @notice Current name and date of birth OFAC root.
|
||||
uint256 internal _nameAndDobOfacRoot;
|
||||
@@ -132,8 +132,6 @@ contract IdentityRegistryAadhaarImplV1 is IdentityRegistryAadhaarStorageV1, IIde
|
||||
error ONLY_HUB_CAN_ACCESS();
|
||||
/// @notice Thrown when attempting to register a commitment that has already been registered.
|
||||
error REGISTERED_COMMITMENT();
|
||||
/// @notice Thrown when the expiry timestamp is in the past.
|
||||
error EXPIRY_IN_PAST();
|
||||
/// @notice Thrown when the hub address is set to the zero address.
|
||||
error HUB_ADDRESS_ZERO();
|
||||
|
||||
@@ -198,15 +196,7 @@ contract IdentityRegistryAadhaarImplV1 is IdentityRegistryAadhaarStorageV1, IIde
|
||||
/// @param commitment The UIDAI pubkey commitment to check.
|
||||
/// @return True if the commitment is registered, false otherwise.
|
||||
function isRegisteredUidaiPubkeyCommitment(uint256 commitment) external view virtual onlyProxy returns (bool) {
|
||||
uint256 expiryTimestamp = _uidaiPubkeyExpiryTimestamps[commitment];
|
||||
return expiryTimestamp > block.timestamp;
|
||||
}
|
||||
|
||||
/// @notice Retrieves the expiry timestamp of a UIDAI pubkey commitment.
|
||||
/// @param commitment The UIDAI pubkey commitment to check.
|
||||
/// @return The expiry timestamp of the commitment.
|
||||
function getUidaiPubkeyExpiryTimestamp(uint256 commitment) external view virtual onlyProxy returns (uint256) {
|
||||
return _uidaiPubkeyExpiryTimestamps[commitment];
|
||||
return _uidaiPubkeyCommitments[commitment];
|
||||
}
|
||||
|
||||
/// @notice Checks if the identity commitment Merkle tree contains the specified root.
|
||||
@@ -262,8 +252,7 @@ contract IdentityRegistryAadhaarImplV1 is IdentityRegistryAadhaarStorageV1, IIde
|
||||
/// @param pubkey The UIDAI pubkey to verify.
|
||||
/// @return True if the given pubkey is stored in the registry and also if it's not expired, otherwise false.
|
||||
function checkUidaiPubkey(uint256 pubkey) external view virtual onlyProxy returns (bool) {
|
||||
uint256 expiryTimestamp = _uidaiPubkeyExpiryTimestamps[pubkey];
|
||||
return expiryTimestamp > block.timestamp;
|
||||
return _uidaiPubkeyCommitments[pubkey];
|
||||
}
|
||||
|
||||
// ====================================================
|
||||
@@ -316,32 +305,25 @@ contract IdentityRegistryAadhaarImplV1 is IdentityRegistryAadhaarStorageV1, IIde
|
||||
/// @notice Registers a new UIDAI pubkey commitment.
|
||||
/// @dev Callable only via a proxy and restricted to the contract owner.
|
||||
/// @param commitment The UIDAI pubkey commitment to register.
|
||||
/// @param expiryTimestamp The expiry timestamp of the commitment.
|
||||
function registerUidaiPubkeyCommitment(uint256 commitment, uint256 expiryTimestamp) external onlyProxy onlyOwner {
|
||||
if (expiryTimestamp < block.timestamp) revert EXPIRY_IN_PAST();
|
||||
_uidaiPubkeyExpiryTimestamps[commitment] = expiryTimestamp;
|
||||
emit UidaiPubkeyCommitmentRegistered(commitment, expiryTimestamp);
|
||||
function registerUidaiPubkeyCommitment(uint256 commitment) external onlyProxy onlyOwner {
|
||||
_uidaiPubkeyCommitments[commitment] = true;
|
||||
emit UidaiPubkeyCommitmentRegistered(commitment, block.timestamp);
|
||||
}
|
||||
|
||||
/// @notice Removes a UIDAI pubkey commitment.
|
||||
/// @dev Callable only via a proxy and restricted to the contract owner.
|
||||
/// @param commitment The UIDAI pubkey commitment to remove.
|
||||
function removeUidaiPubkeyCommitment(uint256 commitment) external onlyProxy onlyOwner {
|
||||
delete _uidaiPubkeyExpiryTimestamps[commitment];
|
||||
delete _uidaiPubkeyCommitments[commitment];
|
||||
emit UidaiPubkeyCommitmentRemoved(commitment, block.timestamp);
|
||||
}
|
||||
|
||||
/// @notice Updates the expiry timestamp of a UIDAI pubkey commitment.
|
||||
/// @notice Updates a UIDAI pubkey commitment.
|
||||
/// @dev Callable only via a proxy and restricted to the contract owner.
|
||||
/// @param commitment The UIDAI pubkey commitment to update.
|
||||
/// @param expiryTimestamp The new expiry timestamp of the commitment.
|
||||
function updateUidaiPubkeyCommitmentExpiryTimestamp(
|
||||
uint256 commitment,
|
||||
uint256 expiryTimestamp
|
||||
) external onlyProxy onlyOwner {
|
||||
if (expiryTimestamp < block.timestamp) revert EXPIRY_IN_PAST();
|
||||
_uidaiPubkeyExpiryTimestamps[commitment] = expiryTimestamp;
|
||||
emit UidaiPubkeyCommitmentUpdated(commitment, expiryTimestamp);
|
||||
function updateUidaiPubkeyCommitment(uint256 commitment) external onlyProxy onlyOwner {
|
||||
_uidaiPubkeyCommitments[commitment] = true;
|
||||
emit UidaiPubkeyCommitmentUpdated(commitment, block.timestamp);
|
||||
}
|
||||
|
||||
/// @notice (DEV) Force-adds an identity commitment.
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity 0.8.28;
|
||||
|
||||
import {ImplRoot} from "../upgradeable/ImplRoot.sol";
|
||||
|
||||
abstract contract UpgradedIdentityVerificationHubStorageV2 {
|
||||
bool internal _isTest;
|
||||
address internal _registry;
|
||||
address internal _vcAndDiscloseCircuitVerifier;
|
||||
mapping(uint256 => address) internal _sigTypeToRegisterCircuitVerifiers;
|
||||
mapping(uint256 => address) internal _sigTypeToDscCircuitVerifiers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @title testUpgradedIdentityVerificationHubImplV2
|
||||
* @notice Test Implementation contract for the Identity Verification Hub V2 upgrade.
|
||||
* @dev Provides functions for testing upgrade functionality.
|
||||
*/
|
||||
contract testUpgradedIdentityVerificationHubImplV2 is ImplRoot, UpgradedIdentityVerificationHubStorageV2 {
|
||||
// ====================================================
|
||||
// Events
|
||||
// ====================================================
|
||||
|
||||
/**
|
||||
* @notice Emitted when the hub is initialized.
|
||||
*/
|
||||
event TestHubInitialized();
|
||||
|
||||
// ====================================================
|
||||
// Constructor
|
||||
// ====================================================
|
||||
|
||||
/**
|
||||
* @notice Constructor that disables initializers.
|
||||
* @dev Prevents direct initialization of the implementation contract.
|
||||
*/
|
||||
constructor() {
|
||||
_disableInitializers();
|
||||
}
|
||||
|
||||
// ====================================================
|
||||
// Initializer
|
||||
// ====================================================
|
||||
|
||||
/**
|
||||
* @notice Initializes the hub implementation.
|
||||
* @dev Sets the registry, VC and Disclose circuit verifier address, register circuit verifiers, and DSC circuit verifiers.
|
||||
* @param isTestInput Boolean value which shows it is test or not
|
||||
*/
|
||||
function initialize(bool isTestInput) external reinitializer(3) {
|
||||
__ImplRoot_init();
|
||||
_isTest = isTestInput;
|
||||
emit TestHubInitialized();
|
||||
}
|
||||
|
||||
// ====================================================
|
||||
// External View Functions
|
||||
// ====================================================
|
||||
|
||||
function isTest() external view virtual onlyProxy returns (bool) {
|
||||
return _isTest;
|
||||
}
|
||||
|
||||
function registry() external view virtual onlyProxy returns (address) {
|
||||
return _registry;
|
||||
}
|
||||
|
||||
function vcAndDiscloseCircuitVerifier() external view virtual onlyProxy returns (address) {
|
||||
return _vcAndDiscloseCircuitVerifier;
|
||||
}
|
||||
|
||||
function sigTypeToRegisterCircuitVerifiers(uint256 typeId) external view virtual onlyProxy returns (address) {
|
||||
return _sigTypeToRegisterCircuitVerifiers[typeId];
|
||||
}
|
||||
|
||||
function sigTypeToDscCircuitVerifiers(uint256 typeId) external view virtual onlyProxy returns (address) {
|
||||
return _sigTypeToDscCircuitVerifiers[typeId];
|
||||
}
|
||||
}
|
||||
@@ -32,14 +32,14 @@
|
||||
"signature": "NoVerifierSet()",
|
||||
"selector": "0x0ee78d58",
|
||||
"file": "contracts/IdentityVerificationHubImplV2.sol",
|
||||
"line": 136
|
||||
"line": 139
|
||||
},
|
||||
{
|
||||
"name": "InvalidAttestationId",
|
||||
"signature": "InvalidAttestationId()",
|
||||
"selector": "0x12ec75fe",
|
||||
"file": "contracts/IdentityVerificationHubImplV2.sol",
|
||||
"line": 168
|
||||
"line": 171
|
||||
},
|
||||
{
|
||||
"name": "InvalidAttestationId",
|
||||
@@ -60,7 +60,7 @@
|
||||
"signature": "InvalidDscProof()",
|
||||
"selector": "0x1644e049",
|
||||
"file": "contracts/IdentityVerificationHubImplV2.sol",
|
||||
"line": 148
|
||||
"line": 151
|
||||
},
|
||||
{
|
||||
"name": "InvalidYearRange",
|
||||
@@ -88,7 +88,7 @@
|
||||
"signature": "HUB_ADDRESS_ZERO()",
|
||||
"selector": "0x22697ffa",
|
||||
"file": "contracts/registry/IdentityRegistryAadhaarImplV1.sol",
|
||||
"line": 138
|
||||
"line": 136
|
||||
},
|
||||
{
|
||||
"name": "RegisteredNullifier",
|
||||
@@ -123,7 +123,7 @@
|
||||
"signature": "InvalidPubkey()",
|
||||
"selector": "0x422cc3b7",
|
||||
"file": "contracts/IdentityVerificationHubImplV2.sol",
|
||||
"line": 196
|
||||
"line": 199
|
||||
},
|
||||
{
|
||||
"name": "InvalidOlderThan",
|
||||
@@ -137,7 +137,7 @@
|
||||
"signature": "InvalidDscCommitmentRoot()",
|
||||
"selector": "0x4cb305bb",
|
||||
"file": "contracts/IdentityVerificationHubImplV2.sol",
|
||||
"line": 160
|
||||
"line": 163
|
||||
},
|
||||
{
|
||||
"name": "HUB_NOT_SET",
|
||||
@@ -200,7 +200,7 @@
|
||||
"signature": "CrossChainIsNotSupportedYet()",
|
||||
"selector": "0x61296fbb",
|
||||
"file": "contracts/IdentityVerificationHubImplV2.sol",
|
||||
"line": 176
|
||||
"line": 179
|
||||
},
|
||||
{
|
||||
"name": "AlreadyClaimed",
|
||||
@@ -221,14 +221,14 @@
|
||||
"signature": "InputTooShort()",
|
||||
"selector": "0x65ec0cf1",
|
||||
"file": "contracts/IdentityVerificationHubImplV2.sol",
|
||||
"line": 180
|
||||
"line": 183
|
||||
},
|
||||
{
|
||||
"name": "InvalidRegisterProof",
|
||||
"signature": "InvalidRegisterProof()",
|
||||
"selector": "0x67b61dc7",
|
||||
"file": "contracts/IdentityVerificationHubImplV2.sol",
|
||||
"line": 144
|
||||
"line": 147
|
||||
},
|
||||
{
|
||||
"name": "RegistrationNotClosed",
|
||||
@@ -251,6 +251,13 @@
|
||||
"file": "contracts/example/Airdrop.sol",
|
||||
"line": 72
|
||||
},
|
||||
{
|
||||
"name": "InvalidUidaiTimestamp",
|
||||
"signature": "InvalidUidaiTimestamp(uint256,uint256)",
|
||||
"selector": "0x6f26ab8d",
|
||||
"file": "contracts/IdentityVerificationHubImplV2.sol",
|
||||
"line": 203
|
||||
},
|
||||
{
|
||||
"name": "INVALID_OFAC",
|
||||
"signature": "INVALID_OFAC()",
|
||||
@@ -258,13 +265,6 @@
|
||||
"file": "contracts/IdentityVerificationHubImplV1.sol",
|
||||
"line": 146
|
||||
},
|
||||
{
|
||||
"name": "InvalidUidaiTimestamp",
|
||||
"signature": "InvalidUidaiTimestamp()",
|
||||
"selector": "0x72b3dac6",
|
||||
"file": "contracts/IdentityVerificationHubImplV2.sol",
|
||||
"line": 200
|
||||
},
|
||||
{
|
||||
"name": "InvalidForbiddenCountries",
|
||||
"signature": "InvalidForbiddenCountries()",
|
||||
@@ -319,7 +319,7 @@
|
||||
"signature": "InvalidCscaRoot()",
|
||||
"selector": "0x8f1b44c7",
|
||||
"file": "contracts/IdentityVerificationHubImplV2.sol",
|
||||
"line": 164
|
||||
"line": 167
|
||||
},
|
||||
{
|
||||
"name": "INVALID_REGISTER_PROOF",
|
||||
@@ -333,7 +333,7 @@
|
||||
"signature": "UserContextDataTooShort()",
|
||||
"selector": "0x94ec3503",
|
||||
"file": "contracts/IdentityVerificationHubImplV2.sol",
|
||||
"line": 184
|
||||
"line": 187
|
||||
},
|
||||
{
|
||||
"name": "NotWithinBirthdayWindow",
|
||||
@@ -361,7 +361,7 @@
|
||||
"signature": "ConfigNotSet()",
|
||||
"selector": "0xace124bc",
|
||||
"file": "contracts/IdentityVerificationHubImplV2.sol",
|
||||
"line": 192
|
||||
"line": 195
|
||||
},
|
||||
{
|
||||
"name": "InvalidDateLength",
|
||||
@@ -410,21 +410,14 @@
|
||||
"signature": "InvalidOfacRoots()",
|
||||
"selector": "0xc67a44d2",
|
||||
"file": "contracts/IdentityVerificationHubImplV2.sol",
|
||||
"line": 208
|
||||
},
|
||||
{
|
||||
"name": "EXPIRY_IN_PAST",
|
||||
"signature": "EXPIRY_IN_PAST()",
|
||||
"selector": "0xca5d75dd",
|
||||
"file": "contracts/registry/IdentityRegistryAadhaarImplV1.sol",
|
||||
"line": 136
|
||||
"line": 211
|
||||
},
|
||||
{
|
||||
"name": "CurrentDateNotInValidRange",
|
||||
"signature": "CurrentDateNotInValidRange()",
|
||||
"selector": "0xcf46551c",
|
||||
"file": "contracts/IdentityVerificationHubImplV2.sol",
|
||||
"line": 140
|
||||
"line": 143
|
||||
},
|
||||
{
|
||||
"name": "INVALID_VC_AND_DISCLOSE_PROOF",
|
||||
@@ -438,14 +431,14 @@
|
||||
"signature": "AttestationIdMismatch()",
|
||||
"selector": "0xd7ca437d",
|
||||
"file": "contracts/IdentityVerificationHubImplV2.sol",
|
||||
"line": 204
|
||||
"line": 207
|
||||
},
|
||||
{
|
||||
"name": "InvalidVcAndDiscloseProof",
|
||||
"signature": "InvalidVcAndDiscloseProof()",
|
||||
"selector": "0xda7bd3a6",
|
||||
"file": "contracts/IdentityVerificationHubImplV2.sol",
|
||||
"line": 152
|
||||
"line": 155
|
||||
},
|
||||
{
|
||||
"name": "INVALID_REVEALED_DATA_TYPE",
|
||||
@@ -459,14 +452,14 @@
|
||||
"signature": "ScopeMismatch()",
|
||||
"selector": "0xe7bee380",
|
||||
"file": "contracts/IdentityVerificationHubImplV2.sol",
|
||||
"line": 172
|
||||
"line": 175
|
||||
},
|
||||
{
|
||||
"name": "InvalidUserIdentifierInProof",
|
||||
"signature": "InvalidUserIdentifierInProof()",
|
||||
"selector": "0xebbcc178",
|
||||
"file": "contracts/IdentityVerificationHubImplV2.sol",
|
||||
"line": 188
|
||||
"line": 191
|
||||
},
|
||||
{
|
||||
"name": "CURRENT_DATE_NOT_IN_VALID_RANGE",
|
||||
@@ -508,13 +501,13 @@
|
||||
"signature": "InvalidIdentityCommitmentRoot()",
|
||||
"selector": "0xf53393a7",
|
||||
"file": "contracts/IdentityVerificationHubImplV2.sol",
|
||||
"line": 156
|
||||
"line": 159
|
||||
},
|
||||
{
|
||||
"name": "LengthMismatch",
|
||||
"signature": "LengthMismatch()",
|
||||
"selector": "0xff633a38",
|
||||
"file": "contracts/IdentityVerificationHubImplV2.sol",
|
||||
"line": 132
|
||||
"line": 135
|
||||
}
|
||||
]
|
||||
|
||||
@@ -18,9 +18,6 @@ const config: HardhatUserConfig = {
|
||||
enabled: true,
|
||||
runs: 200,
|
||||
},
|
||||
metadata: {
|
||||
bytecodeHash: "none",
|
||||
},
|
||||
},
|
||||
},
|
||||
contractSizer: {
|
||||
@@ -62,9 +59,17 @@ const config: HardhatUserConfig = {
|
||||
url: process.env.CELO_ALFAJORES_RPC_URL || "https://alfajores-forno.celo-testnet.org",
|
||||
accounts: [process.env.PRIVATE_KEY as string],
|
||||
},
|
||||
"celo-sepolia": {
|
||||
chainId: 11142220,
|
||||
url: process.env.CELO_SEPOLIA_RPC_URL || "https://rpc.ankr.com/celo_sepolia",
|
||||
accounts: [process.env.PRIVATE_KEY as string],
|
||||
},
|
||||
},
|
||||
etherscan: {
|
||||
apiKey: process.env.CELOSCAN_API_KEY as string,
|
||||
// apiKey: {
|
||||
// "celo-sepolia": process.env.CELOSCAN_API_KEY as string,
|
||||
// },
|
||||
customChains: [
|
||||
{
|
||||
network: "celo",
|
||||
@@ -82,6 +87,14 @@ const config: HardhatUserConfig = {
|
||||
browserURL: "https://alfajores.celoscan.io",
|
||||
},
|
||||
},
|
||||
{
|
||||
network: "celo-sepolia",
|
||||
chainId: 11142220,
|
||||
urls: {
|
||||
apiURL: "https://celo-sepolia.blockscout.com/api",
|
||||
browserURL: "https://celo-sepolia.blockscout.com",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
{
|
||||
"DeployAllVerifiers#Verifier_dsc_sha1_ecdsa_brainpoolP256r1": "0xb5a0c6CB5CDCE8d2fa4e2E2093fa5D5818E8C0F0",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha1_ecdsa_secp256r1": "0xd545461DB81f8E3f06682206b6de369cA3952181",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha1_rsa_65537_4096": "0xF0De013024e1f30Db5aA4023F7eBe440d7f7BA01",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_ecdsa_brainpoolP256r1": "0x6C9040C3D4cD577189AC626Ae7Ba390B9C5b6b5a",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_ecdsa_brainpoolP384r1": "0x954053B0c72EBF4A3025Db9d2579648Aa34d55E4",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_ecdsa_secp256r1": "0x459090549E737BA4b9a97F42c18e5772303B8A49",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_ecdsa_secp384r1": "0xEE669B98054Aed7F35488E8bd8711614665AE315",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_ecdsa_secp521r1": "0xe39d3c2edB9A9597d56a2a504410121feDe68505",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_rsa_107903_4096": "0x2FD2f822DD2372855Ae6fdfF500EFb2335625BDE",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_rsa_122125_4096": "0x627b334590FFCe7c1A1Ee496b143FD24aa0D8386",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_rsa_130689_4096": "0x4106920e331A425A78a56460031779b0CC690557",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_rsa_56611_4096": "0x126Ff21E67f79CC55FDC37A967de959A2D0c9441",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_rsa_65537_4096": "0x215eb04cD7Df5EEA38825e07bAb5036A8AC078a5",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_rsapss_3_32_3072": "0xF66C30aD0aAC6ED59FB8101263Ec0323C0ABD3EF",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_rsapss_65537_32_3072": "0x9E0369327b62f66a13A487824dE5D2BEb5d558B6",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_rsapss_65537_32_4096": "0x1366A6a3AEe9DCBF92aEF2868D236d7c958557a7",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha384_ecdsa_brainpoolP384r1": "0x0E498c33C7AAC4B483eb285BA737CD41104658dA",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha384_ecdsa_brainpoolP512r1": "0xdCFCB268f8AEDeacE9E08DCc6D3cFFCB8f896c49",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha384_ecdsa_secp384r1": "0xe43E9b578479508399b577e2Ea2841D36B2cE880",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha512_ecdsa_brainpoolP512r1": "0x531a5797E9c30eCAFC7619c0e05EE7BB48B8F5e6",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha512_ecdsa_secp521r1": "0x3Bb40ADDa40591b8Ff6bcc321CD69c12300468c1",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha512_rsa_65537_4096": "0x7c14A4c6678E965D040fdbC2E56739CCEBa2d6a6",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha512_rsapss_65537_64_4096": "0x62739725DeF64F448584Cebc78BD9Bbdf8FA3556",
|
||||
"DeployAllVerifiers#Verifier_register_aadhaar": "0x7F52EEBF2b8668c42663049d133b813B9Dc47903",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha1_sha1_sha1_ecdsa_brainpoolP224r1": "0xE32Be3c23f596616726785141af972289c29E99B",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha1_sha1_sha1_ecdsa_secp256r1": "0xf9F885F857709a47ca2d0dBe92fd0eA75746d10e",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha1_sha1_sha1_rsa_65537_4096": "0x0690e42FA30BcC48Dd0bf8BF926654e6efDFee89",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha1_sha256_sha256_rsa_65537_4096": "0xa851a10E399f98E0B8c7B5B104B2F49113EEdD61",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha224_sha224_sha224_ecdsa_brainpoolP224r1": "0x4a07152540A3760CBe5652C91d9E39B404D763ce",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha224_sha224_ecdsa_secp224r1": "0x43558E4Cc859bC6e19EeBEA60c378618cB01FE06",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha224_ecdsa_secp224r1": "0x9481C0e0ECd7ECDeF244e9c838cF46832d20991D",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha256_ecdsa_brainpoolP256r1": "0x1332DD940d80C23989819211F917eED4F08A334b",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha256_ecdsa_brainpoolP384r1": "0x4E4148db84CaA37630D08db78384D76717C01858",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha256_ecdsa_secp256r1": "0x395Bb903E39E81A3D6dB28b05101132675883670",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha256_ecdsa_secp384r1": "0x8B2Dd0204233551Cb47b3FBEE53aBC3C05a009c0",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha256_rsa_3_4096": "0x44622568338eE4E8e7581113048A047666eCB5f8",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha256_rsa_65537_4096": "0x4A2Ca34AC976B55bE875befa11645e8b940FF26F",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha256_rsapss_3_32_2048": "0x1ECbb205005F562f7f668AbA9249E11Fb8E52385",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha256_rsapss_65537_32_2048": "0x9dc809bb06cBfEabf9C1a1549C956f2251c3aE82",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha256_rsapss_65537_32_3072": "0x55e35eEb2f51E895d55Fa11fbEf6Ac584Af4F662",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha256_rsapss_65537_64_2048": "0xc5DE05cdBD7BDc304374e97F12222a053049207C",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha384_sha384_sha384_ecdsa_brainpoolP384r1": "0x160e8e2a6781bAcE877f5E31F2F1f30F1f2a70D9",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha384_sha384_sha384_ecdsa_brainpoolP512r1": "0xBB53000B398a7AC948e960831033F0cBA34259E7",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha384_sha384_sha384_ecdsa_secp384r1": "0xFE4126433bA2CDAbF4A8354Fa169769ab7C617A6",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha384_sha384_sha384_rsapss_65537_48_2048": "0x7f134978E051C313EaAc344372C0D8e75d15aAcF",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha512_sha512_sha256_rsa_65537_4096": "0xFC1De9B4314c23a4e61C58cE9320824B65b09BDf",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha512_sha512_sha256_rsapss_65537_32_2048": "0xC6F41Ff1c43a9DfA42262Bb6723Fb5cCfD1e7AB8",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha512_sha512_sha512_ecdsa_brainpoolP512r1": "0x9e67f5799E7466Fc9465F5E5cb19bE91618D7d8e",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha512_sha512_sha512_ecdsa_secp521r1": "0x7E71f169741Faf8cf2b2aC86925D092ac07caf1D",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha512_sha512_sha512_rsa_65537_4096": "0x1f8451F046a2cF07F0c79a1Ce35fAB239df29b02",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha512_sha512_sha512_rsapss_65537_64_2048": "0x3D6cF01C05822891621638D78845CC13469b3852",
|
||||
"DeployAllVerifiers#Verifier_register_sha1_sha1_sha1_ecdsa_brainpoolP224r1": "0x28BEeb7bF879E89be381383C67dacadf18F92f3C",
|
||||
"DeployAllVerifiers#Verifier_register_sha1_sha1_sha1_ecdsa_secp256r1": "0xb016626F5A3748C4E7A367238A61672A5F17B669",
|
||||
"DeployAllVerifiers#Verifier_register_sha1_sha1_sha1_rsa_64321_4096": "0x0896052F9A58541925c7587744847A4B4Be4d338",
|
||||
"DeployAllVerifiers#Verifier_register_sha1_sha1_sha1_rsa_65537_4096": "0xc0D1A7B02cEf031DAd0C2985e32DDEDCB846B1EE",
|
||||
"DeployAllVerifiers#Verifier_register_sha1_sha256_sha256_rsa_65537_4096": "0x924000D6b92955197631632e312D5E9032597535",
|
||||
"DeployAllVerifiers#Verifier_register_sha224_sha224_sha224_ecdsa_brainpoolP224r1": "0x651cBceE1180f5800e1970bAeC694bC94EF10fD8",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha1_sha1_rsa_65537_4096": "0x4Ef5614c89CBCC6E46dc362091795f1781319b7D",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha224_sha224_ecdsa_secp224r1": "0x1431BD7757558095E7AEE3f768a65f157D88a435",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha224_ecdsa_secp224r1": "0x056a3770e1D55876079D2954b00199b2b56351f7",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_ecdsa_brainpoolP256r1": "0xB4AF02861c9bf1D1C0Ed2d17911c71Da05c5Ab47",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_ecdsa_brainpoolP384r1": "0xc355a3Cd178Adb97A861945Da0D19D18157eb223",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_ecdsa_secp256r1": "0xD1277f1B836812317EA893331dEFB90856368484",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_ecdsa_secp384r1": "0x97A58F0d205dA55a9564644A7342473555D85364",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_rsa_3_4096": "0xD5Ec9b57420366CdE7Defc28b5bb67602125fa25",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_rsa_65537_4096": "0x741a9bB8913AEa687dC334A8F69C7c81B9E61717",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_rsapss_3_32_2048": "0xd02673BE1665D90f6d15f67c195d6E641D6Cf9CD",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_rsapss_65537_32_2048": "0x55ac8Ccf77c9a3F9228A902e3C51AcC115a272Aa",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_rsapss_65537_32_3072": "0x2a7ea603A60b1cCA6910652446A9be18762958f1",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_rsapss_65537_32_4096": "0xD357159208c44025D3cf56F56a0B85DA7683c833",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_rsapss_65537_64_2048": "0x939e06eF755000050781E482ABAE36e0C3E40Ee9",
|
||||
"DeployAllVerifiers#Verifier_register_sha384_sha384_sha384_ecdsa_brainpoolP384r1": "0xF6909233C6Fd8738a46588Dc7267Bed225905A84",
|
||||
"DeployAllVerifiers#Verifier_register_sha384_sha384_sha384_ecdsa_brainpoolP512r1": "0x22891860360D978cb3f7A8E3504F760873F5e7A2",
|
||||
"DeployAllVerifiers#Verifier_register_sha384_sha384_sha384_ecdsa_secp384r1": "0xC9656E81f708F7A352AAf7c9ee8E6f304149D646",
|
||||
"DeployAllVerifiers#Verifier_register_sha384_sha384_sha384_rsapss_65537_48_2048": "0x9D85ea73e683C7E04fADb8C319844286485A59Ac",
|
||||
"DeployAllVerifiers#Verifier_register_sha512_sha512_sha256_rsa_65537_4096": "0x3AA56699f5bc240F7eb232417f3A32C89ef9462c",
|
||||
"DeployAllVerifiers#Verifier_register_sha512_sha512_sha256_rsapss_65537_32_2048": "0xfE79B836847C24b8d2e0286aec7A70c431d68349",
|
||||
"DeployAllVerifiers#Verifier_register_sha512_sha512_sha512_ecdsa_brainpoolP512r1": "0xC8cAaD134e5a54A080e2443744EEA1c86ca768AF",
|
||||
"DeployAllVerifiers#Verifier_register_sha512_sha512_sha512_ecdsa_secp521r1": "0x1233bb5725Bc143CE979Ba5102Ad3dbB2eBE0D7a",
|
||||
"DeployAllVerifiers#Verifier_register_sha512_sha512_sha512_rsa_65537_4096": "0x7a472D4Ebb522C05F540d9eC98b70Ec75b602dB5",
|
||||
"DeployAllVerifiers#Verifier_register_sha512_sha512_sha512_rsapss_65537_64_2048": "0x8297037369CDb21420Dfad842ED49Fd881e7Cb58",
|
||||
"DeployAllVerifiers#Verifier_vc_and_disclose": "0x7C2FBA7F8a577e262b96F964ADEdC5D3B3a5bA0D",
|
||||
"DeployAllVerifiers#Verifier_vc_and_disclose_aadhaar": "0x57289605fDC51C638836BF473443b7b1560e285C",
|
||||
"DeployAllVerifiers#Verifier_vc_and_disclose_id": "0x3f4Fa3eDEC299a9a788884a905D2b1A5AB8f4984",
|
||||
"DeployRegistryModule#PoseidonT3": "0x0a782f7F9f8Aac6E0bacAF3cD4aA292C3275C6f2",
|
||||
"DeployRegistryModule#IdentityRegistryImplV1": "0x873b1289b69C452Fd8349DbAfc748183eB5314ec",
|
||||
"DeployRegistryModule#IdentityRegistry": "0x1651ec77c3dC5997eC05f3EE6C2B0b904b516d1d",
|
||||
"DeployIdCardRegistryModule#PoseidonT3": "0x00865d3DCcD1413a45Afd80d2e0b0a689571cBB9",
|
||||
"DeployIdCardRegistryModule#IdentityRegistryIdCardImplV1": "0xF4781c7e801D1E49aa3A95537FaEF7718f4499Cd",
|
||||
"DeployIdCardRegistryModule#IdentityRegistry": "0x6B39222c3b98003010695cE0A31C9b1a61e07DdC",
|
||||
"DeployAadhaarRegistryModule#PoseidonT3": "0xB80d454C2BF6c886EfA51Af830F43ac3147dCE15",
|
||||
"DeployAadhaarRegistryModule#IdentityRegistryAadhaarImplV1": "0x74A2848D945eCffeE325dAbc9E0b72c118fAD327",
|
||||
"DeployAadhaarRegistryModule#IdentityRegistry": "0x9cbB71468f93672DBF50f511c038eAF9fAB04732",
|
||||
"DeployHubV2#CustomVerifier": "0x3C154D1Bb35589e82B13892dE5283ADAfaDC473f",
|
||||
"DeployHubV2#IdentityVerificationHubImplV2": "0xC49b7FD44Cb4bE0482AEa3335Eb2CeFb1b81B0C9",
|
||||
"DeployHubV2#IdentityVerificationHub": "0x16ECBA51e18a4a7e61fdC417f0d47AFEeDfbed74",
|
||||
"DeployNewHubAndUpgradee#IdentityVerificationHubV2": "0x16ECBA51e18a4a7e61fdC417f0d47AFEeDfbed74",
|
||||
"DeployNewHubAndUpgradee#CustomVerifier": "0x2711E535D68D8B8729a7d126fEb13aEc0fe29A27",
|
||||
"DeployNewHubAndUpgradee#IdentityVerificationHubImplV2": "0x48985ec4f71cBC8f387c5C77143110018560c7eD"
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
{
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_rsa_65537_4096": "0x54159c33A5f69268f3F5Dc8512d99e33F5C08610",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_ecdsa_brainpoolP384r1": "0x45b566e9FEca75EE3e0c6648f714F8e26902f660",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_ecdsa_secp256r1": "0xd0e5cb987E8f8F88756B5DB59ad193A9E6230A93",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_ecdsa_secp384r1": "0xEAc7FC73F1Aa5d8626bd4B3c0F9DE81e82844f42",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_rsa_3_4096": "0x15398D64E2E879350F3a3aA46f5932Aa57c6584f",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_rsapss_3_32_2048": "0x6807494eFfE6F9aA4e08649190bF7a1A50164Fea",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_rsapss_65537_32_2048": "0xf1F8Bc8CFbba3A3bb359319A1Cf9BD57eFF6A958",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_rsapss_65537_32_3072": "0x5fA77Fa0c66664c4A033c1c95d65DD4BC617e55E",
|
||||
"DeployAllVerifiers#Verifier_register_sha384_sha384_sha384_ecdsa_brainpoolP384r1": "0x01F37259b452BA953B786e1A629A830Cdb9a33D0",
|
||||
"DeployAllVerifiers#Verifier_register_sha384_sha384_sha384_ecdsa_brainpoolP512r1": "0x0c6537482055eFB8E8431DeEF1B2ACa27D904165",
|
||||
"DeployAllVerifiers#Verifier_register_sha384_sha384_sha384_ecdsa_secp384r1": "0xA2E64841b5A7c6bF661f80826c3788C2d8e5C0A7",
|
||||
"DeployAllVerifiers#Verifier_register_sha512_sha512_sha512_ecdsa_brainpoolP512r1": "0xb4685a1A44Fcd01f34093c7b94f8E1B47C3597aE",
|
||||
"DeployAllVerifiers#Verifier_register_sha512_sha512_sha512_rsa_65537_4096": "0x6386465594Dc7f09124F8c38890093Caf2F49c6D",
|
||||
"DeployAllVerifiers#Verifier_register_sha512_sha512_sha512_rsapss_65537_64_2048": "0xf7802e25309c494dfD8be085622B8E28533015bb",
|
||||
"DeployAllVerifiers#Verifier_register_sha1_sha1_sha1_rsa_65537_4096": "0xD743B299e660aF8a31865fD1fC4A462242D2b6B6",
|
||||
"DeployAllVerifiers#Verifier_register_sha1_sha256_sha256_rsa_65537_4096": "0xF2F80ffE1Db0c728E4DDd0E6dbF656d802a9Bb4D",
|
||||
"DeployAllVerifiers#Verifier_register_sha224_sha224_sha224_ecdsa_brainpoolP224r1": "0x86b9698Af3E86c40e5FFA8EDEb5BF2c1c6f5E2fe",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha224_sha224_ecdsa_secp224r1": "0x4415D8fB42e5c46ACF200054Eb63DE3B59268712",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_ecdsa_brainpoolP256r1": "0x8eEb20De16A8bD1117aCc7c349000AA50b415C6c",
|
||||
"DeployAllVerifiers#Verifier_register_sha1_sha1_sha1_ecdsa_brainpoolP224r1": "0x30c00c79424375b0dC052aEBf21d3FAF64710e5D",
|
||||
"DeployAllVerifiers#Verifier_register_sha384_sha384_sha384_rsapss_65537_48_2048": "0x244fD55Ea1a9310Ad6Fd98137D6Da077be1cf87C",
|
||||
"DeployAllVerifiers#Verifier_register_sha1_sha1_sha1_ecdsa_secp256r1": "0x01909adDd6daa76E3db85C57D9970b647E8Edacb",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_rsapss_65537_64_2048": "0xF49d6eD3f657F25ADCbFAD5353c82FBdE58CEd2f",
|
||||
"DeployAllVerifiers#Verifier_register_sha512_sha512_sha256_rsa_65537_4096": "0x305222A552b457Fb4475541b2C963C0e44E0cda1",
|
||||
"DeployAllVerifiers#Verifier_register_sha512_sha512_sha512_ecdsa_secp521r1": "0xc440d925a514f0363efEd223453c1FeA8dfe9633",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha256_rsa_65537_4096": "0x9BB8A3CE532c2aa12ce9c6962bC5257Db975cF37",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha224_ecdsa_secp224r1": "0xD61A76fB39aB66F1eF1c4F69334b206e96CE9718",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha1_sha1_sha1_ecdsa_brainpoolP224r1": "0x057ea7BBb4cfeE19a0862e3f7E95481D8cBe69fA",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha1_sha1_sha1_ecdsa_secp256r1": "0x74F3F5D781D9E16A237dbf33F80fbc0d1737d7D8",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha1_sha1_sha1_rsa_65537_4096": "0x1bB9fDf5099b1Bb12a7Fa3032249D5C8b13D5771",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha1_sha256_sha256_rsa_65537_4096": "0xb886E7A0763ff263D35D2c9ceB1E75E3DF7afC74",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha224_sha224_sha224_ecdsa_brainpoolP224r1": "0x4A8150F549CBc86B3E039C9885Ca11A436f0bf6f",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha224_sha224_ecdsa_secp224r1": "0xeDc6bf9981b1804C5716e2bD62a18307B7f388db",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha224_ecdsa_secp224r1": "0x681BFb21cE1c0A6593ebf21E785ea186eb0D0b7A",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha256_ecdsa_brainpoolP256r1": "0xe91F3f8990B3B6218Ec3BdEc379Edfea248622ba",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha256_ecdsa_brainpoolP384r1": "0x5Ab898559c3e0c0800fD0E47D5F27D35f93f58C9",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha256_ecdsa_secp256r1": "0x9DFd012811EBEf9a0dAb4A878C7Ce59b42185996",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha256_ecdsa_secp384r1": "0x2C87D20fD3A8882A497bd3C08D7Ff046d2CceA4e",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha256_rsa_3_4096": "0x6a012ec1a22c853fDEe72177FD97eE1d71D7a45f",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha256_rsapss_3_32_2048": "0xFC783f8c9567347517E43E7ac15f5645E13A8035",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha256_rsapss_65537_32_2048": "0x349d0b4ECAc7b0EEb7f1ea74a68d332b9313363e",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha256_rsapss_65537_32_3072": "0x10cAC885f70B9fdFDc1AB9e9C445De17c2404a5A",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha256_sha256_sha256_rsapss_65537_64_2048": "0xEB3A3625637Ae81fd1A2EB1459867b74f08161AA",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha384_sha384_sha384_ecdsa_brainpoolP384r1": "0xA97130dFc20Eb7224547748f646c8a590487d7e5",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha384_sha384_sha384_ecdsa_brainpoolP512r1": "0x4B754A5C7780846Dd5aFAfb4974E18A6cAd00000",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha384_sha384_sha384_ecdsa_secp384r1": "0x683b478a74Cf26258B054D969dC68260B3b87b61",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha384_sha384_sha384_rsapss_65537_48_2048": "0xda7803D177dC5F8fA252B1A1063ae3AB3bA4C35E",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha512_sha512_sha256_rsa_65537_4096": "0x1006C25A6922e635B95805d8d27461BF24D39F4b",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha512_sha512_sha512_ecdsa_brainpoolP512r1": "0x3b72D98E7cA1F24C25fd455130042d3A6cB4Acb5",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha512_sha512_sha512_ecdsa_secp521r1": "0xeD4CBCFadBbfABe7E3B5b2d8249595F915800883",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha512_sha512_sha512_rsa_65537_4096": "0xd9FA4C7F2c89f0fC4Ec2eBA03f658c9Ae32B9cdc",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha512_sha512_sha512_rsapss_65537_64_2048": "0x7088487C9Cb19bf542e225Cc928bE8c38b526b08",
|
||||
"DeployAllVerifiers#Verifier_register_aadhaar": "0x05CdCE45C73dBBe29CeA722f7E560De2842Ac3Dc",
|
||||
"DeployAllVerifiers#Verifier_register_sha1_sha1_sha1_rsa_64321_4096": "0x79561E25AEB482F32b64E280C8A33D4222a7b9Fc",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha1_sha1_rsa_65537_4096": "0x955116aDA0109CA57161b7fD2f4E65D8235d555d",
|
||||
"DeployAllVerifiers#Verifier_register_sha256_sha256_sha256_rsapss_65537_32_4096": "0xE1B1EeF29dF81133D803c9793e32177B94C1D973",
|
||||
"DeployAllVerifiers#Verifier_register_id_sha512_sha512_sha256_rsapss_65537_32_2048": "0x1EC9f4655aBBB81856Cee75f6a5Bc74294bec5c4",
|
||||
"DeployAllVerifiers#Verifier_register_sha512_sha512_sha256_rsapss_65537_32_2048": "0x1b4047449a8a13BC2c23B782bAfDb0aa338B8255",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha1_ecdsa_brainpoolP256r1": "0x790A5Ddd1774272E8f4713458a525326E0115c02",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha1_rsa_65537_4096": "0x3F0d8bb753ab2aFf644A1ae1547263C7097946Db",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_ecdsa_brainpoolP256r1": "0xc114963bB52da1F143E33ef826f84d8cA95ECCBf",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_ecdsa_brainpoolP384r1": "0xA7cd46eeF4C446150BDc17c05B59476aeb5dC43A",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_ecdsa_secp256r1": "0x2EDC23592f89d4d2BC4DC450Df45F751867B4419",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_ecdsa_secp384r1": "0xb8eCcB2539f80631523f5B56680cf4CA45a1dAf3",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_ecdsa_secp521r1": "0xED9Ae5a25CCc9c40bc6396AEa6FcFdeE6dc6E3AA",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_rsa_65537_4096": "0x9D1b0C5F55A56aCe6e19eD2F344A4c8aE833523C",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_rsapss_3_32_3072": "0xf41B70FDb368640589f65548ADa5c6206211A5aD",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_rsapss_65537_32_3072": "0xE681B60ec42DE3E183f03cbfcEa7D0e57E4CB43a",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_rsapss_65537_32_4096": "0x2136e8D40F5E69202D2D2fb9Ef8B9744Bc3D90bE",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha384_ecdsa_brainpoolP384r1": "0xB4b3fe40bB571aA34298F0d18e9CAd73555E60f6",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha384_ecdsa_brainpoolP512r1": "0xb92a692edBBfF2B4A0137aa213B2A04B05DA4990",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha384_ecdsa_secp384r1": "0x6AAeB76800e24AAf1F3620d183C554BB390cDC9B",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha512_ecdsa_brainpoolP512r1": "0x5582d373AF019c8db8D3be3FE1D8a68E6eeD419b",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha512_ecdsa_secp521r1": "0x3deAFbd016E6288e37AABe29419939B983FA703B",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha512_rsa_65537_4096": "0x4ce14193550cC5775af4368ce4099fe57e263D31",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha512_rsapss_65537_64_4096": "0x1EFa3caF02d21cf0A823925afCC81B675F92F41c",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha1_ecdsa_secp256r1": "0x922eEe01eE9eD65b92605fB9Ae8Af40bBFCE5aB0",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_rsa_107903_4096": "0x568B2Ad9dB6F78Bb82645d307C6Af3cf442Bd0c6",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_rsa_122125_4096": "0xb4718917654E0397d016114fbC4DfE74683C3C43",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_rsa_130689_4096": "0xC2a55171605d25D0Be2a8C0e6811ceD49e405928",
|
||||
"DeployAllVerifiers#Verifier_dsc_sha256_rsa_56611_4096": "0x5ae9029517B67e75FEE10eC09476b8C342265B88",
|
||||
"DeployAllVerifiers#Verifier_vc_and_disclose": "0x0A57C317800865194496763377d25CA2082DB649",
|
||||
"DeployAllVerifiers#Verifier_vc_and_disclose_id": "0xE73457a367d15c7d5df97d1c5d4e265611AfE8C7",
|
||||
"DeployAllVerifiers#Verifier_vc_and_disclose_aadhaar": "0x0F8D63A63c8b9467Fa9d5d8e1BB78A0c4Ee45bF0",
|
||||
"DeployAadhaarRegistryModule#PoseidonT3": "0xC9B4a92d98dbFC76D440233b8598910cA2da353f",
|
||||
"DeployAadhaarRegistryModule#IdentityRegistryAadhaarImplV1": "0x70D543432782D460C96753b52c2aC2797f26924B",
|
||||
"DeployAadhaarRegistryModule#IdentityRegistry": "0xd603Fa8C8f4694E8DD1DcE1f27C0C3fc91e32Ac4",
|
||||
"UpdateAllRegistries#a3": "0xd603Fa8C8f4694E8DD1DcE1f27C0C3fc91e32Ac4",
|
||||
"DeployHubV2#IdentityVerificationHub": "0xe57F4773bd9c9d8b6Cd70431117d353298B9f5BF",
|
||||
"UpdateHubRegistries#IdentityVerificationHubImplV2": "0xe57F4773bd9c9d8b6Cd70431117d353298B9f5BF",
|
||||
"DeployNewHubAndUpgradee#IdentityVerificationHubV2": "0xe57F4773bd9c9d8b6Cd70431117d353298B9f5BF",
|
||||
"DeployNewHubAndUpgradee#CustomVerifier": "0x026696925F7DA40EE8B372442750A70BA9C006fA",
|
||||
"DeployNewHubAndUpgradee#IdentityVerificationHubImplV2": "0xa267e58B2d6BA9fc07Af06471423AFb56e4e82B3"
|
||||
}
|
||||
67
contracts/ignition/modules/hub/updateRegistries.ts
Normal file
67
contracts/ignition/modules/hub/updateRegistries.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
import { buildModule, IgnitionModuleBuilder } from "@nomicfoundation/ignition-core";
|
||||
import hre from "hardhat";
|
||||
import { readFileSync } from "fs";
|
||||
import path from "path";
|
||||
|
||||
// Attestation IDs from the contract (matching AttestationId.sol)
|
||||
const AttestationId = {
|
||||
E_PASSPORT: "0x0000000000000000000000000000000000000000000000000000000000000001",
|
||||
EU_ID_CARD: "0x0000000000000000000000000000000000000000000000000000000000000002",
|
||||
AADHAAR: "0x0000000000000000000000000000000000000000000000000000000000000003",
|
||||
};
|
||||
|
||||
// Map registry deployment modules to their attestation IDs
|
||||
const registryToAttestationId: Record<string, string> = {
|
||||
// "DeployRegistryModule#IdentityRegistry": AttestationId.E_PASSPORT,
|
||||
// "DeployIdCardRegistryModule#IdentityRegistry": AttestationId.EU_ID_CARD,
|
||||
"DeployAadhaarRegistryModule#IdentityRegistry": AttestationId.AADHAAR,
|
||||
};
|
||||
|
||||
const ids = (() => {
|
||||
let id = 0;
|
||||
return () => {
|
||||
id++;
|
||||
return "a" + id.toString();
|
||||
};
|
||||
})();
|
||||
|
||||
export function updateHubRegistries(m: IgnitionModuleBuilder, hubAddress: string, deployedAddresses: any) {
|
||||
const hubContract = m.contractAt("IdentityVerificationHubImplV2", hubAddress);
|
||||
|
||||
console.log("Updating hub registries...");
|
||||
console.log("Hub address:", hubAddress);
|
||||
|
||||
// Update registries based on what's deployed
|
||||
for (const [registryModule, attestationId] of Object.entries(registryToAttestationId)) {
|
||||
const registryAddress = deployedAddresses[registryModule];
|
||||
|
||||
if (registryAddress) {
|
||||
console.log(`Updating ${registryModule} -> ${registryAddress} (AttestationId: ${attestationId})`);
|
||||
m.call(hubContract, "updateRegistry", [attestationId, registryAddress], { id: ids() });
|
||||
} else {
|
||||
console.log(`Registry ${registryModule} not found in deployed addresses, skipping`);
|
||||
}
|
||||
}
|
||||
|
||||
return hubContract;
|
||||
}
|
||||
|
||||
export default buildModule("UpdateHubRegistries", (m) => {
|
||||
const chainId = hre.network.config.chainId;
|
||||
|
||||
const deployedAddressesPath = path.join(__dirname, `../../deployments/chain-${chainId}/deployed_addresses.json`);
|
||||
const deployedAddresses = JSON.parse(readFileSync(deployedAddressesPath, "utf8"));
|
||||
|
||||
// Get the hub address
|
||||
const hubAddress = deployedAddresses["DeployHubV2#IdentityVerificationHub"];
|
||||
|
||||
if (!hubAddress) {
|
||||
throw new Error("Hub address not found in deployed addresses");
|
||||
}
|
||||
|
||||
const hubContract = updateHubRegistries(m, hubAddress, deployedAddresses);
|
||||
|
||||
return {
|
||||
hubContract,
|
||||
};
|
||||
});
|
||||
145
contracts/ignition/modules/hub/updateVerifiers.ts
Normal file
145
contracts/ignition/modules/hub/updateVerifiers.ts
Normal file
@@ -0,0 +1,145 @@
|
||||
import { buildModule, IgnitionModuleBuilder } from "@nomicfoundation/ignition-core";
|
||||
import hre from "hardhat";
|
||||
import { readFileSync } from "fs";
|
||||
import path from "path";
|
||||
import { circuitIds, CircuitName } from "../verifiers/deployAllVerifiersNew";
|
||||
|
||||
// Attestation IDs from the contract
|
||||
const AttestationId = {
|
||||
E_PASSPORT: "0x0000000000000000000000000000000000000000000000000000000000000001",
|
||||
EU_ID_CARD: "0x0000000000000000000000000000000000000000000000000000000000000002",
|
||||
AADHAAR: "0x0000000000000000000000000000000000000000000000000000000000000003",
|
||||
};
|
||||
|
||||
// Circuit type mappings based on circuit names
|
||||
const getCircuitType = (
|
||||
circuitName: CircuitName,
|
||||
): { attestationId: string; typeId: number; circuitType: "register" | "dsc" | "vc_and_disclose" } => {
|
||||
if (circuitName.startsWith("register_")) {
|
||||
const [shouldDeploy, typeId] = circuitIds[circuitName];
|
||||
if (circuitName.startsWith("register_id_")) {
|
||||
return { attestationId: AttestationId.EU_ID_CARD, typeId, circuitType: "register" };
|
||||
} else if (circuitName === "register_aadhaar") {
|
||||
return { attestationId: AttestationId.AADHAAR, typeId, circuitType: "register" };
|
||||
} else {
|
||||
return { attestationId: AttestationId.E_PASSPORT, typeId, circuitType: "register" };
|
||||
}
|
||||
} else if (circuitName.startsWith("dsc_")) {
|
||||
const [shouldDeploy, typeId] = circuitIds[circuitName];
|
||||
// DSC circuits are used for both passport and ID card
|
||||
return { attestationId: AttestationId.E_PASSPORT, typeId, circuitType: "dsc" };
|
||||
} else if (circuitName.startsWith("vc_and_disclose")) {
|
||||
if (circuitName === "vc_and_disclose_id") {
|
||||
return { attestationId: AttestationId.EU_ID_CARD, typeId: 0, circuitType: "vc_and_disclose" };
|
||||
} else if (circuitName === "vc_and_disclose_aadhaar") {
|
||||
return { attestationId: AttestationId.AADHAAR, typeId: 0, circuitType: "vc_and_disclose" };
|
||||
} else {
|
||||
return { attestationId: AttestationId.E_PASSPORT, typeId: 0, circuitType: "vc_and_disclose" };
|
||||
}
|
||||
}
|
||||
throw new Error(`Unknown circuit type: ${circuitName}`);
|
||||
};
|
||||
|
||||
const ids = (() => {
|
||||
let id = 0;
|
||||
return () => {
|
||||
id++;
|
||||
return "a" + id.toString();
|
||||
};
|
||||
})();
|
||||
|
||||
export function updateHubVerifiers(m: IgnitionModuleBuilder, hubAddress: string, deployedAddresses: any) {
|
||||
const hubContract = m.contractAt("IdentityVerificationHubImplV2", hubAddress);
|
||||
|
||||
// Get all deployed verifiers
|
||||
const verifiers: Record<string, any> = {};
|
||||
|
||||
for (const circuitName of Object.keys(circuitIds) as CircuitName[]) {
|
||||
const [shouldDeploy] = circuitIds[circuitName];
|
||||
if (!shouldDeploy) continue;
|
||||
|
||||
const verifierName = `Verifier_${circuitName}`;
|
||||
const verifierAddress = deployedAddresses[`DeployAllVerifiers#${verifierName}`];
|
||||
|
||||
if (verifierAddress) {
|
||||
verifiers[circuitName] = verifierAddress;
|
||||
}
|
||||
}
|
||||
|
||||
// Prepare batch arrays for register circuit verifiers
|
||||
const registerAttestationIds: string[] = [];
|
||||
const registerTypeIds: number[] = [];
|
||||
const registerVerifierAddresses: string[] = [];
|
||||
|
||||
// Prepare batch arrays for DSC circuit verifiers
|
||||
const dscAttestationIds: string[] = [];
|
||||
const dscTypeIds: number[] = [];
|
||||
const dscVerifierAddresses: string[] = [];
|
||||
|
||||
// Process all verifiers and categorize them
|
||||
for (const [circuitName, verifierAddress] of Object.entries(verifiers)) {
|
||||
const { attestationId, typeId, circuitType } = getCircuitType(circuitName as CircuitName);
|
||||
|
||||
if (circuitType === "register") {
|
||||
registerAttestationIds.push(attestationId);
|
||||
registerTypeIds.push(typeId);
|
||||
registerVerifierAddresses.push(verifierAddress);
|
||||
} else if (circuitType === "dsc") {
|
||||
// Add for passport
|
||||
dscAttestationIds.push(AttestationId.E_PASSPORT);
|
||||
dscTypeIds.push(typeId);
|
||||
dscVerifierAddresses.push(verifierAddress);
|
||||
|
||||
// Add for ID card
|
||||
dscAttestationIds.push(AttestationId.EU_ID_CARD);
|
||||
dscTypeIds.push(typeId);
|
||||
dscVerifierAddresses.push(verifierAddress);
|
||||
}
|
||||
}
|
||||
|
||||
// Batch update register circuit verifiers
|
||||
if (registerAttestationIds.length > 0) {
|
||||
m.call(hubContract, "batchUpdateRegisterCircuitVerifiers", [
|
||||
registerAttestationIds,
|
||||
registerTypeIds,
|
||||
registerVerifierAddresses,
|
||||
]);
|
||||
}
|
||||
|
||||
// Batch update DSC circuit verifiers
|
||||
if (dscAttestationIds.length > 0) {
|
||||
m.call(hubContract, "batchUpdateDscCircuitVerifiers", [dscAttestationIds, dscTypeIds, dscVerifierAddresses]);
|
||||
}
|
||||
|
||||
// Update VC and Disclose circuit verifiers (no batch function available)
|
||||
for (const [circuitName, verifierAddress] of Object.entries(verifiers)) {
|
||||
const { attestationId, typeId, circuitType } = getCircuitType(circuitName as CircuitName);
|
||||
|
||||
if (circuitType === "vc_and_disclose") {
|
||||
m.call(hubContract, "updateVcAndDiscloseCircuit", [attestationId, verifierAddress], { id: ids() });
|
||||
}
|
||||
}
|
||||
|
||||
return hubContract;
|
||||
}
|
||||
|
||||
export default buildModule("UpdateVerifiers", (m) => {
|
||||
const chainId = hre.network.config.chainId;
|
||||
|
||||
const deployedAddressesPath = path.join(__dirname, `../../deployments/chain-${chainId}/deployed_addresses.json`);
|
||||
const deployedAddresses = JSON.parse(readFileSync(deployedAddressesPath, "utf8"));
|
||||
|
||||
// Get the hub address
|
||||
//do I get the hub or the implementation address?
|
||||
const hubAddress = deployedAddresses["DeployHubV2#IdentityVerificationHub"];
|
||||
|
||||
if (!hubAddress) {
|
||||
throw new Error("Hub address not found in deployed addresses");
|
||||
}
|
||||
|
||||
const hubContract = updateHubVerifiers(m, hubAddress, deployedAddresses);
|
||||
|
||||
return {
|
||||
hubContract,
|
||||
};
|
||||
});
|
||||
44
contracts/ignition/modules/registry/deployAadhaarRegistry.ts
Normal file
44
contracts/ignition/modules/registry/deployAadhaarRegistry.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
|
||||
import { artifacts } from "hardhat";
|
||||
import { ethers } from "ethers";
|
||||
|
||||
export default buildModule("DeployAadhaarRegistryModule", (m) => {
|
||||
// Deploy PoseidonT3
|
||||
console.log("📚 Deploying PoseidonT3 library...");
|
||||
const poseidonT3 = m.library("PoseidonT3");
|
||||
|
||||
console.log("🏗️ Deploying AadhaarRegistryImplV1 implementation...");
|
||||
// Deploy IdentityRegistryImplV1
|
||||
const aadhaarRegistryImpl = m.contract("IdentityRegistryAadhaarImplV1", [], {
|
||||
libraries: { PoseidonT3: poseidonT3 },
|
||||
});
|
||||
|
||||
console.log("⚙️ Preparing registry initialization data...");
|
||||
// Get the interface and encode the initialize function call
|
||||
const registryInterface = getRegistryInitializeData();
|
||||
|
||||
const registryInitData = registryInterface.encodeFunctionData("initialize", [ethers.ZeroAddress]);
|
||||
console.log(" Init data:", registryInitData);
|
||||
|
||||
console.log("🚀 Deploying IdentityRegistry proxy...");
|
||||
// Deploy the proxy contract with the implementation address and initialization data
|
||||
const registry = m.contract("IdentityRegistry", [aadhaarRegistryImpl, registryInitData]);
|
||||
|
||||
console.log("✅ Registry deployment module setup complete!");
|
||||
console.log(" 📋 Summary:");
|
||||
console.log(" - PoseidonT3: Library");
|
||||
console.log(" - IdentityRegistryImplV1: Implementation contract");
|
||||
console.log(" - IdentityRegistry: Proxy contract");
|
||||
|
||||
return {
|
||||
poseidonT3,
|
||||
aadhaarRegistryImpl,
|
||||
registry,
|
||||
};
|
||||
});
|
||||
|
||||
function getRegistryInitializeData() {
|
||||
const registryArtifact = artifacts.readArtifactSync("IdentityRegistryImplV1");
|
||||
const registryInterface = new ethers.Interface(registryArtifact.abi);
|
||||
return registryInterface;
|
||||
}
|
||||
141
contracts/ignition/modules/registry/updateRegistries.ts
Normal file
141
contracts/ignition/modules/registry/updateRegistries.ts
Normal file
@@ -0,0 +1,141 @@
|
||||
import { buildModule, IgnitionModuleBuilder } from "@nomicfoundation/ignition-core";
|
||||
import hre from "hardhat";
|
||||
import { readFileSync } from "fs";
|
||||
import path from "path";
|
||||
|
||||
const registries = {
|
||||
// "DeployRegistryModule#IdentityRegistry": {
|
||||
// shouldChange: true,
|
||||
// passportNoOfac: "17359956125106148146828355805271472653597249114301196742546733402427978706344",
|
||||
// nameAndDobOfac: "7420120618403967585712321281997181302561301414016003514649937965499789236588",
|
||||
// nameAndYobOfac: "16836358042995742879630198413873414945978677264752036026400967422611478610995",
|
||||
// hub: "0x16ECBA51e18a4a7e61fdC417f0d47AFEeDfbed74",
|
||||
// cscaRoot: "13859398115974385161464830211947258005860166431741677064758266112192747818198",
|
||||
// },
|
||||
// "DeployIdCardRegistryModule#IdentityRegistry": {
|
||||
// shouldChange: true,
|
||||
// nameAndDobOfac: "20550865940766091336114076617084411967227963708544788410483208672684333597871",
|
||||
// nameAndYobOfac: "20607501071671444315195585339157145490348308593668944037177822930025980459166",
|
||||
// hub: "0x16ECBA51e18a4a7e61fdC417f0d47AFEeDfbed74",
|
||||
// cscaRoot: "13859398115974385161464830211947258005860166431741677064758266112192747818198",
|
||||
// },
|
||||
"DeployAadhaarRegistryModule#IdentityRegistry": {
|
||||
shouldChange: true,
|
||||
nameAndDobOfac: "4183822562579010781434914867177251983368244626022840551534475857364967864437",
|
||||
nameAndYobOfac: "14316795765689804800341464910235935757494922653038299433675973925727164473934",
|
||||
hub: "0xe57F4773bd9c9d8b6Cd70431117d353298B9f5BF",
|
||||
pubkeyCommitments: [
|
||||
"5648956411273136337349787488442520720416229937879112788241850936049694492145",
|
||||
"18304035373718681408213540837772113004961405604264885188535510276454415833542",
|
||||
"3099763118716361008062312602688327679110629275746483297740895929951765195538",
|
||||
"5960616419594750988984019912914733527854225713611991429799390436159340745422",
|
||||
"1312086597361744268424404341813751658452218312204370523713186983060138886330",
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
// Helper function to get implementation contract name from deployment module
|
||||
function getImplementationName(registryModule: string): string {
|
||||
const implMap: Record<string, string> = {
|
||||
"DeployRegistryModule#IdentityRegistry": "IdentityRegistryImplV1",
|
||||
"DeployIdCardRegistryModule#IdentityRegistry": "IdentityRegistryIdCardImplV1",
|
||||
"DeployAadhaarRegistryModule#IdentityRegistry": "IdentityRegistryAadhaarImplV1",
|
||||
};
|
||||
|
||||
return implMap[registryModule] || "IdentityRegistryImplV1";
|
||||
}
|
||||
|
||||
//generator function that yields a new id each time it is called
|
||||
const ids = (() => {
|
||||
let id = 2;
|
||||
return () => {
|
||||
id++;
|
||||
return "a" + id.toString();
|
||||
};
|
||||
})();
|
||||
|
||||
export function handleRegistryDeployment(
|
||||
m: IgnitionModuleBuilder,
|
||||
registryModule: string,
|
||||
registryData: any,
|
||||
deployedAddresses: any,
|
||||
lastOperation?: any,
|
||||
) {
|
||||
const registryAddress = deployedAddresses[registryModule];
|
||||
const implName = getImplementationName(registryModule);
|
||||
console.log(`Using implementation ${implName} for proxy at ${registryAddress}`);
|
||||
|
||||
const deployOptions = lastOperation ? { after: [lastOperation] } : {};
|
||||
const registryContract = m.contractAt(implName, registryAddress, { id: ids(), ...deployOptions });
|
||||
|
||||
let currentOperation: any = registryContract;
|
||||
|
||||
if (registryData.shouldChange) {
|
||||
// Update hub for all registries
|
||||
if (registryData.hub) {
|
||||
const callOptions = { after: [currentOperation], id: ids() };
|
||||
currentOperation = m.call(registryContract, "updateHub", [registryData.hub], callOptions);
|
||||
}
|
||||
|
||||
if (registryData.cscaRoot) {
|
||||
const callOptions = { after: [currentOperation], id: ids() };
|
||||
currentOperation = m.call(registryContract, "updateCscaRoot", [registryData.cscaRoot], callOptions);
|
||||
}
|
||||
|
||||
if (registryData.passportNoOfac) {
|
||||
const callOptions = { after: [currentOperation], id: ids() };
|
||||
currentOperation = m.call(
|
||||
registryContract,
|
||||
"updatePassportNoOfacRoot",
|
||||
[registryData.passportNoOfac],
|
||||
callOptions,
|
||||
);
|
||||
}
|
||||
if (registryData.nameAndDobOfac) {
|
||||
const callOptions = { after: [currentOperation], id: ids() };
|
||||
currentOperation = m.call(
|
||||
registryContract,
|
||||
"updateNameAndDobOfacRoot",
|
||||
[registryData.nameAndDobOfac],
|
||||
callOptions,
|
||||
);
|
||||
}
|
||||
if (registryData.nameAndYobOfac) {
|
||||
const callOptions = { after: [currentOperation], id: ids() };
|
||||
currentOperation = m.call(
|
||||
registryContract,
|
||||
"updateNameAndYobOfacRoot",
|
||||
[registryData.nameAndYobOfac],
|
||||
callOptions,
|
||||
);
|
||||
}
|
||||
|
||||
if (registryData.pubkeyCommitments && registryData.pubkeyCommitments.length > 0) {
|
||||
for (const pubkeyCommitment of registryData.pubkeyCommitments) {
|
||||
const callOptions = { after: [currentOperation], id: ids() };
|
||||
currentOperation = m.call(registryContract, "registerUidaiPubkeyCommitment", [pubkeyCommitment], callOptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return { registryContract, lastOperation: currentOperation };
|
||||
}
|
||||
|
||||
export default buildModule("UpdateAllRegistries", (m) => {
|
||||
const deployments: Record<string, any> = {};
|
||||
let lastOperation: any = null;
|
||||
|
||||
const chainId = hre.network.config.chainId;
|
||||
const deployedAddressesPath = path.join(__dirname, `../../deployments/chain-${chainId}/deployed_addresses.json`);
|
||||
const deployedAddresses = JSON.parse(readFileSync(deployedAddressesPath, "utf8"));
|
||||
|
||||
for (const registry of Object.keys(registries)) {
|
||||
const registryData = registries[registry as keyof typeof registries];
|
||||
const result = handleRegistryDeployment(m, registry, registryData, deployedAddresses, lastOperation);
|
||||
deployments[registry] = result.registryContract;
|
||||
lastOperation = result.lastOperation;
|
||||
}
|
||||
|
||||
console.log(`Registry operations will execute sequentially to prevent nonce conflicts`);
|
||||
return deployments;
|
||||
});
|
||||
@@ -4,33 +4,44 @@ import hre from "hardhat";
|
||||
import { readFileSync } from "fs";
|
||||
import path from "path";
|
||||
|
||||
function getTestHubInitializeData() {
|
||||
const hubArtifact = artifacts.readArtifactSync("testUpgradedIdentityVerificationHubImplV1");
|
||||
function getHubImplV2InitializeData() {
|
||||
const hubArtifact = artifacts.readArtifactSync("IdentityVerificationHubImplV2");
|
||||
return new ethers.Interface(hubArtifact.abi);
|
||||
}
|
||||
|
||||
export default buildModule("DeployNewHubAndUpgrade", (m) => {
|
||||
export default buildModule("DeployNewHubAndUpgradee", (m) => {
|
||||
const networkName = hre.network.config.chainId;
|
||||
|
||||
const deployedAddressesPath = path.join(__dirname, `../deployments/chain-${networkName}/deployed_addresses.json`);
|
||||
const deployedAddressesPath = path.join(__dirname, `../../deployments/chain-${networkName}/deployed_addresses.json`);
|
||||
const deployedAddresses = JSON.parse(readFileSync(deployedAddressesPath, "utf8"));
|
||||
|
||||
const hubProxyAddress = deployedAddresses["DeployHub#IdentityVerificationHub"];
|
||||
const hubProxyAddress = deployedAddresses["DeployHubV2#IdentityVerificationHub"];
|
||||
if (!hubProxyAddress) {
|
||||
throw new Error("Hub proxy address not found in deployed_addresses.json");
|
||||
}
|
||||
|
||||
const newHubImpl = m.contract("testUpgradedIdentityVerificationHubImplV1");
|
||||
const customVerifier = m.library("CustomVerifier");
|
||||
const identityVerificationHubImplV2 = m.contract("IdentityVerificationHubImplV2", [], {
|
||||
libraries: { CustomVerifier: customVerifier },
|
||||
});
|
||||
|
||||
const testHubInterface = getTestHubInitializeData();
|
||||
const initializeData = testHubInterface.encodeFunctionData("initialize", [true]);
|
||||
// Get the interface to encode the initialize function call
|
||||
const hubInterface = getHubImplV2InitializeData();
|
||||
|
||||
const hubProxy = m.contractAt("IdentityVerificationHubImplV1", hubProxyAddress);
|
||||
// The V2 initialize function takes no parameters (unlike V1)
|
||||
// It automatically sets circuit version to 2 and emits HubInitializedV2 event
|
||||
const initializeData = hubInterface.encodeFunctionData("initialize", []);
|
||||
|
||||
m.call(hubProxy, "upgradeToAndCall", [newHubImpl, initializeData]);
|
||||
const hubProxy = m.contractAt("IdentityVerificationHubImplV2", hubProxyAddress, { id: "IdentityVerificationHubV2" });
|
||||
|
||||
const a = m.call(hubProxy, "upgradeToAndCall", [identityVerificationHubImplV2, initializeData], {
|
||||
after: [identityVerificationHubImplV2],
|
||||
});
|
||||
|
||||
m.call(hubProxy, "setAadhaarRegistrationWindow", [120], { after: [a] });
|
||||
|
||||
return {
|
||||
newHubImpl,
|
||||
identityVerificationHubImplV2,
|
||||
hubProxy,
|
||||
};
|
||||
});
|
||||
|
||||
205
contracts/ignition/modules/verifiers/deployAllVerifiersNew.ts
Normal file
205
contracts/ignition/modules/verifiers/deployAllVerifiersNew.ts
Normal file
@@ -0,0 +1,205 @@
|
||||
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
|
||||
|
||||
// All circuit names as a union type
|
||||
export type CircuitName =
|
||||
| "register_sha256_sha256_sha256_rsa_65537_4096"
|
||||
| "register_sha256_sha256_sha256_ecdsa_brainpoolP384r1"
|
||||
| "register_sha256_sha256_sha256_ecdsa_secp256r1"
|
||||
| "register_sha256_sha256_sha256_ecdsa_secp384r1"
|
||||
| "register_sha256_sha256_sha256_rsa_3_4096"
|
||||
| "register_sha256_sha256_sha256_rsapss_3_32_2048"
|
||||
| "register_sha256_sha256_sha256_rsapss_65537_32_2048"
|
||||
| "register_sha256_sha256_sha256_rsapss_65537_32_3072"
|
||||
| "register_sha384_sha384_sha384_ecdsa_brainpoolP384r1"
|
||||
| "register_sha384_sha384_sha384_ecdsa_brainpoolP512r1"
|
||||
| "register_sha384_sha384_sha384_ecdsa_secp384r1"
|
||||
| "register_sha512_sha512_sha512_ecdsa_brainpoolP512r1"
|
||||
| "register_sha512_sha512_sha512_rsa_65537_4096"
|
||||
| "register_sha512_sha512_sha512_rsapss_65537_64_2048"
|
||||
| "register_sha1_sha1_sha1_rsa_65537_4096"
|
||||
| "register_sha1_sha256_sha256_rsa_65537_4096"
|
||||
| "register_sha224_sha224_sha224_ecdsa_brainpoolP224r1"
|
||||
| "register_sha256_sha224_sha224_ecdsa_secp224r1"
|
||||
| "register_sha256_sha256_sha256_ecdsa_brainpoolP256r1"
|
||||
| "register_sha1_sha1_sha1_ecdsa_brainpoolP224r1"
|
||||
| "register_sha384_sha384_sha384_rsapss_65537_48_2048"
|
||||
| "register_sha1_sha1_sha1_ecdsa_secp256r1"
|
||||
| "register_sha256_sha256_sha256_rsapss_65537_64_2048"
|
||||
| "register_sha512_sha512_sha256_rsa_65537_4096"
|
||||
| "register_sha512_sha512_sha512_ecdsa_secp521r1"
|
||||
| "register_id_sha256_sha256_sha256_rsa_65537_4096"
|
||||
| "register_sha256_sha256_sha224_ecdsa_secp224r1"
|
||||
| "register_id_sha1_sha1_sha1_ecdsa_brainpoolP224r1"
|
||||
| "register_id_sha1_sha1_sha1_ecdsa_secp256r1"
|
||||
| "register_id_sha1_sha1_sha1_rsa_65537_4096"
|
||||
| "register_id_sha1_sha256_sha256_rsa_65537_4096"
|
||||
| "register_id_sha224_sha224_sha224_ecdsa_brainpoolP224r1"
|
||||
| "register_id_sha256_sha224_sha224_ecdsa_secp224r1"
|
||||
| "register_id_sha256_sha256_sha224_ecdsa_secp224r1"
|
||||
| "register_id_sha256_sha256_sha256_ecdsa_brainpoolP256r1"
|
||||
| "register_id_sha256_sha256_sha256_ecdsa_brainpoolP384r1"
|
||||
| "register_id_sha256_sha256_sha256_ecdsa_secp256r1"
|
||||
| "register_id_sha256_sha256_sha256_ecdsa_secp384r1"
|
||||
| "register_id_sha256_sha256_sha256_rsa_3_4096"
|
||||
| "register_id_sha256_sha256_sha256_rsapss_3_32_2048"
|
||||
| "register_id_sha256_sha256_sha256_rsapss_65537_32_2048"
|
||||
| "register_id_sha256_sha256_sha256_rsapss_65537_32_3072"
|
||||
| "register_id_sha256_sha256_sha256_rsapss_65537_64_2048"
|
||||
| "register_id_sha384_sha384_sha384_ecdsa_brainpoolP384r1"
|
||||
| "register_id_sha384_sha384_sha384_ecdsa_brainpoolP512r1"
|
||||
| "register_id_sha384_sha384_sha384_ecdsa_secp384r1"
|
||||
| "register_id_sha384_sha384_sha384_rsapss_65537_48_2048"
|
||||
| "register_id_sha512_sha512_sha256_rsa_65537_4096"
|
||||
| "register_id_sha512_sha512_sha512_ecdsa_brainpoolP512r1"
|
||||
| "register_id_sha512_sha512_sha512_ecdsa_secp521r1"
|
||||
| "register_id_sha512_sha512_sha512_rsa_65537_4096"
|
||||
| "register_id_sha512_sha512_sha512_rsapss_65537_64_2048"
|
||||
| "register_aadhaar"
|
||||
| "register_sha1_sha1_sha1_rsa_64321_4096"
|
||||
| "register_sha256_sha1_sha1_rsa_65537_4096"
|
||||
| "register_sha256_sha256_sha256_rsapss_65537_32_4096"
|
||||
| "register_id_sha512_sha512_sha256_rsapss_65537_32_2048"
|
||||
| "register_sha512_sha512_sha256_rsapss_65537_32_2048"
|
||||
| "dsc_sha1_ecdsa_brainpoolP256r1"
|
||||
| "dsc_sha1_rsa_65537_4096"
|
||||
| "dsc_sha256_ecdsa_brainpoolP256r1"
|
||||
| "dsc_sha256_ecdsa_brainpoolP384r1"
|
||||
| "dsc_sha256_ecdsa_secp256r1"
|
||||
| "dsc_sha256_ecdsa_secp384r1"
|
||||
| "dsc_sha256_ecdsa_secp521r1"
|
||||
| "dsc_sha256_rsa_65537_4096"
|
||||
| "dsc_sha256_rsapss_3_32_3072"
|
||||
| "dsc_sha256_rsapss_65537_32_3072"
|
||||
| "dsc_sha256_rsapss_65537_32_4096"
|
||||
| "dsc_sha384_ecdsa_brainpoolP384r1"
|
||||
| "dsc_sha384_ecdsa_brainpoolP512r1"
|
||||
| "dsc_sha384_ecdsa_secp384r1"
|
||||
| "dsc_sha512_ecdsa_brainpoolP512r1"
|
||||
| "dsc_sha512_ecdsa_secp521r1"
|
||||
| "dsc_sha512_rsa_65537_4096"
|
||||
| "dsc_sha512_rsapss_65537_64_4096"
|
||||
// | "dsc_sha256_rsapss_3_32_4096"
|
||||
| "dsc_sha1_ecdsa_secp256r1"
|
||||
| "dsc_sha256_rsa_107903_4096"
|
||||
| "dsc_sha256_rsa_122125_4096"
|
||||
| "dsc_sha256_rsa_130689_4096"
|
||||
| "dsc_sha256_rsa_56611_4096"
|
||||
| "vc_and_disclose"
|
||||
| "vc_and_disclose_id"
|
||||
| "vc_and_disclose_aadhaar";
|
||||
|
||||
// Record mapping circuit names to numbers
|
||||
export const circuitIds: Record<CircuitName, [boolean, number]> = {
|
||||
register_sha256_sha256_sha256_rsa_65537_4096: [true, 0],
|
||||
register_sha256_sha256_sha256_ecdsa_brainpoolP384r1: [true, 1],
|
||||
register_sha256_sha256_sha256_ecdsa_secp256r1: [true, 2],
|
||||
register_sha256_sha256_sha256_ecdsa_secp384r1: [true, 3],
|
||||
register_sha256_sha256_sha256_rsa_3_4096: [true, 4],
|
||||
register_sha256_sha256_sha256_rsapss_3_32_2048: [true, 5],
|
||||
register_sha256_sha256_sha256_rsapss_65537_32_2048: [true, 6],
|
||||
register_sha256_sha256_sha256_rsapss_65537_32_3072: [true, 7],
|
||||
register_sha384_sha384_sha384_ecdsa_brainpoolP384r1: [true, 8],
|
||||
register_sha384_sha384_sha384_ecdsa_brainpoolP512r1: [true, 9],
|
||||
register_sha384_sha384_sha384_ecdsa_secp384r1: [true, 10],
|
||||
register_sha512_sha512_sha512_ecdsa_brainpoolP512r1: [true, 11],
|
||||
register_sha512_sha512_sha512_rsa_65537_4096: [true, 12],
|
||||
register_sha512_sha512_sha512_rsapss_65537_64_2048: [true, 13],
|
||||
register_sha1_sha1_sha1_rsa_65537_4096: [true, 14],
|
||||
register_sha1_sha256_sha256_rsa_65537_4096: [true, 15],
|
||||
register_sha224_sha224_sha224_ecdsa_brainpoolP224r1: [true, 16],
|
||||
register_sha256_sha224_sha224_ecdsa_secp224r1: [true, 17],
|
||||
register_sha256_sha256_sha256_ecdsa_brainpoolP256r1: [true, 18],
|
||||
register_sha1_sha1_sha1_ecdsa_brainpoolP224r1: [true, 19],
|
||||
register_sha384_sha384_sha384_rsapss_65537_48_2048: [true, 20],
|
||||
register_sha1_sha1_sha1_ecdsa_secp256r1: [true, 21],
|
||||
register_sha256_sha256_sha256_rsapss_65537_64_2048: [true, 22],
|
||||
register_sha512_sha512_sha256_rsa_65537_4096: [true, 23],
|
||||
register_sha512_sha512_sha512_ecdsa_secp521r1: [true, 24],
|
||||
register_id_sha256_sha256_sha256_rsa_65537_4096: [true, 25],
|
||||
register_sha256_sha256_sha224_ecdsa_secp224r1: [true, 26],
|
||||
register_id_sha1_sha1_sha1_ecdsa_brainpoolP224r1: [true, 27],
|
||||
register_id_sha1_sha1_sha1_ecdsa_secp256r1: [true, 28],
|
||||
register_id_sha1_sha1_sha1_rsa_65537_4096: [true, 29],
|
||||
register_id_sha1_sha256_sha256_rsa_65537_4096: [true, 30],
|
||||
register_id_sha224_sha224_sha224_ecdsa_brainpoolP224r1: [true, 31],
|
||||
register_id_sha256_sha224_sha224_ecdsa_secp224r1: [true, 32],
|
||||
register_id_sha256_sha256_sha224_ecdsa_secp224r1: [true, 33],
|
||||
register_id_sha256_sha256_sha256_ecdsa_brainpoolP256r1: [true, 34],
|
||||
register_id_sha256_sha256_sha256_ecdsa_brainpoolP384r1: [true, 35],
|
||||
register_id_sha256_sha256_sha256_ecdsa_secp256r1: [true, 36],
|
||||
register_id_sha256_sha256_sha256_ecdsa_secp384r1: [true, 37],
|
||||
register_id_sha256_sha256_sha256_rsa_3_4096: [true, 38],
|
||||
register_id_sha256_sha256_sha256_rsapss_3_32_2048: [true, 39],
|
||||
register_id_sha256_sha256_sha256_rsapss_65537_32_2048: [true, 40],
|
||||
register_id_sha256_sha256_sha256_rsapss_65537_32_3072: [true, 41],
|
||||
register_id_sha256_sha256_sha256_rsapss_65537_64_2048: [true, 42],
|
||||
register_id_sha384_sha384_sha384_ecdsa_brainpoolP384r1: [true, 43],
|
||||
register_id_sha384_sha384_sha384_ecdsa_brainpoolP512r1: [true, 44],
|
||||
register_id_sha384_sha384_sha384_ecdsa_secp384r1: [true, 45],
|
||||
register_id_sha384_sha384_sha384_rsapss_65537_48_2048: [true, 46],
|
||||
register_id_sha512_sha512_sha256_rsa_65537_4096: [true, 47],
|
||||
register_id_sha512_sha512_sha512_ecdsa_brainpoolP512r1: [true, 48],
|
||||
register_id_sha512_sha512_sha512_ecdsa_secp521r1: [true, 49],
|
||||
register_id_sha512_sha512_sha512_rsa_65537_4096: [true, 50],
|
||||
register_id_sha512_sha512_sha512_rsapss_65537_64_2048: [true, 51],
|
||||
register_aadhaar: [true, 52],
|
||||
register_sha1_sha1_sha1_rsa_64321_4096: [true, 53],
|
||||
register_sha256_sha1_sha1_rsa_65537_4096: [true, 54],
|
||||
register_sha256_sha256_sha256_rsapss_65537_32_4096: [true, 55],
|
||||
register_id_sha512_sha512_sha256_rsapss_65537_32_2048: [true, 56],
|
||||
register_sha512_sha512_sha256_rsapss_65537_32_2048: [true, 57],
|
||||
|
||||
dsc_sha1_ecdsa_brainpoolP256r1: [true, 0],
|
||||
dsc_sha1_rsa_65537_4096: [true, 1],
|
||||
dsc_sha256_ecdsa_brainpoolP256r1: [true, 2],
|
||||
dsc_sha256_ecdsa_brainpoolP384r1: [true, 3],
|
||||
dsc_sha256_ecdsa_secp256r1: [true, 4],
|
||||
dsc_sha256_ecdsa_secp384r1: [true, 5],
|
||||
dsc_sha256_ecdsa_secp521r1: [true, 6],
|
||||
dsc_sha256_rsa_65537_4096: [true, 7],
|
||||
dsc_sha256_rsapss_3_32_3072: [true, 8],
|
||||
dsc_sha256_rsapss_65537_32_3072: [true, 9],
|
||||
dsc_sha256_rsapss_65537_32_4096: [true, 10],
|
||||
dsc_sha384_ecdsa_brainpoolP384r1: [true, 11],
|
||||
dsc_sha384_ecdsa_brainpoolP512r1: [true, 12],
|
||||
dsc_sha384_ecdsa_secp384r1: [true, 13],
|
||||
dsc_sha512_ecdsa_brainpoolP512r1: [true, 14],
|
||||
dsc_sha512_ecdsa_secp521r1: [true, 15],
|
||||
dsc_sha512_rsa_65537_4096: [true, 16],
|
||||
dsc_sha512_rsapss_65537_64_4096: [true, 17],
|
||||
// dsc_sha256_rsapss_3_32_4096: [true, 18],
|
||||
dsc_sha1_ecdsa_secp256r1: [true, 19],
|
||||
dsc_sha256_rsa_107903_4096: [true, 20],
|
||||
dsc_sha256_rsa_122125_4096: [true, 21],
|
||||
dsc_sha256_rsa_130689_4096: [true, 22],
|
||||
dsc_sha256_rsa_56611_4096: [true, 23],
|
||||
|
||||
vc_and_disclose: [true, 24],
|
||||
vc_and_disclose_id: [true, 25],
|
||||
vc_and_disclose_aadhaar: [true, 26],
|
||||
};
|
||||
|
||||
export default buildModule("DeployAllVerifiers", (m) => {
|
||||
const deployments: Record<string, any> = {};
|
||||
let lastDeployedContract: any = null;
|
||||
|
||||
for (const circuit of Object.keys(circuitIds) as CircuitName[]) {
|
||||
const [shouldDeploy] = circuitIds[circuit];
|
||||
|
||||
if (!shouldDeploy) {
|
||||
console.log(`Skipping Verifier_${circuit}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
const name = `Verifier_${circuit}`;
|
||||
console.log(`Deploying ${name}...`);
|
||||
|
||||
// Create dependency on the last deployed contract to ensure sequential deployment
|
||||
const deployOptions = lastDeployedContract ? { after: [lastDeployedContract] } : {};
|
||||
deployments[name] = m.contract(name, [], deployOptions);
|
||||
lastDeployedContract = deployments[name];
|
||||
}
|
||||
|
||||
console.log(`Deployments will execute sequentially to prevent nonce conflicts`);
|
||||
return deployments;
|
||||
});
|
||||
@@ -31,9 +31,9 @@
|
||||
"deploy:registry": "npx dotenv-cli -- bash -c 'yarn hardhat ignition deploy ignition/modules/registry/deployRegistry.ts --network ${NETWORK:-localhost} ${VERIFY:+--verify}'",
|
||||
"deploy:registry:idcard": "npx dotenv-cli -- bash -c 'yarn hardhat ignition deploy ignition/modules/registry/deployIdCardRegistry.ts --network ${NETWORK:-localhost} ${VERIFY:+--verify}'",
|
||||
"deploy:test:selfverificationroot": "npx dotenv-cli -- bash -c 'yarn hardhat ignition deploy ignition/modules/deployTestSelfVerificationRoot.ts --network ${NETWORK:-localhost} ${VERIFY:+--verify}'",
|
||||
"deploy:verifier:id": "npx dotenv-cli -- bash -c 'yarn hardhat ignition deploy ignition/modules/verifiers/deployAllVerifiers.ts --network ${NETWORK:-localhost} ${VERIFY:+--verify}'",
|
||||
"deploy:verifier:id": "npx dotenv-cli -- bash -c 'yarn hardhat ignition deploy ignition/modules/verifiers/deployAllVerifiersNew.ts --network ${NETWORK:-localhost} ${VERIFY:+--verify}'",
|
||||
"deploy:verifiers": "npx dotenv-cli -- bash -c 'yarn hardhat ignition deploy ignition/modules/verifiers/deployVerifiers.ts --network ${NETWORK:-localhost} ${VERIFY:+--verify}'",
|
||||
"deploy:verifiers:all": "npx dotenv-cli -- bash -c 'yarn hardhat ignition deploy ignition/modules/verifiers/deployAllVerifiers.ts --network ${NETWORK:-localhost} ${VERIFY:+--verify}'",
|
||||
"deploy:verifiers:all": "npx dotenv-cli -- bash -c 'yarn hardhat ignition deploy ignition/modules/verifiers/deployAllVerifiersNew.ts --network ${NETWORK:-localhost}' --verify",
|
||||
"export-prod": "bash ./scripts/prod.sh",
|
||||
"find:error": "npx tsx scripts/findErrorSelectors.ts",
|
||||
"format": "yarn prettier:write",
|
||||
|
||||
@@ -62,7 +62,7 @@ export async function deploySystemFixturesV2(): Promise<DeployedActorsV2> {
|
||||
}
|
||||
|
||||
let vcAndDiscloseIdVerifierArtifact;
|
||||
// Deploy VC and Disclose ID verifier
|
||||
// // Deploy VC and Disclose ID verifier
|
||||
{
|
||||
vcAndDiscloseIdVerifierArtifact = VcAndDiscloseIdVerifierArtifactLocal;
|
||||
const vcAndDiscloseIdVerifierFactory = await ethers.getContractFactory(
|
||||
@@ -280,9 +280,9 @@ export async function deploySystemFixturesV2(): Promise<DeployedActorsV2> {
|
||||
|
||||
// Initialize roots
|
||||
const csca_root = getCscaTreeRoot(serialized_csca_tree);
|
||||
await registryContract.updateCscaRoot(csca_root, { from: owner });
|
||||
await registryIdContract.updateCscaRoot(csca_root, { from: owner });
|
||||
await registryAadhaarContract.registerUidaiPubkeyCommitment(aadhaarPubkeyCommitment, aadhaarExpiryTimestamp, {
|
||||
// await registryContract.updateCscaRoot(csca_root, { from: owner });
|
||||
// await registryIdContract.updateCscaRoot(csca_root, { from: owner });
|
||||
await registryAadhaarContract.registerUidaiPubkeyCommitment(aadhaarPubkeyCommitment, {
|
||||
from: owner,
|
||||
});
|
||||
|
||||
|
||||
@@ -46,23 +46,11 @@ describe("Aadhaar Registration test", function () {
|
||||
if (!block) {
|
||||
throw new Error("Block timestamp not found");
|
||||
}
|
||||
const blockTimestamp = BigInt(block.timestamp) + 1000n;
|
||||
await expect(deployedActors.registryAadhaar.registerUidaiPubkeyCommitment(1n, blockTimestamp)).to.emit(
|
||||
await expect(deployedActors.registryAadhaar.registerUidaiPubkeyCommitment(1n)).to.emit(
|
||||
deployedActors.registryAadhaar,
|
||||
"UidaiPubkeyCommitmentRegistered",
|
||||
);
|
||||
});
|
||||
|
||||
it("should not register UIDAI pubkey commitment if expiry is in the past", async () => {
|
||||
const block = await ethers.provider.getBlock("latest");
|
||||
if (!block) {
|
||||
throw new Error("Block timestamp not found");
|
||||
}
|
||||
const blockTimestamp = BigInt(block.timestamp) - 1000n;
|
||||
await expect(
|
||||
deployedActors.registryAadhaar.registerUidaiPubkeyCommitment(1n, blockTimestamp),
|
||||
).to.be.revertedWithCustomError(deployedActors.registryAadhaar, "EXPIRY_IN_PAST");
|
||||
});
|
||||
});
|
||||
|
||||
describe("Identity Commitment", () => {
|
||||
@@ -88,6 +76,9 @@ describe("Aadhaar Registration test", function () {
|
||||
});
|
||||
|
||||
it("should successfully register identity commitment", async () => {
|
||||
// Fix the AADHAAR_REGISTRATION_WINDOW that was incorrectly set to 0
|
||||
await deployedActors.hub.setAadhaarRegistrationWindow(20);
|
||||
|
||||
await expect(deployedActors.hub.registerCommitment(attestationIdBytes32, 0n, registerProof)).to.emit(
|
||||
deployedActors.registryAadhaar,
|
||||
"CommitmentRegistered",
|
||||
@@ -98,6 +89,8 @@ describe("Aadhaar Registration test", function () {
|
||||
});
|
||||
|
||||
it("should not register identity commitment if the proof is invalid", async () => {
|
||||
await deployedActors.hub.setAadhaarRegistrationWindow(20);
|
||||
|
||||
const newRegisterProof = structuredClone(registerProof);
|
||||
newRegisterProof.a[0] = 0n;
|
||||
await expect(
|
||||
@@ -109,6 +102,8 @@ describe("Aadhaar Registration test", function () {
|
||||
});
|
||||
|
||||
it("should fail with NoVerifierSet when using non-existent register verifier ID", async () => {
|
||||
await deployedActors.hub.setAadhaarRegistrationWindow(20);
|
||||
|
||||
const nonExistentVerifierId = 999999; // Non-existent verifier ID
|
||||
|
||||
await expect(
|
||||
@@ -117,6 +112,8 @@ describe("Aadhaar Registration test", function () {
|
||||
});
|
||||
|
||||
it("should fail with NoVerifierSet when register verifier exists but attestation ID is invalid", async () => {
|
||||
await deployedActors.hub.setAadhaarRegistrationWindow(20);
|
||||
|
||||
const invalidAttestationId = ethers.zeroPadValue(ethers.toBeHex(999), 32);
|
||||
|
||||
await expect(
|
||||
@@ -125,6 +122,8 @@ describe("Aadhaar Registration test", function () {
|
||||
});
|
||||
|
||||
it("should fail with InvalidAttestationId when register verifier exists but attestation ID is invalid", async () => {
|
||||
await deployedActors.hub.setAadhaarRegistrationWindow(20);
|
||||
|
||||
const invalidAttestationId = ethers.zeroPadValue(ethers.toBeHex(999), 32);
|
||||
|
||||
await deployedActors.hub.updateRegisterCircuitVerifier(
|
||||
@@ -139,6 +138,8 @@ describe("Aadhaar Registration test", function () {
|
||||
});
|
||||
|
||||
it("should fail with InvalidUidaiPubkey when UIDAI pubkey commitment is not registered", async () => {
|
||||
await deployedActors.hub.setAadhaarRegistrationWindow(20);
|
||||
|
||||
const newRegisterProof = structuredClone(registerProof);
|
||||
newRegisterProof.pubSignals[0] = 0n;
|
||||
|
||||
@@ -148,6 +149,9 @@ describe("Aadhaar Registration test", function () {
|
||||
});
|
||||
|
||||
it("should not fail if timestamp is within 20 minutes", async () => {
|
||||
// Fix the AADHAAR_REGISTRATION_WINDOW that was incorrectly set to 0
|
||||
await deployedActors.hub.setAadhaarRegistrationWindow(20);
|
||||
|
||||
const newAadhaarData = prepareAadhaarRegisterTestData(
|
||||
privateKeyPem,
|
||||
pubkeyPem,
|
||||
@@ -167,6 +171,9 @@ describe("Aadhaar Registration test", function () {
|
||||
});
|
||||
|
||||
it("should fail with InvalidUidaiTimestamp when UIDAI timestamp is not within 20 minutes of current time", async () => {
|
||||
// Fix the AADHAAR_REGISTRATION_WINDOW that was incorrectly set to 0
|
||||
await deployedActors.hub.setAadhaarRegistrationWindow(20);
|
||||
|
||||
const newAadhaarData = prepareAadhaarRegisterTestData(
|
||||
privateKeyPem,
|
||||
pubkeyPem,
|
||||
|
||||
Reference in New Issue
Block a user