Skip to content

Commit

Permalink
Merge pull request #278 from liquity/remove_checkContract
Browse files Browse the repository at this point in the history
Remove CheckContract
  • Loading branch information
bingen authored Jul 28, 2024
2 parents f0130d6 + d09f872 commit 1bea45a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 40 deletions.
10 changes: 1 addition & 9 deletions contracts/src/ActivePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import "./Interfaces/IActivePool.sol";
import "./Interfaces/IBoldToken.sol";
import "./Interfaces/IInterestRouter.sol";
import "./Dependencies/Ownable.sol";
import "./Dependencies/CheckContract.sol";
import "./Interfaces/IDefaultPool.sol";

// import "forge-std/console2.sol";
Expand All @@ -22,7 +21,7 @@ import "./Interfaces/IDefaultPool.sol";
* Stability Pool, the Default Pool, or both, depending on the liquidation conditions.
*
*/
contract ActivePool is Ownable, CheckContract, IActivePool {
contract ActivePool is Ownable, IActivePool {
using SafeERC20 for IERC20;

string public constant NAME = "ActivePool";
Expand Down Expand Up @@ -78,13 +77,6 @@ contract ActivePool is Ownable, CheckContract, IActivePool {
address _boldTokenAddress,
address _interestRouterAddress
) external onlyOwner {
checkContract(_borrowerOperationsAddress);
checkContract(_troveManagerAddress);
checkContract(_stabilityPoolAddress);
checkContract(_defaultPoolAddress);
checkContract(_boldTokenAddress);
checkContract(_interestRouterAddress);

borrowerOperationsAddress = _borrowerOperationsAddress;
troveManagerAddress = _troveManagerAddress;
defaultPoolAddress = _defaultPoolAddress;
Expand Down
7 changes: 1 addition & 6 deletions contracts/src/DefaultPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";

import "./Interfaces/IActivePool.sol";
import "./Dependencies/Ownable.sol";
import "./Dependencies/CheckContract.sol";
import "./Interfaces/IDefaultPool.sol";

/*
Expand All @@ -16,7 +15,7 @@ import "./Interfaces/IDefaultPool.sol";
* When a trove makes an operation that applies its pending Coll and Bold debt, its pending Coll and Bold debt is moved
* from the Default Pool to the Active Pool.
*/
contract DefaultPool is Ownable, CheckContract, IDefaultPool {
contract DefaultPool is Ownable, IDefaultPool {
using SafeERC20 for IERC20;

string public constant NAME = "DefaultPool";
Expand All @@ -34,16 +33,12 @@ contract DefaultPool is Ownable, CheckContract, IDefaultPool {
event DefaultPoolCollBalanceUpdated(uint256 _collBalance);

constructor(address _collAddress) {
checkContract(_collAddress);
collToken = IERC20(_collAddress);
}

// --- Dependency setters ---

function setAddresses(address _troveManagerAddress, address _activePoolAddress) external onlyOwner {
checkContract(_troveManagerAddress);
checkContract(_activePoolAddress);

troveManagerAddress = _troveManagerAddress;
activePoolAddress = _activePoolAddress;

Expand Down
20 changes: 0 additions & 20 deletions contracts/src/Dependencies/CheckContract.sol

This file was deleted.

6 changes: 1 addition & 5 deletions contracts/src/SortedTroves.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import "./Interfaces/ISortedTroves.sol";
import "./Interfaces/ITroveManager.sol";
import "./Interfaces/IBorrowerOperations.sol";
import "./Dependencies/Ownable.sol";
import "./Dependencies/CheckContract.sol";

// ID of head & tail of the list. Callers should stop iterating with `getNext()` / `getPrev()`
// when encountering this node ID.
Expand Down Expand Up @@ -36,7 +35,7 @@ uint256 constant ROOT_NODE_ID = 0;
*
* - Public functions with parameters have been made internal to save gas, and given an external wrapper function for external access
*/
contract SortedTroves is Ownable, CheckContract, ISortedTroves {
contract SortedTroves is Ownable, ISortedTroves {
string public constant NAME = "SortedTroves";

// Constants used for documentation purposes
Expand Down Expand Up @@ -92,9 +91,6 @@ contract SortedTroves is Ownable, CheckContract, ISortedTroves {
override
onlyOwner
{
checkContract(_troveManagerAddress);
checkContract(_borrowerOperationsAddress);

troveManager = ITroveManager(_troveManagerAddress);
borrowerOperationsAddress = _borrowerOperationsAddress;

Expand Down

0 comments on commit 1bea45a

Please sign in to comment.