Fee on transfer token will cause revert if balance is lesser than the input value
Vulnerability Detail
If order.asset is a fee-on-transfer token, the amount transferred into the contract will be lesser than the input value, This will cause users to loose tokens and will revert if the balance is lesser than the value stored in the order
Impact
Function reclaimContract will revert if balance is lesser than the bullAssetAmount
saian
low
Fee on transfer tokens is not supported
Summary
Fee on transfer token will cause revert if balance is lesser than the input value
Vulnerability Detail
If order.asset is a fee-on-transfer token, the amount transferred into the contract will be lesser than the input value, This will cause users to loose tokens and will revert if the balance is lesser than the value stored in the order
Impact
Function
reclaimContract
will revert if balance is lesser than the bullAssetAmountCode Snippet
https://github.com/sherlock-audit/2022-11-bullvbear/blob/main/bvb-protocol/src/BvbProtocol.sol#L437
https://github.com/sherlock-audit/2022-11-bullvbear/blob/main/bvb-protocol/src/BvbProtocol.sol#L861
Tool used
Manual Review
Recommendation
Store the before and after balance and use the difference as order price