The nonReentrant modifier in the refund function is misconfigured, which could leave the contract vulnerable to reentrancy attacks under certain circumstances.
Location: nonReentrant modifier
Code Issue: The locked variable is reset (locked = false;) after the execution of the main function logic (_), instead of at the end of the modifier’s execution flow. This allows external interactions within the function body to potentially re-enter the contract, bypassing the lock.
Function Affected: refund, where _refundETH and _refundERC20 involve external calls that could be exploited.
A malicious external contract could trigger reentrancy by exploiting the external calls in _refundETH (via Ether transfers) or _refundERC20 (via malicious ERC20 tokens). This could allow an attacker to repeatedly call the refund function, draining user balances or contract funds.
Manual review
Fix the nonreentrant modifier
follow checks-effects-interactsions
use call instead of transfer in refundeth
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.