Skip to content

fix: repair deploy script, per-network env vars, add .env.example#14

Open
PragyaTripathi990 wants to merge 1 commit into
seetadev:mainfrom
PragyaTripathi990:fix/deploy-script-and-env-config
Open

fix: repair deploy script, per-network env vars, add .env.example#14
PragyaTripathi990 wants to merge 1 commit into
seetadev:mainfrom
PragyaTripathi990:fix/deploy-script-and-env-config

Conversation

@PragyaTripathi990

Copy link
Copy Markdown

Summary

Three related issues with the development setup, all fixed together:

1. scripts/deploy.js — PPTToken deployment was entirely commented out, so the script deployed MedInvoiceContract with a hardcoded token address. This means a fresh deployment on any new network would point to the wrong contract. Restored both deployments in correct sequence (PPTToken first, then MedInvoiceContract using that address). Added contract verification for non-local networks with graceful error handling.

2. hardhat.config.js — All 6 networks shared a single RPC_URL env var, making it impossible to have multiple networks configured simultaneously. Replaced with per-network vars (CALIBNET_RPC_URL, OP_SEPOLIA_RPC_URL, etc.) and per-explorer API keys. URLs/accounts default to empty so hardhat doesn't crash on startup when env vars are unset (previously hardhat test was broken locally without a .env).

3. .env.example (new file) — The repo had no .env.example. Added one documenting every required variable with descriptions and links to where each API key can be obtained.

Test plan

  • cp .env.example .env then npx hardhat test → tests run without config errors
  • Set real env vars for a testnet → npx hardhat run scripts/deploy.js --network calibnet deploys both contracts and prints addresses

Closes #3

🤖 Generated with Claude Code

deploy.js had PPTToken deployment commented out and hardcoded the
MedInvoiceContract's token address. Restored both deployments in sequence
so PPTToken is always deployed first and its address passed automatically.
Added contract verification for non-local networks with error handling.

hardhat.config.js used a single RPC_URL for all 6 networks, making it
impossible to deploy to more than one without editing the file. Replaced
with per-network env vars (CALIBNET_RPC_URL, OP_SEPOLIA_RPC_URL, etc.)
and per-explorer API keys. Accounts and URLs default to empty string/array
so hardhat doesn't throw on startup when variables are not set.

Added .env.example documenting all required environment variables with
links to where API keys can be obtained for each network.

Closes seetadev#3
@PragyaTripathi990 PragyaTripathi990 force-pushed the fix/deploy-script-and-env-config branch from 78bd31c to 5d3080a Compare May 10, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade Codebase to Latest Versions

1 participant