The depositfunction does not strictly follow the Checks-Effects-Interactions (CEI) pattern, which is a common best practice in Solidity to prevent reentrancy attacks
In the deposit function, token.safeTransferFrom(msg.sender, address(this), _amount) is an external call that transfers tokens from the sender to the contract.
If msg.sender is a malicious contract, it might execute code upon receiving this transfer, potentially calling back into the deposit function before state changes are finalized.
An attacker could repeatedly call the deposit function before the state changes are finalized, allowing them to manipulate their balance or the total staked amount.
Manual Review
Implement the nonReentrant modifier from OpenZeppelin to provide a simple and comprehensive safeguard against reentrant calls throughout the function. or change the lines
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.