Skip to content

feat: v4 direct minter - #3

Open
DhairyaSethi wants to merge 11 commits into
mainfrom
feat/v4-minter
Open

DhairyaSethi wants to merge 11 commits into
mainfrom
feat/v4-minter

Conversation

@DhairyaSethi

@DhairyaSethi DhairyaSethi commented Feb 27, 2026 •

Copy link
Copy Markdown
Member

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

github-actions Bot commented Feb 27, 2026 •

Copy link
Copy Markdown

Forge Build Sizes

🔕 Unchanged
Contract Runtime Size (B) Initcode Size (B) Runtime Margin (B) Initcode Margin (B)
Create2Utils 121 171 24,455 48,981
Create2UtilsZkSync 104 154 24,472 48,998
Errors 4,652 4,704 19,924 44,448
GhoDirectMinter 3,926 5,397 20,650 43,755
GhoDirectMinterV4 2,994 3,594 21,582 45,558
GovV3Helpers 2,473 2,525 22,103 46,627
ReserveConfiguration 97 147 24,479 49,005

@github-actions

github-actions Bot commented Feb 27, 2026 •

Copy link
Copy Markdown

♻️ 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

github-actions Bot commented Feb 27, 2026 •

Copy link
Copy Markdown
🌈 Test Results
No files changed, compilation skipped

Ran 13 tests for test/GhoDirectMinterV4.t.sol:GHODirectMinterV4_Test
[PASS] test_mintAndSupply_council(uint256) (runs: 256, μ: 266359, ~: 266110)
[PASS] test_mintAndSupply_exceedsBucketCapacity() (gas: 156487)
[PASS] test_mintAndSupply_owner(uint256) (runs: 256, μ: 264173, ~: 263924)
[PASS] test_mintAndSupply_revertsWith_InvalidCaller() (gas: 39482)
[PASS] test_mintAndSupply_zeroAmount() (gas: 43035)
[PASS] test_setup() (gas: 137339)
[PASS] test_transferExcessToTreasury(uint256,uint256,uint256) (runs: 256, μ: 857345, ~: 857224)
[PASS] test_transferExcessToTreasury_noExcess(uint256) (runs: 256, μ: 241054, ~: 240805)
[PASS] test_withdrawAndBurn_council(uint256,uint256) (runs: 256, μ: 496343, ~: 496286)
[PASS] test_withdrawAndBurn_exceedsSpokeBalance() (gas: 216707)
[PASS] test_withdrawAndBurn_owner(uint256,uint256) (runs: 256, μ: 492136, ~: 492079)
[PASS] test_withdrawAndBurn_revertsWith_InvalidCaller() (gas: 39569)
[PASS] test_withdrawAndBurn_zeroBalance() (gas: 78584)
Suite result: ok. 13 passed; 0 failed; 0 skipped; finished in 1.12s (1.42s CPU time)

Ran 7 tests for test/GhoDirectMinter.t.sol:GHODirectMinter_Test
[PASS] test_mintAndSupply_council(uint256) (runs: 256, μ: 393489, ~: 393226)
[PASS] test_mintAndSupply_owner(uint256) (runs: 256, μ: 391188, ~: 390925)
[PASS] test_mintAndSupply_rando() (gas: 39570)
[PASS] test_transferExcessToTreasury() (gas: 1540811)
[PASS] test_withdrawAndBurn_council(uint256,uint256) (runs: 256, μ: 667877, ~: 667786)
[PASS] test_withdrawAndBurn_owner(uint256,uint256) (runs: 256, μ: 663622, ~: 663531)
[PASS] test_withdrawAndBurn_rando() (gas: 39470)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 1.12s (1.49s CPU time)

Ran 2 test suites in 1.13s (2.24s CPU time): 20 tests passed, 0 failed, 0 skipped (20 total tests)

@github-actions

github-actions Bot commented Feb 27, 2026 •

Copy link
Copy Markdown
🔮 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$

Comment thread src/interfaces/IGhoDirectMinterV4.sol Outdated
Comment thread src/GhoDirectMinterV4.sol Outdated
Comment thread src/GhoDirectMinterV4.sol Outdated
Comment thread src/GhoDirectMinterV4.sol
/// @dev Constructor.
/// @param hub_ The address of the Aave v4 Hub.
/// @param gho_ The address of the GHO token.
constructor(address hub_, address gho_) {

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown
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

Comment thread test/GhoDirectMinterV4.t.sol Outdated
Comment thread test/GhoDirectMinterV4.t.sol
Comment thread src/GhoDirectMinterV4.sol Outdated
Comment thread src/interfaces/IGhoDirectMinterV4.sol Outdated
Comment thread test/GhoDirectMinterV4.t.sol
Comment thread foundry.toml Outdated
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