A reentrancy attack is a type of vulnerability in smart contracts where an attacker can repeatedly call a function before the previous execution is complete, potentially draining funds from the contract.
Order of command operation in function is wrong.
First new value is push to list and after that is reduction user's balance by 1.
is possible to send new value to list without reduction a box count.
Foundry
Use the checks-effects-interactions pattern:
First, check conditions, then update the state, and finally interact with other contracts.
Implement reentrancy guards: Use a mutex or a similar mechanism to prevent reentrant calls4.
This line of the code should be before if statmend:
POC
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.