Open deemru opened 1 year ago
withdrawLimitLeft
_reward
DURATION
assetBalance()
withdrawLocked()
fromFree
_amount
computeNewRate()
rate()
exchangeFreeAndLocked()
diff
withdrawLimitLeft
), consider to use -1 or alternative: https://github.com/Tsunami-Exchange/tsunami-contracts/blob/fd62040d914202f817416605ac8cff6e32ce04f4/contracts/ride/vault.ride#L342_reward
/DURATION
*DURATION
can be less than_reward
, consider to return this dust or useassetBalance()
to account the dust in next rounds: https://github.com/Tsunami-Exchange/tsunami-contracts/blob/fd62040d914202f817416605ac8cff6e32ce04f4/contracts/ride/vault.ride#L567 https://github.com/Tsunami-Exchange/tsunami-contracts/blob/fd62040d914202f817416605ac8cff6e32ce04f4/contracts/ride/vault.ride#L571_reward
can extend leftover to full duration: https://github.com/Tsunami-Exchange/tsunami-contracts/blob/fd62040d914202f817416605ac8cff6e32ce04f4/contracts/ride/vault.ride#L571withdrawLocked()
but can withdrawfromFree
actually with no limit at all: https://github.com/Tsunami-Exchange/tsunami-contracts/blob/fd62040d914202f817416605ac8cff6e32ce04f4/contracts/ride/vault.ride#L535_amount
looks dangerous: https://github.com/Tsunami-Exchange/tsunami-contracts/blob/fd62040d914202f817416605ac8cff6e32ce04f4/contracts/ride/vault.ride#L482computeNewRate()
: https://github.com/Tsunami-Exchange/tsunami-contracts/blob/fd62040d914202f817416605ac8cff6e32ce04f4/contracts/ride/vault.ride#L439-L443rate()
can definitely go down atexchangeFreeAndLocked()
andwithdrawLocked()
diff
may be less than expected because of low rewardRate() vs. big totalSupply() when call every block: https://github.com/Tsunami-Exchange/tsunami-contracts/blob/fd62040d914202f817416605ac8cff6e32ce04f4/contracts/ride/vault.ride#L137