diff --git a/contracts/.env.example b/contracts/.env.example index 2f87338b..e3bd56db 100644 --- a/contracts/.env.example +++ b/contracts/.env.example @@ -1,4 +1,4 @@ -export MNEMONIC="resemble evidence test leaf stock situate truck umbrella boss roof stand math peanut stay supply" +export MNEMONIC="adapt mosquito move limb mobile illegal tree voyage juice mosquito burger raise father hope layer" export PRIVATE_KEY_FHEVM_DEPLOYER="0c66d8cde71d2faa29d0cb6e3a567d31279b6eace67b0a9d9ba869c119843a5e" export PRIVATE_KEY_GATEWAY_DEPLOYER="717fd99986df414889fd8b51069d4f90a50af72e542c58ee065f5883779099c6" export PRIVATE_KEY_GATEWAY_RELAYER="7ec931411ad75a7c201469a385d6f18a325d4923f9f213bd882bbea87e160b67" @@ -11,5 +11,4 @@ export PRIVATE_KEY_COPROCESSOR_ACCOUNT="7ec8ada6642fc4ccfb7729bc29c17cf8d21b61ab export IS_COPROCESSOR="true" export SEPOLIA_RPC_URL="https://sepolia.infura.io/v3/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -export MAINNET_RPC_URL="https://mainnet.infura.io/v3/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" export ETHERSCAN_API_KEY="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \ No newline at end of file diff --git a/contracts/contracts/TFHEExecutorWithEvents.sol b/contracts/contracts/TFHEExecutorWithEvents.sol index 1a3df1e3..954efb6f 100644 --- a/contracts/contracts/TFHEExecutorWithEvents.sol +++ b/contracts/contracts/TFHEExecutorWithEvents.sol @@ -216,6 +216,4 @@ contract TFHEExecutorWithEvents is TFHEExecutor { result = super.fheRandBounded(upperBound, randType); emit FheRandBounded(upperBound, randType, result); } - - function _authorizeUpgrade(address _newImplementation) internal virtual override onlyOwner {} } diff --git a/contracts/launch-fhevm-sepolia.sh b/contracts/launch-fhevm-sepolia.sh new file mode 100644 index 00000000..f178052d --- /dev/null +++ b/contracts/launch-fhevm-sepolia.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# 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 + +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) + +rm -rf fhevmTemp/ +mkdir -p fhevmTemp +cp -L -r node_modules/fhevm-core-contracts/. fhevmTemp/ +npx hardhat compile:specific --contract fhevmTemp +npx hardhat compile:specific --contract lib +npx hardhat compile:specific --contract gateway + +npx hardhat task:deployACL --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia +npx hardhat task:deployTFHEExecutor --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia +npx hardhat task:deployKMSVerifier --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia +npx hardhat task:deployInputVerifier --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia +npx hardhat task:deployFHEPayment --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia + +npx hardhat task:addSigners --num-signers "$NUM_KMS_SIGNERS" --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --use-address true --network sepolia + +npx hardhat task:launchFhevm --skip-get-coin true --use-address true --network sepolia + +echo "Waiting 2 minutes before contract verification... Please wait..." +sleep 120 # makes sure that contracts bytescode propagates on Etherscan, otherwise contracts verification might fail in next step +npx hardhat task:verifyACL --network sepolia +npx hardhat task:verifyTFHEExecutor --network sepolia +npx hardhat task:verifyKMSVerifier --network sepolia +npx hardhat task:verifyInputVerifier --network sepolia +npx hardhat task:verifyFHEPayment --network sepolia +npx hardhat task:verifyGatewayContract --network sepolia \ No newline at end of file