Submitted by hansfriese
The if condition of Twav._getTwav() is missing some edge cases.
In this case, this function will return 0 which is different from the correct value and it will affect the main functions like NibblVault.buy() and NibblVault.sell().
I think this condition is to confirm at least 4 values were saved for twav calculation.
Btw this timestamp would be zero even though there are more than 4 values properly as its modularized by 2**32.
In this case, the if condition will be false and this function will return 0.
Solidity Visual Developer of VSCode
I see cumulativeValuation is increasing all the time and recommend replacing timestamp with cumulativeValuation.
mundhrakeshav (Nibbl) confirmed and resolved
HardlyDifficult (judge) commented:
