While true ERC-20 tokens that adhere to the specification and have undergone auditing are generally not susceptible to re-entry risks, caution should be exercised. Malicious actors can potentially create ERC-20 tokens with custom safeTransferFrom()
or approve()
functions containing re-entrancy hooks, posing a threat to the target.
Moreover, it's worth nothing that ERC-777, although offering improved usability, introduces transfer hooks that may introduce re-entrancy vulnerabilities. Therefore, careful consideration and appropriate security measures should be taken when dealing with ERC-777 tokens to mitigate the risk of re-entry attacks.
While traditional ERC-20 tokens are designed to mitigate re-entrancy risks, ERC-777 tokens, due to their increased functionality and transfer hooks, can introduce potential re-entrancy vulnerabilities.
In scenarios where a contract interacts with unknown ERC-20 tokens, adopting a cautious approach and considering the possibility of re-entrancy problems is a prudent security measure. Vigilance and adherence to best practices are essential when dealing with diverse token standards to ensure the robustness of smart contract systems.
Add Re-Entrancy Guard in the following function:
Even though assets are not expected to re-enter and reward tokens re-entering on claimRewards
might not be problematic.
Consider doing this change for security point of view.
Manual Review
Use Openzeppelin or Solmate Re-Entrancy pattern
Here is a example of a re-entracy guard:
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.