Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decreaseHardDeposit #77

Open
Eknir opened this issue Aug 1, 2019 · 0 comments
Open

decreaseHardDeposit #77

Eknir opened this issue Aug 1, 2019 · 0 comments
Labels
simpleSwap Related to SimpleSwap.sol

Comments

@Eknir
Copy link
Collaborator

Eknir commented Aug 1, 2019

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 Eknir added the simpleSwap Related to SimpleSwap.sol label Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
simpleSwap Related to SimpleSwap.sol
Projects
None yet
Development

No branches or pull requests

1 participant