File tree Expand file tree Collapse file tree 2 files changed +2
-42
lines changed Expand file tree Collapse file tree 2 files changed +2
-42
lines changed Original file line number Diff line number Diff line change 11import hre , { ethers } from "hardhat" ;
22
3- import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers" ;
4-
5- import { DropERC20 , TWFactory } from "typechain" ;
3+ import { DropERC20 } from "typechain" ;
64
75async function main ( ) {
8- const [ caller ] : SignerWithAddress [ ] = await ethers . getSigners ( ) ;
9-
10- const twFactoryAddress : string = ethers . constants . AddressZero ; // replace
116
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- }
217 const dropERC20 : DropERC20 = await ethers . getContractFactory ( "DropERC20" ) . then ( f => f . deploy ( ) ) ;
228
239 console . log (
@@ -29,12 +15,6 @@ async function main() {
2915
3016 console . log ( "\n" ) ;
3117
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-
3818 console . log ( "Verifying contract." ) ;
3919 await verify ( dropERC20 . address , [ ] ) ;
4020}
Original file line number Diff line number Diff line change 11import hre , { ethers } from "hardhat" ;
22
3- import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers" ;
4-
5- import { TWFactory , DropERC721 } from "typechain" ;
3+ import { DropERC721 } from "typechain" ;
64
75async function main ( ) {
8- const [ caller ] : SignerWithAddress [ ] = await ethers . getSigners ( ) ;
9-
10- const twFactoryAddress : string = ethers . constants . AddressZero ; // replace
116
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- }
217 const dropERC721 : DropERC721 = await ethers . getContractFactory ( "DropERC721" ) . then ( f => f . deploy ( ) ) ;
228
239 console . log (
@@ -31,12 +17,6 @@ async function main() {
3117
3218 console . log ( "\n" ) ;
3319
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-
4020 console . log ( "Verifying contract." ) ;
4121 await verify ( dropERC721 . address , [ ] ) ;
4222}
You can’t perform that action at this time.
0 commit comments