@@ -27,19 +27,22 @@ async function verify(address: string, args: any[]) {
2727}
2828
2929async function main ( ) {
30- const registryAddress : string = "0x3F17972CB27506eb4a6a3D59659e0B57a43fd16C" ;
3130
3231 const [ deployer ] : SignerWithAddress [ ] = await ethers . getSigners ( ) ;
3332 console . log ( "Deployer address:" , deployer . address ) ;
3433
35- const trustedForwarders : string [ ] = [ "0xc82BbE41f2cF04e3a8efA18F7032BDD7f6d98a81" ] ;
34+ const trustedForwarder : string = "0xc82BbE41f2cF04e3a8efA18F7032BDD7f6d98a81" ;
3635
37- const registry : TWRegistry = await ethers . getContractAt ( "TWRegistry" , registryAddress ) ;
38- console . log ( "TWRegistry at: " , registry . address ) ;
36+ // const registryAddress: string = ethers.constants.AddressZero; // replace
37+ // const registry: TWRegistry = await ethers.getContractAt("TWRegistry", registryAddress);
38+ const registry : TWRegistry = await ethers . getContractFactory ( "TWRegistry" ) . then ( f => f . deploy ( trustedForwarder ) ) ;
39+ console . log ( "\nDeploying new TWRegistry \ntx: " , registry . deployTransaction . hash , "\naddress: " , registry . address ) ;
40+
41+ await registry . deployTransaction . wait ( ) ;
3942
4043 const byocRegsitry : ByocRegistry = await ethers
4144 . getContractFactory ( "ByocRegistry" )
42- . then ( f => f . deploy ( trustedForwarders ) ) ;
45+ . then ( f => f . deploy ( trustedForwarder ) ) ;
4346 console . log (
4447 "Deploying ByocRegistry at tx: " ,
4548 byocRegsitry . deployTransaction . hash ,
@@ -51,20 +54,19 @@ async function main() {
5154
5255 const byocFactory : ByocFactory = await ethers
5356 . getContractFactory ( "ByocFactory" )
54- . then ( f => f . deploy ( registryAddress , trustedForwarders ) ) ;
55- console . log ( "Deploying ByocFactory at tx : " , byocFactory . deployTransaction . hash , " address : " , byocFactory . address ) ;
57+ . then ( f => f . deploy ( registry . address , trustedForwarder ) ) ;
58+ console . log ( "\nDeploying ByocFactory \ntx : " , byocFactory . deployTransaction . hash , "\naddress : " , byocFactory . address ) ;
5659 await byocFactory . deployTransaction . wait ( ) ;
57- console . log ( "Deployed ByocFactory" ) ;
5860
5961 const tx = await registry . grantRole ( await registry . OPERATOR_ROLE ( ) , byocFactory . address ) ;
60- console . log ( "Granting operator role to ByocFactory: " , tx . hash ) ;
62+ console . log ( "\nGranting operator role to ByocFactory: " , tx . hash ) ;
6163
6264 await tx . wait ( ) ;
6365
64- console . log ( "Done . Now verifying contracts:" ) ;
66+ console . log ( "\nDone . Now verifying contracts:" ) ;
6567
66- await verify ( byocRegsitry . address , [ trustedForwarders ] ) ;
67- await verify ( byocFactory . address , [ registryAddress , trustedForwarders ] ) ;
68+ // await verify(byocRegsitry.address, [trustedForwarders]);
69+ await verify ( byocFactory . address , [ registry . address , trustedForwarder ] ) ;
6870}
6971
7072main ( )
0 commit comments