# Strategy can't earn yields for user as underlyingBalance is not updated when strategy deposits

Popcorn AdapterBase.strategyDeposit fails to increase underlyingBalance, so convertToUnderlyingShares returns 1:1 and strategy yields never accrue to users.

- Payout: Contest reward
- Severity: medium
- Program: Popcorn
- Credited: rvierdiiev
- Disclosed: 2023-09-07
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2023-01-popcorn-findings/issues/467
- Library page: https://bugbountylibrary.com/r/c4%3A2023-01-popcorn%3AM-18
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:reward-distribution

**Target:** AdapterBase / BeefyAdapter vault share accounting
**Root cause:** strategyDeposit calls _protocolDeposit without incrementing underlyingBalance, so underlyingBalance stays equal to totalSupply and share conversion is always 1:1.
**Steps:**
1. Read AdapterBase.sol L158-160: underlyingBalance updated only on user deposit/withdraw, totalSupply minted/burned only then.
2. Read strategyDeposit (L456-461): only calls _protocolDeposit(amount, shares), no underlyingBalance increment.
3. Read BeefyAdapter.convertToUnderlyingShares: shares.mulDiv(underlyingBalance, supply).
4. Observe underlyingBalance == supply after strategy deposit, so mulDiv returns shares unchanged; harvest yields never reflected.
**How found:** Code reading of share-conversion math: noticed underlyingBalance only changes on user deposit/withdraw, then traced strategyDeposit and saw it never updates the variable, making the ratio constant.
**Insight:** When auditing vault adapters, check every path that moves assets (strategy deposit/harvest) updates the accounting variable used in share conversion, not just user-facing deposit/withdraw.
