code-423n4 / 2021-12-defiprotocol-findings

0 stars 0 forks source link

Unused Named Return #160

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

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

0xleastwood commented 2 years ago

Not a gas optimisation. This is optimised by the compiler already.