enzymefinance / protocol

Enzyme Protocol Implementation
https://enzyme.finance
GNU General Public License v3.0
375 stars 156 forks source link

Fix: remove partial redemption #988

Closed luongnt95 closed 4 years ago

SeanJCasey commented 4 years ago

@luongnt95 Actually, I think we should structure these functions slightly differently, to protect against bad / accidental inputs.

  1. __redeemShares(uint256 _sharesQuantity, bool _bypassFailure) private - basically the current redeemSharesQuantity()
  2. redeemShares() external - calls __redeemShares(totalShares, false)
  3. redeemSharesQuantity(uint256 _sharesQuantity) external - calls __redeemShares(_sharesQuantity, false)
  4. redeemSharesEmergency() external - calls __redeemShares(totalShares, false)

Most of the comments in the previous review are still valid (I will close the ones that are not).