Gorgeous Jade Falcon
High
A lack of adjustment for fee-on-transfer tokens will cause an ongoing loss of funds for the contract as the swapper
role calls _buyBack
, feeDispersal
, and _stablecoinSwap
, which do not account for fee deductions on transfers.
- _buyBack: 224 lacks logic to account for tokens that charge fees on transfers.
- _feeDispersal: 183 omits validation for reduced token amounts from fees.
- _stablecoinSwap in StablecoinHandler.sol: 144 does not handle deductions on fee-on-transfer tokens.
Swapper
role needs to initiate a swap or buyback with a fee-on-transfer token.- The contract holds fee-on-transfer tokens that are processed through one of these functions.
- Fee-on-transfer token deducts a percentage from each transfer.
- No adjustments in the code for receiving the reduced amounts.
Swapper
role initiates a buyback or swap with a fee-on-transfer token.- The transfer takes place, reducing the actual token amount by a fee.
- The contract performs the operation with the deducted token amount, resulting in a silent loss of funds.
The protocol suffers an ongoing loss of any tokens transferred with a fee. Depending on usage, this could accumulate into a significant amount over time, reducing available funds for swaps and buybacks.
No response
Update _buyBack
, feeDispersal
, and _stablecoinSwap
to adjust for reduced token balances after transfers. Add checks to verify the received amount and recalibrate the expected amount for each transaction