OpenZeppelin / OpenZeppelin/stellar-contracts

🎁 [Feature Request]: FungibleVault: support for overridable total_assets in conversion functions

Open
#674 1 comment 0 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.