Cleaned up harvest and withdraw related functions.
In deposit, updateAverageEntry/updateEntryFIRST, THENposition.amount +, position.rewardDebt+. This is so that the weight calculations that happen inside updateEntry don't include the newly deposited amount within the total position.amount
In withdraw, position.amount -, position.rewardDebt-FIRST, THENupdateAverageEntry/updateEntry
Basically mirrored them.
Also in emergencyWithdraw, decided to call updateEntry after emptying out the position as that would reset the position's entry to timestamp.
Took slight business logic liberties for what looked to be consistent behavior. Hopefully not breaking anything!
Removed support for fee on transfer tokens.
Cleaned up harvest and withdraw related functions.
updateAverageEntry/updateEntry
FIRST, THENposition.amount +
,position.rewardDebt+
. This is so that the weight calculations that happen insideupdateEntry
don't include the newly depositedamount
within the totalposition.amount
position.amount -
,position.rewardDebt-
FIRST, THENupdateAverageEntry/updateEntry
emergencyWithdraw
, decided to callupdateEntry
after emptying out the position as that would reset the position'sentry
totimestamp
.Took slight business logic liberties for what looked to be consistent behavior. Hopefully not breaking anything!