Sparkn

CodeFox Inc.
DeFiFoundryProxy
15,000 USDC
View results
Submission Details
Severity: low

Event Based Reentrancy due to CallBack Tokens

Summary

Callback functions that can reenter functions with events lead to Event Reentrancy

Vulnerability Details

This results in wen function completes emitting incorrect or inconsistent event data as it will always miss emitting the first states, information, data that were suppposed to be emitted but was missed due to reentrancy

Impact

Medium: This results in incorrect events and missed event emission information for offchain tooling, monitoring, analysis, front ends. Users may act on protocol on faulty information from these events

Tools Used

Recommendations

1.It is recommended to follow Checks Effects Interactions patterns CEI pattern to ensure state updates and events are emitted before external calls to ensure accurate information. Move the events above the transfers

  1. It may be ideal to make use of Reentrancy Guards e.g OpenZeppelin nonreentrant modifiers on affected functions

  2. It may be ideal to whitelist allowed tokens for loanToken and collateralTokens and not allow callback, hook, tokens such as ERC777, ERC1363,

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.