@cofhe/hardhat-3-plugin 1.0.0-alpha.0 → 1.0.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,42 @@
1
1
  # @cofhe/hardhat-3-plugin
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 6dcfb7d: ACPs sharing SNAPSHOTs (ctHashes rather than live data) can use the new on-chain ACP Sharing Registry `metadata` field to cite the origin of the snapshotted data (contract address + view-function / event), and the recipient can verify it on-chain. [Docs](https://cofhesdk.fhenix.io/sdk/acp#labelling-a-snapshot-share)
8
+
9
+ **@cofhe/sdk**
10
+
11
+ - `createSharing({ labels })`, `shareOnChain(acp, { labels | metadata })`; labels travel in `export()` / `importShared` as `SharedACP.metadata`.
12
+ - New `client.acp.verifyShareLabels`, `client.acp.getShareFromChain`, and `describeShareMetadata`. `IncomingShare` gains `metadata` and `appKey`.
13
+ - New `acp.app` config option: shares are tagged with the app's key and `getIncomingShares` lists only that app's shares ([docs](https://cofhesdk.fhenix.io/sdk/acp#mark-shares-for-your-app)).
14
+ - `@cofhe/sdk/acps` exports the metadata codec, label builders (`viewFunctionLabel`, `eventLogLabel`, `UNLABELLED`), verifiers, registry readers, `shareAppKey` and `ERC7984_ABI`.
15
+
16
+ **@cofhe/react**
17
+
18
+ - New `useCofheShareLabels`. `useCofheShareOnChain` accepts `{ acp, labels | metadata }`.
19
+ - The inbox shows each share's labels and their verification. [Docs](https://cofhesdk.fhenix.io/react/acp#share-labels)
20
+
21
+ **Mocks and plugins**
22
+
23
+ - `ACPShareRegistry`, `ACPTimestampRevoker` and `Permissioned` are copied verbatim from a pinned cofhe-contracts commit (`pnpm update:cofhe-contracts <commit>`). The share registry is deployed behind `MockERC1967Proxy`.
24
+ - Mocks now need Solidity ≥0.8.25 and `@openzeppelin/contracts-upgradeable` (new Hardhat plugin peer dependency; Foundry users add its remapping).
25
+
26
+ ### Patch Changes
27
+
28
+ - 715b220: `cofhe.logMocks: true` now turns on FHE operation logs when the mocks are deployed. It was previously ignored.
29
+ - Updated dependencies [d711ce2]
30
+ - Updated dependencies [d711ce2]
31
+ - Updated dependencies [5a192ee]
32
+ - Updated dependencies [757e448]
33
+ - Updated dependencies [73d5297]
34
+ - Updated dependencies [6dcfb7d]
35
+ - Updated dependencies [8fad647]
36
+ - Updated dependencies [a4fcea7]
37
+ - @cofhe/mock-contracts@1.0.0
38
+ - @cofhe/sdk@1.0.0
39
+
3
40
  ## 0.8.0
4
41
 
5
42
  ### Minor Changes
@@ -156,6 +156,17 @@ async function deployMocks(ctx, options = {}) {
156
156
  account,
157
157
  chain: null
158
158
  });
159
+ if (options.logMocks) {
160
+ await ctx.walletClient.writeContract({
161
+ address: MOCKS_TASK_MANAGER_ADDRESS,
162
+ abi: MockTaskManagerArtifact.abi,
163
+ functionName: "setLogOps",
164
+ args: [true],
165
+ account,
166
+ chain: null
167
+ });
168
+ log("vv", "FHE operation logs enabled", 2);
169
+ }
159
170
  log("v", chalk.bold("cofhe-hardhat-3-plugin :: mocks deployed"), 0);
160
171
  if (gasWarning) {
161
172
  logEmpty("v");
@@ -3,7 +3,7 @@ import {
3
3
  getMockContractsNpmPaths,
4
4
  mock_expectPlaintext,
5
5
  mock_getPlaintext
6
- } from "./chunk-W4H6WKGI.js";
6
+ } from "./chunk-7CWCMFGX.js";
7
7
  import {
8
8
  mock_setLoggingEnabled,
9
9
  mock_withLogs
@@ -145,7 +145,8 @@ var hreHooks = {
145
145
  { publicClient, walletClient, artifacts: hre.artifacts },
146
146
  {
147
147
  gasWarning: hre.config.cofhe.gasWarning,
148
- mocksDeployVerbosity: hre.config.cofhe.mocksDeployVerbosity
148
+ mocksDeployVerbosity: hre.config.cofhe.mocksDeployVerbosity,
149
+ logMocks: hre.config.cofhe.logMocks
149
150
  }
150
151
  );
151
152
  if (hre.config.cofhe.gasSummary && deployedMockContracts.MockTaskManager !== void 0) {
package/dist/index.d.ts CHANGED
@@ -24,6 +24,7 @@ type DeployedMockContracts = {
24
24
  type DeployMocksArgs = {
25
25
  gasWarning?: boolean;
26
26
  mocksDeployVerbosity?: LogMocksDeploy;
27
+ logMocks?: boolean;
27
28
  };
28
29
  type DeployContext = {
29
30
  publicClient: PublicClient;
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  getMockContractsNpmPaths,
4
4
  mock_expectPlaintext,
5
5
  mock_getPlaintext
6
- } from "./chunk-W4H6WKGI.js";
6
+ } from "./chunk-7CWCMFGX.js";
7
7
  import {
8
8
  localcofheFundAccount,
9
9
  localcofheFundWalletIfNeeded
@@ -36,7 +36,7 @@ var plugin = {
36
36
  id: "@cofhe/hardhat-3-plugin",
37
37
  hookHandlers: {
38
38
  config: async () => import("./config-VUCAYBHC.js"),
39
- hre: async () => import("./hre-MFXYQSRM.js")
39
+ hre: async () => import("./hre-T3ZJJ47F.js")
40
40
  },
41
41
  tasks: [
42
42
  task(TASK_COFHE_USE_FAUCET, "Fund an account via the localcofhe faucet").addOption({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cofhe/hardhat-3-plugin",
3
- "version": "1.0.0-alpha.0",
3
+ "version": "1.0.0",
4
4
  "description": "Hardhat 3 plugin for CoFHE — deploys mock contracts and wires up the hre.cofhe interface",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -28,8 +28,8 @@
28
28
  "dependencies": {
29
29
  "chalk": "4.1.2",
30
30
  "viem": "2.38.6",
31
- "@cofhe/mock-contracts": "1.0.0-alpha.0",
32
- "@cofhe/sdk": "1.0.0-alpha.0"
31
+ "@cofhe/mock-contracts": "1.0.0",
32
+ "@cofhe/sdk": "1.0.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/node": "20.19.15",
package/src/deploy.ts CHANGED
@@ -44,6 +44,7 @@ export type DeployedMockContracts = {
44
44
  export type DeployMocksArgs = {
45
45
  gasWarning?: boolean;
46
46
  mocksDeployVerbosity?: LogMocksDeploy;
47
+ logMocks?: boolean;
47
48
  };
48
49
 
49
50
  export type DeployContext = {
@@ -232,6 +233,20 @@ export async function deployMocks(ctx: DeployContext, options: DeployMocksArgs =
232
233
  chain: null,
233
234
  });
234
235
 
236
+ // The TaskManager is placed with hardhat_setCode, so its `logOps = true` initializer never runs
237
+ // and logging starts off. Turn it on here when the config asks for it.
238
+ if (options.logMocks) {
239
+ await ctx.walletClient.writeContract({
240
+ address: MOCKS_TASK_MANAGER_ADDRESS,
241
+ abi: MockTaskManagerArtifact.abi,
242
+ functionName: 'setLogOps',
243
+ args: [true],
244
+ account,
245
+ chain: null,
246
+ });
247
+ log('vv', 'FHE operation logs enabled', 2);
248
+ }
249
+
235
250
  log('v', chalk.bold('cofhe-hardhat-3-plugin :: mocks deployed'), 0);
236
251
 
237
252
  if (gasWarning) {
package/src/hooks/hre.ts CHANGED
@@ -182,6 +182,7 @@ const hreHooks: Partial<HardhatRuntimeEnvironmentHooks> = {
182
182
  {
183
183
  gasWarning: hre.config.cofhe.gasWarning,
184
184
  mocksDeployVerbosity: hre.config.cofhe.mocksDeployVerbosity,
185
+ logMocks: hre.config.cofhe.logMocks,
185
186
  }
186
187
  );
187
188