dforce-network / dToken

dForce yield token
MIT License
31 stars 10 forks source link

Inconsistent function naming for redemption functions #29

Closed mgcolburn closed 4 years ago

mgcolburn commented 4 years ago

Severity: Code Quality

Description

There are two functions which can be used to redeem dTokens:

Which function operates on dTokens vs. underlying is not immediately clear. A more common naming convention would be operation() and operationUnderlying() (i.e., change burn() to redeem() and redeem() to redeemUnderlying()).

Additionally, burn() and redeem() share a lot of code and it may be beneficial to break these up into internal sub-functions for clarity and consistency when modifying redemption behavior.

Donald-Nobel commented 4 years ago
  1. Will use redeem / redeemUnderlying for better naming.
  2. Will try to make code clean and easy to maintain.