From b4f8592775f41e9e52e0068b3c531a08d0b8750c Mon Sep 17 00:00:00 2001 From: The3D Date: Thu, 15 Oct 2020 17:57:54 +0200 Subject: [PATCH] Fixed #69 --- contracts/libraries/logic/ValidationLogic.sol | 2 +- test/helpers/scenarios/withdraw.json | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/contracts/libraries/logic/ValidationLogic.sol b/contracts/libraries/logic/ValidationLogic.sol index 6a504659c..dc505afaa 100644 --- a/contracts/libraries/logic/ValidationLogic.sol +++ b/contracts/libraries/logic/ValidationLogic.sol @@ -65,7 +65,7 @@ library ValidationLogic { GenericLogic.balanceDecreaseAllowed( reserveAddress, msg.sender, - userBalance, + amount, reservesData, userConfig, reserves, diff --git a/test/helpers/scenarios/withdraw.json b/test/helpers/scenarios/withdraw.json index 4a679b22a..436984fce 100644 --- a/test/helpers/scenarios/withdraw.json +++ b/test/helpers/scenarios/withdraw.json @@ -342,6 +342,20 @@ "expected": "success" } ] + }, + { + "description": "Users 1 tries to withdraw 0.05 WETH, which does not bring the HF below 1", + "actions": [ + { + "name": "withdraw", + "args": { + "reserve": "WETH", + "amount": "0.05", + "user": "1" + }, + "expected": "success" + } + ] } ] }