Skip to content
Request an audit

Precision in the trapezoidal borrow-rate curve, and the Yearn post-mortem behind it

We continued the Panoptic contest on Code4rena.

Lesson Summary:

  • There seems to be enough precision when the utilisation error is small, since it only rounds down to 0 when the error is tiny.
  • The trapezoidal rule in the borrowRate function: check it holds for all values and conditions.
  • Check Yearn exploit post-mortem
  • What if every rate is 0? Look for edge cases in the trapezoidal rule — this one cannot happen, because of line 1841 in _borrowRate.
  • How is elapsed == 0 handled in _borrowRate? Verdict: the precision is handled well.
  • What if _borrowRate is spammed? Verdict: fine.
  • Call it often, call it rarely, skip a day, make a huge deposit, borrow a lot.
Watch the session on YouTube ↗
Message on Telegram All 62 posts