Market deployment revert if originationFeeAsset does not support 0 value transfer while originationFeeAmount is 0
Proof of Concept
The owner of ArchController can add a hook template by calling HooksFactory#addHooksTemplate().
A borrower can create their own hook instance with any active hook template.
When a borrower launch a new market, they might need to pay an origination fee:
However, if originationFeeAsset does not support 0 value transfer, and originationFeeAmount is 0, originationFeeAsset.safeTransferFrom() will revert and the market deployment will fail.
Tools Used
Manual review
Recommended Mitigation Steps
Transfer originationFeeAsset only when originationFeeAmount is not 0:
Lines of code
https://github.com/code-423n4/2024-08-wildcat/blob/main/src/HooksFactory.sol#L418-L424
Vulnerability details
Impact
Market deployment revert if
originationFeeAsset
does not support 0 value transfer whileoriginationFeeAmount
is 0Proof of Concept
The owner of
ArchController
can add a hook template by callingHooksFactory#addHooksTemplate()
. A borrower can create their own hook instance with any active hook template. When a borrower launch a new market, they might need to pay an origination fee:However, if
originationFeeAsset
does not support 0 value transfer, andoriginationFeeAmount
is 0,originationFeeAsset.safeTransferFrom()
will revert and the market deployment will fail.Tools Used
Manual review
Recommended Mitigation Steps
Transfer
originationFeeAsset
only whenoriginationFeeAmount
is not 0:Assessed type
Token-Transfer