# Users are unable to mint shares from a public vault using AstariaRouter contract when share price is bigger than one

AstariaRouter.mint approves only `shares` of the asset token, but ERC4626Cloned.mint pulls `assets` (shares rounded up by share price), so minting reverts once share price exceeds 1.

- Payout: Contest reward
- Severity: medium
- Program: Astaria
- Credited: rbserver
- Disclosed: 2023-05-22
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2023-01-astaria-findings/issues/488
- Library page: https://bugbountylibrary.com/r/c4%3A2023-01-astaria%3AM-05
- Tags: domain:web3 impact:dos kind:contest platform:code4rena sev:medium tech:evm tech:solidity vuln:accounting-error vuln:dos

**Target:** AstariaRouter / ERC4626RouterBase.mint on public ERC4626 vault
**Root cause:** ERC4626RouterBase.mint approves the vault for `shares` of the asset token, but ERC4626Cloned.mint transfers `previewMint(shares)` = shares.mulDivUp(totalAssets(), supply) assets, which exceeds the allowance once share price > 1.
**Steps:**
1. Create public vault, lend 50 ether so share price = 1.
2. Borrower takes 10 ether lien; warp 9 days and repay so share price > 1.
3. Bob deposits WETH and transfers 50 ether to ASTARIA_ROUTER.
4. Call `ASTARIA_ROUTER.mint(IERC4626(publicVault), bob, 1 ether, type(uint256).max)`.
5. Observe revert `TRANSFER_FROM_FAILED` because assets > approved shares.
**How found:** Code reading of ERC4626RouterBase.mint approving `shares` versus ERC4626Cloned.mint pulling `previewMint(shares)` assets; recognized divergence once mulDivUp(totalAssets(), supply) > 1.
**Exploitation:** Not an attack; functional DoS. Any user calling AstariaRouter.mint on a vault whose share price exceeds 1 hits insufficient allowance and cannot mint, losing access to maxAmountIn slippage control.
**Insight:** When a router approves a vault on behalf of itself, check whether the vault pulls `assets` (rounded up) rather than `shares`; any ERC4626 wrapper that rounds previewMint up will break router-mediated mints once share price exceeds 1.
