feat: Add mGlobal Listing Payload#13
Conversation
🌈Test ResultsCompiling 220 files with Solc 0.8.27 Solc 0.8.27 finished in 22.82s Compiler run successful!Ran 3 tests for src/AaveV3Horizon_mGLOBALListing_20260616/AaveV3Horizon_mGLOBALListing_20260616.t.sol:AaveV3Horizon_mGLOBALListing_20260616_Test [PASS] test_mglobalConfig() (gas: 2735984) Ran 2 tests for src/AaveV3Horizon_mGLOBALListing_20260616/AaveV3Horizon_mGLOBALListing_20260616.t.sol:AaveV3Horizon_mGLOBALListing_20260616_PostExecution_Test [PASS] test_mglobalConfig() (gas: 665105) Ran 2 test suites in 92.90s (109.52s CPU time): 5 tests passed, 0 failed, 0 skipped (5 total tests) |
| * @dev Test for Horizon mGLOBAL listing (pre-execution). | ||
| * command: FOUNDRY_PROFILE=test forge test --match-contract AaveV3Horizon_mGLOBALListing_20260616_Test -vv | ||
| */ | ||
| contract AaveV3Horizon_mGLOBALListing_20260616_Test is |
There was a problem hiding this comment.
Why is the abstract then test contract split needed here ?
There was a problem hiding this comment.
bc below we also have a fork test for post tx execution, follows same pattern we used for other payloads here as well
There was a problem hiding this comment.
we should switch to permissioned payloads controller model asap, this separate test is v stupid lol and ppc absorbs most footguns w current flow
| address public constant MGLOBAL_UNDERLYING = 0x7433806912Eae67919e66aea853d46Fa0aef98A8; | ||
| // TODO: replace with the LlamaGuard-bounded NAV feed once deployed; this is the unbounded Chainlink feed | ||
| // https://etherscan.io/address/0xB92A68763b2F83e094595c7B41a7FB9D0f8Da193 | ||
| address public constant MGLOBAL_PRICE_FEED = 0xB92A68763b2F83e094595c7B41a7FB9D0f8Da193; |
| (bool success, bytes memory data) = MIDAS_ACCESS_CONTROL.call( | ||
| abi.encodeWithSignature( | ||
| 'hasRole(bytes32,address)', | ||
| MGLOBAL_GREENLISTED_ROLE, | ||
| addressToWhitelist | ||
| ) | ||
| ); | ||
| require(success && abi.decode(data, (bool)), 'Midas: address not greenlisted'); |
There was a problem hiding this comment.
why not do a high level call with a casted interface if we're reverting on failure anyway, no need to do .call here
There was a problem hiding this comment.
This is how we do it in this entire file. The reason is becase I'd thought it's cleaner like this than defining specific interfaces for each issuer, wdyt
There was a problem hiding this comment.
hasRole is in IAccessManager from oz, nothing custom needed here
in general it's totally fine to add vender specific interfaces, proposals repo (v3) has always done that in src/interfaces
There was a problem hiding this comment.
i would prefer to add those interfaces actually, trimmed from source with their natspec over this in general also
| liqThreshold: 75_00, | ||
| liqBonus: 6_00, | ||
| reserveFactor: EngineFlags.KEEP_CURRENT, | ||
| supplyCap: 60_000_000, |
There was a problem hiding this comment.
| supplyCap: 60_000_000, | |
| supplyCap: 50_000_000, |
| */ | ||
| function test_mglobalConfig() public virtual { | ||
| IPool pool = _pool(); | ||
| uint8 eModeCategory = proposal.MGLOBAL_EMODE_CATEGORY(); |
There was a problem hiding this comment.
can you also test this is the _nextEmodeCategory() bc 5 is hardcoded right now
There was a problem hiding this comment.
i would rather fetch it dynamically in the proposal tbh but nbd
There was a problem hiding this comment.
it's not I think, 5 is a deprecate emode
There was a problem hiding this comment.
i confirm we must use 5 to replace existing emode that was deprecated in a previous gov action
| // the eMode category must be unused before execution (no collateral/borrowable assets, no label) | ||
| assertEq(pool.getEModeCategoryCollateralBitmap(eModeCategory), 0, 'emode collateral not empty'); | ||
| assertEq(pool.getEModeCategoryBorrowableBitmap(eModeCategory), 0, 'emode borrowable not empty'); | ||
| assertEq(pool.getEModeCategoryLabel(eModeCategory), '', 'emode label not empty'); |
There was a problem hiding this comment.
| assertEq(pool.getEModeCategoryLabel(eModeCategory), '', 'emode label not empty'); | |
| assertEq(pool.getEModeCategoryLabel(eModeCategory).length, 0, 'emode label not empty'); |
hidden unicode youre sneaky
Summary
Lists mGLOBAL (Midas Global Diversified Alternative Debt Fund) as an RWA collateral asset on the Aave Horizon pool. The payload is executed through the emergency multisig.
Reserve configuration
The default (non-eMode) reserve parameters are intentionally near-zero, so mGLOBAL cannot be meaningfully borrowed against outside of its eMode:
liquidationProtocolFeeis kept at 0: RWA aTokens revert on thetransferOnLiquidationto the treasury (OPERATION_NOT_SUPPORTED), so a non-zero fee would break liquidations.The unbounded Chainlink NAV feed is used at launch; it will be swapped for the LlamaGuard-bounded feed once available.
mGLOBAL Stablecoins eMode (category 5)
A new eMode pairs mGLOBAL collateral with stablecoin borrowing (GHO excluded):
eMode category 5 was previously deprecated and is reused by this listing. eMode ids 7 and 9 are the only eModes currently deprecated and not reutilised.
Tests