Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pause assets on optimizers #58

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions test/transactions/data/optimizersPausing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"to": "0x40A2aCCbd92BCA938b02010E17A5b8929b49130D",
"value": 0,
"data": "0x8d80ff0a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000c2100a8b9650935efb3f2972d1ca4d3a8ba752d1a807a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000104468721a70000000000000000000000008888882f8f843896699869179fb6e4f7e3b588880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044c3ff9c96000000000000000000000000f650c3d88d12db855b8bf7d11be6c55a4e07dcc900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000a8b9650935efb3f2972d1ca4d3a8ba752d1a807a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000104468721a70000000000000000000000008888882f8f843896699869179fb6e4f7e3b5888800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000447feedb57000000000000000000000000f650c3d88d12db855b8bf7d11be6c55a4e07dcc900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000a8b9650935efb3f2972d1ca4d3a8ba752d1a807a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000104468721a70000000000000000000000008888882f8f843896699869179fb6e4f7e3b5888800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000447feedb570000000000000000000000004ddc2d193948926d02f9b1fe9e1daa0718270ed500000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000a8b9650935efb3f2972d1ca4d3a8ba752d1a807a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000104468721a70000000000000000000000008888882f8f843896699869179fb6e4f7e3b588880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044c3ff9c960000000000000000000000004ddc2d193948926d02f9b1fe9e1daa0718270ed500000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000a8b9650935efb3f2972d1ca4d3a8ba752d1a807a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000104468721a700000000000000000000000033333aea097c193e66081e930c33020272b33333000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004429edd4bb0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000a8b9650935efb3f2972d1ca4d3a8ba752d1a807a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000104468721a700000000000000000000000033333aea097c193e66081e930c33020272b33333000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004429edd4bb0000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c59900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000a8b9650935efb3f2972d1ca4d3a8ba752d1a807a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000104468721a700000000000000000000000033333aea097c193e66081e930c33020272b33333000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004429edd4bb000000000000000000000000be9895146f7af43049ca1c1ae358b0541ea4970400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000a8b9650935efb3f2972d1ca4d3a8ba752d1a807a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000104468721a700000000000000000000000033333aea097c193e66081e930c33020272b33333000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004429edd4bb00000000000000000000000083f20f44975d03b1b09e64809b757c47f942beea00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000a8b9650935efb3f2972d1ca4d3a8ba752d1a807a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000104468721a700000000000000000000000033333aea097c193e66081e930c33020272b33333000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004429edd4bb000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"operation": 1
}
2 changes: 1 addition & 1 deletion test/transactions/helpers/DelayModifierTxTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ abstract contract DelayModifierTxTest is MorphoDaoTxTest {
data: abi.encodeCall(
IAvatar.execTransactionFromModule,
(transaction.to, transaction.value, transaction.data, transaction.operation)
),
),
operation: Operation.Call
})
);
Expand Down
14 changes: 14 additions & 0 deletions test/transactions/helpers/OperatorTxTest.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./TxTest.sol";

abstract contract OperatorTxTest is TxTest {
constructor() {
avatars.push(operator);
}

function _execute(Tx memory transaction) internal virtual override {
operator.execTransactionFromModule(transaction.to, transaction.value, transaction.data, transaction.operation);
}
}
44 changes: 44 additions & 0 deletions test/transactions/optimizersPausingTxTest.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./helpers/OperatorTxTest.sol";

contract optimizersPausingTxTest is OperatorTxTest {
address internal constant cCOMP = 0x70e36f6BF80a52b3B46b3aF8e106CC0ed743E8e4;
address internal constant cWETH = 0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5;
address internal constant cUNI = 0x35A18000230DA775CAc24873d00Ff85BccdeD550;
address internal constant cUSDT = 0xf650C3d88D12dB855b8bf7D11Be6C55A4e07dCC9;
address internal constant DAI = 0x6B175474E89094C44Da98b954EedeAC495271d0F;
address internal constant WBTC = 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599;
address internal constant S_DAI = 0x83F20F44975D03b1b09e64809B757c47f942BEeA;
address internal constant CB_ETH = 0xBe9895146f7AF43049ca1c1AE358B0541Ea49704;
address internal constant USDT = 0xdAC17F958D2ee523a2206206994597C13D831ec7;

address[] internal pausedMC2Assets = [cCOMP, cWETH, cUNI, cUSDT];
address[] internal pausedMA3Assets = [DAI, WBTC, S_DAI, USDT, CB_ETH];

function _txName() internal pure override returns (string memory) {
return "optimizersPausing";
}

function _forkBlockNumber() internal virtual override returns (uint256) {
return 19_723_639;
}

function testOptimizersPausing() public {
for (uint256 i; i < pausedMC2Assets.length; i++) {
address asset = pausedMC2Assets[i];
IMorphoCompound.MarketPauseStatus memory market = morphoCompound.marketPauseStatus(asset);

assertTrue(market.isBorrowPaused, "mc2 isBorrowPaused");
assertTrue(market.isSupplyPaused, "mc2 isSupplyPaused");
}

for (uint256 i; i < pausedMA3Assets.length; i++) {
address asset = pausedMA3Assets[i];
IMorphoAaveV3.Market memory market = morphoAaveV3.market(asset);

assertTrue(market.pauseStatuses.isSupplyCollateralPaused, "ma3 isSupplyCollateralPaused");
}
}
}
Loading