Skip to content

Commit 2698c81

Browse files
authored
Merge pull request #36 from bgd-labs/feat/mantle
feat: Deploy Mantle
2 parents 9bb248f + 259ca65 commit 2698c81

18 files changed

+228
-13
lines changed

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ RPC_BNB=https://binance.llamarpc.com
2121
RPC_ZK_SYNC=https://mainnet.era.zksync.io
2222
RPC_ZK_SYNC_TESTNET=https://sepolia.era.zksync.dev
2323
RPC_LINEA=https://rpc.linea.build
24+
RPC_MANTLE=
25+
RPC_MANTLE_TESTNET=
2426

2527
# Etherscan api keys for verification & download utils
2628
ETHERSCAN_API_KEY_MAINNET=
@@ -34,3 +36,4 @@ ETHERSCAN_API_KEY_ZKEVM=
3436
ETHERSCAN_API_KEY_GNOSIS=
3537
ETHERSCAN_API_KEY_BNB=
3638
ETHERSCAN_API_KEY_ZK_SYNC=
39+
ETHERSCAN_API_KEY_MANTLE=

Makefile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ BASE_KEY = --private-key ${PRIVATE_KEY}
1717

1818

1919

20-
custom_ethereum := --with-gas-price 12000000000 # 53 gwei
20+
custom_ethereum := --with-gas-price 3000000000 # 53 gwei
2121
#custom_polygon := --with-gas-price 190000000000 # 560 gwei
2222
#custom_avalanche := --with-gas-price 27000000000 # 27 gwei
2323
#custom_metis-testnet := --legacy --verifier-url https://goerli.explorer.metisdevops.link/api/
@@ -164,11 +164,11 @@ deploy-full:
164164

165165
# Deploy Proxy Factories on all networks
166166
deploy-proxy-factory-test:
167-
$(call deploy_fn,InitialDeployments,celo)
167+
$(call deploy_fn,InitialDeployments,mantle)
168168

169169
# Deploy Cross Chain Infra on all networks
170170
deploy-cross-chain-infra-test:
171-
$(call deploy_fn,ccc/DeployCCC,celo)
171+
$(call deploy_fn,ccc/DeployCCC,mantle)
172172

173173
## Deploy CCIP bridge adapters on all networks
174174
deploy-ccip-bridge-adapters-test:
@@ -213,17 +213,20 @@ deploy-base-adapters-test:
213213
deploy-linea-adapters-test:
214214
$(call deploy_fn,adapters/DeployLineaAdapter,ethereum)
215215

216+
deploy-mantle-adapters-test:
217+
$(call deploy_fn,adapters/DeployMantleAdapter,ethereum)
218+
216219
## Set sender bridge dapters. Only eth pol avax are needed as other networks will only receive
217220
set-ccf-sender-adapters-test:
218221
$(call deploy_fn,ccc/Set_CCF_Sender_Adapters,ethereum)
219222

220223
# Set the bridge adapters allowed to receive messages
221224
set-ccr-receiver-adapters-test:
222-
$(call deploy_fn,ccc/Set_CCR_Receivers_Adapters,celo)
225+
$(call deploy_fn,ccc/Set_CCR_Receivers_Adapters,mantle)
223226

224227
# Sets the required confirmations
225228
set-ccr-confirmations-test:
226-
$(call deploy_fn,ccc/Set_CCR_Confirmations,celo)
229+
$(call deploy_fn,ccc/Set_CCR_Confirmations,mantle)
227230

228231

229232
## Deploy and configure all contracts
@@ -251,7 +254,7 @@ send-direct-message:
251254
$(call deploy_fn,helpers/Send_Direct_CCMessage,ethereum)
252255

253256
deploy_mock_destination:
254-
$(call deploy_fn,helpers/Deploy_Mock_destination,linea)
257+
$(call deploy_fn,helpers/Deploy_Mock_destination,mantle)
255258

256259
set-approved-ccf-senders:
257260
$(call deploy_fn,helpers/Set_Approved_Senders,ethereum)
@@ -266,7 +269,7 @@ send-message-via-adapter:
266269
$(call deploy_fn,helpers/Send_Message_Via_Adapter,ethereum)
267270

268271
deploy_ccc_granular_guardian:
269-
$(call deploy_fn,access_control/network_scripts/GranularGuardianNetworkDeploys,celo)
272+
$(call deploy_fn,access_control/network_scripts/GranularGuardianNetworkDeploys,mantle)
270273

271274
deploy-ccc-revision-and-update:
272275
$(call deploy_fn,CCC/UpdateCCC,ethereum)

deployments/ethereum.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"hlAdapter": "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1",
1616
"lineaAdapter": "0x8097555ffDa4176C93FEf92dF473b9763e467686",
1717
"lzAdapter": "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC",
18+
"mantleAdapter": "0xAd31Bc5b2555a472d2689F5c387D08a93484bBac",
1819
"metisAdapter": "0x6B3Dc800E7c813Db3fe8D0F30fDCaE636935dC14",
1920
"mockDestination": "0x19198689FfBE82207F023248dca175a84c52eCE1",
2021
"opAdapter": "0x0e24524778fdc67f53eEf144b8cbf50261E930B3",

deployments/mantle.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"arbAdapter": "0x0000000000000000000000000000000000000000",
3+
"baseAdapter": "0x0000000000000000000000000000000000000000",
4+
"ccipAdapter": "0x0000000000000000000000000000000000000000",
5+
"chainId": 5000,
6+
"clEmergencyOracle": "0x0000000000000000000000000000000000000000",
7+
"create3Factory": "0x0000000000000000000000000000000000000000",
8+
"crossChainController": "0x7Fcb83a4a2577e30aaD0218B5A3C015b40b1209A",
9+
"crossChainControllerImpl": "0x751cF898E4ea6982903C310d90Be11AAab4A95EF",
10+
"emergencyRegistry": "0x0000000000000000000000000000000000000000",
11+
"executor": "0x9390B1735def18560c509E2d0bc090E9d6BA257a",
12+
"gnosisAdapter": "0x0000000000000000000000000000000000000000",
13+
"granularCCCGuardian": "0xDA575812755ED6C5Ad33a859798d472C0495529A",
14+
"guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6",
15+
"hlAdapter": "0x0000000000000000000000000000000000000000",
16+
"lineaAdapter": "0x0000000000000000000000000000000000000000",
17+
"lzAdapter": "0x0000000000000000000000000000000000000000",
18+
"mantleAdapter": "0xD6a04d6db9c4546633aB5a10a3F9800200c8db92",
19+
"metisAdapter": "0x0000000000000000000000000000000000000000",
20+
"mockDestination": "0x0000000000000000000000000000000000000000",
21+
"opAdapter": "0x0000000000000000000000000000000000000000",
22+
"owner": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6",
23+
"polAdapter": "0x0000000000000000000000000000000000000000",
24+
"proxyAdminCCC": "0xb9Dc8F89a99De1A20cBc5A28B43b84a2b63168BF",
25+
"proxyFactory": "0xEB0682d148e874553008730f0686ea89db7DA412",
26+
"sameChainAdapter": "0x0000000000000000000000000000000000000000",
27+
"scrollAdapter": "0x0000000000000000000000000000000000000000",
28+
"wormholeAdapter": "0x0000000000000000000000000000000000000000",
29+
"zkevmAdapter": "0x0000000000000000000000000000000000000000",
30+
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
31+
}

deployments/pre_prod_ethereum.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"hlAdapter": "0x834607F5d65451918a8fDD5D22d6eF97f84917ef",
1616
"lineaAdapter": "0x5Dc8724b62F489a98f4f86b3a9629FB3f2552d73",
1717
"lzAdapter": "0xE35B90E1B1eF522dC40a5829c59e3d2d291a9360",
18+
"mantleAdapter": "0xD4FE312b920218A5a3D990c85b2a67aAeb8701dc",
1819
"metisAdapter": "0x92bce04e8B33c7098AA0bEc7663cA8Eb0930f6a4",
1920
"mockDestination": "0x5eB700Fd6aE49fc9890349E4d90737C1420e7E4f",
2021
"opAdapter": "0x091A76a70D9E9Ef3eae895D3b72DCD587ae1A460",

deployments/pre_prod_mantle.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"arbAdapter": "0x0000000000000000000000000000000000000000",
3+
"baseAdapter": "0x0000000000000000000000000000000000000000",
4+
"ccipAdapter": "0x0000000000000000000000000000000000000000",
5+
"chainId": 5000,
6+
"clEmergencyOracle": "0x0000000000000000000000000000000000000000",
7+
"create3Factory": "0x0000000000000000000000000000000000000000",
8+
"crossChainController": "0x482356302d380888e7aDC3da2c33586D19A5A53c",
9+
"crossChainControllerImpl": "0x751cF898E4ea6982903C310d90Be11AAab4A95EF",
10+
"emergencyRegistry": "0x0000000000000000000000000000000000000000",
11+
"executor": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6",
12+
"gnosisAdapter": "0x0000000000000000000000000000000000000000",
13+
"granularCCCGuardian": "0x0000000000000000000000000000000000000000",
14+
"guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6",
15+
"hlAdapter": "0x0000000000000000000000000000000000000000",
16+
"lineaAdapter": "0x0000000000000000000000000000000000000000",
17+
"lzAdapter": "0x0000000000000000000000000000000000000000",
18+
"mantleAdapter": "0x63071f80D3a80b477258133e59613ad3E4F68609",
19+
"metisAdapter": "0x0000000000000000000000000000000000000000",
20+
"mockDestination": "0x889c0cc3283DB588A34E89Ad1E8F25B0fc827b4b",
21+
"opAdapter": "0x0000000000000000000000000000000000000000",
22+
"owner": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6",
23+
"polAdapter": "0x0000000000000000000000000000000000000000",
24+
"proxyAdminCCC": "0xE3903099c5AD1469041982fac5aB9B1eE97D5446",
25+
"proxyFactory": "0xEB0682d148e874553008730f0686ea89db7DA412",
26+
"sameChainAdapter": "0x0000000000000000000000000000000000000000",
27+
"scrollAdapter": "0x0000000000000000000000000000000000000000",
28+
"wormholeAdapter": "0x0000000000000000000000000000000000000000",
29+
"zkevmAdapter": "0x0000000000000000000000000000000000000000",
30+
"zksyncAdapter": "0x0000000000000000000000000000000000000000"
31+
}

foundry.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fs_permissions = [{ access = "read-write", path = "./"}]
1010
metadata="none"
1111
solc = "0.8.22"
1212
ffi = true
13-
evm_version = 'paris'
13+
evm_version = 'cancun'
1414

1515
[profile.zksync.zksync]
1616
fallback_oz = true
@@ -54,6 +54,8 @@ zksync="${RPC_ZK_SYNC}"
5454
zksync-testnet="${RPC_ZK_SYNC_TESTNET}"
5555
linea="${RPC_LINEA}"
5656
linea-testnet="${RPC_LINEA_SEPOLIA}"
57+
mantle="${RPC_MANTLE}"
58+
mantle-testnet="${RPC_MANTLE_TESTNET}"
5759

5860
[etherscan]
5961
ethereum={key="${ETHERSCAN_API_KEY_MAINNET}", chain=1 }
@@ -86,6 +88,8 @@ zksync={key="${ETHERSCAN_API_KEY_ZK_SYNC}", chain=324}
8688
zksync-testnet={key="${ETHERSCAN_API_KEY_ZK_SYNC}", chain=300, url='https://api-sepolia-era.zksync.network/api'}
8789
linea={key="${ETHERSCAN_API_KEY_LINEA}", chain=59144 }
8890
linea-testnet={key="${ETHERSCAN_API_KEY_LINEA}",chain=59141}
91+
mantle={key="${ETHERSCAN_API_KEY_MANTLE}", chain=5000, url='https://api.routescan.io/v2/network/mainnet/evm/5000/etherscan'}
92+
mantle-testnet={key="${ETHERSCAN_API_KEY_MANTLE}", chain=5003, url='https://explorer.testnet.mantle.xyz/api'}
8993

9094
# See more config options https://github.com/gakonst/foundry/tree/master/config
9195
[fuzz]

scripts/BaseDeployerScript.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ struct Addresses {
2222
address hlAdapter;
2323
address lineaAdapter;
2424
address lzAdapter;
25+
address mantleAdapter;
2526
address metisAdapter;
2627
address mockDestination;
2728
address opAdapter;
@@ -81,6 +82,7 @@ library DeployerHelpers {
8182
scrollAdapter: abi.decode(persistedJson.parseRaw('.scrollAdapter'), (address)),
8283
wormholeAdapter: abi.decode(persistedJson.parseRaw('.wormholeAdapter'), (address)),
8384
zksyncAdapter: abi.decode(persistedJson.parseRaw('.zksyncAdapter'), (address)),
85+
mantleAdapter: abi.decode(persistedJson.parseRaw('.mantleAdapter'), (address)),
8486
granularCCCGuardian: abi.decode(persistedJson.parseRaw('.granularCCCGuardian'), (address))
8587
});
8688

@@ -105,6 +107,7 @@ library DeployerHelpers {
105107
json.serialize('hlAdapter', addresses.hlAdapter);
106108
json.serialize('lineaAdapter', addresses.lineaAdapter);
107109
json.serialize('lzAdapter', addresses.lzAdapter);
110+
json.serialize('mantleAdapter', addresses.mantleAdapter);
108111
json.serialize('metisAdapter', addresses.metisAdapter);
109112
json.serialize('mockDestination', addresses.mockDestination);
110113
json.serialize('opAdapter', addresses.opAdapter);

scripts/InitialDeployments.s.sol

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,20 @@ contract Celo is BaseInitialDeployment {
268268
}
269269
}
270270

271+
contract Mantle is BaseInitialDeployment {
272+
function TRANSPARENT_PROXY_FACTORY() internal pure override returns (address) {
273+
return 0xEB0682d148e874553008730f0686ea89db7DA412;
274+
}
275+
276+
function EXECUTOR() internal view override returns (address) {
277+
return 0x9390B1735def18560c509E2d0bc090E9d6BA257a; // executor lvl1
278+
}
279+
280+
function TRANSACTION_NETWORK() internal pure override returns (uint256) {
281+
return ChainIds.MANTLE;
282+
}
283+
}
284+
271285
contract Zksync is BaseInitialDeployment {
272286
function TRANSPARENT_PROXY_FACTORY() internal pure override returns (address) {
273287
return 0x8Ef21C75Ce360078cAD162565ED0c27617eCccE0;

0 commit comments

Comments
 (0)