code-423n4 / 2021-10-pooltogether-findings

0 stars 0 forks source link

Unused named return variables #13

Closed code423n4 closed 3 years ago

code423n4 commented 3 years ago

Handle

ye0lde

Vulnerability details

Impact

Removing unused named return variables can reduce gas usage and improve code clarity.

Proof of Concept

TwabLib.sol: https://github.com/pooltogether/v4-core/blob/35b00f710db422a6193131b7dc2de5202dc4677c/contracts/libraries/TwabLib.sol#L384-L387

Tools Used

VS Code

Recommended Mitigation Steps

Remove the unused named return variables.

PierrickGT commented 3 years ago

These named variables are actually returned at L394 or L407. These kind of return statements are implicit rather than explicit and that maybe why the warden didn't see them while looking at the code.

GalloDaSballo commented 3 years ago

Implicit returns are part of Solidity Invalid finding