@cofhe/hardhat-plugin 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # @cofhe/hardhat-plugin Changelog
2
2
 
3
+ ## 0.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f78beb7: Add `@cofhe/hardhat-3-plugin` and `@cofhe/foundry-plugin` packages.
8
+
9
+ **`@cofhe/hardhat-3-plugin`** — Hardhat 3 plugin with the same mock contract deployment, `network.cofhe` API, logging, and faucet task as the v2 plugin, adapted to the Hardhat 3 plugin/hook model.
10
+
11
+ **`@cofhe/foundry-plugin`** — Foundry test utilities: `CofheTest` base contract (`deployMocks`, `expectPlaintext`, `getPlaintext`) and `CofheClient` SDK mock (`connect`, `createInE*`, `decryptForTx`, `decryptForView`, permits). Usable as a git submodule or npm package, with `remappings.txt` for Hardhat 3 Solidity test compatibility.
12
+
13
+ **`mocksDeployVerbosity` config option** added to both Hardhat plugins:
14
+
15
+ - `''` — silent
16
+ - `'v'` — single summary line (new default)
17
+ - `'vv'` — full per-contract deployment logs (previous default behavior)
18
+
19
+ - 50bb3e4: Decode custom errors from deployed mock contracts by name instead of raw hex selectors.
20
+
21
+ **`@cofhe/mock-contracts`**
22
+
23
+ - Replaced transient storage (`tstore`/`tload`) in `MockACL.sol` with block-number-based storage, removing the EVM `cancun` requirement and lowering the Solidity pragma to `>=0.8.19`.
24
+ - Removed `bytecode` and `deployedBytecode` fields from published artifacts — they are now sourced at runtime from Hardhat's own compilation output.
25
+
26
+ **`@cofhe/hardhat-plugin`**
27
+
28
+ - Overrides `TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS` to inject a stub file that imports all mock contracts, so Hardhat compiles them and registers their artifacts. This lets the Hardhat network decode mock contract custom errors by name (e.g. `PermissionInvalid_Expired`) rather than raw hex.
29
+ - Deployment bytecode is now fetched from `hre.artifacts.readArtifact()` instead of the pre-built artifact bundle.
30
+
31
+ **`@cofhe/hardhat-3-plugin`**
32
+
33
+ - Calls `hre.solidity.build()` during the `hre.created` hook to compile mock contracts once at startup, enabling the EDR to decode their custom errors by name.
34
+ - `deployFixed` and `deployVariable` now source bytecode from `hre.artifacts.readArtifact()`, ensuring the deployed bytecode matches Hardhat's build info — which is required for error decoding on variable-address contracts like `MockACL`.
35
+
36
+ ### Patch Changes
37
+
38
+ - a685cd4: **Breaking change: upgraded to tfhe v1.5.3.**
39
+ Previous cofhesdk versions will no longer function.
40
+ - Updated dependencies [6c4084f]
41
+ - Updated dependencies [50bb3e4]
42
+ - Updated dependencies [788a6e2]
43
+ - Updated dependencies [9a06012]
44
+ - Updated dependencies [503536a]
45
+ - Updated dependencies [a685cd4]
46
+ - @cofhe/sdk@0.5.0
47
+ - @cofhe/mock-contracts@0.5.0
48
+
3
49
  ## 0.4.0
4
50
 
5
51
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -7,10 +7,17 @@ import * as ethers from 'ethers';
7
7
  import { Contract, ethers as ethers$1 } from 'ethers';
8
8
  import { HardhatEthersProvider } from '@nomicfoundation/hardhat-ethers/internal/hardhat-ethers-provider';
9
9
 
10
+ /**
11
+ * Controls deploy-mocks console output.
12
+ * - `''` — silent, no output
13
+ * - `'v'` — single summary line (default)
14
+ * - `'vv'` — full per-contract deployment logs
15
+ */
16
+ type LogMocksDeploy = '' | 'v' | 'vv';
10
17
  type DeployMocksArgs = {
11
18
  deployTestBed?: boolean;
12
19
  gasWarning?: boolean;
13
- silent?: boolean;
20
+ mocksDeployVerbosity?: LogMocksDeploy;
14
21
  };
15
22
  declare const deployMocks: (hre: HardhatRuntimeEnvironment, options?: DeployMocksArgs) => Promise<void>;
16
23
 
@@ -54,6 +61,13 @@ declare module 'hardhat/types/config' {
54
61
  logMocks?: boolean;
55
62
  /** Whether to show gas usage warnings for mock operations (default: true) */
56
63
  gasWarning?: boolean;
64
+ /**
65
+ * Controls deploy-mocks console output.
66
+ * - `''` — silent, no output
67
+ * - `'v'` — single summary line (default)
68
+ * - `'vv'` — full per-contract deployment logs
69
+ */
70
+ mocksDeployVerbosity?: LogMocksDeploy;
57
71
  };
58
72
  }
59
73
  interface HardhatConfig {
@@ -62,6 +76,7 @@ declare module 'hardhat/types/config' {
62
76
  logMocks: boolean;
63
77
  /** Whether to show gas usage warnings for mock operations (default: true) */
64
78
  gasWarning: boolean;
79
+ mocksDeployVerbosity: LogMocksDeploy;
65
80
  };
66
81
  }
67
82
  }
@@ -211,4 +226,4 @@ declare module 'hardhat/types/runtime' {
211
226
  */
212
227
  declare function buildHardhatPluginMocksConfig(mocksConfig: CofheInputConfig['mocks']): NonNullable<CofheInputConfig['mocks']>;
213
228
 
214
- export { type DeployMocksArgs, TASK_COFHE_MOCKS_DEPLOY, TASK_COFHE_MOCKS_SET_LOG_OPS, TASK_COFHE_USE_FAUCET, buildHardhatPluginMocksConfig, deployMockContractFromArtifact, deployMocks, getFixedMockContract, localcofheFundAccount, localcofheFundWalletIfNeeded, mock_expectPlaintext, mock_getPlaintext, mock_getPlaintextExists, mock_setLoggingEnabled, mock_withLogs };
229
+ export { type DeployMocksArgs, type LogMocksDeploy, TASK_COFHE_MOCKS_DEPLOY, TASK_COFHE_MOCKS_SET_LOG_OPS, TASK_COFHE_USE_FAUCET, buildHardhatPluginMocksConfig, deployMockContractFromArtifact, deployMocks, getFixedMockContract, localcofheFundAccount, localcofheFundWalletIfNeeded, mock_expectPlaintext, mock_getPlaintext, mock_getPlaintextExists, mock_setLoggingEnabled, mock_withLogs };
package/dist/index.d.ts CHANGED
@@ -7,10 +7,17 @@ import * as ethers from 'ethers';
7
7
  import { Contract, ethers as ethers$1 } from 'ethers';
8
8
  import { HardhatEthersProvider } from '@nomicfoundation/hardhat-ethers/internal/hardhat-ethers-provider';
9
9
 
10
+ /**
11
+ * Controls deploy-mocks console output.
12
+ * - `''` — silent, no output
13
+ * - `'v'` — single summary line (default)
14
+ * - `'vv'` — full per-contract deployment logs
15
+ */
16
+ type LogMocksDeploy = '' | 'v' | 'vv';
10
17
  type DeployMocksArgs = {
11
18
  deployTestBed?: boolean;
12
19
  gasWarning?: boolean;
13
- silent?: boolean;
20
+ mocksDeployVerbosity?: LogMocksDeploy;
14
21
  };
15
22
  declare const deployMocks: (hre: HardhatRuntimeEnvironment, options?: DeployMocksArgs) => Promise<void>;
16
23
 
@@ -54,6 +61,13 @@ declare module 'hardhat/types/config' {
54
61
  logMocks?: boolean;
55
62
  /** Whether to show gas usage warnings for mock operations (default: true) */
56
63
  gasWarning?: boolean;
64
+ /**
65
+ * Controls deploy-mocks console output.
66
+ * - `''` — silent, no output
67
+ * - `'v'` — single summary line (default)
68
+ * - `'vv'` — full per-contract deployment logs
69
+ */
70
+ mocksDeployVerbosity?: LogMocksDeploy;
57
71
  };
58
72
  }
59
73
  interface HardhatConfig {
@@ -62,6 +76,7 @@ declare module 'hardhat/types/config' {
62
76
  logMocks: boolean;
63
77
  /** Whether to show gas usage warnings for mock operations (default: true) */
64
78
  gasWarning: boolean;
79
+ mocksDeployVerbosity: LogMocksDeploy;
65
80
  };
66
81
  }
67
82
  }
@@ -211,4 +226,4 @@ declare module 'hardhat/types/runtime' {
211
226
  */
212
227
  declare function buildHardhatPluginMocksConfig(mocksConfig: CofheInputConfig['mocks']): NonNullable<CofheInputConfig['mocks']>;
213
228
 
214
- export { type DeployMocksArgs, TASK_COFHE_MOCKS_DEPLOY, TASK_COFHE_MOCKS_SET_LOG_OPS, TASK_COFHE_USE_FAUCET, buildHardhatPluginMocksConfig, deployMockContractFromArtifact, deployMocks, getFixedMockContract, localcofheFundAccount, localcofheFundWalletIfNeeded, mock_expectPlaintext, mock_getPlaintext, mock_getPlaintextExists, mock_setLoggingEnabled, mock_withLogs };
229
+ export { type DeployMocksArgs, type LogMocksDeploy, TASK_COFHE_MOCKS_DEPLOY, TASK_COFHE_MOCKS_SET_LOG_OPS, TASK_COFHE_USE_FAUCET, buildHardhatPluginMocksConfig, deployMockContractFromArtifact, deployMocks, getFixedMockContract, localcofheFundAccount, localcofheFundWalletIfNeeded, mock_expectPlaintext, mock_getPlaintext, mock_getPlaintextExists, mock_setLoggingEnabled, mock_withLogs };
package/dist/index.js CHANGED
@@ -47,6 +47,8 @@ __export(src_exports, {
47
47
  });
48
48
  module.exports = __toCommonJS(src_exports);
49
49
  var import_chalk3 = __toESM(require("chalk"));
50
+ var import_path = __toESM(require("path"));
51
+ var import_fs = __toESM(require("fs"));
50
52
  var import_viem = require("viem");
51
53
  var import_config = require("hardhat/config");
52
54
  var import_task_names = require("hardhat/builtin-tasks/task-names");
@@ -125,15 +127,14 @@ var import_chai = require("chai");
125
127
  var import_ethers = require("ethers");
126
128
  var import_hardhat_ethers_provider = require("@nomicfoundation/hardhat-ethers/internal/hardhat-ethers-provider");
127
129
  var deployMockContractFromArtifact = async (hre, artifact) => {
130
+ const hardhatArtifact = await hre.artifacts.readArtifact(artifact.contractName);
128
131
  if (artifact.isFixed) {
129
- await hre.network.provider.send("hardhat_setCode", [artifact.fixedAddress, artifact.deployedBytecode]);
130
- return getFixedMockContract(hre, artifact);
132
+ await hre.network.provider.send("hardhat_setCode", [artifact.fixedAddress, hardhatArtifact.deployedBytecode]);
133
+ return hre.ethers.getContractAt(hardhatArtifact.abi, artifact.fixedAddress);
131
134
  }
132
135
  const [signer] = await hre.ethers.getSigners();
133
- const factory = new hre.ethers.ContractFactory(artifact.abi, artifact.bytecode, signer);
134
- const contract = await factory.deploy(
135
- /* constructor args */
136
- );
136
+ const factory = new hre.ethers.ContractFactory(hardhatArtifact.abi, hardhatArtifact.bytecode, signer);
137
+ const contract = await factory.deploy();
137
138
  await contract.waitForDeployment();
138
139
  return contract;
139
140
  };
@@ -141,7 +142,8 @@ var getFixedMockContract = async (hre, artifact) => {
141
142
  if (!artifact.isFixed) {
142
143
  throw new Error("Artifact is not fixed");
143
144
  }
144
- return await hre.ethers.getContractAt(artifact.abi, artifact.fixedAddress);
145
+ const hardhatArtifact = await hre.artifacts.readArtifact(artifact.contractName);
146
+ return hre.ethers.getContractAt(hardhatArtifact.abi, artifact.fixedAddress);
145
147
  };
146
148
  var mock_checkIsTestnet = async (fnName, provider) => {
147
149
  const bytecode = await provider.getCode(import_sdk.MOCKS_ZK_VERIFIER_ADDRESS);
@@ -186,50 +188,47 @@ var mock_expectPlaintext = async (provider, ctHash, expectedValue) => {
186
188
  var deployMocks = async (hre, options = {
187
189
  deployTestBed: true,
188
190
  gasWarning: true,
189
- silent: false
191
+ mocksDeployVerbosity: "v"
190
192
  }) => {
193
+ verbosity = options.mocksDeployVerbosity ?? "v";
191
194
  const isHardhat = await getIsHardhat(hre);
192
195
  if (!isHardhat) {
193
- logSuccess(`cofhe-hardhat-plugin - deploy mocks - skipped on non-hardhat network ${hre.network.name}`, 0);
196
+ log("v", `cofhe-hardhat-plugin - deploy mocks - skipped on non-hardhat network ${hre.network.name}`, 0);
194
197
  return;
195
198
  }
196
- isSilent = options.silent ?? false;
197
- logEmpty();
198
- logSuccess(import_chalk.default.bold("cofhe-hardhat-plugin :: deploy mocks"), 0);
199
- logEmpty();
199
+ await hre.run("compile", { quiet: true });
200
+ log("vv", import_chalk.default.bold("cofhe-hardhat-plugin :: deploy mocks"), 0);
200
201
  const taskManager = await deployMockTaskManager(hre);
201
202
  logDeployment("MockTaskManager", await taskManager.getAddress());
202
203
  const acl = await deployMockACL(hre);
203
204
  logDeployment("MockACL", await acl.getAddress());
204
205
  await linkTaskManagerAndACL(taskManager, acl);
205
- logSuccess("ACL address set in TaskManager", 2);
206
+ log("vv", "ACL address set in TaskManager", 2);
206
207
  await setVerifierSigner(taskManager);
207
- logSuccess("Verifier signer set", 2);
208
+ log("vv", "Verifier signer set", 2);
208
209
  await setDecryptResultSigner(taskManager);
209
- logSuccess("Decrypt result signer set", 2);
210
+ log("vv", "Decrypt result signer set", 2);
210
211
  await fundZkVerifierSigner(hre);
211
- logSuccess(`ZkVerifier signer (${import_sdk2.MOCKS_ZK_VERIFIER_SIGNER_ADDRESS}) funded`, 1);
212
+ log("vv", `ZkVerifier signer (${import_sdk2.MOCKS_ZK_VERIFIER_SIGNER_ADDRESS}) funded`, 1);
212
213
  const zkVerifierSignerBalance = await getZkVerifierSignerBalance(hre);
213
- logSuccess(`ETH balance: ${zkVerifierSignerBalance.toString()}`, 2);
214
+ log("vv", `ETH balance: ${zkVerifierSignerBalance.toString()}`, 2);
214
215
  const zkVerifier = await deployMockZkVerifier(hre);
215
216
  logDeployment("MockZkVerifier", await zkVerifier.getAddress());
216
217
  const thresholdNetwork = await deployMockThresholdNetwork(hre, acl);
217
218
  logDeployment("MockThresholdNetwork", await thresholdNetwork.getAddress());
218
219
  if (options.deployTestBed) {
219
- logSuccess("TestBed deployment enabled", 2);
220
220
  const testBed = await deployTestBedContract(hre);
221
221
  logDeployment("TestBed", await testBed.getAddress());
222
222
  }
223
- logEmpty();
224
- logSuccess(import_chalk.default.bold("cofhe-hardhat-plugin :: mocks deployed successfully"), 0);
223
+ log("v", import_chalk.default.bold("cofhe-hardhat-plugin :: mocks deployed"), 0);
225
224
  if (options.gasWarning) {
226
- logEmpty();
225
+ logEmpty("v");
227
226
  logWarning(
228
- "When using mocks, FHE operations (eg FHE.add / FHE.mul) report a higher gas price due to additional on-chain mocking logic. Deploy your contracts on a testnet chain to check the true gas costs.\n(Disable this warning by setting '@cofhe/sdk.gasWarning' to false in your hardhat config",
227
+ "When using mocks, FHE operations (eg FHE.add / FHE.mul) report a higher gas price due to additional on-chain mocking logic. Deploy your contracts on a testnet chain to check the true gas costs.\n(Disable this warning by setting 'cofhe.gasWarning: false' in your hardhat config)",
229
228
  0
230
229
  );
231
230
  }
232
- logEmpty();
231
+ logEmpty("v");
233
232
  };
234
233
  var getIsHardhat = async (hre) => {
235
234
  return hre.network.name === "hardhat";
@@ -299,27 +298,31 @@ var deployMockThresholdNetwork = async (hre, acl) => {
299
298
  var deployTestBedContract = async (hre) => {
300
299
  return deployMockContractFromArtifact(hre, import_mock_contracts.TestBedArtifact);
301
300
  };
302
- var isSilent = false;
303
- var logEmpty = () => {
304
- if (isSilent)
301
+ var verbosity = "v";
302
+ var log = (minVerbosity, message, indent = 1) => {
303
+ if (verbosity === "")
305
304
  return;
306
- console.log("");
307
- };
308
- var logSuccess = (message, indent = 1) => {
309
- if (isSilent)
305
+ if (minVerbosity === "vv" && verbosity !== "vv")
310
306
  return;
311
307
  console.log(import_chalk.default.green(`${" ".repeat(indent)}\u2713 ${message}`));
312
308
  };
309
+ var logEmpty = (minVerbosity = "v") => {
310
+ if (verbosity === "")
311
+ return;
312
+ if (minVerbosity === "vv" && verbosity !== "vv")
313
+ return;
314
+ console.log("");
315
+ };
313
316
  var logWarning = (message, indent = 1) => {
314
- if (isSilent)
317
+ if (verbosity === "")
315
318
  return;
316
319
  console.log(import_chalk.default.bold(import_chalk.default.yellow(`${" ".repeat(indent)}\u26A0 NOTE:`)), message);
317
320
  };
318
321
  var logDeployment = (contractName, address) => {
319
- if (isSilent)
322
+ if (verbosity !== "vv")
320
323
  return;
321
324
  const paddedName = `${contractName} deployed`.padEnd(36);
322
- logSuccess(`${paddedName} ${import_chalk.default.bold(address)}`);
325
+ console.log(import_chalk.default.green(` \u2713 ${paddedName} ${import_chalk.default.bold(address)}`));
323
326
  };
324
327
 
325
328
  // src/logging.ts
@@ -361,16 +364,55 @@ var mock_withLogs = async (hre, closureName, closure) => {
361
364
  const initiallyEnabled = await getLoggingEnabled(hre);
362
365
  await setLoggingEnabled(hre, true);
363
366
  printLogsEnabledMessage(`"${import_chalk2.default.bold(closureName)}" logs:`);
364
- await closure();
365
- printLogsBlockEnd();
366
- if (!initiallyEnabled) {
367
- await setLoggingEnabled(hre, false);
367
+ try {
368
+ await closure();
369
+ } finally {
370
+ printLogsBlockEnd();
371
+ if (!initiallyEnabled) {
372
+ await setLoggingEnabled(hre, false);
373
+ }
368
374
  }
369
375
  };
370
376
 
371
377
  // src/index.ts
372
378
  var import_chains = require("@cofhe/sdk/chains");
373
379
  var import_mock_contracts3 = require("@cofhe/mock-contracts");
380
+ var MOCK_STUBS_DIR_NAME = "cofhe-stubs";
381
+ var MOCK_STUBS_FILE_NAME = "CofheMocksImports.sol";
382
+ function getMockContractsSolFiles() {
383
+ let contractsDir;
384
+ try {
385
+ const pkgJson = require.resolve("@cofhe/mock-contracts/package.json");
386
+ contractsDir = import_path.default.join(import_path.default.dirname(pkgJson), "contracts");
387
+ } catch {
388
+ contractsDir = import_path.default.join(process.cwd(), "node_modules", "@cofhe", "mock-contracts", "contracts");
389
+ }
390
+ if (!import_fs.default.existsSync(contractsDir)) {
391
+ return [];
392
+ }
393
+ return import_fs.default.readdirSync(contractsDir).filter((f) => f.endsWith(".sol")).map((f) => import_path.default.join(contractsDir, f));
394
+ }
395
+ function generateMockContractsStubContent() {
396
+ const imports = getMockContractsSolFiles().map((f) => `import "@cofhe/mock-contracts/contracts/${import_path.default.basename(f)}";`).join("\n");
397
+ return [
398
+ "// SPDX-License-Identifier: UNLICENSED",
399
+ "// Auto-generated by @cofhe/hardhat-plugin \u2014 do not edit.",
400
+ "// Importing mock contracts here causes Hardhat to compile them and register",
401
+ "// their artifacts, enabling proper revert decoding during tests.",
402
+ "pragma solidity >=0.8.25 <0.9.0;",
403
+ "",
404
+ imports,
405
+ ""
406
+ ].join("\n");
407
+ }
408
+ (0, import_config.subtask)(import_task_names.TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS).setAction(async (taskArgs, hre, runSuper) => {
409
+ const existing = await runSuper(taskArgs);
410
+ const stubDir = import_path.default.join(hre.config.paths.cache, MOCK_STUBS_DIR_NAME);
411
+ const stubPath = import_path.default.join(stubDir, MOCK_STUBS_FILE_NAME);
412
+ import_fs.default.mkdirSync(stubDir, { recursive: true });
413
+ import_fs.default.writeFileSync(stubPath, generateMockContractsStubContent(), "utf8");
414
+ return [.../* @__PURE__ */ new Set([...existing, stubPath])];
415
+ });
374
416
  (0, import_config.extendConfig)((config, userConfig) => {
375
417
  if (userConfig.networks && userConfig.networks.localcofhe) {
376
418
  return;
@@ -414,8 +456,9 @@ var import_mock_contracts3 = require("@cofhe/mock-contracts");
414
456
  };
415
457
  }
416
458
  config.cofhe = {
417
- logMocks: userConfig.cofhe?.logMocks ?? true,
418
- gasWarning: userConfig.cofhe?.gasWarning ?? true
459
+ logMocks: userConfig.cofhe?.logMocks ?? false,
460
+ gasWarning: userConfig.cofhe?.gasWarning ?? false,
461
+ mocksDeployVerbosity: userConfig.cofhe?.mocksDeployVerbosity ?? "v"
419
462
  };
420
463
  });
421
464
  (0, import_config.task)(TASK_COFHE_USE_FAUCET, "Fund an account from the funder").addOptionalParam("address", "Address to fund", void 0, import_config.types.string).setAction(async ({ address }, hre) => {
@@ -436,11 +479,11 @@ var import_mock_contracts3 = require("@cofhe/mock-contracts");
436
479
  console.info(import_chalk3.default.red(`failed to get funds from localcofhe for ${address}: ${e}`));
437
480
  }
438
481
  });
439
- (0, import_config.task)(TASK_COFHE_MOCKS_DEPLOY, "Deploys the mock contracts on the Hardhat network").addOptionalParam("deployTestBed", "Whether to deploy the test bed", true, import_config.types.boolean).addOptionalParam("silent", "Whether to suppress output", false, import_config.types.boolean).setAction(async ({ deployTestBed, silent }, hre) => {
482
+ (0, import_config.task)(TASK_COFHE_MOCKS_DEPLOY, "Deploys the mock contracts on the Hardhat network").addOptionalParam("deployTestBed", "Whether to deploy the test bed", true, import_config.types.boolean).setAction(async ({ deployTestBed }, hre) => {
440
483
  await deployMocks(hre, {
441
484
  deployTestBed: deployTestBed ?? true,
442
485
  gasWarning: hre.config.cofhe.gasWarning ?? true,
443
- silent: silent ?? false
486
+ mocksDeployVerbosity: hre.config.cofhe.mocksDeployVerbosity
444
487
  });
445
488
  });
446
489
  (0, import_config.task)(import_task_names.TASK_TEST, "Deploy mock contracts on hardhat").setAction(async ({}, hre, runSuper) => {
@@ -452,7 +495,8 @@ var import_mock_contracts3 = require("@cofhe/mock-contracts");
452
495
  if (!skipAutoDeploy) {
453
496
  await deployMocks(hre, {
454
497
  deployTestBed: true,
455
- gasWarning: hre.config.cofhe.gasWarning ?? true
498
+ gasWarning: hre.config.cofhe.gasWarning ?? true,
499
+ mocksDeployVerbosity: hre.config.cofhe.mocksDeployVerbosity
456
500
  });
457
501
  }
458
502
  return runSuper();
@@ -466,7 +510,8 @@ var import_mock_contracts3 = require("@cofhe/mock-contracts");
466
510
  if (!skipAutoDeploy) {
467
511
  await deployMocks(hre, {
468
512
  deployTestBed: true,
469
- gasWarning: hre.config.cofhe.gasWarning ?? true
513
+ gasWarning: hre.config.cofhe.gasWarning ?? true,
514
+ mocksDeployVerbosity: hre.config.cofhe.mocksDeployVerbosity
470
515
  });
471
516
  }
472
517
  return runSuper();
@@ -532,7 +577,7 @@ function buildHardhatPluginMocksConfig(mocksConfig) {
532
577
  return mock_setLoggingEnabled(hre, false);
533
578
  },
534
579
  deployMocks: async (options = {}) => {
535
- return deployMocks(hre, options);
580
+ return deployMocks(hre, { mocksDeployVerbosity: hre.config.cofhe.mocksDeployVerbosity, ...options });
536
581
  },
537
582
  getPlaintext: async (ctHash) => {
538
583
  const [signer] = await hre.ethers.getSigners();
@@ -546,7 +591,8 @@ function buildHardhatPluginMocksConfig(mocksConfig) {
546
591
  getMockACL: async () => {
547
592
  const taskManager = await getFixedMockContract(hre, import_mock_contracts3.MockTaskManagerArtifact);
548
593
  const aclAddress = await taskManager.acl();
549
- return hre.ethers.getContractAt(import_mock_contracts3.MockACLArtifact.abi, aclAddress);
594
+ const aclArtifact = await hre.artifacts.readArtifact("MockACL");
595
+ return hre.ethers.getContractAt(aclArtifact.abi, aclAddress);
550
596
  },
551
597
  getMockThresholdNetwork: async () => getFixedMockContract(hre, import_mock_contracts3.MockThresholdNetworkArtifact),
552
598
  getMockZkVerifier: async () => getFixedMockContract(hre, import_mock_contracts3.MockZkVerifierArtifact),