From 8b71db64ecce70386de4c99f6b4e81c0e092b3f9 Mon Sep 17 00:00:00 2001 From: Dmytro Horbatenko Date: Wed, 15 Jul 2026 16:10:10 +0300 Subject: [PATCH] feat: enforce blacklist for mGLO and mHYPER --- .openzeppelin/mainnet.json | 212 ++++++++++++++++++ .openzeppelin/unknown-143.json | 216 ++++++++++++++++++- .openzeppelin/unknown-4663.json | 216 ++++++++++++++++++- .openzeppelin/unknown-747474.json | 216 ++++++++++++++++++- .openzeppelin/unknown-8453.json | 216 ++++++++++++++++++- .openzeppelin/unknown-9745.json | 216 ++++++++++++++++++- config/networks/index.ts | 3 +- scripts/upgrades/common/types.ts | 3 +- scripts/upgrades/common/upgrade-contracts.ts | 57 ++++- scripts/upgrades/common/upgrade-vaults.ts | 2 +- scripts/upgrades/configs/upgrade-configs.ts | 10 + scripts/upgrades/executeUpgrade_Token.ts | 36 ++-- scripts/upgrades/proposeUpgrade_Token.ts | 36 ++-- 13 files changed, 1378 insertions(+), 61 deletions(-) diff --git a/.openzeppelin/mainnet.json b/.openzeppelin/mainnet.json index 3f1e6fa6..8702234c 100644 --- a/.openzeppelin/mainnet.json +++ b/.openzeppelin/mainnet.json @@ -119416,6 +119416,218 @@ } } } + }, + "0517d183bdd10d9b5495f20604b38cfc96616941b76bc53537fe8235359e5ab7": { + "address": "0x3f0Ec5b26EC6E50907AbeA87a798bf395189BcD5", + "txHash": "0xd62ebacb1db28d3511712c307b5c89ba7cd2455300b4f19823fdf39ef9408dcc", + "layout": { + "solcVersion": "0.8.9", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_balances", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_address,t_uint256)", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:40" + }, + { + "label": "_allowances", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:42" + }, + { + "label": "_totalSupply", + "offset": 0, + "slot": "53", + "type": "t_uint256", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:44" + }, + { + "label": "_name", + "offset": 0, + "slot": "54", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:46" + }, + { + "label": "_symbol", + "offset": 0, + "slot": "55", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:47" + }, + { + "label": "__gap", + "offset": 0, + "slot": "56", + "type": "t_array(t_uint256)45_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:376" + }, + { + "label": "_paused", + "offset": 0, + "slot": "101", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC20PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PausableUpgradeable.sol:48" + }, + { + "label": "accessControl", + "offset": 0, + "slot": "201", + "type": "t_contract(MidasAccessControl)17280", + "contract": "WithMidasAccessControl", + "src": "contracts/access/WithMidasAccessControl.sol:24" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)50_storage", + "contract": "WithMidasAccessControl", + "src": "contracts/access/WithMidasAccessControl.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)50_storage", + "contract": "Blacklistable", + "src": "contracts/access/Blacklistable.sol:16" + }, + { + "label": "metadata", + "offset": 0, + "slot": "302", + "type": "t_mapping(t_bytes32,t_bytes_storage)", + "contract": "mToken", + "src": "contracts/mToken.sol:18" + }, + { + "label": "__gap", + "offset": 0, + "slot": "303", + "type": "t_array(t_uint256)50_storage", + "contract": "mToken", + "src": "contracts/mToken.sol:23" + }, + { + "label": "__gap", + "offset": 0, + "slot": "353", + "type": "t_array(t_uint256)50_storage", + "contract": "mHYPER", + "src": "contracts/products/mHYPER/mHYPER.sol:32" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)45_storage": { + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(MidasAccessControl)17280": { + "label": "contract MidasAccessControl", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_bytes_storage)": { + "label": "mapping(bytes32 => bytes)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } } } } diff --git a/.openzeppelin/unknown-143.json b/.openzeppelin/unknown-143.json index 76fa0107..46835e6f 100644 --- a/.openzeppelin/unknown-143.json +++ b/.openzeppelin/unknown-143.json @@ -1916,7 +1916,7 @@ "label": "accessControl", "offset": 0, "slot": "201", - "type": "t_contract(MidasAccessControl)15037", + "type": "t_contract(MidasAccessControl)17280", "contract": "WithMidasAccessControl", "src": "contracts/access/WithMidasAccessControl.sol:24" }, @@ -1990,7 +1990,7 @@ "label": "bytes", "numberOfBytes": "32" }, - "t_contract(MidasAccessControl)15037": { + "t_contract(MidasAccessControl)17280": { "label": "contract MidasAccessControl", "numberOfBytes": "20" }, @@ -3344,6 +3344,218 @@ } } } + }, + "0517d183bdd10d9b5495f20604b38cfc96616941b76bc53537fe8235359e5ab7": { + "address": "0xeB097d57FD58E090244e0d6e1fF816d2773F06dE", + "txHash": "0xdee0b1b5a77b8440c4c704a062594e60c61f0cc5fd9033496b44e3cd88698381", + "layout": { + "solcVersion": "0.8.9", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_balances", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_address,t_uint256)", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:40" + }, + { + "label": "_allowances", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:42" + }, + { + "label": "_totalSupply", + "offset": 0, + "slot": "53", + "type": "t_uint256", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:44" + }, + { + "label": "_name", + "offset": 0, + "slot": "54", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:46" + }, + { + "label": "_symbol", + "offset": 0, + "slot": "55", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:47" + }, + { + "label": "__gap", + "offset": 0, + "slot": "56", + "type": "t_array(t_uint256)45_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:376" + }, + { + "label": "_paused", + "offset": 0, + "slot": "101", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC20PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PausableUpgradeable.sol:48" + }, + { + "label": "accessControl", + "offset": 0, + "slot": "201", + "type": "t_contract(MidasAccessControl)17280", + "contract": "WithMidasAccessControl", + "src": "contracts/access/WithMidasAccessControl.sol:24" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)50_storage", + "contract": "WithMidasAccessControl", + "src": "contracts/access/WithMidasAccessControl.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)50_storage", + "contract": "Blacklistable", + "src": "contracts/access/Blacklistable.sol:16" + }, + { + "label": "metadata", + "offset": 0, + "slot": "302", + "type": "t_mapping(t_bytes32,t_bytes_storage)", + "contract": "mToken", + "src": "contracts/mToken.sol:18" + }, + { + "label": "__gap", + "offset": 0, + "slot": "303", + "type": "t_array(t_uint256)50_storage", + "contract": "mToken", + "src": "contracts/mToken.sol:23" + }, + { + "label": "__gap", + "offset": 0, + "slot": "353", + "type": "t_array(t_uint256)50_storage", + "contract": "mHYPER", + "src": "contracts/products/mHYPER/mHYPER.sol:32" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)45_storage": { + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(MidasAccessControl)17280": { + "label": "contract MidasAccessControl", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_bytes_storage)": { + "label": "mapping(bytes32 => bytes)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } } } } diff --git a/.openzeppelin/unknown-4663.json b/.openzeppelin/unknown-4663.json index 4711f353..0919536b 100644 --- a/.openzeppelin/unknown-4663.json +++ b/.openzeppelin/unknown-4663.json @@ -278,7 +278,7 @@ "label": "accessControl", "offset": 0, "slot": "201", - "type": "t_contract(MidasAccessControl)9979", + "type": "t_contract(MidasAccessControl)17280", "contract": "WithMidasAccessControl", "src": "contracts/access/WithMidasAccessControl.sol:24" }, @@ -352,7 +352,7 @@ "label": "bytes", "numberOfBytes": "32" }, - "t_contract(MidasAccessControl)9979": { + "t_contract(MidasAccessControl)17280": { "label": "contract MidasAccessControl", "numberOfBytes": "20" }, @@ -1972,6 +1972,218 @@ } } } + }, + "bd43bec9d71009d2d5057a25b7b2ff2271c3c1265815d8930c185e8c634ef4cd": { + "address": "0xF29aEF8CBe31e5D257D6D3afaB1580de8210f650", + "txHash": "0x4f3691e63c9cd3c484a5633af9881a104eb468e22e41dbd8a8a78212216c8abb", + "layout": { + "solcVersion": "0.8.9", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_balances", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_address,t_uint256)", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:40" + }, + { + "label": "_allowances", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:42" + }, + { + "label": "_totalSupply", + "offset": 0, + "slot": "53", + "type": "t_uint256", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:44" + }, + { + "label": "_name", + "offset": 0, + "slot": "54", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:46" + }, + { + "label": "_symbol", + "offset": 0, + "slot": "55", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:47" + }, + { + "label": "__gap", + "offset": 0, + "slot": "56", + "type": "t_array(t_uint256)45_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:376" + }, + { + "label": "_paused", + "offset": 0, + "slot": "101", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC20PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PausableUpgradeable.sol:48" + }, + { + "label": "accessControl", + "offset": 0, + "slot": "201", + "type": "t_contract(MidasAccessControl)17280", + "contract": "WithMidasAccessControl", + "src": "contracts/access/WithMidasAccessControl.sol:24" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)50_storage", + "contract": "WithMidasAccessControl", + "src": "contracts/access/WithMidasAccessControl.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)50_storage", + "contract": "Blacklistable", + "src": "contracts/access/Blacklistable.sol:16" + }, + { + "label": "metadata", + "offset": 0, + "slot": "302", + "type": "t_mapping(t_bytes32,t_bytes_storage)", + "contract": "mToken", + "src": "contracts/mToken.sol:18" + }, + { + "label": "__gap", + "offset": 0, + "slot": "303", + "type": "t_array(t_uint256)50_storage", + "contract": "mToken", + "src": "contracts/mToken.sol:23" + }, + { + "label": "__gap", + "offset": 0, + "slot": "353", + "type": "t_array(t_uint256)50_storage", + "contract": "mGLO", + "src": "contracts/products/mGLO/mGLO.sol:33" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)45_storage": { + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(MidasAccessControl)17280": { + "label": "contract MidasAccessControl", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_bytes_storage)": { + "label": "mapping(bytes32 => bytes)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } } } } diff --git a/.openzeppelin/unknown-747474.json b/.openzeppelin/unknown-747474.json index 235dd994..4234d6d1 100644 --- a/.openzeppelin/unknown-747474.json +++ b/.openzeppelin/unknown-747474.json @@ -6934,7 +6934,7 @@ "label": "accessControl", "offset": 0, "slot": "201", - "type": "t_contract(MidasAccessControl)15037", + "type": "t_contract(MidasAccessControl)17280", "contract": "WithMidasAccessControl", "src": "contracts/access/WithMidasAccessControl.sol:24" }, @@ -7008,7 +7008,7 @@ "label": "bytes", "numberOfBytes": "32" }, - "t_contract(MidasAccessControl)15037": { + "t_contract(MidasAccessControl)17280": { "label": "contract MidasAccessControl", "numberOfBytes": "20" }, @@ -7678,6 +7678,218 @@ } } } + }, + "0517d183bdd10d9b5495f20604b38cfc96616941b76bc53537fe8235359e5ab7": { + "address": "0x86E6EA4f7930cec5fF657A1511b09f062A047403", + "txHash": "0xb5ac665d1940adbd8b5678090a848beb9988fe6dc49cc1f438f2aa7d47cbb05f", + "layout": { + "solcVersion": "0.8.9", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_balances", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_address,t_uint256)", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:40" + }, + { + "label": "_allowances", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:42" + }, + { + "label": "_totalSupply", + "offset": 0, + "slot": "53", + "type": "t_uint256", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:44" + }, + { + "label": "_name", + "offset": 0, + "slot": "54", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:46" + }, + { + "label": "_symbol", + "offset": 0, + "slot": "55", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:47" + }, + { + "label": "__gap", + "offset": 0, + "slot": "56", + "type": "t_array(t_uint256)45_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:376" + }, + { + "label": "_paused", + "offset": 0, + "slot": "101", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC20PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PausableUpgradeable.sol:48" + }, + { + "label": "accessControl", + "offset": 0, + "slot": "201", + "type": "t_contract(MidasAccessControl)17280", + "contract": "WithMidasAccessControl", + "src": "contracts/access/WithMidasAccessControl.sol:24" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)50_storage", + "contract": "WithMidasAccessControl", + "src": "contracts/access/WithMidasAccessControl.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)50_storage", + "contract": "Blacklistable", + "src": "contracts/access/Blacklistable.sol:16" + }, + { + "label": "metadata", + "offset": 0, + "slot": "302", + "type": "t_mapping(t_bytes32,t_bytes_storage)", + "contract": "mToken", + "src": "contracts/mToken.sol:18" + }, + { + "label": "__gap", + "offset": 0, + "slot": "303", + "type": "t_array(t_uint256)50_storage", + "contract": "mToken", + "src": "contracts/mToken.sol:23" + }, + { + "label": "__gap", + "offset": 0, + "slot": "353", + "type": "t_array(t_uint256)50_storage", + "contract": "mHYPER", + "src": "contracts/products/mHYPER/mHYPER.sol:32" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)45_storage": { + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(MidasAccessControl)17280": { + "label": "contract MidasAccessControl", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_bytes_storage)": { + "label": "mapping(bytes32 => bytes)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } } } } diff --git a/.openzeppelin/unknown-8453.json b/.openzeppelin/unknown-8453.json index 97f84e53..f1400ba0 100644 --- a/.openzeppelin/unknown-8453.json +++ b/.openzeppelin/unknown-8453.json @@ -24142,7 +24142,7 @@ "label": "accessControl", "offset": 0, "slot": "201", - "type": "t_contract(MidasAccessControl)9979", + "type": "t_contract(MidasAccessControl)17280", "contract": "WithMidasAccessControl", "src": "contracts/access/WithMidasAccessControl.sol:24" }, @@ -24216,7 +24216,7 @@ "label": "bytes", "numberOfBytes": "32" }, - "t_contract(MidasAccessControl)9979": { + "t_contract(MidasAccessControl)17280": { "label": "contract MidasAccessControl", "numberOfBytes": "20" }, @@ -25556,6 +25556,218 @@ } } } + }, + "bd43bec9d71009d2d5057a25b7b2ff2271c3c1265815d8930c185e8c634ef4cd": { + "address": "0xA311dcE4469159300abE083fDBa21431ec690753", + "txHash": "0xa4794796cdb60c710fd22cd0f9b962b74409f26457103e47c25211901824bfef", + "layout": { + "solcVersion": "0.8.9", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_balances", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_address,t_uint256)", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:40" + }, + { + "label": "_allowances", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:42" + }, + { + "label": "_totalSupply", + "offset": 0, + "slot": "53", + "type": "t_uint256", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:44" + }, + { + "label": "_name", + "offset": 0, + "slot": "54", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:46" + }, + { + "label": "_symbol", + "offset": 0, + "slot": "55", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:47" + }, + { + "label": "__gap", + "offset": 0, + "slot": "56", + "type": "t_array(t_uint256)45_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:376" + }, + { + "label": "_paused", + "offset": 0, + "slot": "101", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC20PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PausableUpgradeable.sol:48" + }, + { + "label": "accessControl", + "offset": 0, + "slot": "201", + "type": "t_contract(MidasAccessControl)17280", + "contract": "WithMidasAccessControl", + "src": "contracts/access/WithMidasAccessControl.sol:24" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)50_storage", + "contract": "WithMidasAccessControl", + "src": "contracts/access/WithMidasAccessControl.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)50_storage", + "contract": "Blacklistable", + "src": "contracts/access/Blacklistable.sol:16" + }, + { + "label": "metadata", + "offset": 0, + "slot": "302", + "type": "t_mapping(t_bytes32,t_bytes_storage)", + "contract": "mToken", + "src": "contracts/mToken.sol:18" + }, + { + "label": "__gap", + "offset": 0, + "slot": "303", + "type": "t_array(t_uint256)50_storage", + "contract": "mToken", + "src": "contracts/mToken.sol:23" + }, + { + "label": "__gap", + "offset": 0, + "slot": "353", + "type": "t_array(t_uint256)50_storage", + "contract": "mGLO", + "src": "contracts/products/mGLO/mGLO.sol:33" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)45_storage": { + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(MidasAccessControl)17280": { + "label": "contract MidasAccessControl", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_bytes_storage)": { + "label": "mapping(bytes32 => bytes)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } } } } diff --git a/.openzeppelin/unknown-9745.json b/.openzeppelin/unknown-9745.json index c2bb533f..3adbf2ce 100644 --- a/.openzeppelin/unknown-9745.json +++ b/.openzeppelin/unknown-9745.json @@ -3509,7 +3509,7 @@ "label": "accessControl", "offset": 0, "slot": "201", - "type": "t_contract(MidasAccessControl)15037", + "type": "t_contract(MidasAccessControl)17280", "contract": "WithMidasAccessControl", "src": "contracts/access/WithMidasAccessControl.sol:24" }, @@ -3583,7 +3583,7 @@ "label": "bytes", "numberOfBytes": "32" }, - "t_contract(MidasAccessControl)15037": { + "t_contract(MidasAccessControl)17280": { "label": "contract MidasAccessControl", "numberOfBytes": "20" }, @@ -5451,6 +5451,218 @@ } } } + }, + "0517d183bdd10d9b5495f20604b38cfc96616941b76bc53537fe8235359e5ab7": { + "address": "0xe8b32cb5a6B87e24Cfe18B5dD8254bBcE33cE9FA", + "txHash": "0xa40367eccf4adb5797e071e9f6fca5a6d219f31a14067c9ac81a69b7038767ef", + "layout": { + "solcVersion": "0.8.9", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_balances", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_address,t_uint256)", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:40" + }, + { + "label": "_allowances", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:42" + }, + { + "label": "_totalSupply", + "offset": 0, + "slot": "53", + "type": "t_uint256", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:44" + }, + { + "label": "_name", + "offset": 0, + "slot": "54", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:46" + }, + { + "label": "_symbol", + "offset": 0, + "slot": "55", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:47" + }, + { + "label": "__gap", + "offset": 0, + "slot": "56", + "type": "t_array(t_uint256)45_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:376" + }, + { + "label": "_paused", + "offset": 0, + "slot": "101", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC20PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PausableUpgradeable.sol:48" + }, + { + "label": "accessControl", + "offset": 0, + "slot": "201", + "type": "t_contract(MidasAccessControl)17280", + "contract": "WithMidasAccessControl", + "src": "contracts/access/WithMidasAccessControl.sol:24" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)50_storage", + "contract": "WithMidasAccessControl", + "src": "contracts/access/WithMidasAccessControl.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)50_storage", + "contract": "Blacklistable", + "src": "contracts/access/Blacklistable.sol:16" + }, + { + "label": "metadata", + "offset": 0, + "slot": "302", + "type": "t_mapping(t_bytes32,t_bytes_storage)", + "contract": "mToken", + "src": "contracts/mToken.sol:18" + }, + { + "label": "__gap", + "offset": 0, + "slot": "303", + "type": "t_array(t_uint256)50_storage", + "contract": "mToken", + "src": "contracts/mToken.sol:23" + }, + { + "label": "__gap", + "offset": 0, + "slot": "353", + "type": "t_array(t_uint256)50_storage", + "contract": "mHYPER", + "src": "contracts/products/mHYPER/mHYPER.sol:32" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)45_storage": { + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "label": "bytes", + "numberOfBytes": "32" + }, + "t_contract(MidasAccessControl)17280": { + "label": "contract MidasAccessControl", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_bytes_storage)": { + "label": "mapping(bytes32 => bytes)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } } } } diff --git a/config/networks/index.ts b/config/networks/index.ts index 017030da..6dc7b46b 100644 --- a/config/networks/index.ts +++ b/config/networks/index.ts @@ -61,8 +61,7 @@ const defaultRpcUrls: ConfigPerNetwork = { optimism: ALCHEMY_KEY ? `https://opt-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}` : `https://optimism-mainnet.infura.io/v3/${INFURA_KEY}`, - // TODO: Put real robinhood RPC URL when provided - robinhood: 'https://rpc.robinhood.invalid', + robinhood: 'https://rpc.mainnet.chain.robinhood.com', }; export const rpcUrls: ConfigPerNetwork = Object.entries( diff --git a/scripts/upgrades/common/types.ts b/scripts/upgrades/common/types.ts index 517fa135..ee0ec7fc 100644 --- a/scripts/upgrades/common/types.ts +++ b/scripts/upgrades/common/types.ts @@ -24,7 +24,8 @@ export type UpgradeConfig = { > >; overrideSalt?: string; - vaults: Record< + tokens?: Record; + vaults?: Record< number, { // default - false diff --git a/scripts/upgrades/common/upgrade-contracts.ts b/scripts/upgrades/common/upgrade-contracts.ts index 21a80082..cfa5e6d2 100644 --- a/scripts/upgrades/common/upgrade-contracts.ts +++ b/scripts/upgrades/common/upgrade-contracts.ts @@ -1,7 +1,7 @@ import { DeployImplementationResponse } from '@openzeppelin/hardhat-upgrades/dist/deploy-implementation'; import { HardhatRuntimeEnvironment } from 'hardhat/types'; -import { MTokenName } from '../../../config'; +import { chainIds, MTokenName, Network } from '../../../config'; import { getCurrentAddresses, TokenAddresses, @@ -10,20 +10,25 @@ import { getTokenContractNames, TokenContractNames, } from '../../../helpers/contracts'; -import { etherscanVerify, logDeploy } from '../../../helpers/utils'; +import { + etherscanVerify, + getChainOrThrow, + logDeploy, +} from '../../../helpers/utils'; import { executeTimeLockUpgradeTx, GetUpgradeTxParams, proposeTimeLockUpgradeTx, } from '../../deploy/common/timelock'; import { getDeployer } from '../../deploy/common/utils'; +import { upgradeConfigs } from '../configs/upgrade-configs'; // TODO: refactor this whole file and make upgrades more generic type ContractType = 'customAggregator' | 'customAggregatorGrowth' | 'token'; type ContractTypeToUpgrade = 'customFeed' | 'customFeedGrowth' | 'token'; -type MTokenContractsToUpgrade = { +export type MTokenContractsToUpgrade = { mToken: MTokenName; addresses: TokenAddresses; contracts: { @@ -35,6 +40,52 @@ type MTokenContractsToUpgrade = { }[]; }; +export const getConfiguredTokenUpgrades = ( + hre: HardhatRuntimeEnvironment, + upgradeId: string, +): MTokenContractsToUpgrade[] => { + const { chainId, networkName } = getChainOrThrow(hre); + + if (chainIds[networkName as Network] !== chainId) { + throw new Error( + `Network mismatch: ${networkName} is configured for chain ${ + chainIds[networkName as Network] + }, got ${chainId}`, + ); + } + + const mTokens = upgradeConfigs.upgrades[upgradeId]?.tokens?.[chainId]; + + if (!mTokens?.length) { + throw new Error( + `Token upgrade config not found for ${upgradeId} on chain ${chainId}`, + ); + } + + const seen = new Set(); + + return mTokens.map((mToken) => { + if (seen.has(mToken)) { + throw new Error( + `Duplicate token upgrade target: ${networkName}.${mToken}`, + ); + } + seen.add(mToken); + + const addresses = getCurrentAddresses(hre)?.[mToken]; + + if (!addresses?.token) { + throw new Error(`Token addresses not found for ${mToken}`); + } + + return { + mToken, + addresses, + contracts: [{ contractType: 'token' }], + }; + }); +}; + export const proposeUpgradeContracts = async ( hre: HardhatRuntimeEnvironment, upgradeId: string, diff --git a/scripts/upgrades/common/upgrade-vaults.ts b/scripts/upgrades/common/upgrade-vaults.ts index 0058fe5b..78f9b9aa 100644 --- a/scripts/upgrades/common/upgrade-vaults.ts +++ b/scripts/upgrades/common/upgrade-vaults.ts @@ -169,7 +169,7 @@ const upgradeAllVaults = async ( throw new Error(`Upgrade config not found for upgrade ${upgradeId}`); } - const toUpgrade = config.vaults[hre.network.config.chainId!]; + const toUpgrade = config.vaults?.[hre.network.config.chainId!]; if (!toUpgrade) { throw new Error( diff --git a/scripts/upgrades/configs/upgrade-configs.ts b/scripts/upgrades/configs/upgrade-configs.ts index 1840fbfe..839e46f5 100644 --- a/scripts/upgrades/configs/upgrade-configs.ts +++ b/scripts/upgrades/configs/upgrade-configs.ts @@ -5,6 +5,16 @@ import { UpgradeConfig } from '../common/types'; export const upgradeConfigs: UpgradeConfig = { upgrades: { + 'mtoken-blacklist-enforcement': { + tokens: { + [chainIds.robinhood]: ['mGLO'], + [chainIds.base]: ['mGLO'], + [chainIds.main]: ['mHYPER'], + [chainIds.monad]: ['mHYPER'], + [chainIds.plasma]: ['mHYPER'], + [chainIds.katana]: ['mHYPER'], + }, + }, 'mfone-rv-swapper-to-mtoken': { vaults: { [chainIds.sepolia]: { diff --git a/scripts/upgrades/executeUpgrade_Token.ts b/scripts/upgrades/executeUpgrade_Token.ts index d0cbaeba..04eb1470 100644 --- a/scripts/upgrades/executeUpgrade_Token.ts +++ b/scripts/upgrades/executeUpgrade_Token.ts @@ -1,32 +1,24 @@ import { HardhatRuntimeEnvironment } from 'hardhat/types'; -import { executeUpgradeContracts } from './common/upgrade-contracts'; +import { + executeUpgradeContracts, + getConfiguredTokenUpgrades, +} from './common/upgrade-contracts'; -import { getCurrentAddresses } from '../../config/constants/addresses'; -import { getMTokenOrThrow } from '../../helpers/utils'; +import { getActionOrThrow } from '../../helpers/utils'; import { DeployFunction } from '../deploy/common/types'; const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { - const upgradeId = 'mwin-upgrade-permissioned'; - const networkAddresses = getCurrentAddresses(hre); - const mToken = getMTokenOrThrow(hre); - const tokenAddresses = networkAddresses?.[mToken]; + const upgradeId = getActionOrThrow(hre); - if (!tokenAddresses) { - throw new Error('Token addresses not found'); - } - - await executeUpgradeContracts(hre, upgradeId, 'token', [ - { - mToken, - addresses: tokenAddresses, - contracts: [ - { - contractType: 'token', - }, - ], - }, - ]); + await executeUpgradeContracts( + hre, + upgradeId, + 'token', + getConfiguredTokenUpgrades(hre, upgradeId), + ); }; export default func; + +// yarn hardhat runscript scripts/upgrades/executeUpgrade_Token.ts --network --action diff --git a/scripts/upgrades/proposeUpgrade_Token.ts b/scripts/upgrades/proposeUpgrade_Token.ts index 525e25c0..e7b02a6f 100644 --- a/scripts/upgrades/proposeUpgrade_Token.ts +++ b/scripts/upgrades/proposeUpgrade_Token.ts @@ -1,32 +1,24 @@ import { HardhatRuntimeEnvironment } from 'hardhat/types'; -import { proposeUpgradeContracts } from './common/upgrade-contracts'; +import { + getConfiguredTokenUpgrades, + proposeUpgradeContracts, +} from './common/upgrade-contracts'; -import { getCurrentAddresses } from '../../config/constants/addresses'; -import { getMTokenOrThrow } from '../../helpers/utils'; +import { getActionOrThrow } from '../../helpers/utils'; import { DeployFunction } from '../deploy/common/types'; const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { - const upgradeId = 'mwin-upgrade-permissioned'; - const networkAddresses = getCurrentAddresses(hre); - const mToken = getMTokenOrThrow(hre); - const tokenAddresses = networkAddresses?.[mToken]; + const upgradeId = getActionOrThrow(hre); - if (!tokenAddresses) { - throw new Error('Token addresses not found'); - } - - await proposeUpgradeContracts(hre, upgradeId, 'token', [ - { - mToken, - addresses: tokenAddresses, - contracts: [ - { - contractType: 'token', - }, - ], - }, - ]); + await proposeUpgradeContracts( + hre, + upgradeId, + 'token', + getConfiguredTokenUpgrades(hre, upgradeId), + ); }; export default func; + +// yarn hardhat runscript scripts/upgrades/proposeUpgrade_Token.ts --network --action