From b8da9d3c071b6f5fea86a2ace0170e5910acff98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Fingen?= Date: Wed, 28 Aug 2024 11:33:54 +0100 Subject: [PATCH] fix: Remove return value from closeTrove (Dedaub A16) --- contracts/src/BorrowerOperations.sol | 4 +--- contracts/src/Interfaces/IBorrowerOperations.sol | 2 +- contracts/src/Zappers/GasCompZapper.sol | 4 ++-- contracts/src/Zappers/WETHZapper.sol | 6 +++--- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/contracts/src/BorrowerOperations.sol b/contracts/src/BorrowerOperations.sol index 7f4ba202f..c1b8d34f0 100644 --- a/contracts/src/BorrowerOperations.sol +++ b/contracts/src/BorrowerOperations.sol @@ -672,7 +672,7 @@ contract BorrowerOperations is LiquityBase, AddRemoveManagers, IBorrowerOperatio _moveTokensFromAdjustment(receiver, _troveChange, vars.boldToken, vars.activePool); } - function closeTrove(uint256 _troveId) external override returns (uint256) { + function closeTrove(uint256 _troveId) external override { ITroveManager troveManagerCached = troveManager; IActivePool activePoolCached = activePool; IBoldToken boldTokenCached = boldToken; @@ -738,8 +738,6 @@ contract BorrowerOperations is LiquityBase, AddRemoveManagers, IBorrowerOperatio activePoolCached.sendColl(receiver, trove.entireColl); _wipeTroveMappings(_troveId); - - return trove.entireColl; } function applyPendingDebt(uint256 _troveId, uint256 _lowerHint, uint256 _upperHint) public { diff --git a/contracts/src/Interfaces/IBorrowerOperations.sol b/contracts/src/Interfaces/IBorrowerOperations.sol index 664e750ee..d4eb9c613 100644 --- a/contracts/src/Interfaces/IBorrowerOperations.sol +++ b/contracts/src/Interfaces/IBorrowerOperations.sol @@ -56,7 +56,7 @@ interface IBorrowerOperations is ILiquityBase, IAddRemoveManagers { function repayBold(uint256 _troveId, uint256 _amount) external; - function closeTrove(uint256 _troveId) external returns (uint256); + function closeTrove(uint256 _troveId) external; function adjustTrove( uint256 _troveId, diff --git a/contracts/src/Zappers/GasCompZapper.sol b/contracts/src/Zappers/GasCompZapper.sol index f5765bc4c..19d117945 100644 --- a/contracts/src/Zappers/GasCompZapper.sol +++ b/contracts/src/Zappers/GasCompZapper.sol @@ -232,10 +232,10 @@ contract GasCompZapper is AddRemoveManagers { LatestTroveData memory trove = troveManager.getLatestTroveData(_troveId); boldToken.transferFrom(msg.sender, address(this), trove.entireDebt); - uint256 collLeft = borrowerOperations.closeTrove(_troveId); + borrowerOperations.closeTrove(_troveId); // Send coll left - collToken.safeTransfer(receiver, collLeft); + collToken.safeTransfer(receiver, trove.entireColl); // Send gas compensation WETH.withdraw(ETH_GAS_COMPENSATION); diff --git a/contracts/src/Zappers/WETHZapper.sol b/contracts/src/Zappers/WETHZapper.sol index d4655297b..85c501a19 100644 --- a/contracts/src/Zappers/WETHZapper.sol +++ b/contracts/src/Zappers/WETHZapper.sol @@ -226,10 +226,10 @@ contract WETHZapper is AddRemoveManagers { LatestTroveData memory trove = troveManager.getLatestTroveData(_troveId); boldToken.transferFrom(msg.sender, address(this), trove.entireDebt); - uint256 collLeft = borrowerOperations.closeTrove(_troveId); + borrowerOperations.closeTrove(_troveId); - WETH.withdraw(collLeft + ETH_GAS_COMPENSATION); - (bool success,) = receiver.call{value: collLeft + ETH_GAS_COMPENSATION}(""); + WETH.withdraw(trove.entireColl + ETH_GAS_COMPENSATION); + (bool success,) = receiver.call{value: trove.entireColl + ETH_GAS_COMPENSATION}(""); require(success, "WZ: Sending ETH failed"); }