/bounty-methodology:erc7540-async-vault-integratefrom bounty-methodology
Integrate with ERC-7540-style async deposit/redeem vaults: request → manager approve → claim, controllers/operators, NAV freshness for quotes, idle reserves. Use when building frontends, keepers, or contracts that deposit/redeem into async funds (PortfolioVault-class, Enzyme Onyx queues, similar).
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.
Unlike ERC-4626 instant mint/redeem, async vaults freeze share price at approval:
Deposit: requestDeposit(assets) → [manager] approveDeposit → deposit/mint claim shares
Redeem: requestRedeem(shares) → [manager] approveRedemption → redeem/withdraw claim assets
convertToShares / sharePrice often read last finalized NAV, not live NAV. Do not quote them as a real-time oracle after invalidation.
1. Ensure user has SHAREHOLDER / whitelist role if gated
2. ERC20 approve vault (or permit) for assets
3. requestDeposit(assets, controller, owner)
- assets move to vault; pendingDeposit[controller] += assets
4. Off-chain / keeper: wait for manager approveDeposit(controller, assets')
- price locked: shares minted to vault; claimableDeposit* set
5. deposit(assets') or mint(shares') to claim to receiver
6. Optional: cancelDepositRequest only while still pending (pre-approve)
1. requestRedeem(shares, controller, owner) — shares locked on vault
2. Manager approveRedemption — burns shares, reserves claimable assets from idle
3. redeem/withdraw claim assets to receiver
4. cancelRedeemRequest only while pending
setOperator(operator, true) so a keeper can call request/claim on their behalf| Signal | Integrator action |
|---|---|
| NAV computation mid-cycle / invalidated | Disable deposit/redeem approval quotes; show “NAV updating” |
lastNav == 0 / ZeroNav | Bootstrap/seed required; do not promise mint |
maxNavAge exceeded | Treat price as stale until updateNav finalizes |
| Holdings nonce / calculator version change | Mid-cycle restart — wait for finalize |
Backend/keepers that call approveDeposit/approveRedemption must enforce fresh NAV (idle, nonce, version, age). See skill:async-vault-nav-freshness.
idle ≈ balance − pendingDeposits − claimableRedeems
| Footgun | Correct behavior |
|---|---|
| Treat convertToShares as live TWAP | Use only after fresh NAV finalize; document staleness |
| Claim before approve | Reverts / zero claimable |
| minOut=0 on related swaps elsewhere | Separate from vault claim algebra |
| Controller ≠ owner without operator | Only controller/operator can claim |
| Partial claim dust | Floor math may leave dust; claim full when possible |
| Open vault sale offers vs NAV | Backend should block share approvals while vault is active seller (if protocol uses loan NFT listings) |
skill:async-vault-nav-freshness — security invalidate mapWhat 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