From 229fa2ec7538663c380d8af63f7eb86bc4eea694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Kluczek?= Date: Mon, 11 Mar 2024 15:29:15 +0100 Subject: [PATCH] OCT-1466: Improve contracts deployment --- contracts-v1/deploy/7000_contracts_setup.ts | 26 ++++++++++++++++++- .../test/vault/Vault.integration-test.ts | 1 - 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/contracts-v1/deploy/7000_contracts_setup.ts b/contracts-v1/deploy/7000_contracts_setup.ts index 9374203c8c..3a906c9100 100644 --- a/contracts-v1/deploy/7000_contracts_setup.ts +++ b/contracts-v1/deploy/7000_contracts_setup.ts @@ -9,6 +9,7 @@ import { Epochs, Proposals, WithdrawalsTarget } from '../typechain'; // This function needs to be declared this way, otherwise it's not understood by test runner. // eslint-disable-next-line func-names const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + /* eslint-disable no-console */ if (['hardhat'].includes(hre.network.name)) { // Test setup const { TestFoundation } = await hre.ethers.getNamedSigners(); @@ -30,7 +31,30 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { await proposals.connect(TestFoundation).setEpochs(epochs.address); const target: WithdrawalsTarget = await hre.ethers.getContract(WITHDRAWALS_TARGET); - await TestFoundation.sendTransaction({ to: target.address, value: parseEther('0.01') }); + + let sendTx = null; + + if (['sepolia'].includes(hre.network.name)) { + sendTx = await TestFoundation.sendTransaction({ + gasLimit: BigInt(50000), + maxFeePerGas: BigInt(500_000000000), + maxPriorityFeePerGas: BigInt(3_000000000), + to: target.address, + type: 0x2, + value: parseEther('0.01'), + }); + } else { + sendTx = await TestFoundation.sendTransaction({ + gasLimit: BigInt(50000), + to: target.address, + value: parseEther('0.01'), + }); + } + + console.log( + `Initiated 0.01 transfer from ${TestFoundation.address} to ${target.address} (txid: ${sendTx.hash}). Awaiting 1 confirmation...`, + ); + await sendTx.wait(1); } else if (hre.network.name === 'mainnet') { // Mainnet setup } diff --git a/contracts-v1/test/vault/Vault.integration-test.ts b/contracts-v1/test/vault/Vault.integration-test.ts index 2cb7c4fafb..3ca4269906 100644 --- a/contracts-v1/test/vault/Vault.integration-test.ts +++ b/contracts-v1/test/vault/Vault.integration-test.ts @@ -3,7 +3,6 @@ import { BigNumber } from 'ethers'; import { parseEther } from 'ethers/lib/utils'; import { ethers } from 'hardhat'; - import { merkleTreeData } from './vaultTestParameters'; import { VAULT } from '../../helpers/constants';