The buy
function allows users to purchase ZENO tokens in exchange for USDC. However, the function lacks a valid amount check (e.g., ensuring amount > 0
) and updates state after making an external call, which poses a potential reentrancy risk.
The function does not verify whether the amount
is greater than zero. This allows users to execute a zero-amount purchase, updating state variables such as lastBidder
Issue: This condition only checks if amount
is within available supply but does not prevent amount == 0
The function performs an external call (usdc_.transferFrom
) before updating its internal state, which introduces a reentrancy risk if the USDC contract or an intermediary contract is malicious.
Users Can "Buy" ZENO for Free.
A malicious USDC contract could re-enter the function and modify user balances before state updates occur.
Manual review
Add a check require(amount > 0, "Invalid amount");
Update the state before external calls.
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.