mirror of
https://github.com/selfxyz/self.git
synced 2026-04-05 03:00:53 -04:00
* feat: celo mainnet deployments * fix: upgrade script now reads version from contract directly * fix: add library linking for kyc related contracts in upgrade script * feat: IdentityVerificationHub v2.13.0 deployed on Celo - Implementation: 0x0D911083b2F2236D79EF20bb58AAf6009a1220B5 - Changelog: Upgrade * feat: update with new gcpJwtVerifier contract * chore: yarn prettier * Feat/new gcp verifier (#1719) * feat: new gcp jwt verifier * lint: contracts --------- Co-authored-by: Nesopie <87437291+Nesopie@users.noreply.github.com>
52 lines
2.0 KiB
TypeScript
52 lines
2.0 KiB
TypeScript
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
|
|
import { artifacts } from "hardhat";
|
|
import { ethers } from "ethers";
|
|
|
|
export default buildModule("DeployKycRegistryModule", (m) => {
|
|
// Deploy PoseidonT3
|
|
console.log("📚 Deploying PoseidonT3 library...");
|
|
const poseidonT3 = m.library("PoseidonT3");
|
|
|
|
console.log("🏗️ Deploying IdentityRegistryKycImplV1 implementation...");
|
|
// Deploy IdentityRegistryImplV1
|
|
const identityRegistryKycImpl = m.contract("IdentityRegistryKycImplV1", [], {
|
|
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, 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", [identityRegistryKycImpl, registryInitData]);
|
|
|
|
const gcpKycVerifier = m.contract("Verifier_gcp_jwt", []);
|
|
|
|
// PCR0Manager not deployed - using existing mainnet PCR0Manager at 0x9743fe2C1c3D2b068c56dE314e9B10DA9c904717
|
|
// const pcr0Manager = m.contract("PCR0Manager", []);
|
|
|
|
console.log("✅ Registry deployment module setup complete!");
|
|
console.log(" 📋 Summary:");
|
|
console.log(" - PoseidonT3: Library");
|
|
console.log(" - IdentityRegistryKycImplV1: Implementation contract");
|
|
console.log(" - IdentityRegistry: Proxy contract");
|
|
console.log(" - Verifier_gcp_jwt: GCP JWT verifier contract");
|
|
|
|
return {
|
|
poseidonT3,
|
|
identityRegistryKycImpl,
|
|
registry,
|
|
gcpKycVerifier,
|
|
};
|
|
});
|
|
|
|
function getRegistryInitializeData() {
|
|
const registryArtifact = artifacts.readArtifactSync("IdentityRegistryKycImplV1");
|
|
const registryInterface = new ethers.Interface(registryArtifact.abi);
|
|
return registryInterface;
|
|
}
|