@@ -14,6 +14,7 @@ import {AaveV3EthereumHorizonAssets} from 'aave-address-book-latest/AaveV3Ethere
1414 * - Centrifuge (JTRSY, JAAA) — RestrictionManager.endorse
1515 * - Circle/USYC — RolesAuthority.setUserRole
1616 * - Securitize (VBILL, ACRED) — RegistryService.addWallet
17+ * - Midas (mGLOBAL) — MidasAccessControl GREENLISTED_ROLE
1718 *
1819 * Override `_whitelistRwaActors` in concrete tests to add whitelisting for
1920 * newly listed assets.
@@ -37,6 +38,14 @@ abstract contract HorizonRwaWhitelistHelper is Test {
3738 string internal constant VBILL_SECURITIZE_FUND_ID = 'f27e20ca73314651b387da0aa9116f30 ' ;
3839 string internal constant ACRED_SECURITIZE_FUND_ID = '69023a78d57776eca9542d33 ' ;
3940
41+ // ── Midas (mGLOBAL) ──────────────────────────────────────────────────
42+ // Shared Midas access control (mGLOBAL.accessControl()). Transfers require the
43+ // sender and recipient to hold mGLOBAL's product-specific greenlist role.
44+ address internal constant MIDAS_ACCESS_CONTROL = 0x0312A9D1Ff2372DDEdCBB21e4B6389aFc919aC4B ;
45+ bytes32 internal constant MGLOBAL_GREENLISTED_ROLE = keccak256 ('M_GLOBAL_GREENLISTED_ROLE ' );
46+ // Slot of the OZ `_roles` mapping (role => account => bool) in MidasAccessControl.
47+ uint256 internal constant MIDAS_ROLES_SLOT = 101 ;
48+
4049 // ── Whale addresses for tokens incompatible with foundry `deal` ────
4150 // Securitize DS-protocol tokens store balances in an external data store,
4251 // so cannot use native foundry deal. Transfer from a real holder instead.
@@ -61,6 +70,8 @@ abstract contract HorizonRwaWhitelistHelper is Test {
6170 _whitelistVbillRwa (actors[i]);
6271 // Securitize (ACRED) — only if listed (aToken exists)
6372 _whitelistAcredRwa (actors[i]);
73+ // Midas (mGLOBAL)
74+ _whitelistMidasRwa (actors[i]);
6475 }
6576 }
6677
@@ -79,6 +90,8 @@ abstract contract HorizonRwaWhitelistHelper is Test {
7990 _whitelistVbillRwa (_requireAToken (pool, AaveV3EthereumHorizonAssets.VBILL_UNDERLYING));
8091 // Securitize (ACRED)
8192 _whitelistAcredRwa (_requireAToken (pool, AaveV3EthereumHorizonCustom.ACRED_UNDERLYING));
93+ // Midas (mGLOBAL)
94+ _whitelistMidasRwa (_requireAToken (pool, AaveV3EthereumHorizonCustom.MGLOBAL_UNDERLYING));
8295 }
8396
8497 function _requireAToken (IPool pool , address underlying ) internal view returns (address aToken ) {
@@ -176,6 +189,27 @@ abstract contract HorizonRwaWhitelistHelper is Test {
176189 );
177190 }
178191
192+ /// @dev Midas whitelisting: grants mGLOBAL's greenlist role on the shared MidasAccessControl.
193+ function _whitelistMidasRwa (address addressToWhitelist ) internal {
194+ bytes32 slot = keccak256 (
195+ abi.encode (
196+ addressToWhitelist,
197+ keccak256 (abi.encode (MGLOBAL_GREENLISTED_ROLE, MIDAS_ROLES_SLOT))
198+ )
199+ );
200+ vm.store (MIDAS_ACCESS_CONTROL, slot, bytes32 (uint256 (1 )));
201+
202+ // Verify whitelisted
203+ (bool success , bytes memory data ) = MIDAS_ACCESS_CONTROL.call (
204+ abi.encodeWithSignature (
205+ 'hasRole(bytes32,address) ' ,
206+ MGLOBAL_GREENLISTED_ROLE,
207+ addressToWhitelist
208+ )
209+ );
210+ require (success && abi.decode (data, (bool )), 'Midas: address not greenlisted ' );
211+ }
212+
179213 /**
180214 * @dev Generic Securitize whitelisting via RegistryService.addWallet.
181215 * Reuse for any Securitize DS-protocol token (VBILL, ACRED, etc.) by supplying
0 commit comments