Omniscia Kyo Finance Audit

SingleStreamConsumer Static Analysis Findings

SingleStreamConsumer Static Analysis Findings

SSC-01S: Inexistent Sanitization of Input Address

Description:

The linked function accepts an address argument yet does not properly sanitize it.

Impact:

The presence of zero-value addresses, especially in constructor implementations, can cause the contract to be permanently inoperable. These checks are advised as zero-value inputs are a common side-effect of off-chain software related bugs.

Example:

contracts/reward/SingleStreamConsumer.sol
18constructor(ITokenStreamEmitter source_) {
19 source = source_;
20 emit RewardSource(address(source));
21 address[] memory tokens = source.outputTokens();
22 nToken = tokens.length;
23 token0 = nToken >= 1 ? tokens[0] : address(0);
24 token1 = nToken >= 2 ? tokens[1] : address(0);
25 if (nToken >= 3) _tokens = tokens;
26}

Recommendation:

We advise some basic sanitization to be put in place by ensuring that the address specified is non-zero.

Alleviation (17c8d4e59f398021156f6f9657ff278aae0462ae):

The Kyo Finance team evaluated this exhibit but opted to acknowledge it in the current iteration of the codebase.