# Bribe.sol is not meant to handle fee-on-transfer tokens

Bribe.sol credits the stated transfer amount rather than the received amount, so fee-on-transfer reward tokens leave the contract short and deliverReward reverts, locking rewards.

- Payout: Contest reward
- Severity: medium
- Program: Velodrome Finance
- Credited: MiloTruck
- Disclosed: 2022-08-08
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2022-05-velodrome-findings/issues/222
- Library page: https://bugbountylibrary.com/r/c4%3A2022-05-velodrome%3AM-05
- Tags: domain:web3 impact:dos impact:funds-loss kind:contest platform:code4rena sev:medium tech:evm tech:solidity vuln:accounting-error vuln:dos

**Target:** Bribe.sol reward accounting in Velodrome Gauge/Bribe contracts
**Root cause:** notifyRewardAmount() adds the requested `amount` to tokenRewardsPerEpoch after _safeTransferFrom, ignoring the fee deducted in transit, so the recorded reward exceeds the contract's actual balance.
**Steps:**
1. Deploy/whitelist a fee-on-transfer ERC20 (e.g. 2% fee) as a bribe reward token.
2. Call `bribe.notifyRewardAmount(feeToken, 100)`; contract receives 98 but `tokenRewardsPerEpoch[token][epoch]` is set to 100.
3. Advance to the epoch and call `voter.distro()` so the gauge calls `deliverReward(token, epochStart)`.
4. `_safeTransfer` attempts to send 100 with only 98 held, so the transfer reverts and rewards are stuck.
**How found:** Code reading of the deposit/withdraw accounting in Bribe.sol: noticed the credited amount equals the requested amount rather than the measured balance delta, then tested with a mock fee-on-transfer ERC20.
**Exploitation:** A bribe depositor (or attacker) adds a fee-on-transfer token via notifyRewardAmount; the shortfall makes deliverReward revert, blocking reward distribution. An attacker can repeat this to temporarily DOS a Gauge's bribe delivery until swapOutBribeRewardToken() is used.
**Escalation:** Scaling from a single stuck bribe to a temporary DOS of any Gauge's deliverBribes() by depositing a fee-on-transfer token.
**Insight:** When a contract records internal reward/accounting balances from a transfer's nominal `amount`, check whether the token can deduct fees in transit; compare balance-before/after instead. Any open reward-token whitelist invites this class of accounting mismatch.
