Skip to content

Commit 4196a86

Browse files
committed
fix: update upgrade scripts to use environment variables for contract addresses
1 parent 00bd84b commit 4196a86

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

.github/workflows/sharing-smart-contracts-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ jobs:
8888
8989
- name: Upgrade test
9090
working-directory: packages/sharing-smart-contract
91+
env:
92+
DATA_PROTECTOR_SHARING_ADDRESS: 0x1390c3c6a545198809F1C7c5Dd2600ef74D60925
93+
ADD_ONLY_APP_WHITELIST_REGISTRY_ADDRESS: 0x498D324F711b8998Be81818742e268dEE30347c6
9194
run: npm run upgrade-local-fork -- --network local-bellecour-fork
9295

9396
# TODO check why the CI does not fail when the following error occurs

packages/sharing-smart-contract/scripts/upgrade-local-fork.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
/* eslint-disable no-console */
21
import hre from 'hardhat';
32
import { DATASET_REGISTRY_ADDRESS, POCO_ADDRESS } from '../config/config.js';
43
import env from '../config/env.js';
54
import { impersonate, stopImpersonate } from './singleFunction/utils.js';
65
const { ethers, upgrades } = hre;
76

87
async function main() {
9-
const { dataprotectorSharingContractAddress, addOnlyAppWhitelistRegistryContractAddress } = env;
8+
const dataprotectorSharingContractAddress = env.DATA_PROTECTOR_SHARING_ADDRESS;
9+
const addOnlyAppWhitelistRegistryContractAddress = env.ADD_ONLY_APP_WHITELIST_REGISTRY_ADDRESS;
10+
1011
const rpcUrl = hre.network.config.url;
1112
console.log('rpcUrl', rpcUrl);
1213

packages/sharing-smart-contract/scripts/upgrade.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
/* eslint-disable no-console */
21
import hre from 'hardhat';
32
import { DATASET_REGISTRY_ADDRESS, POCO_ADDRESS } from '../config/config.js';
43
import env from '../config/env.js';
54

65
const { ethers, upgrades } = hre;
76

87
async function main() {
9-
const { dataprotectorSharingContractAddress, addOnlyAppWhitelistRegistryContractAddress } = env;
8+
const dataprotectorSharingContractAddress = env.DATA_PROTECTOR_SHARING_ADDRESS;
9+
const addOnlyAppWhitelistRegistryContractAddress = env.ADD_ONLY_APP_WHITELIST_REGISTRY_ADDRESS;
1010

1111
console.log(`Using poco at ${POCO_ADDRESS}`);
1212
console.log(`Using dataset registry at ${DATASET_REGISTRY_ADDRESS}`);

0 commit comments

Comments
 (0)