@@ -58,158 +58,158 @@ export default async function deploy() {
5858 const [ owner ] = await ethers . getSigners ( ) ;
5959 const deploymentOptions = config . getChainConfigOrDefault ( chainId ) ;
6060 const factoryDeployer = new FactoryDeployer ( owner , chainId ) ;
61- // Deploy RLC
62- const isTokenMode = ! config . isNativeChain ( deploymentOptions ) ;
63- let rlcInstanceAddress = isTokenMode
64- ? await getOrDeployRlc ( deploymentOptions . token ! , owner ) // token
65- : ZeroAddress ; // native
66- console . log ( `RLC: ${ rlcInstanceAddress } ` ) ;
61+ // // Deploy RLC
62+ // const isTokenMode = !config.isNativeChain(deploymentOptions);
63+ // let rlcInstanceAddress = isTokenMode
64+ // ? await getOrDeployRlc(deploymentOptions.token!, owner) // token
65+ // : ZeroAddress; // native
66+ // console.log(`RLC: ${rlcInstanceAddress}`);
6767 // Deploy ERC1538 proxy contracts
6868 const erc1538UpdateAddress = await factoryDeployer . deployContract (
6969 new ERC1538UpdateDelegate__factory ( ) ,
7070 ) ;
71- const transferOwnershipCall = await Ownable__factory . connect (
72- ZeroAddress , // any is fine
73- owner , // any is fine
74- )
75- . transferOwnership . populateTransaction ( owner . address )
76- . then ( ( tx ) => tx . data )
77- . catch ( ( ) => {
78- throw new Error ( 'Failed to prepare transferOwnership data' ) ;
79- } ) ;
80- const erc1538ProxyAddress = await factoryDeployer . deployContract (
81- new ERC1538Proxy__factory ( ) ,
82- [ erc1538UpdateAddress ] ,
83- transferOwnershipCall ,
84- ) ;
85- const erc1538 : ERC1538Update = ERC1538Update__factory . connect ( erc1538ProxyAddress , owner ) ;
86- console . log ( `IexecInstance found at address: ${ await erc1538 . getAddress ( ) } ` ) ;
87- // Deploy library & modules
88- const iexecLibOrdersAddress = await factoryDeployer . deployContract (
89- new IexecLibOrders_v5__factory ( ) ,
90- ) ;
91- const iexecLibOrders = {
92- [ 'contracts/libs/IexecLibOrders_v5.sol:IexecLibOrders_v5' ] : iexecLibOrdersAddress ,
93- } ;
94- const modules = [
95- new ERC1538QueryDelegate__factory ( ) ,
96- new IexecAccessorsDelegate__factory ( ) ,
97- new IexecAccessorsABILegacyDelegate__factory ( ) ,
98- new IexecCategoryManagerDelegate__factory ( ) ,
99- new IexecERC20Delegate__factory ( ) ,
100- isTokenMode
101- ? new IexecEscrowTokenDelegate__factory ( )
102- : new IexecEscrowNativeDelegate__factory ( ) ,
103- new IexecMaintenanceDelegate__factory ( iexecLibOrders ) ,
104- new IexecOrderManagementDelegate__factory ( iexecLibOrders ) ,
105- new IexecPoco1Delegate__factory ( iexecLibOrders ) ,
106- new IexecPoco2Delegate__factory ( ) ,
107- new IexecRelayDelegate__factory ( ) ,
108- new ENSIntegrationDelegate__factory ( ) ,
109- new IexecMaintenanceExtraDelegate__factory ( ) ,
110- new IexecPocoAccessorsDelegate__factory ( iexecLibOrders ) ,
111- new IexecPocoBoostDelegate__factory ( iexecLibOrders ) ,
112- new IexecPocoBoostAccessorsDelegate__factory ( ) ,
113- ] ;
114- for ( const module of modules ) {
115- const address = await factoryDeployer . deployContract ( module ) ;
116- await linkContractToProxy ( erc1538 , address , module ) ;
117- }
118- // Verify linking on ERC1538Proxy
119- const erc1538QueryInstance : ERC1538Query = ERC1538Query__factory . connect (
120- erc1538ProxyAddress ,
121- owner ,
122- ) ;
123- const functionCount = await erc1538QueryInstance . totalFunctions ( ) ;
124- console . log ( `The deployed ERC1538Proxy now supports ${ functionCount } functions:` ) ;
125- for ( let i = 0 ; i < Number ( functionCount ) ; i ++ ) {
126- const [ method , , contract ] = await erc1538QueryInstance . functionByIndex ( i ) ;
127- console . log ( `[${ i } ] ${ contract } ${ method } ` ) ;
128- }
129- const appRegistryAddress = await factoryDeployer . deployContract (
130- new AppRegistry__factory ( ) ,
131- [ ] ,
132- transferOwnershipCall ,
133- ) ;
134- const datasetRegistryAddress = await factoryDeployer . deployContract (
135- new DatasetRegistry__factory ( ) ,
136- [ ] ,
137- transferOwnershipCall ,
138- ) ;
139- const workerpoolRegistryAddress = await factoryDeployer . deployContract (
140- new WorkerpoolRegistry__factory ( ) ,
141- [ ] ,
142- transferOwnershipCall ,
143- ) ;
71+ // const transferOwnershipCall = await Ownable__factory.connect(
72+ // ZeroAddress, // any is fine
73+ // owner, // any is fine
74+ // )
75+ // .transferOwnership.populateTransaction(owner.address)
76+ // .then((tx) => tx.data)
77+ // .catch(() => {
78+ // throw new Error('Failed to prepare transferOwnership data');
79+ // });
80+ // const erc1538ProxyAddress = await factoryDeployer.deployContract(
81+ // new ERC1538Proxy__factory(),
82+ // [erc1538UpdateAddress],
83+ // transferOwnershipCall,
84+ // );
85+ // const erc1538: ERC1538Update = ERC1538Update__factory.connect(erc1538ProxyAddress, owner);
86+ // console.log(`IexecInstance found at address: ${await erc1538.getAddress()}`);
87+ // // Deploy library & modules
88+ // const iexecLibOrdersAddress = await factoryDeployer.deployContract(
89+ // new IexecLibOrders_v5__factory(),
90+ // );
91+ // const iexecLibOrders = {
92+ // ['contracts/libs/IexecLibOrders_v5.sol:IexecLibOrders_v5']: iexecLibOrdersAddress,
93+ // };
94+ // const modules = [
95+ // new ERC1538QueryDelegate__factory(),
96+ // new IexecAccessorsDelegate__factory(),
97+ // new IexecAccessorsABILegacyDelegate__factory(),
98+ // new IexecCategoryManagerDelegate__factory(),
99+ // new IexecERC20Delegate__factory(),
100+ // isTokenMode
101+ // ? new IexecEscrowTokenDelegate__factory()
102+ // : new IexecEscrowNativeDelegate__factory(),
103+ // new IexecMaintenanceDelegate__factory(iexecLibOrders),
104+ // new IexecOrderManagementDelegate__factory(iexecLibOrders),
105+ // new IexecPoco1Delegate__factory(iexecLibOrders),
106+ // new IexecPoco2Delegate__factory(),
107+ // new IexecRelayDelegate__factory(),
108+ // new ENSIntegrationDelegate__factory(),
109+ // new IexecMaintenanceExtraDelegate__factory(),
110+ // new IexecPocoAccessorsDelegate__factory(iexecLibOrders),
111+ // new IexecPocoBoostDelegate__factory(iexecLibOrders),
112+ // new IexecPocoBoostAccessorsDelegate__factory(),
113+ // ];
114+ // for (const module of modules) {
115+ // const address = await factoryDeployer.deployContract(module);
116+ // await linkContractToProxy(erc1538, address, module);
117+ // }
118+ // // Verify linking on ERC1538Proxy
119+ // const erc1538QueryInstance: ERC1538Query = ERC1538Query__factory.connect(
120+ // erc1538ProxyAddress,
121+ // owner,
122+ // );
123+ // const functionCount = await erc1538QueryInstance.totalFunctions();
124+ // console.log(`The deployed ERC1538Proxy now supports ${functionCount} functions:`);
125+ // for (let i = 0; i < Number(functionCount); i++) {
126+ // const [method, , contract] = await erc1538QueryInstance.functionByIndex(i);
127+ // console.log(`[${i}] ${contract} ${method}`);
128+ // }
129+ // const appRegistryAddress = await factoryDeployer.deployContract(
130+ // new AppRegistry__factory(),
131+ // [],
132+ // transferOwnershipCall,
133+ // );
134+ // const datasetRegistryAddress = await factoryDeployer.deployContract(
135+ // new DatasetRegistry__factory(),
136+ // [],
137+ // transferOwnershipCall,
138+ // );
139+ // const workerpoolRegistryAddress = await factoryDeployer.deployContract(
140+ // new WorkerpoolRegistry__factory(),
141+ // [],
142+ // transferOwnershipCall,
143+ // );
144144
145- const appRegistryInstance = AppRegistry__factory . connect ( appRegistryAddress , owner ) ;
146- const datasetRegistryInstance = DatasetRegistry__factory . connect ( datasetRegistryAddress , owner ) ;
147- const workerpoolRegistryInstance = WorkerpoolRegistry__factory . connect (
148- workerpoolRegistryAddress ,
149- owner ,
150- ) ;
151- // Base URI configuration from config.json
152- const baseURIApp = config . registriesBaseUri . app ;
153- const baseURIDataset = config . registriesBaseUri . dataset ;
154- const baseURIWorkerpool = config . registriesBaseUri . workerpool ;
155- // Check if registries have been initialized and set base URIs
156- if ( ! ( await appRegistryInstance . initialized ( ) ) ) {
157- await appRegistryInstance
158- . initialize ( deploymentOptions . v3 . AppRegistry || ZeroAddress )
159- . then ( ( tx ) => tx . wait ( ) ) ;
160- await appRegistryInstance . setBaseURI ( `${ baseURIApp } /${ chainId } /` ) . then ( ( tx ) => tx . wait ( ) ) ;
161- }
162- if ( ! ( await datasetRegistryInstance . initialized ( ) ) ) {
163- await datasetRegistryInstance
164- . initialize ( deploymentOptions . v3 . DatasetRegistry || ZeroAddress )
165- . then ( ( tx ) => tx . wait ( ) ) ;
166- await datasetRegistryInstance
167- . setBaseURI ( `${ baseURIDataset } /${ chainId } /` )
168- . then ( ( tx ) => tx . wait ( ) ) ;
169- }
170- if ( ! ( await workerpoolRegistryInstance . initialized ( ) ) ) {
171- await workerpoolRegistryInstance
172- . initialize ( deploymentOptions . v3 . WorkerpoolRegistry || ZeroAddress )
173- . then ( ( tx ) => tx . wait ( ) ) ;
174- await workerpoolRegistryInstance
175- . setBaseURI ( `${ baseURIWorkerpool } /${ chainId } /` )
176- . then ( ( tx ) => tx . wait ( ) ) ;
177- }
145+ // const appRegistryInstance = AppRegistry__factory.connect(appRegistryAddress, owner);
146+ // const datasetRegistryInstance = DatasetRegistry__factory.connect(datasetRegistryAddress, owner);
147+ // const workerpoolRegistryInstance = WorkerpoolRegistry__factory.connect(
148+ // workerpoolRegistryAddress,
149+ // owner,
150+ // );
151+ // // Base URI configuration from config.json
152+ // const baseURIApp = config.registriesBaseUri.app;
153+ // const baseURIDataset = config.registriesBaseUri.dataset;
154+ // const baseURIWorkerpool = config.registriesBaseUri.workerpool;
155+ // // Check if registries have been initialized and set base URIs
156+ // if (!(await appRegistryInstance.initialized())) {
157+ // await appRegistryInstance
158+ // .initialize(deploymentOptions.v3.AppRegistry || ZeroAddress)
159+ // .then((tx) => tx.wait());
160+ // await appRegistryInstance.setBaseURI(`${baseURIApp}/${chainId}/`).then((tx) => tx.wait());
161+ // }
162+ // if (!(await datasetRegistryInstance.initialized())) {
163+ // await datasetRegistryInstance
164+ // .initialize(deploymentOptions.v3.DatasetRegistry || ZeroAddress)
165+ // .then((tx) => tx.wait());
166+ // await datasetRegistryInstance
167+ // .setBaseURI(`${baseURIDataset}/${chainId}/`)
168+ // .then((tx) => tx.wait());
169+ // }
170+ // if (!(await workerpoolRegistryInstance.initialized())) {
171+ // await workerpoolRegistryInstance
172+ // .initialize(deploymentOptions.v3.WorkerpoolRegistry || ZeroAddress)
173+ // .then((tx) => tx.wait());
174+ // await workerpoolRegistryInstance
175+ // .setBaseURI(`${baseURIWorkerpool}/${chainId}/`)
176+ // .then((tx) => tx.wait());
177+ // }
178178
179- // Set main configuration
180- const iexecAccessorsInstance = IexecAccessors__factory . connect ( erc1538ProxyAddress , owner ) ;
181- const iexecInitialized = ( await iexecAccessorsInstance . eip712domain_separator ( ) ) != ZeroHash ;
182- if ( ! iexecInitialized ) {
183- await IexecMaintenanceDelegate__factory . connect ( erc1538ProxyAddress , owner )
184- . configure (
185- rlcInstanceAddress ,
186- 'Staked RLC' ,
187- 'SRLC' ,
188- 9 , // TODO: generic ?
189- appRegistryAddress ,
190- datasetRegistryAddress ,
191- workerpoolRegistryAddress ,
192- ZeroAddress ,
193- )
194- . then ( ( tx ) => tx . wait ( ) ) ;
195- }
196- // Set categories
197- const catCountBefore = await iexecAccessorsInstance . countCategory ( ) ;
198- for ( let i = Number ( catCountBefore ) ; i < config . categories . length ; i ++ ) {
199- const category = config . categories [ i ] ;
200- await IexecCategoryManager__factory . connect ( erc1538ProxyAddress , owner )
201- . createCategory (
202- category . name ,
203- JSON . stringify ( category . description ) ,
204- category . workClockTimeRef ,
205- )
206- . then ( ( tx ) => tx . wait ( ) ) ;
207- }
208- const catCountAfter = await iexecAccessorsInstance . countCategory ( ) ;
209- console . log ( `countCategory is now: ${ catCountAfter } (was ${ catCountBefore } )` ) ;
210- for ( let i = 0 ; i < Number ( catCountAfter ) ; i ++ ) {
211- console . log ( `Category ${ i } : ${ await iexecAccessorsInstance . viewCategory ( i ) } ` ) ;
212- }
179+ // // Set main configuration
180+ // const iexecAccessorsInstance = IexecAccessors__factory.connect(erc1538ProxyAddress, owner);
181+ // const iexecInitialized = (await iexecAccessorsInstance.eip712domain_separator()) != ZeroHash;
182+ // if (!iexecInitialized) {
183+ // await IexecMaintenanceDelegate__factory.connect(erc1538ProxyAddress, owner)
184+ // .configure(
185+ // rlcInstanceAddress,
186+ // 'Staked RLC',
187+ // 'SRLC',
188+ // 9, // TODO: generic ?
189+ // appRegistryAddress,
190+ // datasetRegistryAddress,
191+ // workerpoolRegistryAddress,
192+ // ZeroAddress,
193+ // )
194+ // .then((tx) => tx.wait());
195+ // }
196+ // // Set categories
197+ // const catCountBefore = await iexecAccessorsInstance.countCategory();
198+ // for (let i = Number(catCountBefore); i < config.categories.length; i++) {
199+ // const category = config.categories[i];
200+ // await IexecCategoryManager__factory.connect(erc1538ProxyAddress, owner)
201+ // .createCategory(
202+ // category.name,
203+ // JSON.stringify(category.description),
204+ // category.workClockTimeRef,
205+ // )
206+ // .then((tx) => tx.wait());
207+ // }
208+ // const catCountAfter = await iexecAccessorsInstance.countCategory();
209+ // console.log(`countCategory is now: ${catCountAfter} (was ${catCountBefore})`);
210+ // for (let i = 0; i < Number(catCountAfter); i++) {
211+ // console.log(`Category ${i}: ${await iexecAccessorsInstance.viewCategory(i)}`);
212+ // }
213213
214214 if ( network . name !== 'hardhat' && network . name !== 'localhost' ) {
215215 console . log ( 'Waiting for block explorer to index the contracts...' ) ;
0 commit comments