refactor(cli): generate contracts with @cartesi/wagmi-plugin - #520
Closed
brunomenezes wants to merge 8 commits into
Closed
brunomenezes wants to merge 8 commits into
brunomenezes wants to merge 8 commits into
Conversation
🦋 Changeset detectedLatest commit: 7cccaf1 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)
|
brunomenezes
force-pushed
the
refactor/cli-replace-devnet
branch
from
October 2, 2026 20:59
abf02f3 to
7cccaf1
Compare
Member
Author
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
Replaces
@sunodo/wagmi-plugin-hardhat-deploy+ the@cartesi/devnetpackage with@cartesi/wagmi-pluginfrom therollups-tsrepository, and updates the call sites that the newer contract releases broke.apps/clino longer depends on@cartesi/devnetat all.prt: truepulls the PRT contracts from the dave release alongside the rollups ones, so a single plugin call covers both.Changes
apps/cli/wagmi.config.tshardhatDeploy({ directory: … })→rollupsContracts({ prt: true, exclude: prtInternals })apps/cli/package.json@cartesi/devnetand@sunodo/wagmi-plugin-hardhat-deploy, add@cartesi/wagmi-plugin@1.0.0-alpha.7apps/cli/src/base.tscartesi address-bookapps/cli/src/commands/deposit/{erc20,erc721,erc1155}.tsapps/cli/src/validations.tsversion, and pass the widenedcalculateDaveAppAddressargumentsapps/cli/tests/unit/validations.test.ts@cartesi/wagmi-pluginis pinned exactly, as@cartesi/devnetwas — the plugin version determines codegen output.1.0.0-alpha.7is the newest published version; it defaults to rollups-contracts v3.0.0-alpha.10 and dave v3.0.0-alpha.5, and reads each release's anvil tarball as well, 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 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 blocker: the SDK image
One blocker remains, and the version half of it is now settled.
Codegen emits rollups-contracts alpha.10 / dave alpha.5 addresses. The devnet Anvil state the CLI talks to is baked into the SDK image, and the currently pinned
0.12.0-alpha.41still carries dave alpha.3 / rollups-contracts alpha.6 — socartesi runon devnet would talk to addresses holding no code.#515 is the other half: it moves the SDK image off
@cartesi/devnettoo, pullinganvil_state.jsonstraight from the dave release, and it stops shipping/usr/share/cartesi/deploymentsand printing the address list from thedevnetscript — "usecartesi address-book". It now pinsCARTESI_PRT_VERSION = 3.0.0-alpha.5andFOUNDRY_VERSION = 1.5.1, matching this PR's codegen exactly.So the two must land together, with
DEFAULT_SDK_VERSIONinsrc/config.tsbumped to the resulting image. Dave alpha.5 pairing correctly with rollups-contracts alpha.10 is already confirmed: the two releases agree on all 122 shared (chain, contract) address pairs, which is also what the plugin's own cross-check enforces at codegen time.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
bun run build --filter @cartesi/clicleanbun test apps/cli/tests/unit/green (132 pass)bun lintcleanDEFAULT_SDK_VERSIONinapps/cli/src/config.tsto that imagecartesi run,cartesi address-book(devnet and--fork, checking the three new entries resolve),cartesi run --prt,cartesi deposit erc20againstTestFungibleTokenFollow-up (separate PRs)
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.tscin any script, turbo task or workflow —buildisbun build,lintis biome,testisbun test, all transpile-only. That is precisely why the broken call sites above went unnoticed. Wiring up atypecheckgate is worth doing, but it first needs the 11 pre-existing errors intests/unit/compose/builder.test.tstriaged (Config.namerequired but absent from fixtures;Modelmissingimage/backend), which are unrelated to this change..github/workflows/cli.yamlstill installs Foundry v1.4.3, which existed for the@cartesi/devnetbuild.apps/clino longer depends on that package, so the step is likely dead — worth checking against the integration tests before removing it.Notes for reviewers
apps/cliwill fail; CI is unaffected.