Repository navigation
feat(tokens): add the CHYPE asset - #11
hubagaspar91 wants to merge 5 commits into
Conversation
The CHYPE bridge is the same contract as the BETH bridge, so both assets build the same depositETH call. DepositCall, DepositTarget and their builders now live in one crate-private module. tokens::beth::mint re-exports them, so every public BETH path stays the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CHYPE is HYPE bridged from HyperEVM to Canton. tokens::chype has the BETH API shape: the registrar and bridge of each network, the account, mint and burn flows, the credential filters, three examples and the chype 0.1.0 DAR. A CHYPE withdraw destination must not be a HyperEVM system address. The attestors never pay HYPE to one, and a burn cannot be undone. The localnet image moves to cbtc-6689a6a, which holds the CHYPE packages. CI skips the CHYPE live API checks, because the BitSafe API does not serve the CHYPE routes yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Factory report 1: requirements and implementation specPhases: requirements, implementation-spec. The product spec was skipped: the task is "CHYPE, same pattern as BETH", so the product is already defined. Size: medium. The change adds one asset module that copies an existing pattern. It touches no public BETH or CBTC path. Facts collected
Decisions
Considered and rejected
Agents
|
Factory report 2: implementationPhase: implementation. The orchestrator wrote the code itself. The change copies an existing pattern, so no implementer agent ran. What was done
Verification
Considered and rejected
Agents
|
The suite tested CHYPE deposits on devnet only and BETH's acceptance of one HyperEVM system address. These tests pin each network's bridge from the requirement literals, the documented deposit check order, the largest token system address, every system address BETH must accept, the CHYPE Daml field names, and that a CHYPE account does not compile in the BETH deposit call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Another client can create a CHYPE withdraw account that pays a HyperEVM system address. The burn now checks the account's address again, so it refuses a burn that never gets a payout. The check also refuses the CHYPE bridge proxies, because the bridge reverts a payout to itself. The docs now state the CHYPE limits, the missing API routes and the units. .env.example leaves the amounts unset, so each example uses its own default and a CHYPE run does not burn less than the bridge minimum. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Factory report 3: review and fixPhases: review, fix. Self-review ran once with Gate A, two Claude personas and a Codex lens. One fix round followed. The Codex lens then found nothing material. A second employee still has to do the peer review. Gate A: test audit
Findings and dispositions
Verification on
|
| Agent | Model | Effort | Task |
|---|---|---|---|
| Gate A test auditor | Claude Opus 5.5 | high | Test audit, 13 tests, CI watch |
| Security persona | Claude Opus 5.5 | high | Security lens, independent fact checks |
| Product-manager persona | Claude Opus 5.5 | high | Spec and docs lens |
| Codex lens | Codex GPT-6.1-Sol | high | Second-vendor review of 64fb991 |
| Orchestrator | Claude Opus 5.5 | high | Fix round, issues, reports |
|
The pilot decided to hold this PR until the BitSafe API serves the |
Factory report 4: human gate and devnet roundPhase: human-gate. The pilot made three decisions:
Registrar ids on the clustersThe orchestrator read the config maps of each cluster, read-only, with no secrets. Every id matches the crate.
Devnet round on
|
| Step | Result |
|---|---|
check_dars, ASSET=chype |
PASS: 22 of 22 packages, chype 0.1.0 among them |
chype_credentials |
Ran. The party has no CHYPE credential and no CHYPE offer yet. |
check_balance, ASSET=chype |
Ran: 0 CHYPE, 0 holdings |
list_incoming_offers, ASSET=chype |
Ran: no offers |
chype_mint_flow, chype_redeem_flow |
Not run: the BitSafe API has no /chype routes |
CI is green on 64fb991. The first localnet run failed on a registry rate limit, and the rerun passed.
Considered and rejected
- Add the CHYPE routes to the BitSafe API in this flow. The pilot chose to hold the PR instead.
- Read the party ids from cluster secrets. The config maps hold the ids, so the check read no secrets.
Agents
| Agent | Model | Effort | Task |
|---|---|---|---|
| Orchestrator | Claude Opus 5.5 | high | Cluster check, devnet round, report |
Factory report 5: devnet credential checkPhase: human-gate. The pilot offered the test party a CHYPE Minter credential in DecMan on devnet.
The orchestrator used a small read-only program for the check, because
|
The devnet BitSafe API now serves the CHYPE routes, and the read-only live check passes there. The testnet and mainnet APIs still redirect the CHYPE routes, so CI skips those networks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
This PR adds CHYPE, HYPE bridged from HyperEVM to Canton, as a third asset.
tokens::chypehas the same API shape astokens::beth.tokens::chypeholds the registrar and the bridge of each network, the account, mint and burn flows, and the credential filters.chype_credentials,chype_mint_flowandchype_redeem_flowcopy the BETH examples.dars/chype/chype-0.1.0.daris the releasedchype0.1.0 package. Its SHA-256 matches the release manifest.cbtc-6689a6a.Why
The CHYPE bridge is live on devnet, testnet and mainnet. Integrators need the same library support that BETH has.
How
depositETH(bytes)and has the same deposit unit. The first commit moves the BETH mint builders into one crate-private module, so both assets share them. The public BETH paths do not change.chypepackage useslastProcessedBlock,destinationAddressandtxId. The trait constants carry the first two; the crate never readstxId.create_withdraw_accountchecks the address, andsubmit_withdrawchecks the account's address again before the burn.0xfBC38458ffb91D6Fd731151D46345E89ffc42358chype-network::1220806e…2c520x1E5439257A314d11e6b0779297Ca92887Ed56087chype-network::12204c05…1db00x2940FcBb3C32901Df405da0E96fd97D1E2a53f34chype-network::1220cc3b…5956Known limit
The BitSafe API does not serve the
/chype/*routes yet. Until it does,get_account_contract_rulesandredeem::submit_withdrawfail for CHYPE. CI skips the CHYPE live API checks on all three networks for that reason.How tested
cargo fmt,cargo clippy --all-targets --all-features -D warningsandcargo testpass: 144 library tests, the public-surface tests and the doc tests.compile_faildoc tests prove that a BETH account cannot build a CHYPE deposit call, and the reverse.cbtc-6689a6a, with the CBTC, BETH and CHYPE phases.Size
The diff is larger than 400 lines. Most of it is the CHYPE tests and the three examples, which copy the BETH ones line for line.
🤖 Generated with Claude Code