@@ -6,13 +6,11 @@ const {
6
6
Wallet,
7
7
getContractAt,
8
8
constants : { AddressZero } ,
9
- ContractFactory,
10
9
} = ethers ;
11
10
const { time } = require ( '@nomicfoundation/hardhat-network-helpers' ) ;
12
11
const { expect } = chai ;
13
12
const { getRandomBytes32, expectRevert, isHardhat, waitFor } = require ( './utils' ) ;
14
13
const { deployContract } = require ( '../scripts/deploy' ) ;
15
- const BurnableMintableCappedERC20 = require ( '../artifacts/contracts/test/TestMintableBurnableERC20.sol/TestMintableBurnableERC20.json' ) ;
16
14
17
15
let ownerWallet , otherWallet ;
18
16
@@ -312,6 +310,7 @@ describe('InterchainTokenDeployer', () => {
312
310
describe ( 'Create3Deployer' , ( ) => {
313
311
let deployerWallet ;
314
312
let userWallet ;
313
+ let tokenFactory ;
315
314
316
315
let deployerFactory ;
317
316
let deployer ;
@@ -323,6 +322,7 @@ describe('Create3Deployer', () => {
323
322
[ deployerWallet , userWallet ] = await ethers . getSigners ( ) ;
324
323
325
324
deployerFactory = await ethers . getContractFactory ( 'TestCreate3Fixed' , deployerWallet ) ;
325
+ tokenFactory = await ethers . getContractFactory ( 'TestMintableBurnableERC20' , deployerWallet ) ;
326
326
} ) ;
327
327
328
328
beforeEach ( async ( ) => {
@@ -342,21 +342,19 @@ describe('Create3Deployer', () => {
342
342
343
343
const address = await deployer . deployedAddress ( salt ) ;
344
344
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 ;
347
346
348
347
await expect ( deployer . deploy ( bytecode , salt ) ) . to . emit ( deployer , 'Deployed' ) . withArgs ( address ) ;
349
348
} ) ;
350
349
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.
352
351
/* if (isHardhat) {
353
352
it('should deploy to the predicted address with a know salt', async () => {
354
353
const salt = '0x4943fe1231449cc1baa660716a0cb38ff09af0b2c9acb63d40d9a7ba06d33d21';
355
354
356
355
const address = '0x03C2D7E8Fbcc46C62B3DCBB72121818334af2565';
357
356
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;
360
358
361
359
await expect(deployer.deploy(bytecode, salt)).to.emit(deployer, 'Deployed').withArgs(address);
362
360
});
@@ -367,8 +365,7 @@ describe('Create3Deployer', () => {
367
365
368
366
const address = await deployer . deployedAddress ( salt ) ;
369
367
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 ;
372
369
373
370
await expect ( deployer . deploy ( bytecode , salt , { value : 10 } ) )
374
371
. to . emit ( deployer , 'Deployed' )
0 commit comments