Description: The collectProtocolRevenue
function transfers tokens after changing the state of the contract. This pattern is vulnerable to reentrancy attacks, especially if the safeTransfer
function is called and the recipient is a malicious contract.
Code Reference:
Impact:
A malicious contract could call collectProtocolRevenue
recursively, leading to unexpected behavior and financial loss.
Recommendations:
Use a checks-effects-interactions pattern by first transferring the tokens and then updating the state variable. Alternatively, utilize reentrancy guards:
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.