hardhat
hardhat copied to clipboard
Add Hardhat Ignition to hardhat-toolbox
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-toolboxandhardhat-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:
- Pull the branch locally
- Install the new deps:
pnpm install - Run the build
pnpm build - Start a new verdaccio instance and login (see https://www.notion.so/nomicfoundation/Using-verdaccio-e15e379b59a64ef8a82fe0c1a6b93dd8?pvs=4)
- publish
hardhatto verdaccio:
cd packages/hardhat-core
npm publish --registry=http://localhost:4873/
- publish
@nomicfoundation/hardhat-toolboxto verdaccio:
cd packages/hardhat-toolbox
npm publish --registry=http://localhost:4873/
- publish
@nomicfoundation/hardhat-toolbox-viemto verdaccio:
cd packages/hardhat-toolbox-viem
npm publish --registry=http://localhost:4873/
- 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/
- Create your new sample project with the globally installed hardhat:
hardhat --version
# 2.21.0
echo "registry=http://localhost:4873" > .npmrc
hardhat init
- 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.isDefinedissue - see comment in PR - [x] Investigate no
ignitionin 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.
🦋 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
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 |
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.
I have run the e2e tests locally. They are failing due to the new toolboxes not being in npm.