There are two functions which can be used to redeem dTokens:
burn(address src, uint256 wad), which will burn wad amount of dTokens from src and transfer the unlocked assets to msg.sender, and
redeem(address src, uint256 pie), which will unlock pie assets and burn the corresponding amount of dTokens required from src, before transferring the assets to msg.sender.
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.
Severity: Code Quality
Description
There are two functions which can be used to redeem dTokens:
burn(address src, uint256 wad)
, which will burnwad
amount of dTokens fromsrc
and transfer the unlocked assets tomsg.sender
, andredeem(address src, uint256 pie)
, which will unlockpie
assets and burn the corresponding amount of dTokens required fromsrc
, before transferring the assets tomsg.sender
.Which function operates on dTokens vs. underlying is not immediately clear. A more common naming convention would be
operation()
andoperationUnderlying()
(i.e., changeburn()
toredeem()
andredeem()
toredeemUnderlying()
).Additionally,
burn()
andredeem()
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.