Skip to content

Commit

Permalink
OCT-1466: Improve contracts deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-code committed Mar 14, 2024
1 parent d4b7abd commit 229fa2e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
26 changes: 25 additions & 1 deletion contracts-v1/deploy/7000_contracts_setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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
}
Expand Down
1 change: 0 additions & 1 deletion contracts-v1/test/vault/Vault.integration-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 229fa2e

Please sign in to comment.