Vulnerability: Reentrancy Vulnerability in _transfer Function
Description: The _transfer function in the SDLPool.sol contract executes logic before updating rewards and transferring lock ownership. This leaves the contract vulnerable to reentrancy attacks, where an external contract could maliciously call back into the SDLPool contract before the state is updated.
SDLPool.solReentrancy Risk:
The vulnerable _transfer function allows an external contract to potentially reenter the SDLPool contract before the state is fully updated. This could lead to unexpected behavior and may be exploited by attackers to manipulate the contract's state during the execution of the function.
Manual Code Review
To mitigate the reentrancy vulnerability, it is recommended to follow the check-effects-interactions pattern. This involves updating the contract's state after performing external calls. In this case, move the _updateRewards calls to the end of the function, after all internal state changes are made. This helps ensure that external calls are the last actions in the function, reducing the risk of reentrancy attacks.
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.