suberra / funnel-contracts

Funnels are smart contracts that enforces renewable allowance as a proxy
MIT License
9 stars 0 forks source link

[Hacken 2022-12-21 Medium #04] Violated Checks-Effects-Interactions Pattern #73

Closed zlace0x closed 1 year ago

zlace0x commented 1 year ago

During the function execution, some state variables are updated after the external calls.

This may lead to reentrancies, race conditions, and denial of service vulnerabilities during implementation of new functionality.

Path: ./src/FunnelFactory.sol: deployFunnelForToken()

Recommendation: Common best practices should be followed, functions should be implemented according to the Check-Effect-Interaction pattern.

Status: Reported (Consider emitting DeployedFunnel before the Funnel initialize() in the deployFunnelForToken function. Emitting an event is considered to be an effect and should be done before interaction)