The main functions of the Premarkets contract createOffer, createTaker, listOffer, relistOffer would be bricked if USDC starts charging a fee.
The createOffer, createTaker, listOffer, relistOffer function in the Premarkets contracts calls the tillIn function in the `TokenManager` contract to handle the token transfers between the sender, the capital Pool and the Token manager, this function uses an internal _transfer function to handle the accounting of these transfers, this internal function calculates the balance of the `from` and `to` addresses before and after the transfer and then validates and reverts the transaction if the balances after is different from the balances before minus the amount transferred.
This design won't work with ERC20s that currently implement or may implement fees on transfers in the future, like USDT and USDC, as USDC is an upgradeable token, they can implement fees on transfers in the future, and as the protocol is using USDC and its intention is to work with every ERC20 token, this will brick the main functionality of the PreMarkets contract because the _transfer function will revert when the function checks if the balances after are equal to the balances before minus the amount transferred.
All the main functions of the PreMarket contract will be bricked.
Manual Code Review
update the last if's of the _transfer function to account for fee on transfer tokens.
Valid medium, there are disruptions to the ability to take market actions. The following functions will be disrupted without the possibiliy of reaching settlement, since the respective offers cannot be created/listed regardless of mode when transferring collateral token required to the CapitalPool contract or when refunding token from user to capital pool during relisting. So withdrawal is not an issue - `createOffer()` - reverts [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L96-L102) - `listOffer()` - reverts [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L355-L362) - `relistOffer()` - reverts [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L515-L521) - `createTaker()` - reverts [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L831-L836) I believe medium severity is appropriate although the likelihood is high and impact is medium (only some level of disruption i.e. FOT tokens not supported and no funds at risk)
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.