Skip to content

Commit 9d5c152

Browse files
committed
fix factory import
1 parent a2b9e47 commit 9d5c152

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

test/UtilsTest.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ const {
66
Wallet,
77
getContractAt,
88
constants: { AddressZero },
9-
ContractFactory,
109
} = ethers;
1110
const { time } = require('@nomicfoundation/hardhat-network-helpers');
1211
const { expect } = chai;
1312
const { getRandomBytes32, expectRevert, isHardhat, waitFor } = require('./utils');
1413
const { deployContract } = require('../scripts/deploy');
15-
const BurnableMintableCappedERC20 = require('../artifacts/contracts/test/TestMintableBurnableERC20.sol/TestMintableBurnableERC20.json');
1614

1715
let ownerWallet, otherWallet;
1816

@@ -312,6 +310,7 @@ describe('InterchainTokenDeployer', () => {
312310
describe('Create3Deployer', () => {
313311
let deployerWallet;
314312
let userWallet;
313+
let tokenFactory;
315314

316315
let deployerFactory;
317316
let deployer;
@@ -323,6 +322,7 @@ describe('Create3Deployer', () => {
323322
[deployerWallet, userWallet] = await ethers.getSigners();
324323

325324
deployerFactory = await ethers.getContractFactory('TestCreate3Fixed', deployerWallet);
325+
tokenFactory = await ethers.getContractFactory('TestMintableBurnableERC20', deployerWallet);
326326
});
327327

328328
beforeEach(async () => {
@@ -342,21 +342,19 @@ describe('Create3Deployer', () => {
342342

343343
const address = await deployer.deployedAddress(salt);
344344

345-
const factory = new ContractFactory(BurnableMintableCappedERC20.abi, BurnableMintableCappedERC20.bytecode);
346-
const bytecode = factory.getDeployTransaction(name, symbol, decimals).data;
345+
const bytecode = tokenFactory.getDeployTransaction(name, symbol, decimals).data;
347346

348347
await expect(deployer.deploy(bytecode, salt)).to.emit(deployer, 'Deployed').withArgs(address);
349348
});
350349

351-
// Reintroduce this test if we know the address of the deployer.
350+
// TODO: Reintroduce this test if we know the address of the deployer.
352351
/* if (isHardhat) {
353352
it('should deploy to the predicted address with a know salt', async () => {
354353
const salt = '0x4943fe1231449cc1baa660716a0cb38ff09af0b2c9acb63d40d9a7ba06d33d21';
355354
356355
const address = '0x03C2D7E8Fbcc46C62B3DCBB72121818334af2565';
357356
358-
const factory = new ContractFactory(BurnableMintableCappedERC20.abi, BurnableMintableCappedERC20.bytecode);
359-
const bytecode = factory.getDeployTransaction(name, symbol, decimals).data;
357+
const bytecode = ERC20Factory.getDeployTransaction(name, symbol, decimals).data;
360358
361359
await expect(deployer.deploy(bytecode, salt)).to.emit(deployer, 'Deployed').withArgs(address);
362360
});
@@ -367,8 +365,7 @@ describe('Create3Deployer', () => {
367365

368366
const address = await deployer.deployedAddress(salt);
369367

370-
const factory = new ContractFactory(BurnableMintableCappedERC20.abi, BurnableMintableCappedERC20.bytecode);
371-
const bytecode = factory.getDeployTransaction(name, symbol, decimals).data;
368+
const bytecode = tokenFactory.getDeployTransaction(name, symbol, decimals).data;
372369

373370
await expect(deployer.deploy(bytecode, salt, { value: 10 }))
374371
.to.emit(deployer, 'Deployed')

0 commit comments

Comments
 (0)