Skip to content

Commit ad02627

Browse files
nicholaspaipxrl
andauthored
feat: Deploy Monad contracts (#1182)
Signed-off-by: nicholaspai <npai.nyc@gmail.com> Co-authored-by: Paul <108695806+pxrl@users.noreply.github.com>
1 parent f399296 commit ad02627

15 files changed

+4688
-50
lines changed

broadcast/deployed-addresses.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@
103103
"address": "0x6f1C9d3bcDF51316E7b515a62C02F601500b084b",
104104
"block_number": 23251254
105105
},
106+
"Universal_Adapter_143": {
107+
"address": "0xc29a3ba0fbf477f16fd53d2c438eade024fd8452",
108+
"block_number": 23832288
109+
},
106110
"Universal_Adapter_999": {
107111
"address": "0x0ec70777Ac388774041dD5A1778Cdf3AF3134D2B",
108112
"block_number": 23371516
@@ -314,6 +318,23 @@
314318
}
315319
}
316320
},
321+
"143": {
322+
"chain_name": "Monad Mainnet",
323+
"contracts": {
324+
"Helios": {
325+
"address": "0x09aea4b2242abc8bb4bb78d537a67a245a7bec64",
326+
"block_number": 36241473
327+
},
328+
"MulticallHandler": {
329+
"address": "0xeC41F75c686e376Ab2a4F18bde263ab5822c4511",
330+
"block_number": 36589196
331+
},
332+
"SpokePool": {
333+
"address": "0xd2ecb3afe598b746F8123CaE365a598DA831A449",
334+
"block_number": 36437473
335+
}
336+
}
337+
},
317338
"232": {
318339
"chain_name": "Lens",
319340
"contracts": {

broadcast/deployed-addresses.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ This file contains the latest deployed smart contract addresses from the broadca
126126
- **Universal_Adapter_56**: `0x6f1C9d3bcDF51316E7b515a62C02F601500b084b`
127127
- Block Number: `23251254`
128128

129+
#### Universal_Adapter_143
130+
131+
- **Universal_Adapter_143**: `0xc29a3ba0fbf477f16fd53d2c438eade024fd8452`
132+
- Block Number: `23832288`
133+
129134
#### Universal_Adapter_999
130135

131136
- **Universal_Adapter_999**: `0x0ec70777Ac388774041dD5A1778Cdf3AF3134D2B`
@@ -398,6 +403,23 @@ This file contains the latest deployed smart contract addresses from the broadca
398403
- Transaction Hash: `0x92801b64851c27c614e68b66dc26ab6831c1f2b95f3f805bd8646d1747105685`
399404
- Block Number: `77338915`
400405

406+
### Monad Mainnet (Chain ID: 143)
407+
408+
#### Helios
409+
410+
- **Helios**: `0x09aea4b2242abc8bb4bb78d537a67a245a7bec64`
411+
- Block Number: `36241473`
412+
413+
#### MulticallHandler
414+
415+
- **MulticallHandler**: `0xeC41F75c686e376Ab2a4F18bde263ab5822c4511`
416+
- Block Number: `36589196`
417+
418+
#### SpokePool
419+
420+
- **SpokePool**: `0xd2ecb3afe598b746F8123CaE365a598DA831A449`
421+
- Block Number: `36437473`
422+
401423
### Lens (Chain ID: 232)
402424

403425
#### SpokePool

contracts/libraries/CircleCCTPAdapter.sol

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ library CircleDomainIds {
1515
uint32 public constant Polygon = 7;
1616
uint32 public constant DoctorWho = 10;
1717
uint32 public constant Linea = 11;
18+
uint32 public constant WorldChain = 14;
19+
uint32 public constant Monad = 15;
20+
uint32 public constant BSC = 17;
21+
uint32 public constant HyperEVM = 19;
22+
uint32 public constant Ink = 21;
23+
uint32 public constant Arc = 26;
1824
uint32 public constant UNINITIALIZED = type(uint32).max;
1925
}
2026

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
import { DeployFunction } from "hardhat-deploy/types";
22
import { HardhatRuntimeEnvironment } from "hardhat/types";
33
import { deployNewProxy, getSpokePoolDeploymentInfo } from "../utils/utils.hre";
4-
import {
5-
EXPECTED_SAFE_ADDRESS,
6-
FILL_DEADLINE_BUFFER,
7-
L2_ADDRESS_MAP,
8-
QUOTE_TIME_BUFFER,
9-
USDC,
10-
ZERO_ADDRESS,
11-
} from "./consts";
4+
import { FILL_DEADLINE_BUFFER, L2_ADDRESS_MAP, QUOTE_TIME_BUFFER, USDC, ZERO_ADDRESS } from "./consts";
125
import { CHAIN_IDs, PRODUCTION_NETWORKS, TOKEN_SYMBOLS_MAP } from "../utils/constants";
13-
import { getOftEid, toWei, predictedSafe } from "../utils/utils";
14-
import { getNodeUrl } from "../utils";
6+
import { getOftEid, toWei } from "../utils/utils";
157
import { getDeployedAddress } from "../src/DeploymentUtils";
168
import "@nomiclabs/hardhat-ethers";
17-
import Safe from "@safe-global/protocol-kit";
189

1910
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
2011
const { hubPool, hubChainId, spokeChainId } = await getSpokePoolDeploymentInfo(hre);
@@ -39,7 +30,12 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
3930

4031
const oftEid = getOftEid(hubChainId);
4132
// ! Notice. Deployed has to adjust this fee cap based on dst chain's native token. 4.4 BNB for BSC
42-
const oftFeeCap = toWei(4.4); // ~1 ETH fee cap
33+
let oftFeeCap = toWei("1"); // 1 ETH fee cap
34+
if (spokeChainId == CHAIN_IDs.MONAD) {
35+
oftFeeCap = toWei(78_000); // ~1 ETH fee cap
36+
} else if (spokeChainId == CHAIN_IDs.BSC) {
37+
oftFeeCap = toWei(4.4); // ~1 ETH fee cap
38+
}
4339

4440
const heliosAddress = getDeployedAddress("Helios", spokeChainId);
4541

@@ -56,7 +52,8 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
5652
oftEid,
5753
oftFeeCap,
5854
];
59-
console.log(`Deploying new Universal SpokePool on ${spokeChainId} with args:`, constructorArgs);
55+
console.log(`Deploying new Universal SpokePool on ${spokeChainId} with constructor arguments:`, constructorArgs);
56+
console.log(`Deploying implementation with initialization arguments:`, initArgs);
6057

6158
// @dev Deploy on different address for each chain.
6259
// The Universal Adapter writes calldata to be relayed to L2 by associating it with the
@@ -69,32 +66,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
6966
return;
7067
}
7168

72-
const nodeUrl = getNodeUrl(spokeChainId);
73-
74-
const protocolKit = await Safe.init({
75-
provider: nodeUrl,
76-
predictedSafe,
77-
});
78-
79-
const existingProtocolKit = await protocolKit.connect({
80-
safeAddress: EXPECTED_SAFE_ADDRESS,
81-
});
82-
const isDeployed = await existingProtocolKit.isSafeDeployed();
83-
84-
if (!isDeployed) {
85-
throw new Error("Expected Safe address is not deployed, please deploy it first");
86-
}
87-
88-
const factory = await hre.ethers.getContractFactory("Universal_SpokePool");
89-
const contract = factory.attach(proxyAddress);
90-
91-
const owner = await contract.owner();
92-
if (owner !== EXPECTED_SAFE_ADDRESS) {
93-
await (await contract.transferOwnership(EXPECTED_SAFE_ADDRESS)).wait();
94-
console.log("Transferred ownership to Expected Safe address:", await contract.owner());
95-
} else {
96-
console.log("Expected Safe address is already the owner of the Universal SpokePool");
97-
}
69+
console.log(`Deployed Universal SpokePool at ${proxyAddress}! Remember to transfer ownership to the Gnosis Safe!`);
9870
};
9971
module.exports = func;
10072
func.tags = ["UniversalSpokePool"];

deploy/consts.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ export const L2_ADDRESS_MAP: { [key: number]: { [contractName: string]: string }
205205
cctpV2TokenMessenger: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
206206
permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
207207
},
208+
[CHAIN_IDs.MONAD]: {
209+
cctpV2TokenMessenger: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
210+
},
208211
[CHAIN_IDs.PLASMA]: {
209212
permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
210213
},

deployments/deployments.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"MulticallHandler": { "address": "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E", "blockNumber": 22967417 },
2525
"Lisk_Adapter": { "address": "0xF039AdCC74936F90fE175e8b3FE0FdC8b8E0c73b", "blockNumber": 22474211 },
2626
"Universal_Adapter_56": { "address": "0x6f1C9d3bcDF51316E7b515a62C02F601500b084b", "blockNumber": 23251254 },
27+
"Universal_Adapter_143": { "address": "0xc29a3ba0fbf477f16fd53d2c438eade024fd8452", "blockNumber": 23832288 },
2728
"Universal_Adapter_999": { "address": "0x0ec70777Ac388774041dD5A1778Cdf3AF3134D2B", "blockNumber": 23371516 },
2829
"Universal_Adapter_9745": { "address": "0xb47fD69FE25878F4E43aAF2F9ad7D0A3A0B22363", "blockNumber": 23419367 },
2930
"Blast_Adapter": { "address": "0xF2bEf5E905AAE0295003ab14872F811E914EdD81", "blockNumber": 20221494 },
@@ -86,6 +87,11 @@
8687
"MulticallHandler": { "address": "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E", "blockNumber": 74229464 },
8788
"SpokePoolPeriphery": { "address": "0x89415a82d909a7238d69094C3Dd1dCC1aCbDa85C", "blockNumber": 73247089 }
8889
},
90+
"143": {
91+
"Helios": { "address": "0x09aea4b2242abc8bb4bb78d537a67a245a7bec64", "blockNumber": 36241473 },
92+
"MulticallHandler": { "address": "0xeC41F75c686e376Ab2a4F18bde263ab5822c4511", "blockNumber": 36589196 },
93+
"SpokePool": { "address": "0xd2ecb3afe598b746F8123CaE365a598DA831A449", "blockNumber": 36437473 }
94+
},
8995
"232": {
9096
"SpokePool": { "address": "0xb234cA484866c811d0e6D3318866F583781ED045", "blockNumber": 4197027 },
9197
"SpokePoolVerifier": { "address": "0x3Fb9cED51E968594C87963a371Ed90c39519f65A", "blockNumber": 4419395 },

deployments/monad/.chainId

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
143

0 commit comments

Comments
 (0)