Skip to content

Ensure hardhat demo bootstrap compiles artifacts and add regression test#3853

Open
MontrealAI wants to merge 3 commits into
mainfrom
codex/fix-all-github-actions-to-pass
Open

Ensure hardhat demo bootstrap compiles artifacts and add regression test#3853
MontrealAI wants to merge 3 commits into
mainfrom
codex/fix-all-github-actions-to-pass

Conversation

@MontrealAI
Copy link
Copy Markdown
Owner

Motivation

  • CI/demo runs failed at runtime when owner parameter matrix bootstrap attempted to deploy demo contracts without compiled Hardhat artifacts, producing zero/invalid addresses and causing demo workflows to error.
  • The intent is to auto-bootstrap safe defaults for local/Hardhat/CI demo contexts while preserving strict validation for real networks.

Description

  • Add ensureDemoArtifacts() to scripts/v2/lib/hardhatDemoBootstrap.ts which checks for required artifacts and runs Hardhat compile via run('compile') when artifacts are missing, and import artifacts and run from hardhat.
  • Invoke the artifact check before deploying demo contracts so the demo bootstrap always produces non-zero addresses in local/CI contexts.
  • Add a regression test test/demo/hardhatDemoBootstrap.test.ts that calls bootstrapHardhatDemoConfig('hardhat', ..., { force: true }) and asserts non-zero addresses are written into the generated address book and config overrides.
  • No workflow YAML changes were required because the repository already contains an actionlint guardrail workflow to prevent YAML regressions.

Testing

  • Ran ./scripts/ci/npm-ci.sh to install dependencies and the step completed successfully.
  • Ran npm run owner:parameters -- --network hardhat --format json --out /tmp/owner.json and it completed with a generated demo address book containing non-zero addresses.
  • Ran npx hardhat test test/demo/hardhatDemoBootstrap.test.ts and the new test passed (1 passing).

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant