# `Strategy::checkPoolActivity()` incorrect check leads to vulnerable price

Yieldoor Strategy's checkPoolActivity checks timestamp==0 but Uniswap grow sets it to 1, allowing rebalance with invalid TWAP price and user fund loss.

- Payout: Audit contest
- Severity: medium
- Program: Yieldoor
- Found by: 0x73696d616f
- Disclosed: 2025-02-21
- Write-up quality: 7/10
- Original: https://github.com/sherlock-audit/2025-02-yieldoor-judging/issues/96
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-02-yieldoor%3AM-4
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:evm tech:solidity technique:source-review vuln:business-logic vuln:oracle-manipulation

**Target:** Strategy contract checkPoolActivity TWAP validation
**Root cause:** checkPoolActivity reverts only if timestamp==0, but Uniswap's grow() sets new observation timestamps to 1 for gas savings, so the invalid observation is not caught and the function returns true.
**Steps:**
1. Increase cardinality in the Uniswap V3 pool, causing grow() to set new observation blockTimestamp to 1.
2. Call rebalance; checkPoolActivity loops over observations and hits timestamp 1.
3. Because timestamp != 0, the revert is skipped; tick delta calculation may not revert and function returns true with invalid price.
4. Rebalance proceeds using the unvalidated price, depositing liquidity at an unfavorable price.
**How found:** Code review of checkPoolActivity's timestamp check against Uniswap's Oracle.grow() implementation, noticing the mismatch between expected 0 and actual 1.
**Exploitation:** Attacker or user increases pool cardinality to set observation timestamps to 1, then triggers a rebalance that passes the flawed check, causing liquidity to be deposited at a bad price and users to lose funds.
**Insight:** When validating oracle observations, check for sentinel values like 1 set by Uniswap's grow() for gas savings, not just 0; cross-reference with Uniswap core code.

## Proof of concept (copied exactly from the original report)

**Uniswap Oracle.grow sets timestamps to 1**

```
function grow(
        Observation[65535] storage self,
        uint16 current,
        uint16 next
    ) internal returns (uint16) {
        require(current > 0, 'I');
        // no-op if the passed next value isn't greater than the current next value
        if (next <= current) return current;
        // store in each slot to prevent fresh SSTOREs in swaps
        // this data will not be used because the initialized boolean is still false
        for (uint16 i = current; i < next; i++) self[i].blockTimestamp = 1;
        return next;
    }
```

**Mitigation check for timestamp 1**

```
if (timestamp == 1) {
                revert("timestamp 1");
            }
```

