@@ -11,6 +11,9 @@ const DataUnionFactorySidechain = require("./ethereumContractJSONs/DataUnionFact
11
11
const DataUnionFactoryMainnet = require ( "./ethereumContractJSONs/DataUnionFactoryMainnet.json" )
12
12
const MainnetMigrationManager = require ( "./ethereumContractJSONs/MainnetMigrationManager.json" )
13
13
const SidechainMigrationManager = require ( "./ethereumContractJSONs/SidechainMigrationManager.json" )
14
+ // unichain
15
+ const DataUnionFactory = require ( "./ethereumContractJSONs/DataUnionFactory.json" )
16
+ const DataUnionTemplate = require ( "./ethereumContractJSONs/DataUnionTemplate.json" )
14
17
15
18
const log = process . env . QUIET ? ( ( ) => { } ) : console . log // eslint-disable-line no-console
16
19
// class LoggingProvider extends JsonRpcProvider {
@@ -97,6 +100,25 @@ async function deployDUFactories() {
97
100
let factMainnet = await dtx . deployed ( )
98
101
console . log ( `factMainnet: ${ factMainnet . address } ` )
99
102
103
+ // Deploy unichain template + factory
104
+
105
+ log ( `Deploying DU unichain template contract from ${ wallet_home . address } ` )
106
+ deployer = new ContractFactory ( DataUnionTemplate . abi , DataUnionTemplate . bytecode , wallet_home )
107
+ dtx = await deployer . deploy (
108
+ { gasLimit : 6000000 }
109
+ )
110
+ const unichainTemplate = await dtx . deployed ( )
111
+ console . log ( `Unichain DataUnionTemplate: ${ unichainTemplate . address } ` )
112
+ log ( `Deploying DU unichain factory contract from ${ wallet_home . address } ` )
113
+ deployer = new ContractFactory ( DataUnionFactory . abi , DataUnionFactory . bytecode , wallet_home )
114
+ dtx = await deployer . deploy (
115
+ unichainTemplate . address ,
116
+ home_erc677 ,
117
+ { gasLimit : 6000000 }
118
+ )
119
+
120
+ const unichainFactory = await dtx . deployed ( )
121
+ console . log ( `Unichain DataUnionFactory: ${ unichainFactory . address } ` )
100
122
}
101
123
102
124
async function start ( ) {
0 commit comments