refactor(cli): generate contracts with @cartesi/wagmi-plugin - #520
Open
brunomenezes wants to merge 2 commits into
Open
refactor(cli): generate contracts with @cartesi/wagmi-plugin#520brunomenezes wants to merge 2 commits into
brunomenezes wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: e21f35b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
…uilderFactory to the address book
tuler
force-pushed
the
refactor/cli-replace-devnet
branch
from
September 2, 2026 20:40
1f8e52f to
e21f35b
Compare
Contributor
Coverage Report
📁 File Coverage (19 files)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Code changes that replace the use of
@sunodo/wagmi-plugin-hardhat-deploy+@cartesi/devnetpackage in favour of@cartesi/wagmi-pluginfromrollups-tsrepository.apps/clino longer depends on@cartesi/devnetat all.Changes
apps/cli/wagmi.config.tshardhatDeploy({ directory: … })→rollupsContracts();rollupsPrtContracts()left commented outapps/cli/package.json@cartesi/devnetand@sunodo/wagmi-plugin-hardhat-deploy, add@cartesi/wagmi-plugin@1.0.0-alpha.6apps/cli/src/base.tscartesi address-book@cartesi/wagmi-pluginis pinned exactly, as@cartesi/devnetwas — the plugin version determines codegen output.1.0.0-alpha.6is the newest published version.What the generated file looks like now
rollupsContracts()with no options defaults to rollups-contracts v3.0.0-alpha.10, and reads the release's anvil tarball too, so chain 31337 is covered out of the box.Address book additions
Three contracts the release now provides are added to
cartesi address-book:TestUsdcTestToken/TestNFT/TestMultiTokenRefundOutputBuilder@cartesi/devnetnever had itUsdWithdrawalOutputBuilderFactoryTestUsdWithdrawalOutputBuilderentryOnly five contracts in alpha.9 are genuinely devnet-only —
TestFungibleToken,TestMultiToken,TestNonFungibleToken,TestUsdcandTestUsdWithdrawalOutputBuilder. The other two above are deployed at the same address on all nine chains, which is why they go incommonContracts.This changes
cartesi address-bookoutput: 14 devnet rows become 17, and the fork output gains 2.Merge blockers
1. Version alignment with the SDK image
The devnet Anvil state the CLI actually talks to is baked into the SDK image, and it is built from dave v3.0.0-alpha.3, i.e. rollups-contracts v3.0.0-alpha.6. Codegen now emits v3.0.0-alpha.10 addresses. Until the image catches up,
cartesi runon devnet would talk to addresses that hold no code.#515 is the other half: it moves the SDK image off
@cartesi/devnettoo, pullinganvil_state.jsonstraight from the dave release (CARTESI_PRT_VERSION = 3.0.0-alpha.4,FOUNDRY_VERSION = 1.5.1), and it stops shipping/usr/share/cartesi/deploymentsand printing the address list from thedevnetscript — "usecartesi address-book". It depends on dave v3.0.0-alpha.4.So this PR and #515 must land together, with
DEFAULT_SDK_VERSIONinsrc/config.ts:93bumped to the resulting image, and the generated 31337 addresses re-checked againstdeployments/31337/in the dave anvil tarball that image loads. That check also confirms dave alpha.4 is built against rollups-contracts alpha.9 rather than an earlier release — the matching anvil version (1.5.1 in both) is suggestive but not proof.Worth knowing: after #515, this generated file is the only place devnet addresses are printed, so a codegen mistake is no longer cross-checkable at runtime.
Checklist before merge
DEFAULT_SDK_VERSIONinapps/cli/src/config.tsto that imagedeployments/31337/in its anvil tarballbun run --cwd apps/cli codegen && bun run --cwd apps/cli compilecleanbun test apps/cli/green — the expected addresses intests/unit/validations.test.tsandtests/unit/compose/node.test.tsneed updating for alpha.10bun lintcleancartesi run,cartesi address-book(devnet and--forkon a public chain, checking the three new entries resolve),cartesi run --prt,cartesi deposit erc20againstTestFungibleTokenFollow-up (separate PR)
Once this and #515 are both in, nothing consumes
packages/devnetany more. It can be deleted outright, along with.github/workflows/devnet.yaml, its workspace entry, and its row inCLAUDE.md. That is the endpoint this branch is named for.Notes for reviewers
apps/cliwill fail; CI is unaffected.