The fundAndBribe function can not be used with tokens that have a fee on transfer
Summary
The fundAndBribe function can not be used with tokens that have a fee on transfer.
Vulnerability Detail
The fundAndBribe function in the BribeReward contract does not work with tokens that have a fee on transfer. After transferring totalAmount to the contract, the _bribe function checks if the current balance of the contract is less than the total amount, which is true because tokens with a fee on transfer result in the contract receiving fewer tokens than transferred.
Real Sand Viper
Low/Info
The fundAndBribe function can not be used with tokens that have a fee on transfer
Summary
The
fundAndBribe
function can not be used with tokens that have a fee on transfer.Vulnerability Detail
The
fundAndBribe
function in theBribeReward
contract does not work with tokens that have a fee on transfer. After transferringtotalAmount
to the contract, the_bribe
function checks if the current balance of the contract is less than the total amount, which is true because tokens with a fee on transfer result in the contract receiving fewer tokens than transferred.The whole transaction will revert, and the contract will not be funded and bribed.
Impact
The
fundAndBribe
function can not be used with tokens that have a fee on transfer.Tool used
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/rewarders/BribeRewarder.sol#L111
Manual Review
Recommendation
Add support for fee on transfer tokens to the Bribe reward contract.