Closed code423n4 closed 2 years ago
ye0lde
Removing unused named return variables can reduce gas usage and improve code clarity.
Unused named returns: https://github.com/code-423n4/2021-12-defiprotocol/blob/205d3766044171e325df6a8bf2e79b37856eece1/contracts/contracts/Factory.sol#L74
Visual Studio Code, Remix
Remove the unused named return variable - id
id
Not a gas optimisation. This is optimised by the compiler already.
Handle
ye0lde
Vulnerability details
Impact
Removing unused named return variables can reduce gas usage and improve code clarity.
Proof of Concept
Unused named returns: https://github.com/code-423n4/2021-12-defiprotocol/blob/205d3766044171e325df6a8bf2e79b37856eece1/contracts/contracts/Factory.sol#L74
Tools Used
Visual Studio Code, Remix
Recommended Mitigation Steps
Remove the unused named return variable -
id