/bounty-methodology:cctp-vault-rebalance-integratefrom bounty-methodology
Integrate Circle CCTP for vault/inventory rebalance: depositForBurn, receiveMessage, destinationCaller binding, FAST fees, planned vs measured mint amounts. Use when building cross-chain vaults, inventory ledgers, or rebalance managers on CCTP.
Ships in bounty-methodology. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
CCTP moves USDC (or supported stable) across domains:
Source vault: depositForBurn(amount, dstDomain, mintRecipient, token, destinationCaller, maxFee, finality)
Destination: receiveMessage(message, attestation) → mint to mintRecipient
Your ledger: credit inventory only from measured mint (or trusted fail handling)
1. Source chain ledger marks rebalance Pending; vault burns via TokenMessenger
2. Set mintRecipient = destination vault
3. Set destinationCaller = destination vault // CRITICAL
4. Attestation service signs message
5. Destination vault (only) calls receiveMessage inside rebalanceMint
6. Credit inventory with balanceAfter - balanceBefore (measured)
7. Mark rebalance success; enable withdraws against new inventory
| Setting | Effect |
|---|---|
| destinationCaller = dst vault | Only vault can receiveMessage — blocks unprivileged frontrun of mint |
| destinationCaller = 0 | Anyone can receiveMessage — integrator must not credit planned amount on race/error |
Security lesson: if catch-path credits planned data.amount on "Nonce already used", attackers can only force that if they can call receiveMessage first. Binding destinationCaller to the vault closes that class. See skill:cctp-destination-caller.
balanceOf(vault) after − before// Pattern on destination vault (simplified)
uint256 before = token.balanceOf(address(this));
messageTransmitter.receiveMessage(message, attestation);
uint256 minted = token.balanceOf(address(this)) - before;
// credit ledger with minted — not the original planned burn amount
If a separate VaultManager tracks tokenBalanceOnchain:
balanceOf| Footgun | Fix |
|---|---|
Credit data.amount on any catch | Measure balance or hard-fail |
| destinationCaller = 0 for convenience | Use vault address |
| Double finishMint without Pending guard | Status machine: Pending → Succ/Fail once |
| Assuming attestation is free | Keepers submit attestation; fund gas |
| Ignoring FAST fee | UX shows expected net; ledger uses net |
skill:cctp-destination-caller — security triage for catch/credit bugsWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub cyotee/cyotee-claude-plugins --plugin bounty-methodology8 skills in this plugin
/async-vault-nav-freshnessReviews ERC-7540 / async deposit-redeem vaults with on-chain NAV: invalidate maps, ownership nonces, calculator versions, claim algebra, idle reservations. Use for PortfolioVault-style funds, Enzyme Onyx queues, or any async vault that freezes share price at approval.
/cctp-destination-callerReviews CCTP (Circle Cross-Chain Transfer Protocol) integrations for inventory desync: destinationCaller binding, Nonce already used catch paths, FAST fees, planned vs measured mint amounts. Use when auditing Vault.rebalanceMint-style CCTP burn/mint inventory accounting.
/Other plugins' skills for the same job