Submitted by MiloTruck, also found by 0x52, Dravee, IllIllI, MaratCerby, unforgiven, and WatchPug
Bribe.sol#L50-L51
Bribe.sol#L83-L90
Should a fee-on-transfer token be added as a reward token and deposited, the tokens will be locked in the Bribe contract. Voters will be unable to withdraw their rewards.
Tokens are deposited into the Bribe contract using notifyRewardAmount(), where amount of tokens are transferred, then added directly to tokenRewardsPerEpoch[token][adjustedTstamp]:
Tokens are transferred out of the Bribe contract using deliverReward(), which attempts to transfer tokenRewardsPerEpoch[token][epochStart] amount of tokens out.
If token happens to be a fee-on-transfer token, deliverReward() will always fail. For example:
The following test, which implements a MockERC20 with fee-on-transfer, demonstrates this:
On a larger scale, a malicious attacker could temporarily DOS any Gauge contract. This can be done by:
The only way to undo the DOS would be to call swapOutBribeRewardToken() and swap out the fee-on-transfer token for another valid token.
pooltypes (Velodrome) acknowledged and commented:
Alex the Entreprenerd (judge) commented:
