Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 1013 Bytes

block.timestamp Unreliable.md

File metadata and controls

28 lines (23 loc) · 1013 Bytes

Code uses the block.timestamp as part of the calculations and time checks.

Nevertheless, timestamps can be slightly altered by miners to favor them in contracts that have logics that depend strongly on them.

Recommendation:

Consider taking into account this issue and warning the users that such a scenario could happen.

If the alteration of timestamps cannot affect the protocol in any way, consider documenting the reasoning and writing tests enforcing that these guarantees will be preserved even if the code changes in the future.


Slide Screenshot

182.jpg


Slide Text

  • OpenZeppelin Audit HoldeFi Finding N07
  • Timing
  • block.timestamp
  • Unreliable -> Miners
  • Test & Document
  • Warn Users

References


Tags