Closed wenzhenxiang closed 3 years ago
this change should be applied to the redeem function as well
this change should be applied to the redeem function as well
yes, the logic of borrow, repay, deposit, redeem needs to be changed to
this change should be applied to the redeem function as well
yes, the logic of borrow, repay, deposit, redeem needs to be changed to
- Validation
- UpdateState
- Transfer
- emit event
There is an additional challenge, since mint and repay need to see the actual amount transferred in order to accurately account for deposits in the case of fee tokens, the transfer must happen before updating state. Since these actions mean the sender is actually in a worse position from internal accounting standpoint before accounting updates, it is okay that they do not follow the pattern.
Borrow and Redeem and Transfer only should be updated
Now included with #152
Avoid token reentry attacks, like ERC777 token.