# copy paste error in _batchConfirmOutstandingPendingActions

Copy-paste error in LongShort.sol resets the wrong market-side batch accumulator, so SHORT-to-LONG shift amounts never clear and inflate token shifts.

- Payout: Audit contest
- Severity: high
- Program: Float Capital
- Found by: gpersoon
- Disclosed: 2021-09-16
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2021-08-floatcapital-findings/issues/5
- Library page: https://bugbountylibrary.com/r/c4%3A2021-08-floatcapital%3AH-01
- Tags: area:web3 domain:web3 impact:integrity kind:contest platform:code4rena sev:high tech:solidity technique:source-review vuln:accounting-error

**Target:** LongShort.sol smart contract batch action processing
**Root cause:** In _batchConfirmOutstandingPendingActions the second branch reads batched_amountSyntheticToken_toShiftAwayFrom_marketSide[marketIndex][false] but zeroes the [true] slot, so the false-side accumulator is never reset.
**Steps:**
1. Read _batchConfirmOutstandingPendingActions in LongShort.sol around L1126.
2. Observe first branch reads [true] and zeroes [true] correctly.
3. Observe second branch reads [false] but zeroes [true] instead of [false].
4. Trigger repeated batch confirmations; the [false] accumulator persists and accumulates across calls.
**How found:** Code review of the batch confirmation function; spotted the asymmetric reset where the false-side read was paired with a true-side zeroing, indicating a copy/paste error.
**Exploitation:** Repeated batch confirmations cause the unreset [false] accumulator to keep growing, so internal accounting shifts far too many synthetic tokens from SHORT to LONG, corrupting market state.
**Insight:** In paired true/false (or long/short) branches, diff the read index against the write index line by line; a mismatched reset leaves one accumulator permanently live and compounding.

