Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 559 Bytes

51.md

File metadata and controls

14 lines (10 loc) · 559 Bytes

Unused Variables

Description:

Unused variables are allowed in Solidity and they do not pose a direct security issue. It is best practice though to avoid them as they can:

  • Cause an increase in computations (and unnecessary gas consumption)
  • Indicate bugs or malformed data structures and they are generally a sign of poor code quality
  • Cause code noise and decrease readability of the code

Remediation:

Remove all unused variables from the code base.

References:

https://swcregistry.io/docs/SWC-131