WildcatMarketController Line 345
The MarketControllerFactory allows for setting an originationFeeAsset, as well as originationFeeAmount, which are used to send a fee to the recipient each time a new market is deployed. When a market is deployed, the originationFeeAmount of the originationFeeAsset is transferred from the borrower to the feeRecipient. There is one additional check in place that verifies if the originationFeeAsset address is 0 and only transfers a fee if it is not zero.
The issue with this implementation is that some tokens, like LEND, may revert in case of a zero transfer. This means that if a token like LEND is set as the originationFeeAsset, and later on the fee is reduced to zero, this function will always fail to execute, preventing any new markets from being deployed.
Additionally, not checking for zero transfers could lead to gas waste in the case of a token that does not revert but simply transfers nothing during a zero transfer.
To fix this issue, an additional check needs to be added to the if clause, ensuring that originationFeeAmount is greater than zero:
