# Loss of funds during user adjusting

PriceTierVestingSale claim() passes purchasedAmount to _executeClaim, overwriting admin-adjusted records[beneficiary].total and silently dropping the adjustment, causing user fund loss.

- Payout: Contest reward
- Severity: medium
- Program: Tokensoft
- Credited: 0xMAKEOUTHILL
- Disclosed: 2023-06-30
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2023-06-tokensoft-judging/issues/195
- Library page: https://bugbountylibrary.com/r/sherlock%3A2023-06-tokensoft%3AM-6
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** PriceTierVestingSale_2_0 / Distributor claim logic
**Root cause:** claim() calls _executeClaim with purchasedAmount rather than the adjusted records[beneficiary].total; _executeClaim re-initializes the record when total != purchasedAmount, wiping the admin's adjust() delta.
**Steps:**
1. User buys 200 FOO; initializeDistributionRecord sets records[beneficiary].total = 200.
2. Owner calls adjust() to raise total to 300.
3. User calls claim(); claim() reads purchasedAmount = 200 and calls _executeClaim(beneficiary, 200).
4. In _executeClaim, records[beneficiary].total (300) != totalAmount (200), so _initializeDistributionRecord(beneficiary, 200) resets total to 200.
5. User claims only 200; the 100 adjustment is lost.
**How found:** Code reading of claim()/_executeClaim: noticed _executeClaim is passed purchasedAmount while the re-init guard compares against records[beneficiary].total, so the guard triggers and overwrites the adjusted value.
**Exploitation:** No attacker action needed; any user claiming after an admin adjust() silently reverts their record to purchasedAmount, forfeiting the adjusted delta (upward or downward).
**Insight:** When a claim path re-initializes state based on a stale input (purchasedAmount) instead of the current stored total, any admin-side adjustment is silently clobbered on next claim; check every read of a mutable record for stale-source overwrites.
