sherlock-audit / 2022-11-nounsdao-judging

4 stars 0 forks source link

Deivitto - StreamFactory can be unable to createStreams neither initialize them #57

Closed sherlock-admin closed 1 year ago

sherlock-admin commented 1 year ago

Deivitto

medium

StreamFactory can be unable to createStreams neither initialize them

Summary

If wrongly assigned streamImplementation to address(0), StreamFactory.sol won't be able to create or initialize Streams

Vulnerability Detail

If streamImplementation is set to 0x0 in the StreamFactory.sol contract, the createStream() function will revert when it is called. This is because the function would call a non existing function in target address and therefore will revert.

Additionally, if streamImplementation is set to 0x0, the StreamFactory.sol contract will not be able to initialize Stream contracts, as it will not be able to call the Stream contract's initialize() function that is called inside createStream.

Impact

Factory not able to createStreams neither initialize them. Force of redeploy / gas wasted on deployments.

Code Snippet

https://github.com/sherlock-audit/2022-11-nounsdao/blob/main/src/StreamFactory.sol#L202-L207 https://github.com/sherlock-audit/2022-11-nounsdao/blob/main/src/StreamFactory.sol#L208 https://github.com/sherlock-audit/2022-11-nounsdao/blob/main/src/StreamFactory.sol#L268-L272

Tool used

Manual Review

Recommendation

Add a check for not assigning address(0) to streamImplementation in constructor