Closed sherlock-admin closed 1 year ago
Please view readme:
Additionally we will only use DAI or maybe USDC as a payment token. Any further payment token will be analysed deeply before use (payment tokens with transfer fees etc will be problematic to the system - we are aware of this).
ctf_sec
medium
Incompatible with fee-on-transfer token
Summary
Incompatible with fee-on-transfer token
Vulnerability Detail
In the function _mint, we use the amount user passed in for accounting, but not check the actual account we received.
and
Impact
Some tokens take a transfer fee (e.g. STA, PAXG), some do not currently charge a fee but may do so in the future (e.g. USDT, USDC).
For example, if the token charge 1% transfer fee, the user wants to mint 100 amount, but the contract actually receive 99 amount.
but the code assumes that we receive 100 token and use the number 100 for accounting.
Code Snippet
https://github.com/sherlock-audit/2022-11-float-capital/blob/main/contracts/market/template/MarketCore.sol#L252-L307
Tool used
Manual Review
Recommendation
We recommend the project use before and after balance check to check how many token we actually receive instead of assume we received the exact token amount from user's input.