Skip to content

Commit e1f1dee

Browse files
feat: add megaETH network support (#598)
* chore: bump libs * chore: add megaEth contracts * chore: bump libs * chore: bump aave-cli version * chore: update libs
1 parent 60688d1 commit e1f1dee

5 files changed

Lines changed: 45 additions & 3 deletions

File tree

foundry.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"lib/aave-address-book": {
33
"branch": {
44
"name": "main",
5-
"rev": "acb167b67d7e563034a4e2546b3184e7bf38d44a"
5+
"rev": "00fb5ecbc93bf5c690f63fad84da5da653daf43a"
66
}
77
},
88
"lib/forge-std": {

lib/aave-address-book

src/DiffUtils.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ contract DiffUtils is Test {
2222

2323
string[] memory inputs = new string[](7);
2424
inputs[0] = 'npx';
25-
inputs[1] = '@bgd-labs/aave-cli@^1.4.5';
25+
inputs[1] = '@bgd-labs/aave-cli@^1.4.6';
2626
inputs[2] = 'diff-snapshots';
2727
inputs[3] = beforePath;
2828
inputs[4] = afterPath;

src/GovV3Helpers.sol

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {GovernanceV3Mantle} from 'aave-address-book/GovernanceV3Mantle.sol';
3131
import {GovernanceV3Soneium} from 'aave-address-book/GovernanceV3Soneium.sol';
3232
import {GovernanceV3Ink} from 'aave-address-book/GovernanceV3Ink.sol';
3333
import {GovernanceV3Plasma} from 'aave-address-book/GovernanceV3Plasma.sol';
34+
import {GovernanceV3MegaEth} from 'aave-address-book/GovernanceV3MegaEth.sol';
3435
import {GovernanceV3Bob} from 'aave-address-book/GovernanceV3Bob.sol';
3536
import {MiscEthereum} from 'aave-address-book/MiscEthereum.sol';
3637
import {Create2Utils} from 'solidity-utils/contracts/utils/ScriptUtils.sol';
@@ -956,6 +957,30 @@ library GovV3Helpers {
956957
return _buildPayload(vm, ChainIds.PLASMA, action);
957958
}
958959

960+
/**
961+
* Builds a payload to be executed via governance
962+
* @param vm Vm
963+
* @param actions actions array
964+
*/
965+
function buildMegaEthPayload(
966+
Vm vm,
967+
IPayloadsControllerCore.ExecutionAction[] memory actions
968+
) internal returns (PayloadsControllerUtils.Payload memory) {
969+
return _buildPayload(vm, ChainIds.MEGAETH, actions);
970+
}
971+
972+
/**
973+
* Builds a payload to be executed via governance
974+
* @param vm Vm
975+
* @param action single action struct
976+
*/
977+
function buildMegaEthPayload(
978+
Vm vm,
979+
IPayloadsControllerCore.ExecutionAction memory action
980+
) internal returns (PayloadsControllerUtils.Payload memory) {
981+
return _buildPayload(vm, ChainIds.MEGAETH, action);
982+
}
983+
959984
/**
960985
* Builds a payload to be executed via governance
961986
* @param vm Vm
@@ -1113,6 +1138,8 @@ library GovV3Helpers {
11131138
return GovernanceV3Ink.PAYLOADS_CONTROLLER;
11141139
} else if (chainId == ChainIds.PLASMA) {
11151140
return GovernanceV3Plasma.PAYLOADS_CONTROLLER;
1141+
} else if (chainId == ChainIds.MEGAETH) {
1142+
return GovernanceV3MegaEth.PAYLOADS_CONTROLLER;
11161143
} else if (chainId == ChainIds.BOB) {
11171144
return GovernanceV3Bob.PAYLOADS_CONTROLLER;
11181145
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.0;
3+
4+
import {AaveV3MegaEth} from 'aave-address-book/AaveV3MegaEth.sol';
5+
import 'aave-v3-origin/contracts/extensions/v3-config-engine/AaveV3Payload.sol';
6+
7+
/**
8+
* @dev Base smart contract for an Aave v3.6.0 listing on v3 MegaEth.
9+
* @author BGD Labs
10+
*/
11+
abstract contract AaveV3PayloadMegaEth is AaveV3Payload(IEngine(AaveV3MegaEth.CONFIG_ENGINE)) {
12+
function getPoolContext() public pure override returns (IEngine.PoolContext memory) {
13+
return IEngine.PoolContext({networkName: 'MegaEth', networkAbbreviation: 'Meg'});
14+
}
15+
}

0 commit comments

Comments
 (0)