From e715e292d8938a46105db7feb72ddd11eeb6b46f Mon Sep 17 00:00:00 2001 From: RickGriff Date: Tue, 23 Jan 2024 14:55:45 +0700 Subject: [PATCH] Move IPriceFeedTestnet and delete redundant test contracts --- .../src/OldTestContracts/ActivePoolTester.sol | 16 ----- .../src/OldTestContracts/BoldTokenCaller.sol | 29 -------- .../src/OldTestContracts/BoldTokenTester.sol | 66 ------------------- .../BorrowerOperationsTester.sol | 63 ------------------ .../src/OldTestContracts/CDPManagerTester.sol | 60 ----------------- .../OldTestContracts/DefaultPoolTester.sol | 16 ----- .../src/OldTestContracts/Destructible.sol | 12 ---- .../src/OldTestContracts/FunctionCaller.sol | 49 -------------- .../OldTestContracts/LiquityMathTester.sol | 24 ------- contracts/src/OldTestContracts/MockTellor.sol | 51 -------------- contracts/src/OldTestContracts/NonPayable.sol | 24 ------- .../src/OldTestContracts/PriceFeedTester.sol | 16 ----- .../src/OldTestContracts/PriceFeedTestnet.sol | 35 ---------- .../OldTestContracts/SortedTrovesTester.sol | 34 ---------- .../OldTestContracts/StabilityPoolTester.sol | 20 ------ .../src/TestContracts/PriceFeedTestnet.sol | 4 +- contracts/src/TroveManager.sol | 2 +- .../src/test/TestContracts/DevTestSetup.sol | 4 +- .../Interfaces/IPriceFeedTestnet.sol | 2 +- contracts/src/test/basicOps.t.sol | 2 +- 20 files changed, 7 insertions(+), 522 deletions(-) delete mode 100644 contracts/src/OldTestContracts/ActivePoolTester.sol delete mode 100644 contracts/src/OldTestContracts/BoldTokenCaller.sol delete mode 100644 contracts/src/OldTestContracts/BoldTokenTester.sol delete mode 100644 contracts/src/OldTestContracts/BorrowerOperationsTester.sol delete mode 100644 contracts/src/OldTestContracts/CDPManagerTester.sol delete mode 100644 contracts/src/OldTestContracts/DefaultPoolTester.sol delete mode 100644 contracts/src/OldTestContracts/Destructible.sol delete mode 100644 contracts/src/OldTestContracts/FunctionCaller.sol delete mode 100644 contracts/src/OldTestContracts/LiquityMathTester.sol delete mode 100644 contracts/src/OldTestContracts/MockTellor.sol delete mode 100644 contracts/src/OldTestContracts/NonPayable.sol delete mode 100644 contracts/src/OldTestContracts/PriceFeedTester.sol delete mode 100644 contracts/src/OldTestContracts/PriceFeedTestnet.sol delete mode 100644 contracts/src/OldTestContracts/SortedTrovesTester.sol delete mode 100644 contracts/src/OldTestContracts/StabilityPoolTester.sol rename contracts/src/{ => test/TestContracts}/Interfaces/IPriceFeedTestnet.sol (78%) diff --git a/contracts/src/OldTestContracts/ActivePoolTester.sol b/contracts/src/OldTestContracts/ActivePoolTester.sol deleted file mode 100644 index 75cee9b5..00000000 --- a/contracts/src/OldTestContracts/ActivePoolTester.sol +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.18; - -import "../ActivePool.sol"; - -contract ActivePoolTester is ActivePool { - - function unprotectedIncreaseBoldDebt(uint _amount) external { - boldDebt = boldDebt + _amount; - } - - function unprotectedPayable() external payable { - ETH = ETH + msg.value; - } -} diff --git a/contracts/src/OldTestContracts/BoldTokenCaller.sol b/contracts/src/OldTestContracts/BoldTokenCaller.sol deleted file mode 100644 index 613b41a3..00000000 --- a/contracts/src/OldTestContracts/BoldTokenCaller.sol +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.18; - -import "../Interfaces/IBoldToken.sol"; - -contract BoldTokenCaller { - IBoldToken Bold; - - function setBold(IBoldToken _bold) external { - Bold = _bold; - } - - function boldMint(address _account, uint _amount) external { - Bold.mint(_account, _amount); - } - - function boldBurn(address _account, uint _amount) external { - Bold.burn(_account, _amount); - } - - function boldSendToPool(address _sender, address _poolAddress, uint256 _amount) external { - Bold.sendToPool(_sender, _poolAddress, _amount); - } - - function boldReturnFromPool(address _poolAddress, address _receiver, uint256 _amount ) external { - Bold.returnFromPool(_poolAddress, _receiver, _amount); - } -} diff --git a/contracts/src/OldTestContracts/BoldTokenTester.sol b/contracts/src/OldTestContracts/BoldTokenTester.sol deleted file mode 100644 index 446299e6..00000000 --- a/contracts/src/OldTestContracts/BoldTokenTester.sol +++ /dev/null @@ -1,66 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.18; - -import "../BoldToken.sol"; - -contract BoldTokenTester is BoldToken { - - bytes32 private immutable _PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9; - - constructor( - address _troveManagerAddress, - address _stabilityPoolAddress, - address _borrowerOperationsAddress - ) public BoldToken(_troveManagerAddress, - _stabilityPoolAddress, - _borrowerOperationsAddress) {} - - function unprotectedMint(address _account, uint256 _amount) external { - // No check on caller here - - _mint(_account, _amount); - } - - function unprotectedBurn(address _account, uint _amount) external { - // No check on caller here - - _burn(_account, _amount); - } - - function unprotectedSendToPool(address _sender, address _poolAddress, uint256 _amount) external { - // No check on caller here - - _transfer(_sender, _poolAddress, _amount); - } - - function unprotectedReturnFromPool(address _poolAddress, address _receiver, uint256 _amount ) external { - // No check on caller here - - _transfer(_poolAddress, _receiver, _amount); - } - - function callInternalApprove(address owner, address spender, uint256 amount) external returns (bool) { - _approve(owner, spender, amount); - } - - function getChainId() external view returns (uint256 chainID) { - //return _chainID(); // it’s private - assembly { - chainID := chainid() - } - } - - function getDigest(address owner, address spender, uint amount, uint nonce, uint deadline) external view returns (bytes32) { - return keccak256(abi.encodePacked( - uint16(0x1901), - domainSeparator(), - keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, amount, nonce, deadline)) - ) - ); - } - - function recoverAddress(bytes32 digest, uint8 v, bytes32 r, bytes32 s) external pure returns (address) { - return ecrecover(digest, v, r, s); - } -} diff --git a/contracts/src/OldTestContracts/BorrowerOperationsTester.sol b/contracts/src/OldTestContracts/BorrowerOperationsTester.sol deleted file mode 100644 index 142cbdad..00000000 --- a/contracts/src/OldTestContracts/BorrowerOperationsTester.sol +++ /dev/null @@ -1,63 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.18; - -import "../BorrowerOperations.sol"; - -/* Tester contract inherits from BorrowerOperations, and provides external functions -for testing the parent's internal functions. */ -contract BorrowerOperationsTester is BorrowerOperations { - - function getNewICRFromTroveChange - ( - uint _coll, - uint _debt, - uint _collChange, - bool isCollIncrease, - uint _debtChange, - bool isDebtIncrease, - uint _price - ) - external - pure - returns (uint) - { - return _getNewICRFromTroveChange(_coll, _debt, _collChange, isCollIncrease, _debtChange, isDebtIncrease, _price); - } - - function getNewTCRFromTroveChange - ( - uint _collChange, - bool isCollIncrease, - uint _debtChange, - bool isDebtIncrease, - uint _price - ) - external - view - returns (uint) - { - return _getNewTCRFromTroveChange(_collChange, isCollIncrease, _debtChange, isDebtIncrease, _price); - } - - function getUSDValue(uint _coll, uint _price) external pure returns (uint) { - return _getUSDValue(_coll, _price); - } - - function callInternalAdjustLoan - ( - address _borrower, - uint _collWithdrawal, - uint _debtChange, - bool _isDebtIncrease, - address _upperHint, - address _lowerHint) - external - { - _adjustTrove(_borrower, _collWithdrawal, _debtChange, _isDebtIncrease, _upperHint, _lowerHint, 0); - } - - - // Payable fallback function - receive() external payable { } -} diff --git a/contracts/src/OldTestContracts/CDPManagerTester.sol b/contracts/src/OldTestContracts/CDPManagerTester.sol deleted file mode 100644 index 02eee294..00000000 --- a/contracts/src/OldTestContracts/CDPManagerTester.sol +++ /dev/null @@ -1,60 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.18; - -import "../TroveManager.sol"; - -/* Tester contract inherits from TroveManager, and provides external functions -for testing the parent's internal functions. */ - -contract TroveManagerTester is TroveManager { - - function computeICR(uint _coll, uint _debt, uint _price) external pure returns (uint) { - return LiquityMath._computeCR(_coll, _debt, _price); - } - - function getCollGasCompensation(uint _coll) external pure returns (uint) { - return _getCollGasCompensation(_coll); - } - - function getBoldGasCompensation() external pure returns (uint) { - return BOLD_GAS_COMPENSATION; - } - - function getCompositeDebt(uint _debt) external pure returns (uint) { - return _getCompositeDebt(_debt); - } - - function unprotectedDecayBaseRateFromBorrowing() external returns (uint) { - baseRate = _calcDecayedBaseRate(); - assert(baseRate >= 0 && baseRate <= DECIMAL_PRECISION); - - _updateLastFeeOpTime(); - return baseRate; - } - - function minutesPassedSinceLastFeeOp() external view returns (uint) { - return _minutesPassedSinceLastFeeOp(); - } - - function setLastFeeOpTimeToNow() external { - lastFeeOperationTime = block.timestamp; - } - - function setBaseRate(uint _baseRate) external { - baseRate = _baseRate; - } - - function callGetRedemptionFee(uint _ETHDrawn) external view returns (uint) { - _getRedemptionFee(_ETHDrawn); - } - - function getActualDebtFromComposite(uint _debtVal) external pure returns (uint) { - return _getNetDebt(_debtVal); - } - - function callInternalRemoveTroveOwner(address _troveOwner) external { - uint troveOwnersArrayLength = TroveOwners.length; - _removeTroveOwner(_troveOwner, troveOwnersArrayLength); - } -} diff --git a/contracts/src/OldTestContracts/DefaultPoolTester.sol b/contracts/src/OldTestContracts/DefaultPoolTester.sol deleted file mode 100644 index a81c3f47..00000000 --- a/contracts/src/OldTestContracts/DefaultPoolTester.sol +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.18; - -import "../DefaultPool.sol"; - -contract DefaultPoolTester is DefaultPool { - - function unprotectedIncreaseBoldDebt(uint _amount) external { - BoldDebt = BoldDebt + _amount; - } - - function unprotectedPayable() external payable { - ETH = ETH + msg.value; - } -} diff --git a/contracts/src/OldTestContracts/Destructible.sol b/contracts/src/OldTestContracts/Destructible.sol deleted file mode 100644 index 2146a9ff..00000000 --- a/contracts/src/OldTestContracts/Destructible.sol +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.18; - -contract Destructible { - - receive() external payable {} - - function destruct(address payable _receiver) external { - selfdestruct(_receiver); - } -} diff --git a/contracts/src/OldTestContracts/FunctionCaller.sol b/contracts/src/OldTestContracts/FunctionCaller.sol deleted file mode 100644 index 04929ae6..00000000 --- a/contracts/src/OldTestContracts/FunctionCaller.sol +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.18; - -import '../Interfaces/ITroveManager.sol'; -import '../Interfaces/ISortedTroves.sol'; -import '../Interfaces/IPriceFeed.sol'; -import '../Dependencies/LiquityMath.sol'; - -/* Wrapper contract - used for calculating gas of read-only and internal functions. -Not part of the Liquity application. */ -contract FunctionCaller { - - ITroveManager troveManager; - address public troveManagerAddress; - - ISortedTroves sortedTroves; - address public sortedTrovesAddress; - - IPriceFeed priceFeed; - address public priceFeedAddress; - - // --- Dependency setters --- - - function setTroveManagerAddress(address _troveManagerAddress) external { - troveManagerAddress = _troveManagerAddress; - troveManager = ITroveManager(_troveManagerAddress); - } - - function setSortedTrovesAddress(address _sortedTrovesAddress) external { - troveManagerAddress = _sortedTrovesAddress; - sortedTroves = ISortedTroves(_sortedTrovesAddress); - } - - function setPriceFeedAddress(address _priceFeedAddress) external { - priceFeedAddress = _priceFeedAddress; - priceFeed = IPriceFeed(_priceFeedAddress); - } - - // --- Non-view wrapper functions used for calculating gas --- - - function troveManager_getCurrentICR(address _address, uint _price) external returns (uint) { - return troveManager.getCurrentICR(_address, _price); - } - - function sortedTroves_findInsertPosition(uint _NICR, address _prevId, address _nextId) external returns (address, address) { - return sortedTroves.findInsertPosition(_NICR, _prevId, _nextId); - } -} diff --git a/contracts/src/OldTestContracts/LiquityMathTester.sol b/contracts/src/OldTestContracts/LiquityMathTester.sol deleted file mode 100644 index 627bf788..00000000 --- a/contracts/src/OldTestContracts/LiquityMathTester.sol +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.18; - -import "../Dependencies/LiquityMath.sol"; - -/* Tester contract for math functions in Math.sol library. */ - -contract LiquityMathTester { - - function callMax(uint _a, uint _b) external pure returns (uint) { - return LiquityMath._max(_a, _b); - } - - // Non-view wrapper for gas test - function callDecPowTx(uint _base, uint _n) external returns (uint) { - return LiquityMath._decPow(_base, _n); - } - - // External wrapper - function callDecPow(uint _base, uint _n) external pure returns (uint) { - return LiquityMath._decPow(_base, _n); - } -} diff --git a/contracts/src/OldTestContracts/MockTellor.sol b/contracts/src/OldTestContracts/MockTellor.sol deleted file mode 100644 index be039b47..00000000 --- a/contracts/src/OldTestContracts/MockTellor.sol +++ /dev/null @@ -1,51 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.18; - - -contract MockTellor { - - // --- Mock price data --- - - bool didRetrieve = true; // default to a positive retrieval - uint private price; - uint private updateTime; - - bool private revertRequest; - - // --- Setters for mock price data --- - - function setPrice(uint _price) external { - price = _price; - } - - function setDidRetrieve(bool _didRetrieve) external { - didRetrieve = _didRetrieve; - } - - function setUpdateTime(uint _updateTime) external { - updateTime = _updateTime; - } - - function setRevertRequest() external { - revertRequest = !revertRequest; - } - - // --- Mock data reporting functions --- - - function getTimestampbyRequestIDandIndex(uint, uint) external view returns (uint) { - return updateTime; - } - - function getNewValueCountbyRequestId(uint) external view returns (uint) { - if (revertRequest) {require (1 == 0, "Tellor request reverted");} - return 1; - } - - function retrieveData(uint256, uint256) external view returns (uint256) { - return price; - } - - - -} diff --git a/contracts/src/OldTestContracts/NonPayable.sol b/contracts/src/OldTestContracts/NonPayable.sol deleted file mode 100644 index 6539427c..00000000 --- a/contracts/src/OldTestContracts/NonPayable.sol +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.18; - -//import "../Dependencies/console.sol"; - - -contract NonPayable { - bool isPayable; - - function setPayable(bool _isPayable) external { - isPayable = _isPayable; - } - - function forward(address _dest, bytes calldata _data) external payable { - (bool success, bytes memory returnData) = _dest.call{ value: msg.value }(_data); - //console.logBytes(returnData); - require(success, string(returnData)); - } - - receive() external payable { - require(isPayable); - } -} diff --git a/contracts/src/OldTestContracts/PriceFeedTester.sol b/contracts/src/OldTestContracts/PriceFeedTester.sol deleted file mode 100644 index aec017ef..00000000 --- a/contracts/src/OldTestContracts/PriceFeedTester.sol +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.18; - -import "../PriceFeed.sol"; - -contract PriceFeedTester is PriceFeed { - - function setLastGoodPrice(uint _lastGoodPrice) external { - lastGoodPrice = _lastGoodPrice; - } - - function setStatus(Status _status) external { - status = _status; - } -} \ No newline at end of file diff --git a/contracts/src/OldTestContracts/PriceFeedTestnet.sol b/contracts/src/OldTestContracts/PriceFeedTestnet.sol deleted file mode 100644 index c85eb6c1..00000000 --- a/contracts/src/OldTestContracts/PriceFeedTestnet.sol +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.18; - -import "../Interfaces/IPriceFeedTestnet.sol"; - -/* -* PriceFeed placeholder for testnet and development. The price is simply set manually and saved in a state -* variable. The contract does not connect to a live Chainlink price feed. -*/ -contract PriceFeedTestnet is IPriceFeedTestnet { - event LastGoodPriceUpdated(uint _lastGoodPrice); - - uint256 private _price = 200 * 1e18; - - // --- Functions --- - - // View price getter for simplicity in tests - function getPrice() external view returns (uint256) { - return _price; - } - - function fetchPrice() external override returns (uint256) { - // Fire an event just like the mainnet version would. - // This lets the subgraph rely on events to get the latest price even when developing locally. - emit LastGoodPriceUpdated(_price); - return _price; - } - - // Manual external price setter. - function setPrice(uint256 price) external returns (bool) { - _price = price; - return true; - } -} diff --git a/contracts/src/OldTestContracts/SortedTrovesTester.sol b/contracts/src/OldTestContracts/SortedTrovesTester.sol deleted file mode 100644 index 3a373d16..00000000 --- a/contracts/src/OldTestContracts/SortedTrovesTester.sol +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.18; - -import "../Interfaces/ISortedTroves.sol"; - - -contract SortedTrovesTester { - ISortedTroves sortedTroves; - - function setSortedTroves(address _sortedTrovesAddress) external { - sortedTroves = ISortedTroves(_sortedTrovesAddress); - } - - function insert(address _id, uint256 _NICR, address _prevId, address _nextId) external { - sortedTroves.insert(_id, _NICR, _prevId, _nextId); - } - - function remove(address _id) external { - sortedTroves.remove(_id); - } - - function reInsert(address _id, uint256 _newNICR, address _prevId, address _nextId) external { - sortedTroves.reInsert(_id, _newNICR, _prevId, _nextId); - } - - function getNominalICR(address) external pure returns (uint) { - return 1; - } - - function getCurrentICR(address, uint) external pure returns (uint) { - return 1; - } -} diff --git a/contracts/src/OldTestContracts/StabilityPoolTester.sol b/contracts/src/OldTestContracts/StabilityPoolTester.sol deleted file mode 100644 index 57f503ce..00000000 --- a/contracts/src/OldTestContracts/StabilityPoolTester.sol +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.18; - -import "../StabilityPool.sol"; - -contract StabilityPoolTester is StabilityPool { - - function unprotectedPayable() external payable { - ETH = ETH + msg.value; - } - - function setCurrentScale(uint128 _currentScale) external { - currentScale = _currentScale; - } - - function setTotalDeposits(uint _totalBoldDeposits) external { - totalBoldDeposits = _totalBoldDeposits; - } -} diff --git a/contracts/src/TestContracts/PriceFeedTestnet.sol b/contracts/src/TestContracts/PriceFeedTestnet.sol index 2f220196..3c57c514 100644 --- a/contracts/src/TestContracts/PriceFeedTestnet.sol +++ b/contracts/src/TestContracts/PriceFeedTestnet.sol @@ -2,13 +2,13 @@ pragma solidity 0.8.18; -import "../Interfaces/IPriceFeed.sol"; +import "../test/TestContracts/Interfaces/IPriceFeedTestnet.sol"; /* * PriceFeed placeholder for testnet and development. The price is simply set manually and saved in a state * variable. The contract does not connect to a live Chainlink price feed. */ -contract PriceFeedTestnet is IPriceFeed { +contract PriceFeedTestnet is IPriceFeedTestnet { event LastGoodPriceUpdated(uint _lastGoodPrice); uint256 private _price = 200 * 1e18; diff --git a/contracts/src/TroveManager.sol b/contracts/src/TroveManager.sol index 087b0f4d..03d5da9f 100644 --- a/contracts/src/TroveManager.sol +++ b/contracts/src/TroveManager.sol @@ -13,7 +13,7 @@ import "./Dependencies/LiquityBase.sol"; import "./Dependencies/Ownable.sol"; import "./Dependencies/CheckContract.sol"; -import "forge-std/console2.sol"; +// import "forge-std/console2.sol"; contract TroveManager is LiquityBase, Ownable, CheckContract, ITroveManager { string constant public NAME = "TroveManager"; diff --git a/contracts/src/test/TestContracts/DevTestSetup.sol b/contracts/src/test/TestContracts/DevTestSetup.sol index 0313326a..ec44f378 100644 --- a/contracts/src/test/TestContracts/DevTestSetup.sol +++ b/contracts/src/test/TestContracts/DevTestSetup.sol @@ -2,7 +2,7 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.18; -import "../../Interfaces/IPriceFeedTestnet.sol"; +import "./Interfaces/IPriceFeedTestnet.sol"; import "../../ActivePool.sol"; import "../../BoldToken.sol"; @@ -12,7 +12,7 @@ import "../../DefaultPool.sol"; import "../../GasPool.sol"; import "../../HintHelpers.sol"; import "../../MultiTroveGetter.sol"; -import "../../OldTestContracts/PriceFeedTestnet.sol"; +import "../../TestContracts/PriceFeedTestnet.sol"; import "../../SortedTroves.sol"; import "../../StabilityPool.sol"; import "../../TroveManager.sol"; diff --git a/contracts/src/Interfaces/IPriceFeedTestnet.sol b/contracts/src/test/TestContracts/Interfaces/IPriceFeedTestnet.sol similarity index 78% rename from contracts/src/Interfaces/IPriceFeedTestnet.sol rename to contracts/src/test/TestContracts/Interfaces/IPriceFeedTestnet.sol index 5db7d1df..06325aa0 100644 --- a/contracts/src/Interfaces/IPriceFeedTestnet.sol +++ b/contracts/src/test/TestContracts/Interfaces/IPriceFeedTestnet.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.18; -import "./IPriceFeed.sol"; +import "../../../Interfaces/IPriceFeed.sol"; interface IPriceFeedTestnet is IPriceFeed { function setPrice(uint256 _price) external returns (bool); diff --git a/contracts/src/test/basicOps.t.sol b/contracts/src/test/basicOps.t.sol index 0fc8b51c..f5644b2a 100644 --- a/contracts/src/test/basicOps.t.sol +++ b/contracts/src/test/basicOps.t.sol @@ -160,7 +160,7 @@ contract BasicOps is DevTestSetup { assertEq(boldToken.balanceOf(A), 1900e18); assertEq(stabilityPool.getCompoundedBoldDeposit(A), 100e18); - // A tops up their SP deposit + // A withdraws their full SP deposit stabilityPool.withdrawFromSP(100e18); // Check A's balance increased and SP deposit decreased to 0