From 33bc083593076084deacdb555f0628edacec72dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20=27birdy=27=20Danjou?= Date: Sat, 29 Jun 2024 22:07:35 +0200 Subject: [PATCH 1/8] feat: export decryptor in web package --- .npmignore | 2 ++ node.d.ts | 1 + node.js | 1 + src/web.ts | 1 + 4 files changed, 5 insertions(+) create mode 100644 node.d.ts create mode 100644 node.js diff --git a/.npmignore b/.npmignore index ea6fb83..a75360d 100644 --- a/.npmignore +++ b/.npmignore @@ -3,6 +3,8 @@ !lib/**/* !web.d.ts !web.js +!node.d.ts +!node.js !package.json !README.md !LICENSE diff --git a/node.d.ts b/node.d.ts new file mode 100644 index 0000000..ef80b5f --- /dev/null +++ b/node.d.ts @@ -0,0 +1 @@ +export * from './lib/node'; diff --git a/node.js b/node.js new file mode 100644 index 0000000..b79be42 --- /dev/null +++ b/node.js @@ -0,0 +1 @@ +export * from './lib/node.cjs'; diff --git a/src/web.ts b/src/web.ts index a70232d..6e585fc 100644 --- a/src/web.ts +++ b/src/web.ts @@ -1,2 +1,3 @@ export * from './sdk'; export * from './init'; +export { clientKeyDecryptor, getCiphertextCallParams } from './utils'; From 85bb7e5bf97b587d1cfca19d51755761fb61b068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20=27birdy=27=20Danjou?= Date: Sat, 29 Jun 2024 22:09:43 +0200 Subject: [PATCH 2/8] chore: 0.5.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1e995e0..f7d891c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "fhevmjs", - "version": "0.5.0", + "version": "0.5.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "fhevmjs", - "version": "0.5.0", + "version": "0.5.1", "license": "BSD-3-Clause-Clear", "dependencies": { "@types/keccak": "^3.0.4", diff --git a/package.json b/package.json index 7b89e59..e5ff153 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fhevmjs", - "version": "0.5.0", + "version": "0.5.1", "description": "fhEVM SDK for blockchain using TFHE", "main": "lib/node.js", "types": "lib/node/node.d.ts", From af9afcb5ed3b01c9197672e930db2d1a1eab0abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20=27birdy=27=20Danjou?= Date: Sun, 30 Jun 2024 02:02:08 +0200 Subject: [PATCH 3/8] feat: add support for eip1193 --- package-lock.json | 36 ++++++++++++++++++++++++++---------- package.json | 5 ++++- src/sdk/index.ts | 14 +++++++++----- src/sdk/network.ts | 40 ++++++++++++++++++++++++++++++++++++++-- 4 files changed, 77 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index f7d891c..66b0343 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,6 @@ "@types/keccak": "^3.0.4", "bigint-buffer": "^1.1.5", "commander": "^11.0.0", - "ethers": "^6.6.4", "node-fetch": "^2.7.0", "node-tfhe": "^0.6.3", "sha3": "^2.1.4", @@ -34,6 +33,7 @@ "@types/node-fetch": "^2.6.11", "buffer": "^6.0.3", "crypto-browserify": "^3.12.0", + "ethers": "^6.13.1", "fetch-mock-jest": "^1.5.1", "jest": "^29.5.0", "jest-raw-loader": "^1.0.1", @@ -57,7 +57,8 @@ "node_modules/@adraffy/ens-normalize": { "version": "1.10.1", "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", - "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==" + "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==", + "dev": true }, "node_modules/@ampproject/remapping": { "version": "2.2.1", @@ -1159,6 +1160,7 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "dev": true, "engines": { "node": ">= 16" }, @@ -1933,7 +1935,8 @@ "node_modules/aes-js": { "version": "4.0.0-beta.5", "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", - "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==" + "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==", + "dev": true }, "node_modules/ajv": { "version": "6.12.6", @@ -3129,6 +3132,7 @@ "version": "6.13.1", "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.1.tgz", "integrity": "sha512-hdJ2HOxg/xx97Lm9HdCWk949BfYqYWpyw4//78SiwOLgASyfrNszfMUNB2joKjvGUdwhHfaiMMFFwacVVoLR9A==", + "dev": true, "funding": [ { "type": "individual", @@ -3156,6 +3160,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", + "dev": true, "dependencies": { "@noble/hashes": "1.3.2" }, @@ -3166,12 +3171,14 @@ "node_modules/ethers/node_modules/@types/node": { "version": "18.15.13", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz", - "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==" + "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==", + "dev": true }, "node_modules/ethers/node_modules/tslib": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", + "dev": true }, "node_modules/events": { "version": "3.3.0", @@ -6828,6 +6835,7 @@ "version": "8.17.1", "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "dev": true, "engines": { "node": ">=10.0.0" }, @@ -6911,7 +6919,8 @@ "@adraffy/ens-normalize": { "version": "1.10.1", "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", - "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==" + "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==", + "dev": true }, "@ampproject/remapping": { "version": "2.2.1", @@ -7767,7 +7776,8 @@ "@noble/hashes": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", - "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==" + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "dev": true }, "@nodelib/fs.scandir": { "version": "2.1.5", @@ -8376,7 +8386,8 @@ "aes-js": { "version": "4.0.0-beta.5", "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", - "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==" + "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==", + "dev": true }, "ajv": { "version": "6.12.6", @@ -9285,6 +9296,7 @@ "version": "6.13.1", "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.1.tgz", "integrity": "sha512-hdJ2HOxg/xx97Lm9HdCWk949BfYqYWpyw4//78SiwOLgASyfrNszfMUNB2joKjvGUdwhHfaiMMFFwacVVoLR9A==", + "dev": true, "requires": { "@adraffy/ens-normalize": "1.10.1", "@noble/curves": "1.2.0", @@ -9299,6 +9311,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", + "dev": true, "requires": { "@noble/hashes": "1.3.2" } @@ -9306,12 +9319,14 @@ "@types/node": { "version": "18.15.13", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz", - "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==" + "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==", + "dev": true }, "tslib": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", + "dev": true } } }, @@ -11996,6 +12011,7 @@ "version": "8.17.1", "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "dev": true, "requires": {} }, "y18n": { diff --git a/package.json b/package.json index e5ff153..becaa0b 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,9 @@ "require": "./lib/node.cjs" } }, + "engines": { + "node": ">=20" + }, "scripts": { "lint": "eslint src/", "build": "npm run build:lib && npm run build:bundle", @@ -45,7 +48,6 @@ "@types/keccak": "^3.0.4", "bigint-buffer": "^1.1.5", "commander": "^11.0.0", - "ethers": "^6.6.4", "node-fetch": "^2.7.0", "node-tfhe": "^0.6.3", "sha3": "^2.1.4", @@ -64,6 +66,7 @@ "@types/node-fetch": "^2.6.11", "buffer": "^6.0.3", "crypto-browserify": "^3.12.0", + "ethers": "^6.13.1", "fetch-mock-jest": "^1.5.1", "jest": "^29.5.0", "jest-raw-loader": "^1.0.1", diff --git a/src/sdk/index.ts b/src/sdk/index.ts index 93776d2..a33b89a 100644 --- a/src/sdk/index.ts +++ b/src/sdk/index.ts @@ -1,4 +1,5 @@ import { TfheCompactPublicKey } from 'node-tfhe'; +import type { Eip1193Provider } from 'ethers'; import { URL } from 'url'; import { fromHexString } from '../utils'; import { ZKInput } from './encrypt'; @@ -6,6 +7,8 @@ import { getPublicKeyFromNetwork, getPublicKeyFromCoprocessor, getChainIdFromNetwork, + getChainIdFromEip1193, + getPublicKeyFromEip1193, } from './network'; import { createEncryptedInput } from './encrypt'; import { generateKeypair, createEIP712, EIP712 } from './keypair'; @@ -22,6 +25,7 @@ type FhevmInstanceConfig = { chainId?: number; publicKey?: string; gatewayUrl?: string; + network?: Eip1193Provider; networkUrl?: string; coprocessorUrl?: string; }; @@ -51,7 +55,7 @@ export type FhevmInstance = { export const createInstance = async ( config: FhevmInstanceConfig, ): Promise => { - let { publicKey, networkUrl, gatewayUrl, coprocessorUrl } = config; + let { publicKey, networkUrl, network, gatewayUrl, coprocessorUrl } = config; if (gatewayUrl) { gatewayUrl = new URL(gatewayUrl).href; @@ -72,6 +76,8 @@ export const createInstance = async ( throw new Error('chainId must be a number.'); } else if (networkUrl) { chainId = await getChainIdFromNetwork(networkUrl); + } else if (network) { + chainId = await getChainIdFromEip1193(network); } else { throw new Error( "You didn't provide the chainId nor the network url to get it.", @@ -83,10 +89,8 @@ export const createInstance = async ( publicKey = data.publicKey; } else if (networkUrl && !publicKey) { publicKey = await getPublicKeyFromNetwork(networkUrl); - } - - if (networkUrl && !chainId) { - chainId = await getChainIdFromNetwork(networkUrl); + } else if (network && !publicKey) { + publicKey = await getPublicKeyFromEip1193(network); } if (publicKey && typeof publicKey !== 'string') diff --git a/src/sdk/network.ts b/src/sdk/network.ts index ddf627f..d848ce9 100644 --- a/src/sdk/network.ts +++ b/src/sdk/network.ts @@ -1,10 +1,27 @@ -import { fetchJSONRPC } from '../ethCall'; +import type { Eip1193Provider } from 'ethers'; +import { decodeAbiBytes, fetchJSONRPC } from '../ethCall'; +import { toHexString } from 'src/utils'; export const getPublicKeyCallParams = () => ({ to: '0x000000000000000000000000000000000000005d', data: '0xd9d47bb001', }); +export const getChainIdFromEip1193 = async (ethereum: Eip1193Provider) => { + const payload = { + method: 'eth_chainId', + params: [], + }; + + let chainId; + try { + chainId = await ethereum.request(payload); + } catch (e) { + throw new Error('Impossible to fetch chain id (wrong network?)'); + } + return Number(chainId); +}; + export const getChainIdFromNetwork = async (url: string) => { const payload = { jsonrpc: '2.0', @@ -24,11 +41,30 @@ export const getChainIdFromNetwork = async (url: string) => { try { chainId = await fetchJSONRPC(url, options); } catch (e) { - throw new Error('Impossible to fetch chain id (wrong networkUrl?)'); + throw new Error('Impossible to fetch chain id (wrong url?)'); } return Number(chainId); }; +export const getPublicKeyFromEip1193 = async (ethereum: Eip1193Provider) => { + const payload = { + method: 'eth_call', + params: [getPublicKeyCallParams(), 'latest'], + }; + + let publicKey; + try { + const rawPubKey = await ethereum.request(payload); + const decodedBytes = decodeAbiBytes(rawPubKey); + publicKey = `0x${toHexString(decodedBytes)}`; + } catch (e) { + throw new Error( + 'Impossible to fetch public key from network (wrong network?)', + ); + } + return publicKey; +}; + // Define the function to perform the eth_call export const getPublicKeyFromNetwork = async (url: string) => { // Create the JSON-RPC request payload From c0bc49cca534ca62f23d09da6f5c4335b4178174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20=27birdy=27=20Danjou?= Date: Sun, 30 Jun 2024 02:04:32 +0200 Subject: [PATCH 4/8] chore: 0.5.2 --- package-lock.json | 7 +++++-- package.json | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 66b0343..582184e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "fhevmjs", - "version": "0.5.1", + "version": "0.5.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "fhevmjs", - "version": "0.5.1", + "version": "0.5.2", "license": "BSD-3-Clause-Clear", "dependencies": { "@types/keccak": "^3.0.4", @@ -52,6 +52,9 @@ "webpack": "^5.82.1", "webpack-cli": "^5.1.1", "webpack-merge": "^5.9.0" + }, + "engines": { + "node": ">=20" } }, "node_modules/@adraffy/ens-normalize": { diff --git a/package.json b/package.json index becaa0b..c299912 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fhevmjs", - "version": "0.5.1", + "version": "0.5.2", "description": "fhEVM SDK for blockchain using TFHE", "main": "lib/node.js", "types": "lib/node/node.d.ts", From a94ac6f3f4b57e2270a8fe6ce579e6495f282b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20=27birdy=27=20Danjou?= Date: Sun, 30 Jun 2024 02:08:19 +0200 Subject: [PATCH 5/8] chore: use node 20 --- .github/workflows/main.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/publishprerelease.yml | 2 +- .github/workflows/test.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5367946..637f2b8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: - node-version: [18.x] + node-version: [20.x] steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d848f48..262e470 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 20.x - run: npm ci - run: npm test - run: npm run build diff --git a/.github/workflows/publishprerelease.yml b/.github/workflows/publishprerelease.yml index 183d8ae..bd1bb5f 100644 --- a/.github/workflows/publishprerelease.yml +++ b/.github/workflows/publishprerelease.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 20.x - run: npm ci - run: npm test - run: npm run build diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c8e4c2a..fb63c85 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - node-version: [18.x] + node-version: [20.x] steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} From 9f368dda07c277fcd61db708639827db4aff0e2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20=27birdy=27=20Danjou?= Date: Sun, 30 Jun 2024 02:09:44 +0200 Subject: [PATCH 6/8] fix: fix aliased path --- src/sdk/network.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdk/network.ts b/src/sdk/network.ts index d848ce9..c8e007c 100644 --- a/src/sdk/network.ts +++ b/src/sdk/network.ts @@ -1,6 +1,6 @@ import type { Eip1193Provider } from 'ethers'; import { decodeAbiBytes, fetchJSONRPC } from '../ethCall'; -import { toHexString } from 'src/utils'; +import { toHexString } from '../utils'; export const getPublicKeyCallParams = () => ({ to: '0x000000000000000000000000000000000000005d', From dcff819a5552bf4d92418008ce8594cb359ae782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?= Date: Mon, 21 Oct 2024 12:04:13 +0200 Subject: [PATCH 7/8] feat: adds storage check for ACL --- src/sdk/ACL.json | 381 +++++++++++++++++++++++++++++++++++++++++++ src/sdk/index.ts | 18 +- src/sdk/reencrypt.ts | 19 ++- 3 files changed, 407 insertions(+), 11 deletions(-) create mode 100644 src/sdk/ACL.json diff --git a/src/sdk/ACL.json b/src/sdk/ACL.json new file mode 100644 index 0000000..5853bbe --- /dev/null +++ b/src/sdk/ACL.json @@ -0,0 +1,381 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "ACL", + "sourceName": "fhevm/lib/ACL.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_coprocessorAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256[]", + "name": "handlesList", + "type": "uint256[]" + } + ], + "name": "AllowedForDecryption", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "NewDelegation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "RevokedDelegation", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "handle", + "type": "uint256" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "allow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "handlesList", + "type": "uint256[]" + } + ], + "name": "allowForDecryption", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "handle", + "type": "uint256" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "allowTransient", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allowedForDecryption", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "handle", + "type": "uint256" + }, + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "allowedOnBehalf", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "handle", + "type": "uint256" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "allowedTransient", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "cleanTransientStorage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "delegateAccountForContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "bool", + "name": "isDelegate", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "fhEVMcoprocessorAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVersion", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "handle", + "type": "uint256" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "isAllowed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "handle", + "type": "uint256" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "persistAllowed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "handle", + "type": "uint256" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "persistedAllowedPairs", + "outputs": [ + { + "internalType": "bool", + "name": "isAllowed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "removeDelegationForContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x60a060405234801561000f575f80fd5b50604051610e03380380610e0383398101604081905261002e9161003f565b6001600160a01b031660805261006c565b5f6020828403121561004f575f80fd5b81516001600160a01b0381168114610065575f80fd5b9392505050565b608051610d7861008b5f395f818161011701526105380152610d785ff3fe608060405234801561000f575f80fd5b50600436106100f0575f3560e01c80637a9a598e11610093578063b198d65711610063578063b198d65714610248578063c151dcf31461025b578063ccd9a7cd1461027d578063f623fab414610290575f80fd5b80637a9a598e146101dc5780638d9c9c92146101ef578063985d44ab14610202578063b0f4173714610215575f80fd5b806337e6b44f116100ce57806337e6b44f1461015b578063557e1004146101a35780635faa299a146101b657806365d0509c146101c9575f80fd5b80630d8e6e2c146100f457806331d87e7d1461011257806335334c2314610151575b5f80fd5b6100fc6102bd565b6040516101099190610a8a565b60405180910390f35b6101397f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610109565b61015961031e565b005b610193610169366004610ad7565b5f9182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6040519015158152602001610109565b6101596101b1366004610b15565b610348565b6101936101c4366004610ad7565b610420565b6101596101d7366004610ad7565b61045e565b6101936101ea366004610ad7565b6104da565b6101596101fd366004610ad7565b61052d565b610159610210366004610bce565b610606565b610193610223366004610bf6565b600260209081525f938452604080852082529284528284209052825290205460ff1681565b610159610256366004610bce565b6106ec565b610193610269366004610c36565b5f6020819052908152604090205460ff1681565b61019361028b366004610c4d565b610854565b61019361029e366004610ad7565b600160209081525f928352604080842090915290825290205460ff1681565b6060604051806040016040528060038152602001621050d360ea1b8152506102e45f6108e9565b6102ee60016108e9565b6102f75f6108e9565b60405160200161030a9493929190610c97565b604051602081830303815290604052905090565b5f5c5f805d600190810190805b8281101561034357805c5f825d5f815d50810161032b565b505050565b80515f5b818110156103e4575f83828151811061036757610367610d14565b6020026020010151905061037b8133610420565b6103c35760405162461bcd60e51b81526020600482015260146024820152731cd95b99195c881a5cdb89dd08185b1b1bddd95960621b60448201526064015b60405180910390fd5b5f908152602081905260409020805460ff191660019081179091550161034c565b507f2fd616621b8415a2efb27b224024340ac767797553ce6fdf4c1adefd160504c6826040516104149190610d28565b60405180910390a15050565b5f61042b83836104da565b8061045757505f8381526001602090815260408083206001600160a01b038616845290915290205460ff165b9392505050565b6104688233610420565b6104ab5760405162461bcd60e51b81526020600482015260146024820152731cd95b99195c881a5cdb89dd08185b1b1bddd95960621b60448201526064016103ba565b5f9182526001602081815260408085206001600160a01b0390941685529290529120805460ff19169091179055565b5f805f848460405160200161050b92919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b60408051808303601f1901815291905280516020909101205c95945050505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105aa576105678233610420565b6105aa5760405162461bcd60e51b81526020600482015260146024820152731cd95b99195c881a5cdb89dd08185b1b1bddd95960621b60448201526064016103ba565b5f82826040516020016105d992919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b6040516020818303038152906040528051906020012090506001815d60015f5c0181815d805f5d50505050565b335f9081526002602090815260408083206001600160a01b038681168552908352818420908516845290915290205460ff166106845760405162461bcd60e51b815260206004820152601160248201527f6e6f742064656c6567617465642079657400000000000000000000000000000060448201526064016103ba565b335f8181526002602090815260408083206001600160a01b038781168086529184528285209087168086529352818420805460ff1916905590519193909290917f718a1622aecd6d64aeaebe3b2110f9e2a337cc379e87b327fd1c50a683808ff69190a45050565b336001600160a01b0382160361076a5760405162461bcd60e51b815260206004820152603360248201527f636f6e7472616374416464726573732073686f756c642062652064696666657260448201527f656e742066726f6d206d73672e73656e6465720000000000000000000000000060648201526084016103ba565b335f9081526002602090815260408083206001600160a01b038681168552908352818420908516845290915290205460ff16156107e95760405162461bcd60e51b815260206004820152601160248201527f616c72656164792064656c65676174656400000000000000000000000000000060448201526064016103ba565b335f8181526002602090815260408083206001600160a01b038781168086529184528285209087168086529352818420805460ff1916600117905590519193909290917ff03b7c0d4879b0bcbbf440794871f139c96fd13a145a8172b33b9cab5fa2830a9190a45050565b5f8381526001602090815260408083206001600160a01b038516845290915281205460ff1680156108a657505f8481526001602090815260408083206001600160a01b038716845290915290205460ff165b80156108e057506001600160a01b038083165f908152600260209081526040808320898516845282528083209387168352929052205460ff165b95945050505050565b60605f6108f583610986565b60010190505f8167ffffffffffffffff81111561091457610914610b01565b6040519080825280601f01601f19166020018201604052801561093e576020820181803683370190505b5090508181016020015b5f19017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508461094857509392505050565b5f807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106109ce577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106109fa576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310610a1857662386f26fc10000830492506010015b6305f5e1008310610a30576305f5e100830492506008015b6127108310610a4457612710830492506004015b60648310610a56576064830492506002015b600a8310610a62576001015b92915050565b5f5b83811015610a82578181015183820152602001610a6a565b50505f910152565b602081525f8251806020840152610aa8816040850160208701610a68565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114610ad2575f80fd5b919050565b5f8060408385031215610ae8575f80fd5b82359150610af860208401610abc565b90509250929050565b634e487b7160e01b5f52604160045260245ffd5b5f6020808385031215610b26575f80fd5b823567ffffffffffffffff80821115610b3d575f80fd5b818501915085601f830112610b50575f80fd5b813581811115610b6257610b62610b01565b8060051b604051601f19603f83011681018181108582111715610b8757610b87610b01565b604052918252848201925083810185019188831115610ba4575f80fd5b938501935b82851015610bc257843584529385019392850192610ba9565b98975050505050505050565b5f8060408385031215610bdf575f80fd5b610be883610abc565b9150610af860208401610abc565b5f805f60608486031215610c08575f80fd5b610c1184610abc565b9250610c1f60208501610abc565b9150610c2d60408501610abc565b90509250925092565b5f60208284031215610c46575f80fd5b5035919050565b5f805f8060808587031215610c60575f80fd5b610c6985610abc565b935060208501359250610c7e60408601610abc565b9150610c8c60608601610abc565b905092959194509250565b5f8551610ca8818460208a01610a68565b61103b60f11b9083019081528551610cc7816002840160208a01610a68565b808201915050601760f91b8060028301528551610ceb816003850160208a01610a68565b60039201918201528351610d06816004840160208801610a68565b016004019695505050505050565b634e487b7160e01b5f52603260045260245ffd5b602080825282518282018190525f9190848201906040850190845b81811015610d5f57835183529284019291840191600101610d43565b5090969550505050505056fea164736f6c6343000818000a", + "deployedBytecode": "0x608060405234801561000f575f80fd5b50600436106100f0575f3560e01c80637a9a598e11610093578063b198d65711610063578063b198d65714610248578063c151dcf31461025b578063ccd9a7cd1461027d578063f623fab414610290575f80fd5b80637a9a598e146101dc5780638d9c9c92146101ef578063985d44ab14610202578063b0f4173714610215575f80fd5b806337e6b44f116100ce57806337e6b44f1461015b578063557e1004146101a35780635faa299a146101b657806365d0509c146101c9575f80fd5b80630d8e6e2c146100f457806331d87e7d1461011257806335334c2314610151575b5f80fd5b6100fc6102bd565b6040516101099190610a8a565b60405180910390f35b6101397f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610109565b61015961031e565b005b610193610169366004610ad7565b5f9182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6040519015158152602001610109565b6101596101b1366004610b15565b610348565b6101936101c4366004610ad7565b610420565b6101596101d7366004610ad7565b61045e565b6101936101ea366004610ad7565b6104da565b6101596101fd366004610ad7565b61052d565b610159610210366004610bce565b610606565b610193610223366004610bf6565b600260209081525f938452604080852082529284528284209052825290205460ff1681565b610159610256366004610bce565b6106ec565b610193610269366004610c36565b5f6020819052908152604090205460ff1681565b61019361028b366004610c4d565b610854565b61019361029e366004610ad7565b600160209081525f928352604080842090915290825290205460ff1681565b6060604051806040016040528060038152602001621050d360ea1b8152506102e45f6108e9565b6102ee60016108e9565b6102f75f6108e9565b60405160200161030a9493929190610c97565b604051602081830303815290604052905090565b5f5c5f805d600190810190805b8281101561034357805c5f825d5f815d50810161032b565b505050565b80515f5b818110156103e4575f83828151811061036757610367610d14565b6020026020010151905061037b8133610420565b6103c35760405162461bcd60e51b81526020600482015260146024820152731cd95b99195c881a5cdb89dd08185b1b1bddd95960621b60448201526064015b60405180910390fd5b5f908152602081905260409020805460ff191660019081179091550161034c565b507f2fd616621b8415a2efb27b224024340ac767797553ce6fdf4c1adefd160504c6826040516104149190610d28565b60405180910390a15050565b5f61042b83836104da565b8061045757505f8381526001602090815260408083206001600160a01b038616845290915290205460ff165b9392505050565b6104688233610420565b6104ab5760405162461bcd60e51b81526020600482015260146024820152731cd95b99195c881a5cdb89dd08185b1b1bddd95960621b60448201526064016103ba565b5f9182526001602081815260408085206001600160a01b0390941685529290529120805460ff19169091179055565b5f805f848460405160200161050b92919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b60408051808303601f1901815291905280516020909101205c95945050505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105aa576105678233610420565b6105aa5760405162461bcd60e51b81526020600482015260146024820152731cd95b99195c881a5cdb89dd08185b1b1bddd95960621b60448201526064016103ba565b5f82826040516020016105d992919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b6040516020818303038152906040528051906020012090506001815d60015f5c0181815d805f5d50505050565b335f9081526002602090815260408083206001600160a01b038681168552908352818420908516845290915290205460ff166106845760405162461bcd60e51b815260206004820152601160248201527f6e6f742064656c6567617465642079657400000000000000000000000000000060448201526064016103ba565b335f8181526002602090815260408083206001600160a01b038781168086529184528285209087168086529352818420805460ff1916905590519193909290917f718a1622aecd6d64aeaebe3b2110f9e2a337cc379e87b327fd1c50a683808ff69190a45050565b336001600160a01b0382160361076a5760405162461bcd60e51b815260206004820152603360248201527f636f6e7472616374416464726573732073686f756c642062652064696666657260448201527f656e742066726f6d206d73672e73656e6465720000000000000000000000000060648201526084016103ba565b335f9081526002602090815260408083206001600160a01b038681168552908352818420908516845290915290205460ff16156107e95760405162461bcd60e51b815260206004820152601160248201527f616c72656164792064656c65676174656400000000000000000000000000000060448201526064016103ba565b335f8181526002602090815260408083206001600160a01b038781168086529184528285209087168086529352818420805460ff1916600117905590519193909290917ff03b7c0d4879b0bcbbf440794871f139c96fd13a145a8172b33b9cab5fa2830a9190a45050565b5f8381526001602090815260408083206001600160a01b038516845290915281205460ff1680156108a657505f8481526001602090815260408083206001600160a01b038716845290915290205460ff165b80156108e057506001600160a01b038083165f908152600260209081526040808320898516845282528083209387168352929052205460ff165b95945050505050565b60605f6108f583610986565b60010190505f8167ffffffffffffffff81111561091457610914610b01565b6040519080825280601f01601f19166020018201604052801561093e576020820181803683370190505b5090508181016020015b5f19017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508461094857509392505050565b5f807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106109ce577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106109fa576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310610a1857662386f26fc10000830492506010015b6305f5e1008310610a30576305f5e100830492506008015b6127108310610a4457612710830492506004015b60648310610a56576064830492506002015b600a8310610a62576001015b92915050565b5f5b83811015610a82578181015183820152602001610a6a565b50505f910152565b602081525f8251806020840152610aa8816040850160208701610a68565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114610ad2575f80fd5b919050565b5f8060408385031215610ae8575f80fd5b82359150610af860208401610abc565b90509250929050565b634e487b7160e01b5f52604160045260245ffd5b5f6020808385031215610b26575f80fd5b823567ffffffffffffffff80821115610b3d575f80fd5b818501915085601f830112610b50575f80fd5b813581811115610b6257610b62610b01565b8060051b604051601f19603f83011681018181108582111715610b8757610b87610b01565b604052918252848201925083810185019188831115610ba4575f80fd5b938501935b82851015610bc257843584529385019392850192610ba9565b98975050505050505050565b5f8060408385031215610bdf575f80fd5b610be883610abc565b9150610af860208401610abc565b5f805f60608486031215610c08575f80fd5b610c1184610abc565b9250610c1f60208501610abc565b9150610c2d60408501610abc565b90509250925092565b5f60208284031215610c46575f80fd5b5035919050565b5f805f8060808587031215610c60575f80fd5b610c6985610abc565b935060208501359250610c7e60408601610abc565b9150610c8c60608601610abc565b905092959194509250565b5f8551610ca8818460208a01610a68565b61103b60f11b9083019081528551610cc7816002840160208a01610a68565b808201915050601760f91b8060028301528551610ceb816003850160208a01610a68565b60039201918201528351610d06816004840160208801610a68565b016004019695505050505050565b634e487b7160e01b5f52603260045260245ffd5b602080825282518282018190525f9190848201906040850190845b81811015610d5f57835183529284019291840191600101610d43565b5090969550505050505056fea164736f6c6343000818000a", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/sdk/index.ts b/src/sdk/index.ts index a33b89a..ccd4807 100644 --- a/src/sdk/index.ts +++ b/src/sdk/index.ts @@ -1,5 +1,4 @@ import { TfheCompactPublicKey } from 'node-tfhe'; -import type { Eip1193Provider } from 'ethers'; import { URL } from 'url'; import { fromHexString } from '../utils'; import { ZKInput } from './encrypt'; @@ -7,8 +6,6 @@ import { getPublicKeyFromNetwork, getPublicKeyFromCoprocessor, getChainIdFromNetwork, - getChainIdFromEip1193, - getPublicKeyFromEip1193, } from './network'; import { createEncryptedInput } from './encrypt'; import { generateKeypair, createEIP712, EIP712 } from './keypair'; @@ -25,9 +22,9 @@ type FhevmInstanceConfig = { chainId?: number; publicKey?: string; gatewayUrl?: string; - network?: Eip1193Provider; networkUrl?: string; coprocessorUrl?: string; + aclAddress?: string; }; export type FhevmInstance = { @@ -55,7 +52,8 @@ export type FhevmInstance = { export const createInstance = async ( config: FhevmInstanceConfig, ): Promise => { - let { publicKey, networkUrl, network, gatewayUrl, coprocessorUrl } = config; + let { publicKey, networkUrl, gatewayUrl, coprocessorUrl, aclAddress } = + config; if (gatewayUrl) { gatewayUrl = new URL(gatewayUrl).href; @@ -76,8 +74,6 @@ export const createInstance = async ( throw new Error('chainId must be a number.'); } else if (networkUrl) { chainId = await getChainIdFromNetwork(networkUrl); - } else if (network) { - chainId = await getChainIdFromEip1193(network); } else { throw new Error( "You didn't provide the chainId nor the network url to get it.", @@ -89,8 +85,10 @@ export const createInstance = async ( publicKey = data.publicKey; } else if (networkUrl && !publicKey) { publicKey = await getPublicKeyFromNetwork(networkUrl); - } else if (network && !publicKey) { - publicKey = await getPublicKeyFromEip1193(network); + } + + if (networkUrl && !chainId) { + chainId = await getChainIdFromNetwork(networkUrl); } if (publicKey && typeof publicKey !== 'string') @@ -114,7 +112,7 @@ export const createInstance = async ( ), generateKeypair, createEIP712: createEIP712(chainId), - reencrypt: reencryptRequest(gatewayUrl), + reencrypt: reencryptRequest(gatewayUrl, networkUrl, aclAddress), getPublicKey: () => publicKey || null, }; }; diff --git a/src/sdk/reencrypt.ts b/src/sdk/reencrypt.ts index 919a7e5..5c2266a 100644 --- a/src/sdk/reencrypt.ts +++ b/src/sdk/reencrypt.ts @@ -10,9 +10,12 @@ import { process_reencryption_resp_from_json, u8vec_to_cryptobox_sk, } from '../kms/node/kms_lib.js'; +import { ethers } from 'ethers'; + +import aclArtifact from './ACL.json'; export const reencryptRequest = - (gatewayUrl?: string) => + (gatewayUrl?: string, networkUrl?: string, aclAddress?: string) => async ( handle: bigint, privateKey: string, @@ -22,6 +25,20 @@ export const reencryptRequest = userAddress: string, ) => { if (!gatewayUrl) throw new Error('You must provide a reencryption URL.'); + if (!aclAddress) throw new Error('You must provide the ACL address.'); + const provider = new ethers.JsonRpcProvider(networkUrl); + const acl = new ethers.Contract(contractAddress, aclArtifact.abi, provider); + const userAllowed = await acl.persistAllowed(handle, userAddress); + const contractAllowed = await acl.persistAllowed(handle, contractAddress); + const isAllowed = userAllowed && contractAllowed; + if (!isAllowed) { + throw new Error('User is not authorized to reencrypt this handle!'); + } + if (userAddress === contractAddress) { + throw new Error( + 'userAddress should not be equal to contractAddress when requesting reencryption!', + ); + } const payload = { signature: signature.replace(/^(0x)/, ''), From 44d68ab9eec45a85021a6bade107cb24f17a1fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?= Date: Mon, 21 Oct 2024 12:10:13 +0200 Subject: [PATCH 8/8] 0.5.3 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 582184e..80605c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "fhevmjs", - "version": "0.5.2", + "version": "0.5.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "fhevmjs", - "version": "0.5.2", + "version": "0.5.3", "license": "BSD-3-Clause-Clear", "dependencies": { "@types/keccak": "^3.0.4", diff --git a/package.json b/package.json index c299912..cb8d6cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fhevmjs", - "version": "0.5.2", + "version": "0.5.3", "description": "fhEVM SDK for blockchain using TFHE", "main": "lib/node.js", "types": "lib/node/node.d.ts",