Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 1.58 KB

Users can collect interest from `SavingsContract` by only staking mTokens momentarily.md

File metadata and controls

29 lines (24 loc) · 1.58 KB

The SAVE contract allows users to deposit mAssets in return for lending yield and swap fees. When depositing mAsset, users receive a “credit” tokens at the momentary credit/mAsset exchange rate which is updated at every deposit.

However, the smart contract enforces a minimum timeframe of 30 minutes in which the interest rate will not be updated.

A user who deposits shortly before the end of the timeframe will receive credits at the stale interest rate and can immediately trigger an update of the rate and withdraw at the updated (more favorable) rate after the 30 minutes window.

As a result, it would be possible for users to benefit from interest payouts by only staking mAssets momentarily and using them for other purposes the rest of the time.

Recommendation:

Remove the 30 minutes window such that every deposit also updates the exchange rate between credits and tokens.


Slide Screenshot

021.jpg


Slide Text

  • ConsenSys Audit mstable-1.1 Finding 6.2
  • Timing
  • Major Severity
  • Abuse of Sliding Window
  • Remove Window
  • Anticipate/Prevent Abuse

References


Tags