swap-swear-and-swindle icon indicating copy to clipboard operation
swap-swear-and-swindle copied to clipboard

decreaseHardDeposit

Open Eknir opened this issue 5 years ago • 0 comments

If there is a cash-out in between the prepareDecreaseHardDeposit and decreaseHardDeposit, the line hardDeposit.amount = hardDeposit.amount.sub(hardDeposit.decreaseAmount); in decreaseHardDeposit might throw and decreasing the hardDeposit can be effectively blocked temporarily. Proposed solution: if decreaseAmount is more than amount, set the hardDeposits to 0. As an extra benefit: this makes the require(decreaseAmount <= hardDeposit.amount) in prepareDecreaseHardDeposit redundant. @ralph-pichler

Eknir avatar Aug 01 '19 10:08 Eknir