Skip to content

feat: v4 direct minter#3

Open
DhairyaSethi wants to merge 4 commits intomainfrom
feat/v4-minter
Open

feat: v4 direct minter#3
DhairyaSethi wants to merge 4 commits intomainfrom
feat/v4-minter

Conversation

@DhairyaSethi
Copy link
Member

@DhairyaSethi DhairyaSethi commented Feb 27, 2026

Add GhoDirectMinterV4, a GHO facilitator that injects (mints) and removes (burns) GHO from an Aave v4 Hub. The minter is expected to be registered as a spoke on the Hub with infinite addCap. mintAndSupply mints GHO and adds it as liquidity to the Hub, withdrawAndBurn removes GHO liquidity and burns it, and transferExcessToTreasury transfers excess interest (added shares above the facilitator bucket level) to the Hub's fee receiver.

@github-actions
Copy link

github-actions bot commented Feb 27, 2026

Forge Build Sizes

Contract Runtime Size (B) Initcode Size (B) Runtime Margin (B) Initcode Margin (B)
GhoDirectMinterV4 2,994 3,594 21,582 45,558
GhoEthereum 44 94 24,532 49,058
🔕 Unchanged
Contract Runtime Size (B) Initcode Size (B) Runtime Margin (B) Initcode Margin (B)
AaveV3Ethereum 44 94 24,532 49,058
AaveV3EthereumAssets 44 94 24,532 49,058
AaveV3EthereumEModes 44 94 24,532 49,058
AaveV3EthereumExternalLibraries 44 94 24,532 49,058
AaveV3EthereumLido 44 94 24,532 49,058
AaveV3EthereumLidoAssets 44 94 24,532 49,058
AaveV3EthereumLidoEModes 44 94 24,532 49,058
AaveV3EthereumLidoExternalLibraries 44 94 24,532 49,058
AaveV3InkWhitelabel 44 94 24,532 49,058
AaveV3InkWhitelabelAssets 44 94 24,532 49,058
AaveV3InkWhitelabelEModes 44 94 24,532 49,058
AaveV3InkWhitelabelExternalLibraries 44 94 24,532 49,058
Address 44 94 24,532 49,058
ChainHelpers 44 94 24,532 49,058
ChainIds 44 94 24,532 49,058
ConfiguratorInputTypes 44 94 24,532 49,058
Create2Utils 121 171 24,455 48,981
Create2UtilsZkSync 104 154 24,472 48,998
DataTypes 44 94 24,532 49,058
DeploymentLibrary 44 94 24,532 49,058
Errors (lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/Errors.sol) 44 94 24,532 49,058
Errors (lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/protocol/libraries/helpers/Errors.sol) 44 94 24,532 49,058
Errors (lib/aave-helpers/lib/aave-address-book/src/governance-v3/Errors.sol) 4,652 4,704 19,924 44,448
GhoDirectMinter 3,926 5,397 20,650 43,755
GovV3Helpers 2,469 2,521 22,107 46,631
GovV3StorageHelpers 44 94 24,532 49,058
GovernanceV3Arbitrum 44 94 24,532 49,058
GovernanceV3Avalanche 44 94 24,532 49,058
GovernanceV3BNB 44 94 24,532 49,058
GovernanceV3Base 44 94 24,532 49,058
GovernanceV3Bob 44 94 24,532 49,058
GovernanceV3Celo 44 94 24,532 49,058
GovernanceV3Ethereum 44 94 24,532 49,058
GovernanceV3Gnosis 44 94 24,532 49,058
GovernanceV3Ink 44 94 24,532 49,058
GovernanceV3InkWhitelabel 44 94 24,532 49,058
GovernanceV3Linea 44 94 24,532 49,058
GovernanceV3Mantle 44 94 24,532 49,058
GovernanceV3MegaEth 44 94 24,532 49,058
GovernanceV3Metis 44 94 24,532 49,058
GovernanceV3Optimism 44 94 24,532 49,058
GovernanceV3Plasma 44 94 24,532 49,058
GovernanceV3Polygon 44 94 24,532 49,058
GovernanceV3PolygonZkEvm 44 94 24,532 49,058
GovernanceV3Scroll 44 94 24,532 49,058
GovernanceV3Soneium 44 94 24,532 49,058
GovernanceV3Sonic 44 94 24,532 49,058
GovernanceV3ZkSync 44 94 24,532 49,058
IpfsUtils 44 94 24,532 49,058
MiscEthereum 44 94 24,532 49,058
PayloadsControllerUtils 44 94 24,532 49,058
ProxyHelpers 44 94 24,532 49,058
ReserveConfiguration 128 178 24,448 48,974
SafeERC20 44 94 24,532 49,058
StorageHelpers 44 94 24,532 49,058
TestNetChainIds 44 94 24,532 49,058

@github-actions
Copy link

github-actions bot commented Feb 27, 2026

♻️ Forge Gas Snapshots

Seems like you are not measuring gas of any operations yet. 🤔
Consider adding some snapshot tests to measure regressions & improvements.

@github-actions
Copy link

github-actions bot commented Feb 27, 2026

🌈 Test Results
No files changed, compilation skipped

Ran 7 tests for test/GhoDirectMinter.t.sol:GHODirectMinter_Test
[PASS] test_mintAndSupply_council(uint256) (runs: 256, μ: 245260, ~: 244950)
[PASS] test_mintAndSupply_owner(uint256) (runs: 256, μ: 242959, ~: 242649)
[PASS] test_mintAndSupply_rando() (gas: 18366)
[PASS] test_transferExcessToTreasury() (gas: 919147)
[PASS] test_withdrawAndBurn_council(uint256,uint256) (runs: 256, μ: 309667, ~: 311012)
[PASS] test_withdrawAndBurn_owner(uint256,uint256) (runs: 256, μ: 305412, ~: 306757)
[PASS] test_withdrawAndBurn_rando() (gas: 18266)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 986.33ms (2.03s CPU time)

Ran 13 tests for test/GhoDirectMinterV4.t.sol:GHODirectMinterV4_Test
[PASS] test_mintAndSupply_council(uint256) (runs: 256, μ: 124545, ~: 124506)
[PASS] test_mintAndSupply_exceedsBucketCapacity() (gas: 98089)
[PASS] test_mintAndSupply_owner(uint256) (runs: 256, μ: 122359, ~: 122320)
[PASS] test_mintAndSupply_revertsWith_InvalidCaller() (gas: 18300)
[PASS] test_mintAndSupply_zeroAmount() (gas: 21755)
[PASS] test_setup() (gas: 80042)
[PASS] test_transferExcessToTreasury() (gas: 355290)
[PASS] test_transferExcessToTreasury_noExcess(uint256) (runs: 256, μ: 119544, ~: 119505)
[PASS] test_withdrawAndBurn_council(uint256,uint256) (runs: 256, μ: 166925, ~: 167387)
[PASS] test_withdrawAndBurn_exceedsSpokeBalance() (gas: 110547)
[PASS] test_withdrawAndBurn_owner(uint256,uint256) (runs: 256, μ: 162718, ~: 163180)
[PASS] test_withdrawAndBurn_revertsWith_InvalidCaller() (gas: 18365)
[PASS] test_withdrawAndBurn_zeroBalance() (gas: 52408)
Suite result: ok. 13 passed; 0 failed; 0 skipped; finished in 986.35ms (912.76ms CPU time)

Ran 2 test suites in 989.10ms (1.97s CPU time): 20 tests passed, 0 failed, 0 skipped (20 total tests)

@github-actions
Copy link

github-actions bot commented Feb 27, 2026

🔮 Coverage report
File Line Coverage Function Coverage Branch Coverage
src/GhoDirectMinter.sol ${\color{red}0\%}$
$0 / 26$
37, 38, 39, 40, 41 and 21 more
${\color{red}0\%}$
$0 / 5$
GhoDirectMinter.constructor, GhoDirectMinter.initialize, GhoDirectMinter.mintAndSupply, GhoDirectMinter.withdrawAndBurn, GhoDirectMinter.transferExcessToTreasury
${\color{red}0\%}$
$0 / 2$
src/GhoDirectMinterV4.sol ${\color{green}100\%}$
$26 / 26$
${\color{green}100\%}$
$8 / 8$
${\color{green}100\%}$
$1 / 1$

/// @dev Constructor.
/// @param hub_ The address of the Aave v4 Hub.
/// @param gho_ The address of the GHO token.
constructor(address hub_, address gho_) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we think about having this more flexible so it can mint GHO to multiple hubs if needed?

Is that unnecessary?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while that's possible, I think we'd need to do like AIP to grant access to each, rather than allowing the same owner/guardian to supply into multiple hubs, so would need to add more granular access controls on a per-hub basis perhaps

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no i dont think we should mix facilitator capacities also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants