# Exchange rate is calculated incorrectly when the vault is closed, potentially leading to funds being stolen

AsyncSynthVault double-adds +1 to cached epoch totals in _convertToAssets/_convertToShares, mispricing shares when vault is closed and letting attackers over-mint shares.

- Payout: Contest reward
- Severity: high
- Program: Amphor
- Credited: Darinrikusham
- Disclosed: 2024-03-04
- Write-up quality: 8/10
- Original: https://github.com/sherlock-audit/2024-03-amphor-judging/issues/131
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-03-amphor%3AH-3
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:chained technique:source-review vuln:business-logic vuln:precision-loss vuln:share-inflation

**Target:** AsyncSynthVault.sol share/asset conversion (_convertToAssets/_convertToShares)
**Root cause:** previewSettle already adds +1 to totalAssetsSnapshotForDeposit/Supply and Redeem/Supply, but _convertToAssets and _convertToShares add another +1 to those cached values, so closed-vault conversions diverge from open-vault math whenever the ratio isn't 1:1.
**Steps:**
1. Attacker donates `1e18-1` assets to the vault address before/at deployment to raise share price.
2. Protocol bootstraps `1e18` and users deposit `10e18`; vault is closed and users requestDeposit `15e18`.
3. Attacker computes `minToDepositToGetOneShare = (lastSavedBalance+2)/(totalSupply+2)` and frontruns `open()` with 30 fresh accounts each calling `requestDeposit(minToDepositToGetOneShare,...)`.
4. Vault opens with `open(lastSavedBalance)`; attacker calls `claimDeposit` then `redeem` full balance per account.
5. Assert `totalRedeemed > totalDeposited + donation` — attacker profits (~1.69 ETH in PoC), stealing shares from the claimable silo.
**How found:** Code reading of _convertToAssets/_convertToShares revealed a redundant +1 on top of previewSettle's +1, then reasoned that closed-vault conversions diverge from open-vault math and built a Foundry PoC to confirm profit.
**Exploitation:** Attacker frontruns vault open() with many minimum-size deposit requests from fresh EOAs, exploiting the inflated share conversion to receive more shares than deposited, then claims and redeems immediately for profit at other users' expense.
**Escalation:** Scales by using many accounts each depositing the minimum to mint 1 share, multiplying the rounding gain.
**Insight:** When a protocol uses virtual shares/assets (+1 offsets) for inflation-attack protection, check every conversion path for double-application of the offset — especially snapshot/cached values written in one function and re-offset in another.
