Files
self/contracts/ignition/modules/deployTestSelfVerificationRoot.ts
Evi Nova a5797bc2e2 refactor: generate scope upon deployment instead of manual generation and using setScope (#1117)
* refactor: generate scope for SelfVerificationRoot upon deploment

Utilise Poseidon to generate the scope for the deploying contract instead of relying on utilizing the Scope Generator tool on the frontend and calling a function that inherits the _setScope function

* style: use explicit import for PoseidonT3

* fix: link Poseidon library in TestSelfVerificationRoot deployments

* fix: Use same logic in SelfVerificationRoot as in hashEndpointWithScope

* refactor: use hardcoded PoseidonT3 addresses for Celo Mainnet + Sepolia

Also allowed functionality for testing environments which have a fresh deploy each time they are spun up, and which now utilize the testSetScope function for tests relying on TestSelfVerificationRoot

* style: change setTestScope to setGenerateScope for clarity

* refactor: Move logic out of SelfVerificationRoot into util files

* chore: update version

* fix: sepolia chain id

* fmt

---------

Co-authored-by: ayman <aymanshaik1015@gmail.com>
2025-09-26 01:26:27 +05:30

38 lines
1.3 KiB
TypeScript

import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
/**
* TestSelfVerificationRoot Deployment Module
*
* Deploys the TestSelfVerificationRoot contract for testing self-verification functionality.
*
* USAGE:
* npx hardhat ignition deploy ignition/modules/deployTestSelfVerificationRoot.ts --network alfajores --verify
*
* VERIFICATION:
* npx hardhat verify <DEPLOYED_ADDRESS> 0x68c931C9a534D37aa78094877F46fE46a49F1A51 "test-scope" --network alfajores
*
* PARAMETERS:
* - identityVerificationHubV2Address: Hub V2 contract address (default: 0x68c931C9a534D37aa78094877F46fE46a49F1A51)
* - scopeSeed: Scope seed string for automatic scope generation (default: "test-scope")
*/
export default buildModule("DeployTestSelfVerificationRoot", (m) => {
const identityVerificationHubV2Address = m.getParameter(
"identityVerificationHubV2Address",
"0x68c931C9a534D37aa78094877F46fE46a49F1A51",
);
const scopeSeed = m.getParameter("scopeSeed", "test-scope");
console.log("identityVerificationHubV2Address", identityVerificationHubV2Address);
console.log("scopeSeed", scopeSeed);
// Deploy TestSelfVerificationRoot
const testSelfVerificationRoot = m.contract("TestSelfVerificationRoot", [
identityVerificationHubV2Address,
scopeSeed,
]);
return {
testSelfVerificationRoot,
};
});