diff --git a/codegen/main.ts b/codegen/main.ts index 236c7179..241c6445 100644 --- a/codegen/main.ts +++ b/codegen/main.ts @@ -16,7 +16,6 @@ function generateAllFiles() { const ovShards = testgen.splitOverloadsToShards(overloads); writeFileSync('lib/Impl.sol', t.implSol(context, operators)); writeFileSync('lib/TFHE.sol', tfheSolSource); - writeFileSync('lib/FhevmLib.sol', t.fhevmLibSol(operators)); writeFileSync('lib/FHEPayment.sol', generateFHEPayment(operatorsPrices)); writeFileSync('payment/Payment.sol', t.paymentSol()); mkdirSync('examples/tests', { recursive: true }); diff --git a/codegen/payments.ts b/codegen/payments.ts index 3c76090a..de8e96e9 100644 --- a/codegen/payments.ts +++ b/codegen/payments.ts @@ -40,8 +40,8 @@ export function generateFHEPayment(priceData: PriceData): string { address public constant tfheExecutorAddress = tfheExecutorAdd; uint256 private constant FHE_GAS_BLOCKLIMIT = 10_000_000; - uint256 private constant MIN_FHE_GASPRICE = 10_000_000; // minimum of 0.01 Gwei - uint256 private constant FHE_GASPRICE_NATIVE_RATIO = 1000; // fhe gas price is set to 0.1% of native gas price (if above minimum) + uint256 private constant MIN_FHE_GASPRICE = 0; // eg: 10_000_000 means a minimum of 0.01 Gwei + uint256 private constant FHE_GASPRICE_NATIVE_RATIO = 0; // eg: 1000 means fhe gas price is set to 0.1% of native gas price (if above minimum) /// @custom:storage-location erc7201:fhevm.storage.FHEPayment struct FHEPaymentStorage { diff --git a/codegen/testgen.ts b/codegen/testgen.ts index 96844d98..088a3fd3 100644 --- a/codegen/testgen.ts +++ b/codegen/testgen.ts @@ -81,9 +81,7 @@ async function deployTfheTestFixture${os.shardNumber}(): Promise mapping(spender => allowance)). mapping(address => mapping(address => euint64)) internal allowances; - constructor(string memory name_, string memory symbol_) payable Ownable(msg.sender) { + constructor(string memory name_, string memory symbol_) Ownable(msg.sender) { TFHE.setFHEVM(FHEVMConfig.defaultConfig()); - Payment.depositForThis(msg.value); _name = name_; _symbol = symbol_; } diff --git a/examples/Rand.sol b/examples/Rand.sol index 183b4f08..d84e62be 100644 --- a/examples/Rand.sol +++ b/examples/Rand.sol @@ -3,7 +3,6 @@ pragma solidity ^0.8.24; import "../lib/TFHE.sol"; -import "../payment/Payment.sol"; contract Rand { euint8 public value8; @@ -12,9 +11,8 @@ contract Rand { euint64 public value64; euint64 public value64Bounded; - constructor() payable { + constructor() { TFHE.setFHEVM(FHEVMConfig.defaultConfig()); - Payment.depositForThis(msg.value); } function generate8() public { diff --git a/examples/Reencrypt.sol b/examples/Reencrypt.sol index 7243e99d..44e7ace3 100644 --- a/examples/Reencrypt.sol +++ b/examples/Reencrypt.sol @@ -3,7 +3,6 @@ pragma solidity ^0.8.24; import "../lib/TFHE.sol"; -import "../payment/Payment.sol"; contract Reencrypt { ebool public xBool; @@ -15,11 +14,9 @@ contract Reencrypt { eaddress public xAddress; ebytes256 public yBytes256; - constructor() payable { + constructor() { TFHE.setFHEVM(FHEVMConfig.defaultConfig()); - Payment.depositForThis(msg.value); - xBool = TFHE.asEbool(true); TFHE.allowThis(xBool); TFHE.allow(xBool, msg.sender); diff --git a/examples/TestAsyncDecrypt.sol b/examples/TestAsyncDecrypt.sol index 5c441e13..6d81b9ec 100644 --- a/examples/TestAsyncDecrypt.sol +++ b/examples/TestAsyncDecrypt.sol @@ -4,7 +4,6 @@ pragma solidity ^0.8.24; import "../lib/TFHE.sol"; import "../gateway/GatewayCaller.sol"; -import "../payment/Payment.sol"; contract TestAsyncDecrypt is GatewayCaller { ebool xBool; @@ -32,10 +31,9 @@ contract TestAsyncDecrypt is GatewayCaller { uint256 public latestRequestID; - constructor() payable { + constructor() { TFHE.setFHEVM(FHEVMConfig.defaultConfig()); Gateway.setGateway(Gateway.defaultGatewayAddress()); - Payment.depositForThis(msg.value); xBool = TFHE.asEbool(true); TFHE.allowThis(xBool); xUint4 = TFHE.asEuint4(4); diff --git a/examples/tests/TFHEManualTestSuite.sol b/examples/tests/TFHEManualTestSuite.sol index 20a65b8d..4a7eb45d 100644 --- a/examples/tests/TFHEManualTestSuite.sol +++ b/examples/tests/TFHEManualTestSuite.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.24; import "../../lib/TFHE.sol"; -import "../../payment/Payment.sol"; contract TFHEManualTestSuite { ebool public resb; @@ -13,9 +12,8 @@ contract TFHEManualTestSuite { euint64 public res64; eaddress public resAdd; - constructor() payable { + constructor() { TFHE.setFHEVM(FHEVMConfig.defaultConfig()); - Payment.depositForThis(msg.value); } function eqEbytes256(einput inp1, bytes calldata inputProof1, einput inp2, bytes calldata inputProof2) external { diff --git a/examples/tests/TFHETestSuite1.sol b/examples/tests/TFHETestSuite1.sol index 7b0269db..9ddd40aa 100644 --- a/examples/tests/TFHETestSuite1.sol +++ b/examples/tests/TFHETestSuite1.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.24; import "../../lib/TFHE.sol"; -import "../../payment/Payment.sol"; contract TFHETestSuite1 { ebool public resb; @@ -12,9 +11,8 @@ contract TFHETestSuite1 { euint32 public res32; euint64 public res64; - constructor() payable { + constructor() { TFHE.setFHEVM(FHEVMConfig.defaultConfig()); - Payment.depositForThis(msg.value); } function add_euint4_euint4(einput a, einput b, bytes calldata inputProof) public { diff --git a/examples/tests/TFHETestSuite2.sol b/examples/tests/TFHETestSuite2.sol index faa53c1f..715d8caa 100644 --- a/examples/tests/TFHETestSuite2.sol +++ b/examples/tests/TFHETestSuite2.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.24; import "../../lib/TFHE.sol"; -import "../../payment/Payment.sol"; contract TFHETestSuite2 { ebool public resb; @@ -12,9 +11,8 @@ contract TFHETestSuite2 { euint32 public res32; euint64 public res64; - constructor() payable { + constructor() { TFHE.setFHEVM(FHEVMConfig.defaultConfig()); - Payment.depositForThis(msg.value); } function eq_euint8_euint4(einput a, einput b, bytes calldata inputProof) public { diff --git a/examples/tests/TFHETestSuite3.sol b/examples/tests/TFHETestSuite3.sol index d6f9e182..c3836358 100644 --- a/examples/tests/TFHETestSuite3.sol +++ b/examples/tests/TFHETestSuite3.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.24; import "../../lib/TFHE.sol"; -import "../../payment/Payment.sol"; contract TFHETestSuite3 { ebool public resb; @@ -12,9 +11,8 @@ contract TFHETestSuite3 { euint32 public res32; euint64 public res64; - constructor() payable { + constructor() { TFHE.setFHEVM(FHEVMConfig.defaultConfig()); - Payment.depositForThis(msg.value); } function min_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { diff --git a/examples/tests/TFHETestSuite4.sol b/examples/tests/TFHETestSuite4.sol index b2818a38..9224da21 100644 --- a/examples/tests/TFHETestSuite4.sol +++ b/examples/tests/TFHETestSuite4.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.24; import "../../lib/TFHE.sol"; -import "../../payment/Payment.sol"; contract TFHETestSuite4 { ebool public resb; @@ -12,9 +11,8 @@ contract TFHETestSuite4 { euint32 public res32; euint64 public res64; - constructor() payable { + constructor() { TFHE.setFHEVM(FHEVMConfig.defaultConfig()); - Payment.depositForThis(msg.value); } function or_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { diff --git a/examples/tests/TFHETestSuite5.sol b/examples/tests/TFHETestSuite5.sol index d4d3ec18..e1782ede 100644 --- a/examples/tests/TFHETestSuite5.sol +++ b/examples/tests/TFHETestSuite5.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.24; import "../../lib/TFHE.sol"; -import "../../payment/Payment.sol"; contract TFHETestSuite5 { ebool public resb; @@ -12,9 +11,8 @@ contract TFHETestSuite5 { euint32 public res32; euint64 public res64; - constructor() payable { + constructor() { TFHE.setFHEVM(FHEVMConfig.defaultConfig()); - Payment.depositForThis(msg.value); } function le_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { diff --git a/examples/tests/TFHETestSuite6.sol b/examples/tests/TFHETestSuite6.sol index 31d7b52c..cca9b1eb 100644 --- a/examples/tests/TFHETestSuite6.sol +++ b/examples/tests/TFHETestSuite6.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.24; import "../../lib/TFHE.sol"; -import "../../payment/Payment.sol"; contract TFHETestSuite6 { ebool public resb; @@ -12,9 +11,8 @@ contract TFHETestSuite6 { euint32 public res32; euint64 public res64; - constructor() payable { + constructor() { TFHE.setFHEVM(FHEVMConfig.defaultConfig()); - Payment.depositForThis(msg.value); } function shr_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { diff --git a/lib/FHEPayment.sol b/lib/FHEPayment.sol index d04a969c..d0e6d3dc 100644 --- a/lib/FHEPayment.sol +++ b/lib/FHEPayment.sol @@ -30,8 +30,8 @@ contract FHEPayment is UUPSUpgradeable, Ownable2StepUpgradeable { address public constant tfheExecutorAddress = tfheExecutorAdd; uint256 private constant FHE_GAS_BLOCKLIMIT = 10_000_000; - uint256 private constant MIN_FHE_GASPRICE = 10_000_000; // minimum of 0.01 Gwei - uint256 private constant FHE_GASPRICE_NATIVE_RATIO = 1000; // fhe gas price is set to 0.1% of native gas price (if above minimum) + uint256 private constant MIN_FHE_GASPRICE = 0; // eg: 10_000_000 means a minimum of 0.01 Gwei + uint256 private constant FHE_GASPRICE_NATIVE_RATIO = 0; // eg: 1000 means fhe gas price is set to 0.1% of native gas price (if above minimum) /// @custom:storage-location erc7201:fhevm.storage.FHEPayment struct FHEPaymentStorage { diff --git a/test/encryptedERC20/EncryptedERC20.fixture.ts b/test/encryptedERC20/EncryptedERC20.fixture.ts index b837d04a..401bbd9c 100644 --- a/test/encryptedERC20/EncryptedERC20.fixture.ts +++ b/test/encryptedERC20/EncryptedERC20.fixture.ts @@ -7,9 +7,7 @@ export async function deployEncryptedERC20Fixture(): Promise { const signers = await getSigners(); const contractFactory = await ethers.getContractFactory('EncryptedERC20'); - const contract = await contractFactory.connect(signers.alice).deploy('Naraggara', 'NARA', { - value: ethers.parseEther('0.001'), - }); // City of Zama's battle + const contract = await contractFactory.connect(signers.alice).deploy('Naraggara', 'NARA'); // City of Zama's battle await contract.waitForDeployment(); return contract; diff --git a/test/gatewayDecrypt/testAsyncDecrypt.ts b/test/gatewayDecrypt/testAsyncDecrypt.ts index 3a4ffad8..bdf29485 100644 --- a/test/gatewayDecrypt/testAsyncDecrypt.ts +++ b/test/gatewayDecrypt/testAsyncDecrypt.ts @@ -15,9 +15,7 @@ describe('TestAsyncDecrypt', function () { // very first request of decryption always fail at the moment due to a gateway bug // TODO: remove following 8 lines when the gateway bug will be fixed const contractFactory = await ethers.getContractFactory('TestAsyncDecrypt'); - this.contract = await contractFactory.connect(this.signers.alice).deploy({ - value: ethers.parseEther('0.001'), - }); + this.contract = await contractFactory.connect(this.signers.alice).deploy(); await this.contract.waitForDeployment(); this.contractAddress = await this.contract.getAddress(); this.instances = await createInstances(this.signers); @@ -30,7 +28,7 @@ describe('TestAsyncDecrypt', function () { beforeEach(async function () { const contractFactory = await ethers.getContractFactory('TestAsyncDecrypt'); - this.contract = await contractFactory.connect(this.signers.alice).deploy({ value: ethers.parseEther('0.001') }); + this.contract = await contractFactory.connect(this.signers.alice).deploy(); this.contractAddress = await this.contract.getAddress(); this.instances = await createInstances(this.signers); }); @@ -89,9 +87,7 @@ describe('TestAsyncDecrypt', function () { it('test async decrypt bool trustless', async function () { const contractFactory = await ethers.getContractFactory('TestAsyncDecrypt'); - const contract2 = await contractFactory.connect(this.signers.alice).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract2 = await contractFactory.connect(this.signers.alice).deploy(); const tx2 = await contract2.requestBoolTrustless({ gasLimit: 5_000_000 }); await tx2.wait(); await awaitAllDecryptionResults(); @@ -390,9 +386,7 @@ describe('TestAsyncDecrypt', function () { it('test async decrypt ebytes256 non-trivial trustless', async function () { const contractFactory = await ethers.getContractFactory('TestAsyncDecrypt'); - const contract2 = await contractFactory.connect(this.signers.alice).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract2 = await contractFactory.connect(this.signers.alice).deploy(); const inputAlice = this.instances.alice.createEncryptedInput( await contract2.getAddress(), this.signers.alice.address, @@ -412,9 +406,7 @@ describe('TestAsyncDecrypt', function () { it('test async decrypt mixed with ebytes256 trustless', async function () { const contractFactory = await ethers.getContractFactory('TestAsyncDecrypt'); - const contract2 = await contractFactory.connect(this.signers.alice).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract2 = await contractFactory.connect(this.signers.alice).deploy(); const inputAlice = this.instances.alice.createEncryptedInput( await contract2.getAddress(), this.signers.alice.address, diff --git a/test/kmsVerifier/kmsVerifier.ts b/test/kmsVerifier/kmsVerifier.ts index 85c37dae..a2ada6bb 100644 --- a/test/kmsVerifier/kmsVerifier.ts +++ b/test/kmsVerifier/kmsVerifier.ts @@ -34,9 +34,7 @@ describe('KMSVerifier', function () { expect((await kmsVerifier.getSigners()).length).to.equal(2); // one signer has been added const contractFactory = await ethers.getContractFactory('TestAsyncDecrypt'); - const contract = await contractFactory.connect(this.signers.alice).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(this.signers.alice).deploy(); const tx2 = await contract.requestBool({ gasLimit: 5_000_000 }); await tx2.wait(); await awaitAllDecryptionResults(); @@ -79,9 +77,7 @@ describe('KMSVerifier', function () { const y4 = await contract.yUint8(); expect(y4).to.equal(42); // even with more than 2 signatures decryption should still succeed - const contract2 = await contractFactory.connect(this.signers.alice).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract2 = await contractFactory.connect(this.signers.alice).deploy(); const inputAlice = this.instances.alice.createEncryptedInput( await contract2.getAddress(), this.signers.alice.address, diff --git a/test/paymentUtils.ts b/test/paymentUtils.ts index 26f4f57a..2740c492 100644 --- a/test/paymentUtils.ts +++ b/test/paymentUtils.ts @@ -9,5 +9,5 @@ export async function initializeFHEPayment() { return fhePayment; } -export const FHE_GASPRICE_NATIVE_RATIO = 1000n; -export const MIN_FHE_GASPRICE = 10_000_000n; +export const FHE_GASPRICE_NATIVE_RATIO = 0n; // 1000n; +export const MIN_FHE_GASPRICE = 0n; // 10_000_000n; diff --git a/test/payments/payments.ts b/test/payments/payments.ts index a7ef4c38..435737f4 100644 --- a/test/payments/payments.ts +++ b/test/payments/payments.ts @@ -17,100 +17,118 @@ describe('TestFHEPayment', function () { }); it('contract which is not funded cannot be used by non-depositor', async function () { - const contractFactory = await ethers.getContractFactory('EncryptedERC20'); - const contract = await contractFactory.connect(this.signers.alice).deploy('Naraggara', 'NARA', { - value: ethers.parseEther('0'), // don't fund contract - }); - await contract.waitForDeployment(); - await expect(contract.mint(1000)).to.be.revertedWithCustomError(this.fhePayment, 'AccountNotEnoughFunded'); + if (FHE_GASPRICE_NATIVE_RATIO !== 0n || MIN_FHE_GASPRICE !== 0n) { + // skip test if FHE gas price is set to 0 + const contractFactory = await ethers.getContractFactory('EncryptedERC20'); + const contract = await contractFactory.connect(this.signers.alice).deploy('Naraggara', 'NARA', { + value: ethers.parseEther('0'), // don't fund contract + }); + await contract.waitForDeployment(); + await expect(contract.mint(1000)).to.be.revertedWithCustomError(this.fhePayment, 'AccountNotEnoughFunded'); + } }); it('contract with enough deposits burns the correct amount of fheGas', async function () { - const contractFactory = await ethers.getContractFactory('EncryptedERC20'); - const contract = await contractFactory.connect(this.signers.alice).deploy('Naraggara', 'NARA', { - value: ethers.parseEther('0.001'), - }); - const initialDeposit = await this.fhePayment.getAvailableDepositsETH(await contract.getAddress()); - await contract.waitForDeployment(); - const tx = await contract.mint(1000n); - const rcpt = await tx.wait(); - const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n; - const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE; - const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(await contract.getAddress()); - const consumedFheGas = (initialDeposit - remainingDeposit) / effectiveFheGasPrice; - expect(consumedFheGas).to.equal(188000n + 600n); // scalarFheAdd(euint64) + trivialEncrypt(euint64) + if (FHE_GASPRICE_NATIVE_RATIO !== 0n || MIN_FHE_GASPRICE !== 0n) { + // skip test if FHE gas price is set to 0 + const contractFactory = await ethers.getContractFactory('EncryptedERC20'); + const contract = await contractFactory.connect(this.signers.alice).deploy('Naraggara', 'NARA', { + value: ethers.parseEther('0.001'), + }); + const initialDeposit = await this.fhePayment.getAvailableDepositsETH(await contract.getAddress()); + await contract.waitForDeployment(); + const tx = await contract.mint(1000n); + const rcpt = await tx.wait(); + const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n; + const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE; + const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(await contract.getAddress()); + const consumedFheGas = (initialDeposit - remainingDeposit) / effectiveFheGasPrice; + expect(consumedFheGas).to.equal(188000n + 600n); // scalarFheAdd(euint64) + trivialEncrypt(euint64) + } }); it('contract which is not funded can be used by depositor if he whitelisted dApp contract', async function () { - const contractFactory = await ethers.getContractFactory('EncryptedERC20'); - const contract = await contractFactory.connect(this.signers.alice).deploy('Naraggara', 'NARA', { - value: ethers.parseEther('0'), // don't fund contract - }); - await contract.waitForDeployment(); - const tx = await this.fhePayment.depositETH(this.signers.alice, { value: ethers.parseEther('0.001') }); - await tx.wait(); - const initialDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice); - const txbis = await this.fhePayment.whitelistContract(contract); - await txbis.wait(); - const tx2 = await contract.mint(1000); - const rcpt = await tx2.wait(); - const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n; - const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE; - const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice); - const consumedFheGas = (initialDeposit - remainingDeposit) / effectiveFheGasPrice; - expect(consumedFheGas).to.equal(188000n + 600n); // scalarFheAdd(euint64) + trivialEncrypt(euint64) + if (FHE_GASPRICE_NATIVE_RATIO !== 0n || MIN_FHE_GASPRICE !== 0n) { + // skip test if FHE gas price is set to 0 + const contractFactory = await ethers.getContractFactory('EncryptedERC20'); + const contract = await contractFactory.connect(this.signers.alice).deploy('Naraggara', 'NARA', { + value: ethers.parseEther('0'), // don't fund contract + }); + await contract.waitForDeployment(); + const tx = await this.fhePayment.depositETH(this.signers.alice, { value: ethers.parseEther('0.001') }); + await tx.wait(); + const initialDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice); + const txbis = await this.fhePayment.whitelistContract(contract); + await txbis.wait(); + const tx2 = await contract.mint(1000); + const rcpt = await tx2.wait(); + const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n; + const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE; + const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice); + const consumedFheGas = (initialDeposit - remainingDeposit) / effectiveFheGasPrice; + expect(consumedFheGas).to.equal(188000n + 600n); // scalarFheAdd(euint64) + trivialEncrypt(euint64) + } }); it('contract which is not funded can be used by depositor if he authorized all contracts', async function () { - const contractFactory = await ethers.getContractFactory('EncryptedERC20'); - const contract = await contractFactory.connect(this.signers.alice).deploy('Naraggara', 'NARA', { - value: ethers.parseEther('0'), // don't fund contract - }); - await contract.waitForDeployment(); - const tx = await this.fhePayment.depositETH(this.signers.alice, { value: ethers.parseEther('0.001') }); - await tx.wait(); - const initialDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice); - const txbis = await this.fhePayment.authorizeAllContracts(contract); - await txbis.wait(); - const tx2 = await contract.mint(1000); - const rcpt = await tx2.wait(); - const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n; - const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE; - const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice); - const consumedFheGas = (initialDeposit - remainingDeposit) / effectiveFheGasPrice; - expect(consumedFheGas).to.equal(188000n + 600n); // scalarFheAdd(euint64) + trivialEncrypt(euint64) + if (FHE_GASPRICE_NATIVE_RATIO !== 0n || MIN_FHE_GASPRICE !== 0n) { + // skip test if FHE gas price is set to 0 + const contractFactory = await ethers.getContractFactory('EncryptedERC20'); + const contract = await contractFactory.connect(this.signers.alice).deploy('Naraggara', 'NARA', { + value: ethers.parseEther('0'), // don't fund contract + }); + await contract.waitForDeployment(); + const tx = await this.fhePayment.depositETH(this.signers.alice, { value: ethers.parseEther('0.001') }); + await tx.wait(); + const initialDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice); + const txbis = await this.fhePayment.authorizeAllContracts(contract); + await txbis.wait(); + const tx2 = await contract.mint(1000); + const rcpt = await tx2.wait(); + const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n; + const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE; + const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice); + const consumedFheGas = (initialDeposit - remainingDeposit) / effectiveFheGasPrice; + expect(consumedFheGas).to.equal(188000n + 600n); // scalarFheAdd(euint64) + trivialEncrypt(euint64) + } }); it('contract which is not funded cannot be used by depositor if he did not authorize all contracts nor whitelisted dapp contract', async function () { - const contractFactory = await ethers.getContractFactory('EncryptedERC20'); - const contract = await contractFactory.connect(this.signers.alice).deploy('Naraggara', 'NARA', { - value: ethers.parseEther('0'), // don't fund contract - }); - await contract.waitForDeployment(); - const tx = await this.fhePayment.depositETH(this.signers.alice, { value: ethers.parseEther('0.001') }); - await tx.wait(); - const initialDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice); - const txbis = await this.fhePayment.removeAuthorizationAllContracts(); - await txbis.wait(); - await expect(contract.mint(1000)).to.be.revertedWithCustomError(this.fhePayment, 'AccountNotEnoughFunded'); - const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice); - expect(remainingDeposit).to.equal(initialDeposit); + if (FHE_GASPRICE_NATIVE_RATIO !== 0n || MIN_FHE_GASPRICE !== 0n) { + // skip test if FHE gas price is set to 0 + const contractFactory = await ethers.getContractFactory('EncryptedERC20'); + const contract = await contractFactory.connect(this.signers.alice).deploy('Naraggara', 'NARA', { + value: ethers.parseEther('0'), // don't fund contract + }); + await contract.waitForDeployment(); + const tx = await this.fhePayment.depositETH(this.signers.alice, { value: ethers.parseEther('0.001') }); + await tx.wait(); + const initialDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice); + const txbis = await this.fhePayment.removeAuthorizationAllContracts(); + await txbis.wait(); + await expect(contract.mint(1000)).to.be.revertedWithCustomError(this.fhePayment, 'AccountNotEnoughFunded'); + const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice); + expect(remainingDeposit).to.equal(initialDeposit); + } }); it('tx succeeds if under block fheGas limit', async function () { - const contractFactory = await ethers.getContractFactory('PaymentLimit'); - const contract = await contractFactory.connect(this.signers.alice).deploy(); - await contract.waitForDeployment(); - const initialDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice); - const txbis = await this.fhePayment.authorizeAllContracts(); - await txbis.wait(); - const tx2 = await contract.underBlockFHEGasLimit(); - const rcpt = await tx2.wait(); - const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n; - const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE; - const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice); - const consumedFheGas = (initialDeposit - remainingDeposit) / effectiveFheGasPrice; - expect(consumedFheGas).to.equal(15n * 641000n + 2n * 600n); // 15*FheMul(euint64) + 2*trivialEncrypt(euint64) + if (FHE_GASPRICE_NATIVE_RATIO !== 0n || MIN_FHE_GASPRICE !== 0n) { + // skip test if FHE gas price is set to 0 + const contractFactory = await ethers.getContractFactory('PaymentLimit'); + const contract = await contractFactory.connect(this.signers.alice).deploy(); + await contract.waitForDeployment(); + const initialDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice); + const txbis = await this.fhePayment.authorizeAllContracts(); + await txbis.wait(); + const tx2 = await contract.underBlockFHEGasLimit(); + const rcpt = await tx2.wait(); + const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n; + const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE; + const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(this.signers.alice); + const consumedFheGas = (initialDeposit - remainingDeposit) / effectiveFheGasPrice; + expect(consumedFheGas).to.equal(15n * 641000n + 2n * 600n); // 15*FheMul(euint64) + 2*trivialEncrypt(euint64) + } }); it('tx reverts if above block fheGas limit', async function () { @@ -121,132 +139,144 @@ describe('TestFHEPayment', function () { }); it('a smart account becomes spender by calling becomeTransientSpender', async function () { - const contractFactory = await ethers.getContractFactory('SmartAccount'); - const smartAccount = await contractFactory.connect(this.signers.bob).deploy(); - await smartAccount.waitForDeployment(); - const tx = await this.fhePayment - .connect(this.signers.bob) - .depositETH(await smartAccount.getAddress(), { value: ethers.parseEther('0.001') }); - await tx.wait(); - - const initialDeposit = await this.fhePayment.getAvailableDepositsETH(await smartAccount.getAddress()); - - const contractFactory2 = await ethers.getContractFactory('PaymentLimit'); - const contract = await contractFactory2.connect(this.signers.alice).deploy(); - await contract.waitForDeployment(); + if (FHE_GASPRICE_NATIVE_RATIO !== 0n || MIN_FHE_GASPRICE !== 0n) { + // skip test if FHE gas price is set to 0 + const contractFactory = await ethers.getContractFactory('SmartAccount'); + const smartAccount = await contractFactory.connect(this.signers.bob).deploy(); + await smartAccount.waitForDeployment(); + const tx = await this.fhePayment + .connect(this.signers.bob) + .depositETH(await smartAccount.getAddress(), { value: ethers.parseEther('0.001') }); + await tx.wait(); + + const initialDeposit = await this.fhePayment.getAvailableDepositsETH(await smartAccount.getAddress()); + + const contractFactory2 = await ethers.getContractFactory('PaymentLimit'); + const contract = await contractFactory2.connect(this.signers.alice).deploy(); + await contract.waitForDeployment(); + + const allowTx = [ + { + target: await this.fhePayment.getAddress(), + data: this.fhePayment.interface.encodeFunctionData('authorizeAllContracts'), + value: 0, + }, + ]; - const allowTx = [ - { - target: await this.fhePayment.getAddress(), - data: this.fhePayment.interface.encodeFunctionData('authorizeAllContracts'), - value: 0, - }, - ]; - - const txSmartAllow = await smartAccount.connect(this.signers.bob).executeBatch(allowTx); - await txSmartAllow.wait(); - - const FHETx = [ - { - target: await this.fhePayment.getAddress(), - data: this.fhePayment.interface.encodeFunctionData('becomeTransientSpender'), - value: 0, - }, - { - target: await contract.getAddress(), - data: contract.interface.encodeFunctionData('underBlockFHEGasLimit'), - value: 0, - }, - ]; - - // Execute the batched transaction - const txSmartFHE = await smartAccount.connect(this.signers.bob).executeBatch(FHETx); - - const rcpt = await txSmartFHE.wait(); - const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n; - const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE; - const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(await smartAccount.getAddress()); - const consumedFheGas = (initialDeposit - remainingDeposit) / effectiveFheGasPrice; - expect(consumedFheGas).to.equal(15n * 641000n + 2n * 600n); // 15*FheMul(euint64) + 2*trivialEncrypt(euint64) + const txSmartAllow = await smartAccount.connect(this.signers.bob).executeBatch(allowTx); + await txSmartAllow.wait(); + + const FHETx = [ + { + target: await this.fhePayment.getAddress(), + data: this.fhePayment.interface.encodeFunctionData('becomeTransientSpender'), + value: 0, + }, + { + target: await contract.getAddress(), + data: contract.interface.encodeFunctionData('underBlockFHEGasLimit'), + value: 0, + }, + ]; + + // Execute the batched transaction + const txSmartFHE = await smartAccount.connect(this.signers.bob).executeBatch(FHETx); + + const rcpt = await txSmartFHE.wait(); + const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n; + const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE; + const remainingDeposit = await this.fhePayment.getAvailableDepositsETH(await smartAccount.getAddress()); + const consumedFheGas = (initialDeposit - remainingDeposit) / effectiveFheGasPrice; + expect(consumedFheGas).to.equal(15n * 641000n + 2n * 600n); // 15*FheMul(euint64) + 2*trivialEncrypt(euint64) + } }); it('batching a user-paid tx with a dapp-sponsored tx via a smart account', async function () { - const contractFactory = await ethers.getContractFactory('SmartAccount'); - const smartAccount = await contractFactory.connect(this.signers.bob).deploy(); - await smartAccount.waitForDeployment(); - const tx = await this.fhePayment - .connect(this.signers.bob) - .depositETH(await smartAccount.getAddress(), { value: ethers.parseEther('0.001') }); - await tx.wait(); - - const contractFactory2 = await ethers.getContractFactory('PaymentLimit'); - const contract = await contractFactory2.connect(this.signers.alice).deploy(); // non-sponsored dApp - await contract.waitForDeployment(); + if (FHE_GASPRICE_NATIVE_RATIO !== 0n || MIN_FHE_GASPRICE !== 0n) { + // skip test if FHE gas price is set to 0 + const contractFactory = await ethers.getContractFactory('SmartAccount'); + const smartAccount = await contractFactory.connect(this.signers.bob).deploy(); + await smartAccount.waitForDeployment(); + const tx = await this.fhePayment + .connect(this.signers.bob) + .depositETH(await smartAccount.getAddress(), { value: ethers.parseEther('0.001') }); + await tx.wait(); + + const contractFactory2 = await ethers.getContractFactory('PaymentLimit'); + const contract = await contractFactory2.connect(this.signers.alice).deploy(); // non-sponsored dApp + await contract.waitForDeployment(); + + const contract2 = await contractFactory2 + .connect(this.signers.alice) + .deploy({ value: ethers.parseEther('0.001') }); // sponsored dApp + await contract2.waitForDeployment(); + + const initialDepositSmartAccount = await this.fhePayment.getAvailableDepositsETH(await smartAccount.getAddress()); + const initialDepositSponsoredDapp = await this.fhePayment.getAvailableDepositsETH(await contract2.getAddress()); + + const allowTx = [ + { + target: await this.fhePayment.getAddress(), + data: this.fhePayment.interface.encodeFunctionData('authorizeAllContracts'), + value: 0, + }, + ]; + + const txSmartAllow = await smartAccount.connect(this.signers.bob).executeBatch(allowTx); + await txSmartAllow.wait(); + + const FHETx = [ + { + target: await this.fhePayment.getAddress(), + data: this.fhePayment.interface.encodeFunctionData('becomeTransientSpender'), + value: 0, + }, + { + target: await contract.getAddress(), + data: contract.interface.encodeFunctionData('wayunderBlockFHEGasLimit'), + value: 0, + }, + { + target: await this.fhePayment.getAddress(), + data: this.fhePayment.interface.encodeFunctionData('stopBeingTransientSpender'), + value: 0, + }, + { + target: await contract2.getAddress(), + data: contract2.interface.encodeFunctionData('wayunderBlockFHEGasLimit'), + value: 0, + }, + ]; + + // Execute the batched transaction + const txSmartFHE = await smartAccount.connect(this.signers.bob).executeBatch(FHETx); + + const rcpt = await txSmartFHE.wait(); + const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n; + const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE; + const remainingDepositSmartAccount = await this.fhePayment.getAvailableDepositsETH( + await smartAccount.getAddress(), + ); + const remainingDepositSponsoredDapp = await this.fhePayment.getAvailableDepositsETH(await contract2.getAddress()); - const contract2 = await contractFactory2.connect(this.signers.alice).deploy({ value: ethers.parseEther('0.001') }); // sponsored dApp - await contract2.waitForDeployment(); - - const initialDepositSmartAccount = await this.fhePayment.getAvailableDepositsETH(await smartAccount.getAddress()); - const initialDepositSponsoredDapp = await this.fhePayment.getAvailableDepositsETH(await contract2.getAddress()); - - const allowTx = [ - { - target: await this.fhePayment.getAddress(), - data: this.fhePayment.interface.encodeFunctionData('authorizeAllContracts'), - value: 0, - }, - ]; - - const txSmartAllow = await smartAccount.connect(this.signers.bob).executeBatch(allowTx); - await txSmartAllow.wait(); - - const FHETx = [ - { - target: await this.fhePayment.getAddress(), - data: this.fhePayment.interface.encodeFunctionData('becomeTransientSpender'), - value: 0, - }, - { - target: await contract.getAddress(), - data: contract.interface.encodeFunctionData('wayunderBlockFHEGasLimit'), - value: 0, - }, - { - target: await this.fhePayment.getAddress(), - data: this.fhePayment.interface.encodeFunctionData('stopBeingTransientSpender'), - value: 0, - }, - { - target: await contract2.getAddress(), - data: contract2.interface.encodeFunctionData('wayunderBlockFHEGasLimit'), - value: 0, - }, - ]; - - // Execute the batched transaction - const txSmartFHE = await smartAccount.connect(this.signers.bob).executeBatch(FHETx); - - const rcpt = await txSmartFHE.wait(); - const ratioGas = (rcpt!.gasPrice * FHE_GASPRICE_NATIVE_RATIO) / 1_000_000n; - const effectiveFheGasPrice = ratioGas > MIN_FHE_GASPRICE ? ratioGas : MIN_FHE_GASPRICE; - const remainingDepositSmartAccount = await this.fhePayment.getAvailableDepositsETH(await smartAccount.getAddress()); - const remainingDepositSponsoredDapp = await this.fhePayment.getAvailableDepositsETH(await contract2.getAddress()); - - const consumedFheGasSmartAccount = - (initialDepositSmartAccount - remainingDepositSmartAccount) / effectiveFheGasPrice; - expect(consumedFheGasSmartAccount).to.equal(3n * 641000n + 2n * 600n); // 3*FheMul(euint64) + 2*trivialEncrypt(euint64) - const consumedFheGasSponsoredDapp = - (initialDepositSponsoredDapp - remainingDepositSponsoredDapp) / effectiveFheGasPrice; - expect(consumedFheGasSponsoredDapp).to.equal(3n * 641000n + 2n * 600n); // 3*FheMul(euint64) + 2*trivialEncrypt(euint64) + const consumedFheGasSmartAccount = + (initialDepositSmartAccount - remainingDepositSmartAccount) / effectiveFheGasPrice; + expect(consumedFheGasSmartAccount).to.equal(3n * 641000n + 2n * 600n); // 3*FheMul(euint64) + 2*trivialEncrypt(euint64) + const consumedFheGasSponsoredDapp = + (initialDepositSponsoredDapp - remainingDepositSponsoredDapp) / effectiveFheGasPrice; + expect(consumedFheGasSponsoredDapp).to.equal(3n * 641000n + 2n * 600n); // 3*FheMul(euint64) + 2*trivialEncrypt(euint64) + } }); it('user can withdraw his unburnt deposited funds', async function () { - const depositValue = await this.fhePayment.getAvailableDepositsETH(this.signers.alice); - expect(depositValue).to.be.greaterThan(0); - const balBobBefore = await ethers.provider.getBalance(this.signers.bob); - const tx = await this.fhePayment.withdrawETH(depositValue, this.signers.bob); - await tx.wait(); - const balBobAfter = await ethers.provider.getBalance(this.signers.bob); - expect(balBobAfter - balBobBefore).to.equal(depositValue); + if (FHE_GASPRICE_NATIVE_RATIO !== 0n || MIN_FHE_GASPRICE !== 0n) { + const depositValue = await this.fhePayment.getAvailableDepositsETH(this.signers.alice); + expect(depositValue).to.be.greaterThan(0); + const balBobBefore = await ethers.provider.getBalance(this.signers.bob); + const tx = await this.fhePayment.withdrawETH(depositValue, this.signers.bob); + await tx.wait(); + const balBobAfter = await ethers.provider.getBalance(this.signers.bob); + expect(balBobAfter - balBobBefore).to.equal(depositValue); + } }); }); diff --git a/test/rand/Rand.fixture.ts b/test/rand/Rand.fixture.ts index 2276f1af..c4e5e5f6 100644 --- a/test/rand/Rand.fixture.ts +++ b/test/rand/Rand.fixture.ts @@ -7,9 +7,7 @@ export async function deployRandFixture(): Promise { const signers = await getSigners(); const contractFactory = await ethers.getContractFactory('Rand'); - const contract = await contractFactory.connect(signers.alice).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(signers.alice).deploy(); await contract.waitForDeployment(); return contract; diff --git a/test/reencryption/reencryption.ts b/test/reencryption/reencryption.ts index 53be9906..4b6ce6a1 100644 --- a/test/reencryption/reencryption.ts +++ b/test/reencryption/reencryption.ts @@ -12,9 +12,7 @@ describe('Reencryption', function () { this.instances = await createInstances(this.signers); const contractFactory = await ethers.getContractFactory('Reencrypt'); - this.contract = await contractFactory.connect(this.signers.alice).deploy({ - value: ethers.parseEther('0.001'), - }); + this.contract = await contractFactory.connect(this.signers.alice).deploy(); this.contractAddress = await this.contract.getAddress(); this.instances = await createInstances(this.signers); diff --git a/test/tfheOperations/manual.ts b/test/tfheOperations/manual.ts index c9f37698..d8e751a1 100644 --- a/test/tfheOperations/manual.ts +++ b/test/tfheOperations/manual.ts @@ -20,9 +20,7 @@ async function deployTfheManualTestFixture(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHEManualTestSuite'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; diff --git a/test/tfheOperations/tfheOperations1.ts b/test/tfheOperations/tfheOperations1.ts index 00af7d06..ecd18ae7 100644 --- a/test/tfheOperations/tfheOperations1.ts +++ b/test/tfheOperations/tfheOperations1.ts @@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; diff --git a/test/tfheOperations/tfheOperations10.ts b/test/tfheOperations/tfheOperations10.ts index 8aa89960..963f198c 100644 --- a/test/tfheOperations/tfheOperations10.ts +++ b/test/tfheOperations/tfheOperations10.ts @@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; diff --git a/test/tfheOperations/tfheOperations11.ts b/test/tfheOperations/tfheOperations11.ts index 011aa1f5..e1c19134 100644 --- a/test/tfheOperations/tfheOperations11.ts +++ b/test/tfheOperations/tfheOperations11.ts @@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; diff --git a/test/tfheOperations/tfheOperations12.ts b/test/tfheOperations/tfheOperations12.ts index 5a6292ef..9a753ae6 100644 --- a/test/tfheOperations/tfheOperations12.ts +++ b/test/tfheOperations/tfheOperations12.ts @@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; diff --git a/test/tfheOperations/tfheOperations2.ts b/test/tfheOperations/tfheOperations2.ts index ea6a13fc..6b8b15fe 100644 --- a/test/tfheOperations/tfheOperations2.ts +++ b/test/tfheOperations/tfheOperations2.ts @@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; diff --git a/test/tfheOperations/tfheOperations3.ts b/test/tfheOperations/tfheOperations3.ts index 9baada84..8fd24457 100644 --- a/test/tfheOperations/tfheOperations3.ts +++ b/test/tfheOperations/tfheOperations3.ts @@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; diff --git a/test/tfheOperations/tfheOperations4.ts b/test/tfheOperations/tfheOperations4.ts index eebad653..3380044a 100644 --- a/test/tfheOperations/tfheOperations4.ts +++ b/test/tfheOperations/tfheOperations4.ts @@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; diff --git a/test/tfheOperations/tfheOperations5.ts b/test/tfheOperations/tfheOperations5.ts index 2da996ca..652b9c57 100644 --- a/test/tfheOperations/tfheOperations5.ts +++ b/test/tfheOperations/tfheOperations5.ts @@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; diff --git a/test/tfheOperations/tfheOperations6.ts b/test/tfheOperations/tfheOperations6.ts index ee89b1ce..5f4ec0a2 100644 --- a/test/tfheOperations/tfheOperations6.ts +++ b/test/tfheOperations/tfheOperations6.ts @@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; diff --git a/test/tfheOperations/tfheOperations7.ts b/test/tfheOperations/tfheOperations7.ts index c62830e0..90f485ee 100644 --- a/test/tfheOperations/tfheOperations7.ts +++ b/test/tfheOperations/tfheOperations7.ts @@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; diff --git a/test/tfheOperations/tfheOperations8.ts b/test/tfheOperations/tfheOperations8.ts index f57dac11..261e7412 100644 --- a/test/tfheOperations/tfheOperations8.ts +++ b/test/tfheOperations/tfheOperations8.ts @@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; diff --git a/test/tfheOperations/tfheOperations9.ts b/test/tfheOperations/tfheOperations9.ts index cd37417b..4c9a30bc 100644 --- a/test/tfheOperations/tfheOperations9.ts +++ b/test/tfheOperations/tfheOperations9.ts @@ -15,9 +15,7 @@ async function deployTfheTestFixture1(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -28,9 +26,7 @@ async function deployTfheTestFixture2(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -41,9 +37,7 @@ async function deployTfheTestFixture3(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -54,9 +48,7 @@ async function deployTfheTestFixture4(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -67,9 +59,7 @@ async function deployTfheTestFixture5(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract; @@ -80,9 +70,7 @@ async function deployTfheTestFixture6(): Promise { const admin = signers.alice; const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy({ - value: ethers.parseEther('0.001'), - }); + const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); return contract;