# ERC4626 mint uses wrong amount

ERC4626.mint mints `amount` assets as shares instead of `shares`, letting users over-mint shares and redeem a profit from the vault.

- Payout: Audit contest
- Severity: high
- Program: Tribe
- Found by: cmichel
- Disclosed: 2022-04-19
- Write-up quality: 7/10
- Original: https://github.com/code-423n4/2022-02-tribe-turbo-findings/issues/27
- Library page: https://bugbountylibrary.com/r/c4%3A2022-02-tribe-turbo%3AH-01
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error

**Target:** ERC4626 vault contract (TurboSafe)
**Root cause:** mint() calls _mint(to, amount) using the asset amount from previewMint instead of the requested shares, so shares credited exceed shares paid for whenever asset<>share ratio is not 1:1.
**Steps:**
1. Set vault state totalSupply=1000, totalAssets=1500 (ratio 1.5).
2. Call `mint(shares=1000)`; previewMint returns amount=1500... but code mints `amount` shares; pay amount assets, receive `amount` shares.
3. Call `redeem(shares=1000)` to withdraw (1000/2000)*2500=1250 assets.
4. Repeat while ratio != 1:1 to drain vault.
**How found:** Code review of ERC4626.mint against the ERC4626 spec, noticing _mint uses `amount` rather than `shares` and reasoning about non-1:1 asset/share ratios.
**Exploitation:** Attacker mints shares paying only the asset amount but receiving that amount as shares; since shares are worth more than assets in a yield-bearing vault, redeeming yields more assets than paid, extracting profit repeatedly until ratio converges to 1:1.
**Insight:** In ERC4626 implementations, verify that mint credits exactly `shares` and deposit credits shares computed from assets; any mismatch between the credited share variable and the parameter becomes profitable once the vault accrues yield (ratio != 1:1).
