Skip to content

Commit

Permalink
fix: Remove unused BorrowerOperations from StabilityPool
Browse files Browse the repository at this point in the history
  • Loading branch information
bingen committed Aug 28, 2024
1 parent eb2b1a9 commit 9a57228
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 17 deletions.
2 changes: 0 additions & 2 deletions contracts/src/Interfaces/IStabilityPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pragma solidity ^0.8.0;

import "./IActivePool.sol";
import "./ILiquityBase.sol";
import "./IBorrowerOperations.sol";
import "./IBoldToken.sol";
import "./ITroveManager.sol";
import "./IBoldRewardsReceiver.sol";
Expand All @@ -30,7 +29,6 @@ import "./IBoldRewardsReceiver.sol";
*
*/
interface IStabilityPool is ILiquityBase, IBoldRewardsReceiver {
function borrowerOperations() external view returns (IBorrowerOperations);
function boldToken() external view returns (IBoldToken);
function troveManager() external view returns (ITroveManager);

Expand Down
1 change: 1 addition & 0 deletions contracts/src/Interfaces/ITroveManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pragma solidity ^0.8.0;

import "./ILiquityBase.sol";
import "./ITroveNFT.sol";
import "./IBorrowerOperations.sol";
import "./IStabilityPool.sol";
import "./IBoldToken.sol";
import "./ISortedTroves.sol";
Expand Down
9 changes: 0 additions & 9 deletions contracts/src/StabilityPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";

import "./Interfaces/IStabilityPool.sol";
import "./Interfaces/IAddressesRegistry.sol";
import "./Interfaces/IBorrowerOperations.sol";
import "./Interfaces/IStabilityPoolEvents.sol";
import "./Interfaces/IBorrowerOperations.sol";
import "./Interfaces/ITroveManager.sol";
import "./Interfaces/IBoldToken.sol";
import "./Interfaces/ISortedTroves.sol";
Expand Down Expand Up @@ -136,7 +134,6 @@ contract StabilityPool is LiquityBase, IStabilityPool, IStabilityPoolEvents {
string public constant NAME = "StabilityPool";

IERC20 public immutable collToken;
IBorrowerOperations public immutable borrowerOperations;
ITroveManager public immutable troveManager;
IBoldToken public immutable boldToken;
// Needed to check if there are pending liquidations
Expand Down Expand Up @@ -206,25 +203,19 @@ contract StabilityPool is LiquityBase, IStabilityPool, IStabilityPoolEvents {

// --- Events ---

event BorrowerOperationsAddressChanged(address _newBorrowerOperationsAddress);
event TroveManagerAddressChanged(address _newTroveManagerAddress);
event BoldTokenAddressChanged(address _newBoldTokenAddress);
event SortedTrovesAddressChanged(address _newSortedTrovesAddress);

constructor(IAddressesRegistry _addressesRegistry) LiquityBase(_addressesRegistry) {
collToken = _addressesRegistry.collToken();
borrowerOperations = _addressesRegistry.borrowerOperations();
troveManager = _addressesRegistry.troveManager();
boldToken = _addressesRegistry.boldToken();
sortedTroves = _addressesRegistry.sortedTroves();

emit BorrowerOperationsAddressChanged(address(borrowerOperations));
emit TroveManagerAddressChanged(address(troveManager));
emit BoldTokenAddressChanged(address(boldToken));
emit SortedTrovesAddressChanged(address(sortedTroves));

// Allow funds movements between Liquity contracts
collToken.approve(address(borrowerOperations), type(uint256).max);
}

// --- Getters for public variables. Required by IPool interface ---
Expand Down
6 changes: 0 additions & 6 deletions contracts/src/test/deployment.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,6 @@ contract Deployment is DevTestSetup {
assertEq(activePoolAddress, recordedActivePoolAddress);
}

function testStabilityPoolHasCorrectCorrectBorrowerOpsAddress() public view {
address borrowerOperationsAddress = address(borrowerOperations);
address recordedBorrowerOperationsAddress = address(stabilityPool.borrowerOperations());
assertEq(borrowerOperationsAddress, recordedBorrowerOperationsAddress);
}

function testStabilityPoolHasCorrectCorrectBoldTokenAddress() public view {
address boldTokenAddress = address(boldToken);
address recordedBoldTokenAddress = address(stabilityPool.boldToken());
Expand Down

0 comments on commit 9a57228

Please sign in to comment.