Skip to content

feat(cast): add ERC-4626 commands - #16601

Merged
mattsse merged 2 commits into
masterfrom
mattsse/cast-erc4626
Sep 3, 2026
Merged

feat(cast): add ERC-4626 commands#16601
mattsse merged 2 commits into
masterfrom
mattsse/cast-erc4626

Conversation

@mattsse

@mattsse mattsse commented Sep 3, 2026

Copy link
Copy Markdown
Member

Adds cast erc4626 (with cast vault as an alias) for all sixteen ERC-4626-specific methods in the synchronous base interface. Read commands accept the usual RPC and block options, while deposit, mint, withdraw, and redeem use ABI-generated calldata and the shared cast send transaction path so wallet, browser, and Tempo behavior stays aligned with the generic sender. The vault's inherited ERC-20 share operations remain available through cast erc20.

The command emits targeted compatibility guidance when a vault reports conservative zero deposit or mint maxima, when it reports a zero exit maximum for an owner that still has shares, and when asset() returns the ERC-7535 native-asset sentinel. Failed preview calls also explain the intentional ERC-7540 asynchronous-vault behavior. End-to-end coverage executes every base selector against a local writable vault, uses a table-driven fixed-block Ethereum fork for Morpho MetaMorpho, Yearn V3, and Maple syrupUSDC, and runs the same complete read surface through a pinned Tempo mainnet fork of this Morpho-style vault.

Follow-ups

Separate changes can add ERC-7540 request/claim flows and ERC-7575 multi-asset share discovery, first-class ERC-7535 native-value writes, slippage-bounded ERC-5143 or router-style operations, permit/approval composition, and a richer vault summary or position command with asset/share unit formatting. Keeping those extensions outside this PR leaves the initial surface exactly aligned with the broadly deployed synchronous ERC-4626 selectors.

Codex was used for protocol research, implementation, tests, and PR text.

Expose every synchronous ERC-4626 vault selector through Cast, with compatibility warnings and local plus production-fork coverage.
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

✅ Changelog found

The deterministic check will validate the changed entry.

Add a pinned Tempo mainnet fork test for the requested Morpho-style vault and reuse the production read-surface assertions across networks.
Comment thread crates/cast/src/cmd/erc4626.rs
@mattsse
mattsse merged commit 239283e into master Sep 3, 2026
28 checks passed
@mattsse
mattsse deleted the mattsse/cast-erc4626 branch September 3, 2026 22:28
@github-project-automation github-project-automation Bot moved this to Done in Foundry Sep 3, 2026
@mattsse
mattsse restored the mattsse/cast-erc4626 branch September 3, 2026 22:33
@mattsse
mattsse deleted the mattsse/cast-erc4626 branch September 3, 2026 22:35
mattsse added a commit to mattsse/foundry-book that referenced this pull request Sep 3, 2026
Add an authored guide for synchronous tokenized-vault workflows and generated reference pages for every cast erc4626 subcommand. Keep the reference generator grouping the command family under Vault Commands.\n\nDocuments foundry-rs/foundry#16601.
mattsse added a commit to foundry-rs/book that referenced this pull request Sep 3, 2026
* docs(cast): document ERC-4626 commands

Add an authored guide for synchronous tokenized-vault workflows and generated reference pages for every cast erc4626 subcommand. Keep the reference generator grouping the command family under Vault Commands.\n\nDocuments foundry-rs/foundry#16601.

* docs(cast): add ERC-4626 inspection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants