Skip to content

Commit 3fcc07c

Browse files
committed
fix: Update deployment workflow to include verification step and adjust environment variables
1 parent 1293365 commit 3fcc07c

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

.github/workflows/core-smart-contract-deploy.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ jobs:
8080
DEPLOYER_PRIVATE_KEY: ${{ secrets.DEPLOYER_PRIVATE_KEY }}
8181
DATASET_REGISTRY_ADDRESS: ${{ vars.DATASET_REGISTRY_ADDRESS }}
8282
HARDHAT_IGNITION_CONFIRM_DEPLOYMENT: ${{ vars.HARDHAT_IGNITION_CONFIRM_DEPLOYMENT }}
83-
# For Verification
84-
EXPLORER_API_KEY: ${{ secrets.EXPLORER_API_KEY }}
85-
IS_VERIFICATION_API_V2: ${{ vars.IS_VERIFICATION_API_V2 }}
8683
run: |
8784
if [ "${{ inputs.network }}" = "hardhat" ]; then
8885
npm run deploy -- --network ${{ inputs.network }}
@@ -93,8 +90,24 @@ jobs:
9390
else
9491
DEPLOYMENT_ID="${{ inputs.network }}"
9592
fi
96-
npm run deploy -- --network ${{ inputs.network }} --deployment-id "$DEPLOYMENT_ID" --verify
93+
npm run deploy -- --network ${{ inputs.network }} --deployment-id "$DEPLOYMENT_ID"
94+
fi
95+
96+
- name: Verify contract
97+
if: inputs.network != 'hardhat'
98+
working-directory: packages/smart-contract
99+
env:
100+
# For Verification
101+
EXPLORER_API_KEY: ${{ secrets.EXPLORER_API_KEY }}
102+
IS_VERIFICATION_API_V2: ${{ vars.IS_VERIFICATION_API_V2 }}
103+
run: |
104+
# For testnets, use network-environment; for mainnets, use network only
105+
if [ "$IS_MAINNET" = false ]; then
106+
DEPLOYMENT_ID="${{ inputs.network }}-${{ inputs.environment }}"
107+
else
108+
DEPLOYMENT_ID="${{ inputs.network }}"
97109
fi
110+
npm run verify -- "$DEPLOYMENT_ID"
98111
99112
- name: Save deployment artifacts
100113
if: inputs.network != 'hardhat'

packages/smart-contract/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"test": "hardhat test",
77
"coverage": "hardhat coverage",
88
"deploy": "hardhat ignition deploy ignition/modules/DataProtector.ts --strategy create2",
9+
"verify": "hardhat ignition verify --include-unrelated-contracts",
910
"artifact-to-abis": "node tools/artifacts-to-abis.mjs",
1011
"check-format": "prettier --loglevel warn 'contracts/**/*.sol' '**/*.ts' --check",
1112
"format": "prettier --loglevel warn 'contracts/**/*.sol' '**/*.ts' --write",

0 commit comments

Comments
 (0)