diff --git a/src/aave-v2/MorphoGovernance.sol b/src/aave-v2/MorphoGovernance.sol index fb472d156..bef68e4c8 100644 --- a/src/aave-v2/MorphoGovernance.sol +++ b/src/aave-v2/MorphoGovernance.sol @@ -357,17 +357,6 @@ abstract contract MorphoGovernance is MorphoUtils { emit IsDeprecatedSet(_poolToken, _isDeprecated); } - /// @notice Sets a market's asset as collateral. - /// @param _poolToken The address of the market to (un)set as collateral. - /// @param _assetAsCollateral True to set the asset as collateral (True by default). - function setAssetAsCollateral(address _poolToken, bool _assetAsCollateral) - external - onlyOwner - isMarketCreated(_poolToken) - { - pool.setUserUseReserveAsCollateral(market[_poolToken].underlyingToken, _assetAsCollateral); - } - /// @notice Increases peer-to-peer deltas, to put some liquidity back on the pool. /// @dev The current Morpho supply on the pool might not be enough to borrow `_amount` before resuppling it. /// In this case, consider calling multiple times this function. diff --git a/src/aave-v2/MorphoUtils.sol b/src/aave-v2/MorphoUtils.sol index 55a953660..39faa0981 100644 --- a/src/aave-v2/MorphoUtils.sol +++ b/src/aave-v2/MorphoUtils.sol @@ -285,18 +285,11 @@ abstract contract MorphoUtils is MorphoStorage { if (vars.poolToken != _poolToken) _updateIndexes(vars.poolToken); + // Assumes that the Morpho contract has not disabled the asset as collateral in the underlying pool. (assetData.ltv, assetData.liquidationThreshold, , assetData.decimals, ) = pool .getConfiguration(vars.underlyingToken) .getParamsMemory(); - // LTV and liquidation threshold should be zero if Morpho has not enabled this asset as collateral. - if ( - !morphoPoolConfig.isUsingAsCollateral(pool.getReserveData(vars.underlyingToken).id) - ) { - assetData.ltv = 0; - assetData.liquidationThreshold = 0; - } - unchecked { assetData.tokenUnit = 10**assetData.decimals; } diff --git a/test/aave-v2/TestBorrow.t.sol b/test/aave-v2/TestBorrow.t.sol index 6dea58d11..fc56b15f3 100644 --- a/test/aave-v2/TestBorrow.t.sol +++ b/test/aave-v2/TestBorrow.t.sol @@ -247,23 +247,6 @@ contract TestBorrow is TestSetup { borrower1.borrow(aUsdc, amount); } - function testShouldNotBorrowWithDisabledCollateral() public { - uint256 amount = 100 ether; - - borrower1.approve(dai, type(uint256).max); - borrower1.supply(aDai, amount * 10); - - // Give Morpho a position on the pool to be able to unset the DAI asset as collateral. - // Without this position on the pool, it's not possible to do so. - supplier1.approve(usdc, to6Decimals(amount)); - supplier1.supply(aUsdc, to6Decimals(amount)); - - morpho.setAssetAsCollateral(aDai, false); - - hevm.expectRevert(EntryPositionsManager.UnauthorisedBorrow.selector); - borrower1.borrow(aUsdc, to6Decimals(amount)); - } - function testBorrowLargerThanDeltaShouldClearDelta() public { // Allows only 10 unmatch suppliers.