Security guide

ERC-4626 Vault Audit: Rounding, Donations and Withdrawals

Scope an ERC-4626 vault audit around share accounting, inflation attacks, donation handling, liquidity, fees, and integrations that value vault shares.

An ERC-4626 interface does not establish the safety of a vault's strategy or its integrations. Review how assets become shares, how shares become assets, and who absorbs rounding, losses, and fees.

Start with the exchange-rate model

OpenZeppelin's ERC-4626 documentation explains how donations and rounding can affect share issuance, including inflation attacks against vulnerable vault designs. It also describes defenses used in its implementation. Source 1 is implementation guidance, not evidence that every contract using the interface has the same behavior. Audit the actual version, overrides, and integration assumptions.

Example: accepting a deposit with too little protection

Consider a user who previews a deposit and submits later. In between, another operation changes the share price. Test the shares actually minted and whether the transaction enforces the user's acceptable outcome. Repeat with a small deposit and with assets sent directly to the vault. The review question is whether a user can receive an unintended economic result despite a technically successful call.

Write accounting properties for sequences

Define how total assets, shares, strategy positions, pending fees, and realized losses relate. Test sequences of deposit, withdrawal, donation, fee collection, and strategy updates. Identify which values are estimates and which are immediately available. A single conversion unit test cannot establish the consistency of a vault across all those transitions.

Separate asset value from available liquidity

A vault may report assets that cannot all be withdrawn immediately. Document how strategy exits, queues, paused markets, or losses affect redemption. Test multiple users leaving at different times and determine whether the order creates an unintended advantage. If asynchronous withdrawal behavior exists, include the queue and its permissions in the review scope.

Review downstream use of shares

When a lending market accepts vault shares as collateral, the share-price adapter becomes a separate risk boundary. Test whether direct donations, strategy valuation changes, or stale information can affect borrowing power. Agree on what prevents a temporary valuation change from creating debt that the collateral cannot ultimately cover.

What auditors need

Provide the vault implementation, strategies, fee model, share-price consumers, accepted assets, and the intended rounding rules. Include economic examples for gains, losses, and insufficient liquidity. Scope integrations separately where another protocol interprets the vault's accounting in a way that can affect funds.

Review Checklist

  • Test empty and near-empty vault states with donations.
  • Exercise minimum acceptable outcomes and fee rounding.
  • Verify redemption behavior during strategy losses and restricted liquidity.

Sources and Further Reading

  1. OpenZeppelin: ERC-4626 security considerations

The linked sources describe the standards or research discussed above. Review scenarios are practical planning examples, not findings from an audit of a specific project.

Discuss Your Audit Scope

Start with your email and a short project description. Technical details can follow. Request a smart contract audit quote or review public CTDSEC audit examples.

Discuss a vault and strategy audit

Tell us what you are building and the security questions your team needs answered. We can clarify the scope together.

Get an Audit Quote