collectUsdcFromSelling is intended to retain protocol fees inside the contract and forward the remainder to the seller.
The function calls usdc.safeTransfer(address(this), fees) — a transfer from the contract to itself. For standard ERC20 tokens this is a no-op (the balance does not change), but the fees are already inside the contract from the earlier buy() call and need not be moved at all. The explicit self-transfer is misleading and will revert on tokens that disallow transfers to the sender (some non-standard ERC20 implementations), making collectUsdcFromSelling completely non-functional in those deployments.
Likelihood: Low
With the intended USDC token, this line executes on every collectUsdcFromSelling call but causes no observable effect — the transfer completes as a no-op.
Impact only materialises when a non-standard ERC20 that reverts on self-transfers is configured as the payment token at deploy time.
Impact: Low
With standard USDC the call wastes gas and misrepresents intent but causes no fund loss.
With an ERC20 that disallows self-transfers, collectUsdcFromSelling becomes permanently non-functional for all sellers, preventing them from ever collecting sale proceeds.
The test confirms that the self-transfer is a no-op with standard USDC: the contract balance after the call equals exactly the fees, meaning fees stayed in the contract naturally and the safeTransfer(address(this), ...) line contributed nothing.
Remove the self-transfer line from collectUsdcFromSelling. Fees remain in the contract automatically because the buyer's USDC was already transferred to the contract in buy() and only the seller's portion needs to be explicitly forwarded.
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.
The contest is complete and the rewards are being distributed.