Skip to content

Latest commit

 

History

History
27 lines (23 loc) · 1.14 KB

`Timed.isTimeEnded` returns true if the timer has not been initialized.md

File metadata and controls

27 lines (23 loc) · 1.14 KB

Timed initialization is a 2-step process: 1. Timed.duration is set in the constructor 2. Timed.startTime is set when the method _initTimed is called.

Before this second method is called, isTimeEnded() calculates remaining time using a startTime of 0, resulting in the method returning true for most values, even though the timer has not technically been started.

Recommendation:

If Timed has not been initialized, isTimeEnded() should return false, or revert


Slide Screenshot

013.jpg


Slide Text

  • ConsenSys Audit Fei Finding 3.5
  • Error Handling
  • Medium Severity
  • Timer Returns True instead-of False
  • Return False before Initialization

References


Tags