@cofhe/hardhat-3-plugin 0.8.0 → 1.0.0-alpha.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.
@@ -1,8 +1,9 @@
1
1
  // src/deploy.ts
2
- import { createTestClient, custom } from "viem";
2
+ import { createTestClient, custom, encodeFunctionData } from "viem";
3
3
  import chalk from "chalk";
4
4
  import { privateKeyToAccount } from "viem/accounts";
5
5
  import {
6
+ ACPShareRegistryArtifact,
6
7
  MockACLArtifact,
7
8
  MockCoFHEAddressBookArtifact,
8
9
  MockTaskManagerArtifact,
@@ -96,7 +97,11 @@ async function deployMocks(ctx, options = {}) {
96
97
  chain: null
97
98
  });
98
99
  log("vv", "Default revoker contract set in ACL", 2);
99
- const acpShareRegistryAddress = await deployVariable(ctx, "ACPShareRegistry", []);
100
+ const acpShareRegistryImpl = await deployVariable(ctx, "ACPShareRegistry", []);
101
+ const acpShareRegistryAddress = await deployVariable(ctx, "MockERC1967Proxy", [
102
+ acpShareRegistryImpl,
103
+ encodeFunctionData({ abi: ACPShareRegistryArtifact.abi, functionName: "initialize", args: [account] })
104
+ ]);
100
105
  logDeployment("ACPShareRegistry", acpShareRegistryAddress);
101
106
  await ctx.walletClient.writeContract({
102
107
  address: aclAddress,
@@ -3,7 +3,7 @@ import {
3
3
  getMockContractsNpmPaths,
4
4
  mock_expectPlaintext,
5
5
  mock_getPlaintext
6
- } from "./chunk-FDCRLC5K.js";
6
+ } from "./chunk-W4H6WKGI.js";
7
7
  import {
8
8
  mock_setLoggingEnabled,
9
9
  mock_withLogs
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  getMockContractsNpmPaths,
4
4
  mock_expectPlaintext,
5
5
  mock_getPlaintext
6
- } from "./chunk-FDCRLC5K.js";
6
+ } from "./chunk-W4H6WKGI.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-T3TPXWIY.js")
39
+ hre: async () => import("./hre-MFXYQSRM.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": "0.8.0",
3
+ "version": "1.0.0-alpha.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": "0.8.0",
32
- "@cofhe/sdk": "0.8.0"
31
+ "@cofhe/mock-contracts": "1.0.0-alpha.0",
32
+ "@cofhe/sdk": "1.0.0-alpha.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/node": "20.19.15",
package/src/deploy.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import type { ArtifactManager } from 'hardhat/types/artifacts';
2
2
  import type { PublicClient, WalletClient } from 'viem';
3
- import { createTestClient, custom } from 'viem';
3
+ import { createTestClient, custom, encodeFunctionData } from 'viem';
4
4
  import chalk from 'chalk';
5
5
  import { privateKeyToAccount } from 'viem/accounts';
6
6
 
7
7
  import {
8
+ ACPShareRegistryArtifact,
8
9
  MockACLArtifact,
9
10
  MockCoFHEAddressBookArtifact,
10
11
  MockTaskManagerArtifact,
@@ -159,7 +160,12 @@ export async function deployMocks(ctx: DeployContext, options: DeployMocksArgs =
159
160
  log('vv', 'Default revoker contract set in ACL', 2);
160
161
 
161
162
  // 5c. ACP: on-chain hand-off for sharing ACPs
162
- const acpShareRegistryAddress = await deployVariable(ctx, 'ACPShareRegistry', []);
163
+ // The production contract (upgradeable): behind a proxy, initialized with the deployer as admin
164
+ const acpShareRegistryImpl = await deployVariable(ctx, 'ACPShareRegistry', []);
165
+ const acpShareRegistryAddress = await deployVariable(ctx, 'MockERC1967Proxy', [
166
+ acpShareRegistryImpl,
167
+ encodeFunctionData({ abi: ACPShareRegistryArtifact.abi, functionName: 'initialize', args: [account] }),
168
+ ]);
163
169
  logDeployment('ACPShareRegistry', acpShareRegistryAddress);
164
170
  await ctx.walletClient.writeContract({
165
171
  address: aclAddress,