The buyOrder
function does not validate whether the buyer has enough USDC balance or has granted sufficient allowance before calling safeTransferFrom
. Without these pre-checks, the transaction may revert unexpectedly during execution, leading to a poor user experience and wasted gas.
Likelihood:
The issue occurs when a user attempts to buy an order without approving enough USDC allowance or lacking sufficient balance.
Impact:
The transaction reverts mid-way, wasting gas and causing confusion.
It may lead to frustration for users especially if the dApp UI doesn’t handle or explain the error clearly.
A user with:
The transaction reverts during safeTransferFrom
, despite passing earlier validations.
Add explicit checks for allowance and balance before proceeding with transfers:
This improves fail-fast behavior, user experience, and avoids unnecessary gas usage.
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.