55 POCO_ADDRESS as defaultPocoAddress ,
66} from '../config/config.js' ;
77import { saveDeployment } from '../utils/utils.js' ;
8+ import { env } from '../config/env.js' ;
89
910const { ethers, upgrades } = hre ;
1011
@@ -13,13 +14,11 @@ async function main() {
1314 const [ deployer ] = await ethers . getSigners ( ) ;
1415 console . log ( 'Deploying contracts with the account:' , deployer . address ) ;
1516
16- const {
17- POCO_ADDRESS = defaultPocoAddress ,
18- DATASET_REGISTRY_ADDRESS = defaultDatasetRegistryAddress ,
19- } = process . env ;
17+ const pocoAddress = env . POCO_ADDRESS || defaultPocoAddress ;
18+ const datasetRegistryAddress = env . DATASET_REGISTRY_ADDRESS || defaultDatasetRegistryAddress ;
2019
21- console . log ( `Using poco at ${ POCO_ADDRESS } ` ) ;
22- console . log ( `Using dataset registry at ${ DATASET_REGISTRY_ADDRESS } ` ) ;
20+ console . log ( `Using poco at ${ pocoAddress } ` ) ;
21+ console . log ( `Using dataset registry at ${ datasetRegistryAddress } ` ) ;
2322
2423 const AddOnlyAppWhitelistRegistryFactory = await ethers . getContractFactory (
2524 'AddOnlyAppWhitelistRegistry' ,
@@ -47,8 +46,8 @@ async function main() {
4746 const DataProtectorSharingFactory = await ethers . getContractFactory ( 'DataProtectorSharing' ) ;
4847
4948 const dataProtectorSharingConstructorArgs = [
50- DATASET_REGISTRY_ADDRESS ,
51- POCO_ADDRESS ,
49+ datasetRegistryAddress ,
50+ pocoAddress ,
5251 addOnlyAppWhitelistRegistryAddress ,
5352 ] ;
5453 const dataProtectorSharingContract = await upgrades . deployProxy ( DataProtectorSharingFactory , {
0 commit comments