diff --git a/contracts/examples/BlindAuction.sol b/contracts/examples/BlindAuction.sol index 7f01c15f..454c6a26 100644 --- a/contracts/examples/BlindAuction.sol +++ b/contracts/examples/BlindAuction.sol @@ -5,7 +5,7 @@ pragma solidity ^0.8.24; import "../lib/TFHE.sol"; import "./EncryptedERC20.sol"; import "@openzeppelin/contracts/access/Ownable2Step.sol"; -import "../gateway/GatewayCaller.sol"; +import "../gatewayLib/GatewayCaller.sol"; /// @notice Main contract for the blind auction contract BlindAuction is Ownable2Step, GatewayCaller { diff --git a/contracts/examples/TestAsyncDecrypt.sol b/contracts/examples/TestAsyncDecrypt.sol index ce1fab68..ed6c51c5 100644 --- a/contracts/examples/TestAsyncDecrypt.sol +++ b/contracts/examples/TestAsyncDecrypt.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.24; import "../lib/TFHE.sol"; -import "../gateway/GatewayCaller.sol"; +import "../gatewayLib/GatewayCaller.sol"; /// @notice Contract for testing asynchronous decryption using the Gateway contract TestAsyncDecrypt is GatewayCaller { diff --git a/contracts/tasks/etherscanVerify.ts b/contracts/tasks/etherscanVerify.ts index 1567f660..6fcd959e 100644 --- a/contracts/tasks/etherscanVerify.ts +++ b/contracts/tasks/etherscanVerify.ts @@ -73,7 +73,7 @@ task('task:verifyFHEPayment').setAction(async function (taskArguments, { upgrade }); task('task:verifyGatewayContract').setAction(async function (taskArguments, { upgrades, run }) { - const parsedEnvGateway = dotenv.parse(fs.readFileSync('gateway/.env.gateway')); + const parsedEnvGateway = dotenv.parse(fs.readFileSync('addresses/.env.gateway')); const proxyGateway = parsedEnvGateway.GATEWAY_CONTRACT_PREDEPLOY_ADDRESS; const implementationGatewayAddress = await upgrades.erc1967.getImplementationAddress(proxyGateway); await run('verify:verify', { diff --git a/contracts/tasks/taskDeploy.ts b/contracts/tasks/taskDeploy.ts index bf586126..590e89bd 100644 --- a/contracts/tasks/taskDeploy.ts +++ b/contracts/tasks/taskDeploy.ts @@ -17,7 +17,7 @@ task('task:deployGateway') }); await Gateway.waitForDeployment(); const GatewayContractAddress = await Gateway.getAddress(); - const envConfig = dotenv.parse(fs.readFileSync('gateway/.env.gateway')); + const envConfig = dotenv.parse(fs.readFileSync('addresses/.env.gateway')); if (GatewayContractAddress !== envConfig.GATEWAY_CONTRACT_PREDEPLOY_ADDRESS) { throw new Error( `The nonce of the deployer account is not null. Please use another deployer private key or relaunch a clean instance of the fhEVM`, diff --git a/contracts/tasks/taskGatewayRelayer.ts b/contracts/tasks/taskGatewayRelayer.ts index a2da8d2b..d3c6c3af 100644 --- a/contracts/tasks/taskGatewayRelayer.ts +++ b/contracts/tasks/taskGatewayRelayer.ts @@ -23,13 +23,13 @@ task('task:computeGatewayAddress') from: deployerAddress, nonce: 1, // deployer is supposed to have nonce 0 when deploying GatewayContract (0 nonce for implementation, +1 for UUPS) }); - const envFilePath = path.join(__dirname, '../gateway/.env.gateway'); + const envFilePath = path.join(__dirname, '../addresses/.env.gateway'); const content = `GATEWAY_CONTRACT_PREDEPLOY_ADDRESS=${gatewayContractAddressPrecomputed}`; try { fs.writeFileSync(envFilePath, content, { flag: 'w' }); - console.log('gatewayContractAddress written to gateway/.env.gateway successfully!'); + console.log('gatewayContractAddress written to addresses/.env.gateway successfully!'); } catch (err) { - console.error('Failed to write to gateway/.env.gateway:', err); + console.error('Failed to write to addresses/.env.gateway:', err); } const solidityTemplate = `// SPDX-License-Identifier: BSD-3-Clause-Clear @@ -40,10 +40,13 @@ address constant GATEWAY_CONTRACT_PREDEPLOY_ADDRESS = ${gatewayContractAddressPr `; try { - fs.writeFileSync('./gateway/lib/GatewayContractAddress.sol', solidityTemplate, { encoding: 'utf8', flag: 'w' }); - console.log('gateway/lib/GatewayContractAddress.sol file has been generated successfully.'); + fs.writeFileSync('./addresses/GatewayContractAddress.sol', solidityTemplate, { + encoding: 'utf8', + flag: 'w', + }); + console.log('addresses/GatewayContractAddress.sol file has been generated successfully.'); } catch (error) { - console.error('Failed to write gateway/lib/GatewayContractAddress.sol', error); + console.error('Failed to write addresses/GatewayContractAddress.sol', error); } }); @@ -115,7 +118,7 @@ task('task:launchFhevm') } await hre.run('task:deployGateway', { privateKey: privKeyDeployer, ownerAddress: deployerAddress }); - const parsedEnv = dotenv.parse(fs.readFileSync('gateway/.env.gateway')); + const parsedEnv = dotenv.parse(fs.readFileSync('addresses/.env.gateway')); const gatewayContractAddress = parsedEnv.GATEWAY_CONTRACT_PREDEPLOY_ADDRESS; await hre.run('task:addRelayer', { diff --git a/contracts/tasks/upgradeProxy.ts b/contracts/tasks/upgradeProxy.ts index 9c99ba0a..7f9063a1 100644 --- a/contracts/tasks/upgradeProxy.ts +++ b/contracts/tasks/upgradeProxy.ts @@ -213,7 +213,7 @@ task('task:upgradeGatewayContract') types.boolean, ) .setAction(async function (taskArguments: TaskArguments, { ethers, upgrades, run }) { - const parsedEnv = dotenv.parse(fs.readFileSync('gateway/.env.gateway')); + const parsedEnv = dotenv.parse(fs.readFileSync('addresses/.env.gateway')); const proxyAddress = parsedEnv.GATEWAY_CONTRACT_PREDEPLOY_ADDRESS; await upgradeCurrentToNew( taskArguments.privateKey, diff --git a/contracts/test/asyncDecrypt.ts b/contracts/test/asyncDecrypt.ts index 31767ae2..98524b36 100644 --- a/contracts/test/asyncDecrypt.ts +++ b/contracts/test/asyncDecrypt.ts @@ -32,7 +32,7 @@ const currentTime = (): string => { return now.toLocaleTimeString('en-US', { hour12: true, hour: 'numeric', minute: 'numeric', second: 'numeric' }); }; -const parsedEnv = dotenv.parse(fs.readFileSync('gateway/.env.gateway')); +const parsedEnv = dotenv.parse(fs.readFileSync('addresses/.env.gateway')); let relayer: Wallet; if (networkName === 'hardhat') { const privKeyRelayer = process.env.PRIVATE_KEY_GATEWAY_RELAYER;