@@ -27,19 +27,22 @@ async function verify(address: string, args: any[]) {
27
27
}
28
28
29
29
async function main ( ) {
30
- const registryAddress : string = "0x3F17972CB27506eb4a6a3D59659e0B57a43fd16C" ;
31
30
32
31
const [ deployer ] : SignerWithAddress [ ] = await ethers . getSigners ( ) ;
33
32
console . log ( "Deployer address:" , deployer . address ) ;
34
33
35
- const trustedForwarders : string [ ] = [ "0xc82BbE41f2cF04e3a8efA18F7032BDD7f6d98a81" ] ;
34
+ const trustedForwarder : string = "0xc82BbE41f2cF04e3a8efA18F7032BDD7f6d98a81" ;
36
35
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 ( ) ;
39
42
40
43
const byocRegsitry : ByocRegistry = await ethers
41
44
. getContractFactory ( "ByocRegistry" )
42
- . then ( f => f . deploy ( trustedForwarders ) ) ;
45
+ . then ( f => f . deploy ( trustedForwarder ) ) ;
43
46
console . log (
44
47
"Deploying ByocRegistry at tx: " ,
45
48
byocRegsitry . deployTransaction . hash ,
@@ -51,20 +54,19 @@ async function main() {
51
54
52
55
const byocFactory : ByocFactory = await ethers
53
56
. 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 ) ;
56
59
await byocFactory . deployTransaction . wait ( ) ;
57
- console . log ( "Deployed ByocFactory" ) ;
58
60
59
61
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 ) ;
61
63
62
64
await tx . wait ( ) ;
63
65
64
- console . log ( "Done . Now verifying contracts:" ) ;
66
+ console . log ( "\nDone . Now verifying contracts:" ) ;
65
67
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 ] ) ;
68
70
}
69
71
70
72
main ( )
0 commit comments