The transfer
and transfer_from
operations assume the bidder has enough funds, but there’s no validation before transferring tokens. If the ERC20 transfer fails (due to insufficient balance or lack of allowance), the state may still be updated, leading to incorrect bid tracking.
If the ERC20 transfer fails, the state (such as highest_bid
and bid_values
) will still reflect the new bid. This could allow invalid bids to remain recorded.
Auction integrity is compromised: The highest bid may not actually exist in the ERC20 token contract, but the auction treats it as valid.
Introduce a pre-check for ERC20 balance and allowance before accepting a bid.
If the check fails, the bid should not be accepted.
With these pre-checks:
The bid will only be accepted if the user has enough balance and allowance.
This prevents failed ERC20 transfers from corrupting the auction state.
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.