Skip to content

Commit 476d8b1

Browse files
authored
feat: add megaeth (#79)
* feat: add megaeth * fix: updated deploy command
1 parent 0399312 commit 476d8b1

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ deploy-optimism :; forge script script/DeployTransparentProxyFactory.s.sol:Deplo
1616
deploy-arbitrum :; forge script script/DeployTransparentProxyFactory.s.sol:DeployArbitrum --rpc-url arbitrum --broadcast --legacy --ledger --mnemonic-indexes ${MNEMONIC_INDEX} --sender ${LEDGER_SENDER} --verify -vvvv
1717
deploy-zksync :; FOUNDRY_PROFILE=zksync forge script zksync/script/DeployTransparentProxyFactoryZkSync.s.sol:DeployZkSync --zksync --system-mode=true --rpc-url zksync --broadcast --ledger --mnemonic-indexes ${MNEMONIC_INDEX} --sender ${LEDGER_SENDER} --verify -vvvv
1818
deploy-xlayer :; forge script script/DeployTransparentProxyFactory.s.sol:DeployTransparentProxyFactory --rpc-url xlayer --broadcast --ledger --mnemonic-indexes ${MNEMONIC_INDEX} --sender ${LEDGER_SENDER} --verify --legacy -vvvv
19+
deploy-megaeth :; forge script script/DeployTransparentProxyFactory.s.sol:DeployTransparentProxyFactory --rpc-url megaeth --broadcast --ledger --mnemonic-indexes ${MNEMONIC_INDEX} --sender ${LEDGER_SENDER} --verify --legacy -vvvv --skip-simulation
1920
# ---------------------------------------------- BASE SCRIPT CONFIGURATION ---------------------------------------------
2021

2122
BASE_LEDGER = --ledger --mnemonic-indexes $(MNEMONIC_INDEX) --sender $(LEDGER_SENDER)

foundry.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ linea = "${RPC_LINEA}"
6262
soneium = "${RPC_SONEIUM}"
6363
bob = "${RPC_BOB}"
6464
xlayer = "${RPC_XLAYER}"
65+
megaeth = "${RPC_MEGAETH}"
6566

6667
[fuzz]
6768
no_zksync_reserved_addresses = true

src/contracts/utils/ChainHelpers.sol

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ library ChainIds {
3030
uint256 internal constant PLASMA = 9745;
3131
uint256 internal constant XLAYER = 196;
3232
uint256 internal constant ANVIL = 31337;
33+
uint256 internal constant MEGAETH = 4326;
3334
}
3435

3536
library TestNetChainIds {
@@ -54,6 +55,7 @@ library TestNetChainIds {
5455
uint256 internal constant BOB_SEPOLIA = 808813;
5556
uint256 internal constant PLASMA_TESTNET = 9746;
5657
uint256 internal constant XLAYER_TESTNET = 1952;
58+
uint256 internal constant MEGAETH_TESTNET = 6342;
5759
}
5860

5961
library ChainHelpers {
@@ -113,6 +115,8 @@ library ChainHelpers {
113115
newFork = vm.createSelectFork(vm.rpcUrl('plasma'));
114116
} else if (chainId == ChainIds.XLAYER) {
115117
newFork = vm.createSelectFork(vm.rpcUrl('xlayer'));
118+
} else if (chainId == ChainIds.MEGAETH) {
119+
newFork = vm.createSelectFork(vm.rpcUrl('megaeth'));
116120
} else {
117121
revert UnknownChainId();
118122
}
@@ -163,6 +167,8 @@ library ChainHelpers {
163167
networkName = 'plasma';
164168
} else if (chainId == ChainIds.XLAYER) {
165169
networkName = 'xlayer';
170+
} else if (chainId == ChainIds.MEGAETH) {
171+
networkName = 'megaeth';
166172
}
167173
// testnets
168174
else if (chainId == TestNetChainIds.ETHEREUM_SEPOLIA) {
@@ -203,6 +209,8 @@ library ChainHelpers {
203209
networkName = 'plasma_testnet';
204210
} else if (chainId == TestNetChainIds.XLAYER_TESTNET) {
205211
networkName = 'xlayer_testnet';
212+
} else if (chainId == TestNetChainIds.MEGAETH_TESTNET) {
213+
networkName = 'megaeth_testnet';
206214
} else {
207215
revert('chain id is not supported');
208216
}

0 commit comments

Comments
 (0)