Skip to content

Latest commit

 

History

History
25 lines (21 loc) · 896 Bytes

Assignment in `require` statement.md

File metadata and controls

25 lines (21 loc) · 896 Bytes

In the YieldOracle contract, there is a require statement that makes an assignment.

This deviates from the standard usage and intention of require statements and can easily lead to confusion.

Recommendation:

Consider moving the assignment to its own line before the require statement and then using the require statement solely for condition checking.


Slide Screenshot

183.jpg


Slide Text

  • OpenZeppelin BarnBridge Finding N01
  • Error Checking
  • Assignment in require()
  • require() -> Checks
  • No Side-effects

References


Tags