diff --git a/.github/workflows/fhevm-core-contracts-publish.yml b/.github/workflows/fhevm-core-contracts-publish.yml index b6e3ea43..756ecd01 100644 --- a/.github/workflows/fhevm-core-contracts-publish.yml +++ b/.github/workflows/fhevm-core-contracts-publish.yml @@ -17,9 +17,10 @@ jobs: - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version: 20.x - - run: cp .env.example .env + - run: cp .env.example.deployment .env - run: npm ci --include=optional - run: npm run compile + - run: npm run compile:gateway - uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c # v3.1.1 with: package: ./contracts/package.json diff --git a/.github/workflows/fhevm-core-contracts-publishprerelease.yml b/.github/workflows/fhevm-core-contracts-publishprerelease.yml index e4d92b8b..f77f0cb4 100644 --- a/.github/workflows/fhevm-core-contracts-publishprerelease.yml +++ b/.github/workflows/fhevm-core-contracts-publishprerelease.yml @@ -17,9 +17,10 @@ jobs: - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version: 20.x - - run: cp .env.example .env + - run: cp .env.example.deployment .env - run: npm ci --include=optional - run: npm run compile + - run: npm run compile:gateway - uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c # v3.1.1 with: package: ./contracts/package.json diff --git a/contracts/.npmignore b/contracts/.npmignore index 374991e4..ebfdae25 100644 --- a/contracts/.npmignore +++ b/contracts/.npmignore @@ -1,14 +1,14 @@ * -!/artifacts/ -!/artifacts/contracts/ -!/artifacts/contracts/**/*.json -/artifacts/contracts/**/*.dbg.json -!/artifacts/gateway/ +!/artifacts/contracts/ACL.sol/ACL.json +!/artifacts/contracts/FHEPayment.sol/FHEPayment.json +!/artifacts/contracts/InputVerifier.coprocessor.sol/InputVerifier.json +!/artifacts/contracts/InputVerifier.native.sol/InputVerifier.json +!/artifacts/contracts/KMSVerifier.sol/KMSVerifier.json +!/artifacts/contracts/TFHEExecutor.sol/TFHEExecutor.json +!/artifacts/contracts/TFHEExecutorWithEvents.sol/TFHEExecutorWithEvents.json !/artifacts/gateway/GatewayContract.sol/GatewayContract.json -/artifacts/gateway/**/*.json -/artifacts/gateway/**/*.dbg.json -!addresses/** !contracts/** !gateway/** !package.json -!LICENSE \ No newline at end of file +!LICENSE +!README.md \ No newline at end of file diff --git a/contracts/LICENSE.md b/contracts/LICENSE similarity index 74% rename from contracts/LICENSE.md rename to contracts/LICENSE index 2e0743ab..c75c5e8d 100644 --- a/contracts/LICENSE.md +++ b/contracts/LICENSE @@ -7,16 +7,16 @@ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. +list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this - list of conditions and the following disclaimer in the documentation and/or other - materials provided with the distribution. +list of conditions and the following disclaimer in the documentation and/or other +materials provided with the distribution. 3. Neither the name of ZAMA nor the names of its contributors may be used to endorse - or promote products derived from this software without specific prior written permission. +or promote products derived from this software without specific prior written permission. -NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE\*. +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE*. THIS SOFTWARE IS PROVIDED BY THE ZAMA AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL @@ -27,7 +27,7 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCL NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -\*In addition to the rights carried by this license, ZAMA grants to the user a non-exclusive, -free and non-commercial license on all patents filed in its name relating to the open-source -code (the "Patents") for the sole purpose of evaluation, development, research, prototyping -and experimentation. +*In addition to the rights carried by this license, ZAMA grants to the user a non-exclusive, +free and non-commercial license on all patents filed in its name relating to the open-source +code (the "Patents") for the sole purpose of evaluation, development, research, prototyping +and experimentation. \ No newline at end of file diff --git a/contracts/addresses/.env.acl b/contracts/addresses/.env.acl index 83c07ff7..ead8830e 100644 --- a/contracts/addresses/.env.acl +++ b/contracts/addresses/.env.acl @@ -1 +1 @@ -ACL_CONTRACT_ADDRESS=0x339EcE85B9E11a3A3AA557582784a15d7F82AAf2 +ACL_CONTRACT_ADDRESS=0xFee8407e2f5e3Ee68ad77cAE98c434e637f516e5 diff --git a/contracts/addresses/.env.exec b/contracts/addresses/.env.exec index adba3fce..7e4d8dff 100644 --- a/contracts/addresses/.env.exec +++ b/contracts/addresses/.env.exec @@ -1 +1 @@ -TFHE_EXECUTOR_CONTRACT_ADDRESS=0x596E6682c72946AF006B27C131793F2b62527A4b +TFHE_EXECUTOR_CONTRACT_ADDRESS=0x687408aB54661ba0b4aeF3a44156c616c6955E07 diff --git a/contracts/addresses/.env.fhepayment b/contracts/addresses/.env.fhepayment index 2a38d176..1b318939 100644 --- a/contracts/addresses/.env.fhepayment +++ b/contracts/addresses/.env.fhepayment @@ -1 +1 @@ -FHE_PAYMENT_CONTRACT_ADDRESS=0x6d5A11aC509C707c00bc3A0a113ACcC26c532547 +FHE_PAYMENT_CONTRACT_ADDRESS=0xFb03BE574d14C256D56F09a198B586bdfc0A9de2 diff --git a/contracts/addresses/.env.inputverifier b/contracts/addresses/.env.inputverifier index b628bb02..2766c3be 100644 --- a/contracts/addresses/.env.inputverifier +++ b/contracts/addresses/.env.inputverifier @@ -1 +1 @@ -INPUT_VERIFIER_CONTRACT_ADDRESS=0x69dE3158643e738a0724418b21a35FAA20CBb1c5 +INPUT_VERIFIER_CONTRACT_ADDRESS=0x3a2DA6f1daE9eF988B48d9CF27523FA31a8eBE50 diff --git a/contracts/addresses/.env.kmsverifier b/contracts/addresses/.env.kmsverifier index d5db2185..9c1fc0af 100644 --- a/contracts/addresses/.env.kmsverifier +++ b/contracts/addresses/.env.kmsverifier @@ -1 +1 @@ -KMS_VERIFIER_CONTRACT_ADDRESS=0x208De73316E44722e16f6dDFF40881A3e4F86104 +KMS_VERIFIER_CONTRACT_ADDRESS=0x9D6891A6240D6130c54ae243d8005063D05fE14b diff --git a/contracts/addresses/ACLAddress.sol b/contracts/addresses/ACLAddress.sol index 06488813..6f8d1890 100644 --- a/contracts/addresses/ACLAddress.sol +++ b/contracts/addresses/ACLAddress.sol @@ -2,4 +2,4 @@ pragma solidity ^0.8.24; -address constant aclAdd = 0x339EcE85B9E11a3A3AA557582784a15d7F82AAf2; +address constant aclAdd = 0xFee8407e2f5e3Ee68ad77cAE98c434e637f516e5; diff --git a/contracts/addresses/FHEPaymentAddress.sol b/contracts/addresses/FHEPaymentAddress.sol index 8b0e4358..80fa131a 100644 --- a/contracts/addresses/FHEPaymentAddress.sol +++ b/contracts/addresses/FHEPaymentAddress.sol @@ -2,4 +2,4 @@ pragma solidity ^0.8.24; -address constant fhePaymentAdd = 0x6d5A11aC509C707c00bc3A0a113ACcC26c532547; +address constant fhePaymentAdd = 0xFb03BE574d14C256D56F09a198B586bdfc0A9de2; diff --git a/contracts/addresses/InputVerifierAddress.sol b/contracts/addresses/InputVerifierAddress.sol index 6dfb7606..1f603f8a 100644 --- a/contracts/addresses/InputVerifierAddress.sol +++ b/contracts/addresses/InputVerifierAddress.sol @@ -2,4 +2,4 @@ pragma solidity ^0.8.24; -address constant inputVerifierAdd = 0x69dE3158643e738a0724418b21a35FAA20CBb1c5; +address constant inputVerifierAdd = 0x3a2DA6f1daE9eF988B48d9CF27523FA31a8eBE50; diff --git a/contracts/addresses/KMSVerifierAddress.sol b/contracts/addresses/KMSVerifierAddress.sol index e9293d6b..b545e84b 100644 --- a/contracts/addresses/KMSVerifierAddress.sol +++ b/contracts/addresses/KMSVerifierAddress.sol @@ -2,4 +2,4 @@ pragma solidity ^0.8.24; -address constant kmsVerifierAdd = 0x208De73316E44722e16f6dDFF40881A3e4F86104; +address constant kmsVerifierAdd = 0x9D6891A6240D6130c54ae243d8005063D05fE14b; diff --git a/contracts/addresses/TFHEExecutorAddress.sol b/contracts/addresses/TFHEExecutorAddress.sol index f13f3da8..f8be05c9 100644 --- a/contracts/addresses/TFHEExecutorAddress.sol +++ b/contracts/addresses/TFHEExecutorAddress.sol @@ -2,4 +2,4 @@ pragma solidity ^0.8.24; -address constant tfheExecutorAdd = 0x596E6682c72946AF006B27C131793F2b62527A4b; +address constant tfheExecutorAdd = 0x687408aB54661ba0b4aeF3a44156c616c6955E07; diff --git a/contracts/gateway/.env.gateway b/contracts/gateway/.env.gateway index 0228cb70..e0a0bdce 100644 --- a/contracts/gateway/.env.gateway +++ b/contracts/gateway/.env.gateway @@ -1 +1 @@ -GATEWAY_CONTRACT_PREDEPLOY_ADDRESS=0x096b4679d45fB675d4e2c1E4565009Cec99A12B1 \ No newline at end of file +GATEWAY_CONTRACT_PREDEPLOY_ADDRESS=0x33347831500F1e73f0ccCBb95c9f86B94d7b1123 \ No newline at end of file diff --git a/contracts/gateway/lib/GatewayContractAddress.sol b/contracts/gateway/lib/GatewayContractAddress.sol index ea9d8976..0fdadcf8 100644 --- a/contracts/gateway/lib/GatewayContractAddress.sol +++ b/contracts/gateway/lib/GatewayContractAddress.sol @@ -2,4 +2,4 @@ pragma solidity ^0.8.24; -address constant GATEWAY_CONTRACT_PREDEPLOY_ADDRESS = 0x096b4679d45fB675d4e2c1E4565009Cec99A12B1; +address constant GATEWAY_CONTRACT_PREDEPLOY_ADDRESS = 0x33347831500F1e73f0ccCBb95c9f86B94d7b1123; diff --git a/contracts/launch-fhevm-sepolia.sh b/contracts/launch-fhevm-sepolia.sh index d2955af0..8601edae 100644 --- a/contracts/launch-fhevm-sepolia.sh +++ b/contracts/launch-fhevm-sepolia.sh @@ -2,6 +2,8 @@ # This script should be launched after precomputing the addresses via `precompute-addresses.sh`, and preferably after setting up the different services - KMS, Geth node, Gateway npx hardhat clean +mkdir -p addresses + PRIVATE_KEY_FHEVM_DEPLOYER=$(grep PRIVATE_KEY_FHEVM_DEPLOYER .env | cut -d '"' -f 2) NUM_KMS_SIGNERS=$(grep NUM_KMS_SIGNERS .env | cut -d '"' -f 2) diff --git a/contracts/package-lock.json b/contracts/package-lock.json index 07709ad9..0c72b783 100644 --- a/contracts/package-lock.json +++ b/contracts/package-lock.json @@ -1,12 +1,12 @@ { "name": "fhevm-core-contracts", - "version": "0.6.0-2", + "version": "0.6.0-3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "fhevm-core-contracts", - "version": "0.6.0-2", + "version": "0.6.0-3", "license": "BSD-3-Clause", "devDependencies": { "@nomicfoundation/hardhat-toolbox": "^5.0.0", diff --git a/contracts/package.json b/contracts/package.json index 0e2bd65a..ca2e4d2b 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -1,6 +1,6 @@ { "name": "fhevm-core-contracts", - "version": "0.6.0-2", + "version": "0.6.0-3", "description": "fhEVM contracts", "repository": { "type": "git", @@ -9,6 +9,7 @@ "main": "index.js", "scripts": { "compile": "cross-env TS_NODE_TRANSPILE_ONLY=true hardhat compile", + "compile:gateway": "cross-env TS_NODE_TRANSPILE_ONLY=true hardhat compile:specific --contract gateway", "lint": "npm run lint:sol && npm run lint:ts && npm run prettier:check", "lint:ts": "eslint --ignore-path ./.eslintignore --ext .js,.ts .", "prettier:check": "prettier --check \"**/*.{js,json,md,sol,ts,yml}\"", diff --git a/contracts/precompute-addresses.sh b/contracts/precompute-addresses.sh index d4754064..b5803465 100755 --- a/contracts/precompute-addresses.sh +++ b/contracts/precompute-addresses.sh @@ -1,6 +1,8 @@ #!/bin/bash npx hardhat clean +mkdir -p addresses + PRIVATE_KEY_GATEWAY_DEPLOYER=$(grep PRIVATE_KEY_GATEWAY_DEPLOYER .env | cut -d '"' -f 2) PRIVATE_KEY_FHEVM_DEPLOYER=$(grep PRIVATE_KEY_FHEVM_DEPLOYER .env | cut -d '"' -f 2)