Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 832 Bytes

Use `delete` to clear variables.md

File metadata and controls

28 lines (23 loc) · 832 Bytes

The Controller contract sets a variable to the zero address in order to clear it.

Similarly, the SetToken clears the locker by assigning the zero address.

Recommendation:

The delete key better conveys the intention and is also more idiomatic.

Consider replacing assignments of zero with delete statements.


Slide Screenshot

201.jpg


Slide Text

  • OpenZeppelin Audit Set Protocol Finding N09
  • Patching
  • Clear Variables
  • Zero Address vs delete
  • Use delete
  • Intention & Idiomatic

References


Tags