Submitted by WatchPug
https://github.com/code-423n4/2021-11-malt/blob/c3a204a2c0f7c653c6c2dda9f4563fd1dc1cecf3/src/contracts/MovingAverage.sol#L424-L442
In the current implementation, when sampleMemory is updated, the samples index will be malposition, making getValueWithLookback() get the wrong samples, so that returns the wrong value.
The current movingAverage.getValueWithLookback(sampleLength * 10) returns 0.00000203312 e18, while its expeceted to be 1e18
After setSampleMemory(), getValueWithLookback() may also return 0or revert FullMath: FULLDIV_OVERFLOW at L134.
Consider removing setSampleMemory function.
0xScotch (sponsor) confirmed
Alex the Entreprenerd (judge) commented:
Alex the Entreprenerd (judge) commented:
