Skip to content

Commit

Permalink
fix: Remove return value from closeTrove (Dedaub A16)
Browse files Browse the repository at this point in the history
  • Loading branch information
bingen committed Aug 28, 2024
1 parent 5cb0e86 commit b8da9d3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
4 changes: 1 addition & 3 deletions contracts/src/BorrowerOperations.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/Interfaces/IBorrowerOperations.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions contracts/src/Zappers/GasCompZapper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions contracts/src/Zappers/WETHZapper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down

0 comments on commit b8da9d3

Please sign in to comment.