Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions broadcast/deployed-addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@
"address": "0x6f1C9d3bcDF51316E7b515a62C02F601500b084b",
"block_number": 23251254
},
"Universal_Adapter_143": {
"address": "0xc29a3ba0fbf477f16fd53d2c438eade024fd8452",
"block_number": 23832288
},
"Universal_Adapter_999": {
"address": "0x0ec70777Ac388774041dD5A1778Cdf3AF3134D2B",
"block_number": 23371516
Expand Down Expand Up @@ -314,6 +318,23 @@
}
}
},
"143": {
"chain_name": "Monad Mainnet",
"contracts": {
"Helios": {
"address": "0x09aea4b2242abc8bb4bb78d537a67a245a7bec64",
"block_number": 36241473
},
"MulticallHandler": {
"address": "0xeC41F75c686e376Ab2a4F18bde263ab5822c4511",
"block_number": 36589196
},
"SpokePool": {
"address": "0xd2ecb3afe598b746F8123CaE365a598DA831A449",
"block_number": 36437473
}
}
},
"232": {
"chain_name": "Lens",
"contracts": {
Expand Down
22 changes: 22 additions & 0 deletions broadcast/deployed-addresses.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ This file contains the latest deployed smart contract addresses from the broadca
- **Universal_Adapter_56**: `0x6f1C9d3bcDF51316E7b515a62C02F601500b084b`
- Block Number: `23251254`

#### Universal_Adapter_143

- **Universal_Adapter_143**: `0xc29a3ba0fbf477f16fd53d2c438eade024fd8452`
- Block Number: `23832288`

#### Universal_Adapter_999

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

### Monad Mainnet (Chain ID: 143)

#### Helios

- **Helios**: `0x09aea4b2242abc8bb4bb78d537a67a245a7bec64`
- Block Number: `36241473`

#### MulticallHandler

- **MulticallHandler**: `0xeC41F75c686e376Ab2a4F18bde263ab5822c4511`
- Block Number: `36589196`

#### SpokePool

- **SpokePool**: `0xd2ecb3afe598b746F8123CaE365a598DA831A449`
- Block Number: `36437473`

### Lens (Chain ID: 232)

#### SpokePool
Expand Down
6 changes: 6 additions & 0 deletions contracts/libraries/CircleCCTPAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ library CircleDomainIds {
uint32 public constant Polygon = 7;
uint32 public constant DoctorWho = 10;
uint32 public constant Linea = 11;
uint32 public constant WorldChain = 14;
uint32 public constant Monad = 15;
uint32 public constant BSC = 17;
uint32 public constant HyperEVM = 19;
uint32 public constant Ink = 21;
uint32 public constant Arc = 26;
uint32 public constant UNINITIALIZED = type(uint32).max;
}

Expand Down
50 changes: 11 additions & 39 deletions deploy/111_deploy_universal_spokepool.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
import { DeployFunction } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { deployNewProxy, getSpokePoolDeploymentInfo } from "../utils/utils.hre";
import {
EXPECTED_SAFE_ADDRESS,
FILL_DEADLINE_BUFFER,
L2_ADDRESS_MAP,
QUOTE_TIME_BUFFER,
USDC,
ZERO_ADDRESS,
} from "./consts";
import { FILL_DEADLINE_BUFFER, L2_ADDRESS_MAP, QUOTE_TIME_BUFFER, USDC, ZERO_ADDRESS } from "./consts";
import { CHAIN_IDs, PRODUCTION_NETWORKS, TOKEN_SYMBOLS_MAP } from "../utils/constants";
import { getOftEid, toWei, predictedSafe } from "../utils/utils";
import { getNodeUrl } from "../utils";
import { getOftEid, toWei } from "../utils/utils";
import { getDeployedAddress } from "../src/DeploymentUtils";
import "@nomiclabs/hardhat-ethers";
import Safe from "@safe-global/protocol-kit";

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

const oftEid = getOftEid(hubChainId);
// ! Notice. Deployed has to adjust this fee cap based on dst chain's native token. 4.4 BNB for BSC
const oftFeeCap = toWei(4.4); // ~1 ETH fee cap
let oftFeeCap = toWei("1"); // 1 ETH fee cap
if (spokeChainId == CHAIN_IDs.MONAD) {
oftFeeCap = toWei(78_000); // ~1 ETH fee cap
} else if (spokeChainId == CHAIN_IDs.BSC) {
oftFeeCap = toWei(4.4); // ~1 ETH fee cap
}

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

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

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

const nodeUrl = getNodeUrl(spokeChainId);

const protocolKit = await Safe.init({
provider: nodeUrl,
predictedSafe,
});

const existingProtocolKit = await protocolKit.connect({
safeAddress: EXPECTED_SAFE_ADDRESS,
});
const isDeployed = await existingProtocolKit.isSafeDeployed();

if (!isDeployed) {
throw new Error("Expected Safe address is not deployed, please deploy it first");
}

const factory = await hre.ethers.getContractFactory("Universal_SpokePool");
const contract = factory.attach(proxyAddress);

const owner = await contract.owner();
if (owner !== EXPECTED_SAFE_ADDRESS) {
await (await contract.transferOwnership(EXPECTED_SAFE_ADDRESS)).wait();
console.log("Transferred ownership to Expected Safe address:", await contract.owner());
} else {
console.log("Expected Safe address is already the owner of the Universal SpokePool");
}
console.log(`Deployed Universal SpokePool at ${proxyAddress}! Remember to transfer ownership to the Gnosis Safe!`);
};
module.exports = func;
func.tags = ["UniversalSpokePool"];
3 changes: 3 additions & 0 deletions deploy/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ export const L2_ADDRESS_MAP: { [key: number]: { [contractName: string]: string }
cctpV2TokenMessenger: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
},
[CHAIN_IDs.MONAD]: {
cctpV2TokenMessenger: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d",
},
[CHAIN_IDs.PLASMA]: {
permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
},
Expand Down
6 changes: 6 additions & 0 deletions deployments/deployments.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"MulticallHandler": { "address": "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E", "blockNumber": 22967417 },
"Lisk_Adapter": { "address": "0xF039AdCC74936F90fE175e8b3FE0FdC8b8E0c73b", "blockNumber": 22474211 },
"Universal_Adapter_56": { "address": "0x6f1C9d3bcDF51316E7b515a62C02F601500b084b", "blockNumber": 23251254 },
"Universal_Adapter_143": { "address": "0xc29a3ba0fbf477f16fd53d2c438eade024fd8452", "blockNumber": 23832288 },
"Universal_Adapter_999": { "address": "0x0ec70777Ac388774041dD5A1778Cdf3AF3134D2B", "blockNumber": 23371516 },
"Universal_Adapter_9745": { "address": "0xb47fD69FE25878F4E43aAF2F9ad7D0A3A0B22363", "blockNumber": 23419367 },
"Blast_Adapter": { "address": "0xF2bEf5E905AAE0295003ab14872F811E914EdD81", "blockNumber": 20221494 },
Expand Down Expand Up @@ -86,6 +87,11 @@
"MulticallHandler": { "address": "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E", "blockNumber": 74229464 },
"SpokePoolPeriphery": { "address": "0x89415a82d909a7238d69094C3Dd1dCC1aCbDa85C", "blockNumber": 73247089 }
},
"143": {
"Helios": { "address": "0x09aea4b2242abc8bb4bb78d537a67a245a7bec64", "blockNumber": 36241473 },
"MulticallHandler": { "address": "0xeC41F75c686e376Ab2a4F18bde263ab5822c4511", "blockNumber": 36589196 },
"SpokePool": { "address": "0xd2ecb3afe598b746F8123CaE365a598DA831A449", "blockNumber": 36437473 }
},
"232": {
"SpokePool": { "address": "0xb234cA484866c811d0e6D3318866F583781ED045", "blockNumber": 4197027 },
"SpokePoolVerifier": { "address": "0x3Fb9cED51E968594C87963a371Ed90c39519f65A", "blockNumber": 4419395 },
Expand Down
1 change: 1 addition & 0 deletions deployments/monad/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
143
Loading
Loading