hardhat icon indicating copy to clipboard operation
hardhat copied to clipboard

Add Hardhat Ignition to hardhat-toolbox

Open zoeyTM opened this issue 1 year ago • 3 comments
trafficstars

Updates the @nomicfoundation/hardhat-toolbox and @nomicfoundation/hardhat-toolbox-viem packages to include Hardhat Ignition.

This includes

  • Updated sample projects with Hardhat Ignition files
  • Added Hardhat Ignition to hardhat-toolbox and hardhat-toolbox-viem
  • Updated relevant docs to use Hardhat Ignition where relevant

A sibling PR to update hardhat-boilerplate has also been opened.

resolves https://github.com/NomicFoundation/hardhat-ignition/issues/614 resolves https://github.com/NomicFoundation/hardhat-ignition/issues/613

Manual Testing Instructions

To manually create HH projects with the new toolbox:

  1. Pull the branch locally
  2. Install the new deps: pnpm install
  3. Run the build pnpm build
  4. Start a new verdaccio instance and login (see https://www.notion.so/nomicfoundation/Using-verdaccio-e15e379b59a64ef8a82fe0c1a6b93dd8?pvs=4)
  5. publish hardhat to verdaccio:
cd packages/hardhat-core
npm publish --registry=http://localhost:4873/
  1. publish @nomicfoundation/hardhat-toolbox to verdaccio:
cd packages/hardhat-toolbox
npm publish --registry=http://localhost:4873/
  1. publish @nomicfoundation/hardhat-toolbox-viem to verdaccio:
cd packages/hardhat-toolbox-viem
npm publish --registry=http://localhost:4873/
  1. Install the new hardhat globally from verdaccio (is there a better approach? Also you might want to do this outside a volta controller directory):
npm install -g [email protected] --registry=http://localhost:4873/
  1. Create your new sample project with the globally installed hardhat:
hardhat --version
# 2.21.0
echo "registry=http://localhost:4873" > .npmrc
hardhat init
  1. Run the docs locally:
cd docs
pnpm install
pnpm dev

Questions and decisions

  • [x] Are we happy with the failing CI Test - yes a local manual run with updated versions counts as a pass
  • [x] How do we approach scripting in the docs given that it is currently about deploymeent
    • Remove the scripts from the sample projects
    • Remove the scripting guide from basic, move it to advanced and show a replacement script story (e.g. "how long left in timelock")
  • [x] Confirm whether we are updating the verification guide - yes
    • short intro going through ignition verification
    • follow on section for manual verification based on existing guide
  • [x] Are we updating the deployment contracts to reflect the danger of msg.sender in a create2 context?
    • no - lets see if anyone raises it as an issue and reconsider

TODO

  • [x] Confirm whether we are updating the hackathon guide
  • [x] Manually test the new sample projects
  • [x] Investigate assert.isDefined issue - see comment in PR
  • [x] Investigate no ignition in tasks issue - see comment in PR
  • [x] Update verification guide in HH
  • [x] Update docs to move scripts from basic to advanced
  • [x] Remove scripts from sample project + update their readmes
  • [ ] Local manual run of end to end tests with bumped versions
  • [ ] Run through the Tutorial section of the docs manually @ChristopherDedominici
  • [ ] Run through the Guides section of the docs manually, key areas of focus: @schaable
    • [ ] Setting up a project
    • [ ] Testing contracts
    • [ ] Deploying your contracts
    • [ ] Verifying your contracts
    • [ ] Writing tasks
  • [ ] Run through the Scripts section of Advanced in the docs manually @kanej
  • [ ] Run through hardhat-boilerplate @kanej
  • [ ] Review example to work better with Ignition, specifically it is a complicated example that needs lots of Ignition Module features explained.

zoeyTM avatar Dec 07 '23 05:12 zoeyTM

🦋 Changeset detected

Latest commit: 26720f80b6d110845b1348a7f5ea52936a67dac3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
hardhat Patch
@nomicfoundation/hardhat-toolbox Major
@nomicfoundation/hardhat-toolbox-viem Major
benchmark Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Dec 07 '23 05:12 changeset-bot[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hardhat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 14, 2024 1:30pm

vercel[bot] avatar Dec 07 '23 05:12 vercel[bot]

IMO, we should be careful about the naming pattern we suggest in documentation and sample projects. So far we've kept names simple, for example:

./contracts/Lock.sol
./tests/Lock.ts
./artifacts/contracts/Lock.sol/Lock.json

But for modules, we have:

./ignition/modules/LockModule.ts

While it won't change the behavior, there are good reasons for avoiding repetition. The "Module" postfix feels redundant since the file is already in a modules folder. This aligns with clean code principles, which advocate for simplicity and eliminating unnecessary information.

schaable avatar Feb 16 '24 22:02 schaable

I have run the e2e tests locally. They are failing due to the new toolboxes not being in npm.

kanej avatar Mar 14 '24 13:03 kanej