Closed code423n4 closed 2 years ago
If this were to occur, the admin could raise the fee to correct the issue. But adding a require (or addressing the 0 fee scenario) is a good consideration. Merging with the warden's QA report https://github.com/code-423n4/2022-06-infinity-findings/issues/209
Lines of code
https://github.com/code-423n4/2022-06-infinity/blob/765376fa238bbccd8b1e2e12897c91098c7e5ac6/contracts/core/InfinityExchange.sol#L899
Vulnerability details
Description
While unlikely, should the protocol fee be set to zero, it is possible for orders to revert if the buy token is an ERC20 that reverts on zero amount transfers (Eg. BNB).
Recommended Mitigation Steps
Only execute the
safeTransferFrom()
if protocol fee is non-zero.