Submitted by kenzo
Every time an account is settled, if shortfall is created, due to a wrong calculation shortfall will double in size and add the new shortfall.
Loss of funds: users wont be able to withdraw the correct amount of funds. Somebody would have to donate funds to resolve the wrong shortfall.
We can see in the settleAccount of OptimisticLedger that self.shortfall ends up being self.shortfall+self.shortfall+newShortfall: (Code ref)
Additionally, you can add the following line to the shortfall reverts if depleted test in Collateral.test.js, line 190:
Previously the test product had 50 shortfall. Now we added 50 more, but the test will print that the actual shortfall is 150, and not 100 as it should be.
Move the setting of self.shortfall to inside the if function and change the line to:
kbrizzle (Perennial) confirmed:
Alex the Entreprenerd (judge) commented:
