Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 1.09 KB

Logic duplicated across code.md

File metadata and controls

31 lines (24 loc) · 1.09 KB

The logic in the repositories provided to Trail of Bits contains a significant amount of duplicated code.

This development practice increases the risk that new bugs will be introduced into the system, as bug fixes must be copied and pasted into files across the system.

Recommendation:

Short term, use inheritance to allow code to be reused across contracts.

Changes to one inherited contract will be applied to all files without requiring developers to copy and paste them.

Long term, minimize the amount of manual copying and pasting required to apply changes made to one file to other files.


Slide Screenshot

160.jpg


Slide Text

  • ToB Audit Advanced Blockchain Finding 4
  • Patching
  • Duplicated Code
  • Error-prone
  • Code Reuse
  • Inheritance

References


Tags