File tree 2 files changed +2
-42
lines changed
2 files changed +2
-42
lines changed Original file line number Diff line number Diff line change 1
1
import hre , { ethers } from "hardhat" ;
2
2
3
- import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers" ;
4
-
5
- import { DropERC20 , TWFactory } from "typechain" ;
3
+ import { DropERC20 } from "typechain" ;
6
4
7
5
async function main ( ) {
8
- const [ caller ] : SignerWithAddress [ ] = await ethers . getSigners ( ) ;
9
-
10
- const twFactoryAddress : string = ethers . constants . AddressZero ; // replace
11
6
12
- const twFactory : TWFactory = await ethers . getContractAt ( "TWFactory" , twFactoryAddress ) ;
13
-
14
- const hasFactoryRole = await twFactory . hasRole (
15
- ethers . utils . solidityKeccak256 ( [ "string" ] , [ "FACTORY_ROLE" ] ) ,
16
- caller . address ,
17
- ) ;
18
- if ( ! hasFactoryRole ) {
19
- throw new Error ( "Caller does not have FACTORY_ROLE on factory" ) ;
20
- }
21
7
const dropERC20 : DropERC20 = await ethers . getContractFactory ( "DropERC20" ) . then ( f => f . deploy ( ) ) ;
22
8
23
9
console . log (
@@ -29,12 +15,6 @@ async function main() {
29
15
30
16
console . log ( "\n" ) ;
31
17
32
- const addImplementationTx = await twFactory . addImplementation ( dropERC20 . address ) ;
33
- console . log ( "Adding DropERC20 implementation to TWFactory: " , addImplementationTx . hash ) ;
34
- await addImplementationTx . wait ( ) ;
35
-
36
- console . log ( "\n" ) ;
37
-
38
18
console . log ( "Verifying contract." ) ;
39
19
await verify ( dropERC20 . address , [ ] ) ;
40
20
}
Original file line number Diff line number Diff line change 1
1
import hre , { ethers } from "hardhat" ;
2
2
3
- import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers" ;
4
-
5
- import { TWFactory , DropERC721 } from "typechain" ;
3
+ import { DropERC721 } from "typechain" ;
6
4
7
5
async function main ( ) {
8
- const [ caller ] : SignerWithAddress [ ] = await ethers . getSigners ( ) ;
9
-
10
- const twFactoryAddress : string = ethers . constants . AddressZero ; // replace
11
6
12
- const twFactory : TWFactory = await ethers . getContractAt ( "TWFactory" , twFactoryAddress ) ;
13
-
14
- const hasFactoryRole = await twFactory . hasRole (
15
- ethers . utils . solidityKeccak256 ( [ "string" ] , [ "FACTORY_ROLE" ] ) ,
16
- caller . address ,
17
- ) ;
18
- if ( ! hasFactoryRole ) {
19
- throw new Error ( "Caller does not have FACTORY_ROLE on factory" ) ;
20
- }
21
7
const dropERC721 : DropERC721 = await ethers . getContractFactory ( "DropERC721" ) . then ( f => f . deploy ( ) ) ;
22
8
23
9
console . log (
@@ -31,12 +17,6 @@ async function main() {
31
17
32
18
console . log ( "\n" ) ;
33
19
34
- const addImplementationTx = await twFactory . addImplementation ( dropERC721 . address ) ;
35
- console . log ( "Adding DropERC721 implementation to TWFactory: " , addImplementationTx . hash ) ;
36
- await addImplementationTx . wait ( ) ;
37
-
38
- console . log ( "\n" ) ;
39
-
40
20
console . log ( "Verifying contract." ) ;
41
21
await verify ( dropERC721 . address , [ ] ) ;
42
22
}
You can’t perform that action at this time.
0 commit comments