Add the rollupsPrtContracts wagmi plugin - #162
Draft
tuler wants to merge 1 commit into
Draft
Conversation
🦋 Changeset detectedLatest commit: b524656 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 |
tuler
force-pushed
the
claude/wagmi-plugin-version-bump-e8wqpt
branch
from
August 17, 2026 12:44
5fbf1fc to
0c9a591
Compare
This was referenced Aug 19, 2026
Base automatically changed from
claude/wagmi-plugin-version-bump-e8wqpt
to
prerelease/v2-alpha
August 19, 2026 19:24
tuler
force-pushed
the
claude/rollups-prt-contracts-import-202p0s
branch
2 times, most recently
from
August 20, 2026 14:05
f22a61b to
b7fa215
Compare
Generate the PRT (Permissionless Refereed Tournaments) contracts from a dave release, defaulting to the v3.0.0-alpha.3 GitHub release tarballs. The tarball reading shared with rollupsContracts moves to release.ts, and grows the three things the dave release layout needs: - artifacts are searched for `.sol` directories at any depth, so a tarball holding one foundry build per contracts project works as well as one holding a single `out` directory; - a contract built by more than one project is generated once, and its copies must declare the same ABI; - a deployment address without a build artifact is skipped rather than an error, since the dave release also lists the rollups-contracts contracts a PRT deployment runs against, which dave does not build. Both plugins can be used in the same config: the contracts both releases build, exported as SHARED_CONTRACTS, are excluded from rollupsPrtContracts by default, so the wagmi CLI does not fail on duplicate contract names. dave publishes an anvil tarball of its own, so the devnet addresses are read the same way, through an `anvil` option defaulting to the release and disabled with `false`. dave still ships one JSON file per deployed contract, as rollups-contracts did before 3.0.0-alpha.8, so deployment addresses are read according to a deploymentFormat option. It defaults to PRT_DEFAULT_DEPLOYMENT_FORMAT, which becomes "txt" when the default moves to dave 3.0.0-alpha.4. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017dyPxGkLKcxgyECXkVKqae
tuler
force-pushed
the
claude/rollups-prt-contracts-import-202p0s
branch
from
August 24, 2026 19:57
b7fa215 to
b524656
Compare
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.
Follows #151, now merged — this branch is rebased onto
prerelease/v2-alpha.Adds
rollupsPrtContracts, a second@wagmi/cliplugin that generates the PRT (Permissionless Refereed Tournaments) contracts from a dave release, defaulting to the v3.0.0-alpha.3 tarballs (hash-verified).What the dave release layout needs
The tarball reading shared with
rollupsContractsmoves tosrc/release.tsand grows three things, each driven by how the dave release differs from a rollups-contracts one:cartesi-rollups/contracts/outandprt/contracts/out, and both nest.soldirectories below theirout(out/src/…,out/libs/…). Artifacts are now found by searching for.soldirectories at any depth, which also covers the single-outrollups-contracts layout.ITournament,Machine,Time, …). They are generated once, and the copies must declare the same ABI — in alpha.3 they all do.InputBox, the portals,ApplicationFactory, the devnet test tokens, …). dave does not build them, so they have no ABI in the release. Those are now skipped instead of raisingDeployed contract X has no build artifact.dave publishes an anvil tarball of its own (
deployments/31337/), so the devnet addresses are read the same wayrollupsContractsreads them since #151 — through ananviloption defaulting to the release and disabled withfalse.The intersection with rollups-contracts
dave builds its own copy of five cartesi-rollups interfaces —
IApplication,IApplicationFactory,IInputBox,IOutputsMerkleRootValidatorandIWithdrawalOutputBuilder— pinned to whichever rollups-contracts version it was released against, so the ABIs are not the same. The wagmi CLI rejects two contracts with the same name (Contract name "IApplication" must be unique.), sorollupsPrtContractsexcludes them by default, exported asSHARED_CONTRACTS, and leaves them torollupsContracts.That makes the two plugins usable in the same config out of the box:
excludeSharedContracts: falsegenerates the dave copies instead, which then rulesrollupsContractsout.The intersection is the same five names against both rollups-contracts 3.0.0-alpha.8 and 3.0.0-alpha.9, so #151's version bump did not change it.
One caveat, documented on the new docs page: while dave pins an older rollups-contracts, the two releases are deployed at different addresses (dave's
InputBoxon mainnet is0x346B…3939, rollups-contracts 3.0.0-alpha.9's is0xCC04…6fF2). The generated addresses for the rollups contracts are the rollups-contracts ones.Preparing for dave 3.0.0-alpha.4
alpha.3 still ships one JSON file per deployed contract, as rollups-contracts did before 3.0.0-alpha.8. Deployment addresses are now read according to a
deploymentFormatoption ("json" | "txt"), defaulting toPRT_DEFAULT_DEPLOYMENT_FORMAT. When alpha.4 lands, moving to it is a bump ofPRT_DEFAULT_VERSION,PRT_DEFAULT_ANVIL_VERSIONand the three hashes, plus flipping that one constant to"txt";rollupsContractsstays plaintext-only, as #151 made it.Verification
Re-run in full after the rebase onto
prerelease/v2-alpha:rollupsContracts()alone: codec, client and react codegen unchanged; every package builds; docs site builds with no dead links and renders the new/wagmi-plugin/prtpage.pnpm lintis green across all 7 packages.rollupsPrtContracts()alone: generates the PRT contracts with addresses across the 8 livenets plus the devnet.iInputBoxAbihas alpha.9's 12 entries,inputBoxAddressis the alpha.9 address). Devnet addresses merge for every PRT contract —Tournamentresolves to dave's0xae22…57cAon chain 31337 and the livenets alike.anvil: false: no chain 31337 in the output.excludeSharedContracts: falsealongsiderollupsContracts(): fails with the wagmi CLI's duplicate-name error, as documented.deploymentFormat: "txt"against alpha.3: fails with… has no .txt deployment file, so the tarball is not in the expected format.changeset versionarchives it into.changeset/pre/and lands the entry under@cartesi/wagmi-plugin@1.0.0-alpha.5as a minor.One caveat about the sandbox this was verified in, not about the diff:
turbo run buildhitsfetch failedwhen several packages download release tarballs concurrently. It reproduces on the base branch with this diff stashed, and building the packages one at a time succeeds.🤖 Generated with Claude Code
https://claude.ai/code/session_017dyPxGkLKcxgyECXkVKqae