**Description:** in the `refund` function, nonReentrant modifier is used, but well implemented.
the locked state is only checked at the start,but it is reset to false after the function logic.
```javascript
modifier nonReentrant() {
require(!locked, "No re-entrancy");
_;
locked = false;
}
```
**Impact:** If an attacker can re-enter the function before locked is set back to false, they could exploit the contract draining funds or causing unintended behavior.
**Proof of Concept:**
**Recommended Mitigation:**
1. consider using Openzeppelin's ReentrancyGuard implementation
2. The locked state should be set to true immediately before the function logic (_) and reset to false only after the logic is executed. A proper implementation should look like this:
```diff
modifier nonReentrant() {
require(!locked, "No re-entrancy");
+ locked = true; // Set lock before the function execution
_;
locked = false; // Reset lock after the function execution
}
```