OpenZeppelin / OpenZeppelin/stellar-contracts
🎁 [Feature Request]: FungibleVault: support for overridable total_assets in conversion functions
@ozgunozerk is already working on this.
Since Apr 10, 2026.
- Dominant language
- Rust
- Stars
- 95
- Forks
- 68
- Avg merge
- 4d 42m
- Merged PRs (30d)
- 20
Description
What is the feature you would like to see?
The FungibleVault trait exposes total_assets as overridable, but the internal conversion functions (convert_to_shares_with_rounding, convert_to_assets_with_rounding) call Self::total_assets(e) directly on the Vault struct. Any custom total_assets on the trait is ignored by the conversion math that deposit, mint, withdraw, and redeem all depend on.
Since Vault::total_assets is hardcoded to the contract's on-chain token balance, it's impossible to build yield-bearing vaults that deploy assets into external protocols (e.g. Blend). Share pricing will only reflect assets sitting idle in the contract, not the total managed position.
On Ethereum's ERC-4626, overriding totalAssets() flows through to all conversion logic, enabling strategy/debt-accounting patterns (e.g. Yearn). The Stellar vault currently lacks this capability.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.