Closed code423n4 closed 3 years ago
ye0lde
Removing unused named return variables can reduce gas usage and improve code clarity.
TwabLib.sol: https://github.com/pooltogether/v4-core/blob/35b00f710db422a6193131b7dc2de5202dc4677c/contracts/libraries/TwabLib.sol#L384-L387
VS Code
Remove the unused named return variables.
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.
Implicit returns are part of Solidity Invalid finding
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.