# Targeted-lockup bypass: freshly minted shares can be transferred immediately in the same `transfer()` or `transferFrom()` call

TokenizedShareManager checks lock before claimShares mints new shares, so freshly minted locked shares can be transferred out in the same transfer() call.

- Payout: Audit contest
- Severity: medium
- Program: Mellow Flexible Vaults
- Found by: rsam_eth
- Disclosed: 2025-07-12
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2025-07-mellow-flexible-vaults-judging/issues/617
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-07-mellow-flexible-vaults%3AM-6
- Tags: area:web3 domain:web3 impact:integrity kind:contest platform:sherlock sev:medium tech:evm tech:solidity technique:source-review vuln:business-logic

**Target:** TokenizedShareManager ERC-20 share token _update hook
**Root cause:** _update runs updateChecks(from,to) before claimShares(from) mints allocated shares and sets a new lockedUntil; the subsequent super._update moves the just-minted shares without re-checking the lock.
**Steps:**
1. Ensure targetedLockup > 0 and Alice has >=1 allocated unclaimed shares with expired lockedUntil.
2. Alice calls `share.transfer(bob, 100)`.
3. Outer `_update(Alice,Bob)` passes `updateChecks` (lock expired).
4. `claimShares(Alice)` mints 100 shares via ERC20 `_mint` (inner `_update(0,Alice)` skips lock check), then sets `accounts[Alice].lockedUntil = now + targetedLockup`.
5. `super._update(Alice,Bob,100)` transfers the freshly minted shares to Bob in the same tx.
**How found:** Code reading of _update ordering: noticed updateChecks precedes claimShares, and mint sets lockedUntil after the inner _mint's lock check already passed.
**Exploitation:** Holder of allocated-but-unclaimed shares transfers them out immediately upon mint, bypassing the intended cooling-off lock; shares arrive liquid at recipient while sender's lock is moot since balance is zero.
**Insight:** When a token hook both validates and lazily mints, check the ordering of validation vs mint side-effects; a mint triggered inside the transfer path can bypass the lock set immediately after.

