Skip to content

Commit

Permalink
Zkcronos mainnet deployment (#1826)
Browse files Browse the repository at this point in the history
* temp

* update

* tiny changes

* tiny changes
  • Loading branch information
aditya520 committed Aug 15, 2024
1 parent 8966444 commit acf5a40
Show file tree
Hide file tree
Showing 10 changed files with 3,911 additions and 1,495 deletions.
4 changes: 4 additions & 0 deletions contract_manager/store/chains/EvmChains.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -678,4 +678,8 @@
mainnet: true
rpcUrl: https://mainnet-rpc.b3.fun/http
networkId: 8333
- id: cronos_zkevm_mainnet
mainnet: true
rpcUrl: https://mainnet.zkevm.cronos.org
networkId: 388
type: EvmChain
3 changes: 3 additions & 0 deletions contract_manager/store/contracts/EvmPriceFeedContracts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -376,3 +376,6 @@
- chain: reya_testnet
address: "0x2880aB155794e7179c9eE2e38200202908C17B43"
type: EvmPriceFeedContract
- chain: cronos_zkevm_mainnet
address: "0x056f829183Ec806A78c26C98961678c24faB71af"
type: EvmPriceFeedContract
3 changes: 3 additions & 0 deletions contract_manager/store/contracts/EvmWormholeContracts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,6 @@
- chain: b3_mainnet
address: "0xb27e5ca259702f209a29225d0eDdC131039C9933"
type: EvmWormholeContract
- chain: cronos_zkevm_mainnet
address: "0xc10F5BE78E464BB0E1f534D66E5A6ecaB150aEFa"
type: EvmWormholeContract
1 change: 1 addition & 0 deletions governance/xc_admin/packages/xc_admin_common/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export const RECEIVER_CHAINS = {
klaytn: 60056,
kinto: 60057,
b3_mainnet: 60058,
cronos_zkevm_mainnet: 60059,

// Testnets as a separate chain ids (to use stable data sources and governance for them)
injective_testnet: 60013,
Expand Down
5,332 changes: 3,868 additions & 1,464 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion target_chains/ethereum/contracts/deploy/zkSyncDeploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { Deployer } from "@matterlabs/hardhat-zksync-deploy";
import { CHAINS } from "@pythnetwork/xc-admin-common";
import { assert } from "chai";
import { writeFileSync } from "fs";
// import {Wallet as ZkWallet} from "zksync-ethers"; // Use These packages if "zksync-web3" doesn't work
// import { Deployer as ZkDeployer } from "@matterlabs/hardhat-zksync";

const { getDefaultConfig } = require("../scripts/contractManagerConfig");

Expand Down Expand Up @@ -46,7 +48,6 @@ export default async function (hre: HardhatRuntimeEnvironment) {
emitterAddresses,
emitterChainIds,
} = getDefaultConfig(envOrErr("MIGRATIONS_NETWORK"));

const chainName = envOrErr("MIGRATIONS_NETWORK");
const wormholeReceiverChainId = CHAINS[chainName];
assert(wormholeReceiverChainId !== undefined);
Expand All @@ -59,10 +60,17 @@ export default async function (hre: HardhatRuntimeEnvironment) {
"WormholeReceiver"
);

console.log("Deploying WormholeReceiver contract...");
const receiverSetupContract = await deployer.deploy(receiverSetupArtifact);
console.log("Deployed ReceiverSetup on", receiverSetupContract.address);

console.log("Deploying ReceiverImplementation contract...");
// deploy implementation
const receiverImplContract = await deployer.deploy(receiverImplArtifact);
console.log(
"Deployed ReceiverImplementation on",
receiverImplContract.address
);

// encode initialisation data
const whInitData = receiverSetupContract.interface.encodeFunctionData(
Expand Down
40 changes: 15 additions & 25 deletions target_chains/ethereum/contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { http } from "wagmi";
import "@nomiclabs/hardhat-etherscan";
import "@openzeppelin/hardhat-upgrades";
import "@matterlabs/hardhat-zksync-deploy";
Expand All @@ -14,19 +15,15 @@ module.exports = {
},
},
},
defaultNetwork: "cronosZkEvmTestnet",
defaultNetwork: "cronosZkEvmMainnet",
networks: {
[process.env.MIGRATIONS_NETWORK!]: {
url: process.env.RPC_URL,
chainId: Number(process.env.NETWORK_ID),
accounts: {
mnemonic: process.env.MNEMONIC,
},
},
goerli: {
url: `https://goerli.infura.io/v3/${process.env.INFURA_KEY}`,
zksync: false,
},
// [process.env.MIGRATIONS_NETWORK!]: {
// url: process.env.RPC_URL,
// chainId: Number(process.env.NETWORK_ID),
// accounts: {
// mnemonic: process.env.MNEMONIC,
// },
// },
zkSyncTestnet: {
url: "https://zksync2-testnet.zksync.dev", // URL of the zkSync network RPC
ethNetwork: "goerli", // Can also be the RPC URL of the Ethereum network (e.g. `https://goerli.infura.io/v3/<API_KEY>`)
Expand All @@ -49,19 +46,12 @@ module.exports = {
zksync: true,
verifyURL: "https://explorer.zkevm.cronos.org/contract_verification",
},
neon_devnet: {
url: "https://devnet.neonevm.org",
chainId: 245022926,
accounts: {
mnemonic: process.env.MNEMONIC,
},
},
shimmer_testnet: {
url: "https://json-rpc.evm.testnet.shimmer.network",
chainId: 1071,
accounts: {
mnemonic: process.env.MNEMONIC,
},
cronosZkEvmMainnet: {
url: "https://mainnet.zkevm.cronos.org",
ethNetwork: "sepolia", // or a Sepolia RPC endpoint from Infura/Alchemy/Chainstack etc.
zksync: true,
verifyURL:
"https://explorer-api.zkevm.cronos.org/api/v1/contract/verify/hardhat?apikey=",
},
},
etherscan: {
Expand Down
10 changes: 6 additions & 4 deletions target_chains/ethereum/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@
"license": "Apache-2.0",
"dependencies": {
"@certusone/wormhole-sdk": "^0.9.22",
"@matterlabs/hardhat-zksync-deploy": "^0.6.2",
"@matterlabs/hardhat-zksync": "^1.1.0",
"@matterlabs/hardhat-zksync-deploy": "^0.6.6",
"@matterlabs/hardhat-zksync-solc": "^0.3.14",
"@nomiclabs/hardhat-etherscan": "^3.1.7",
"@openzeppelin/contracts": "=4.8.1",
"@openzeppelin/contracts-upgradeable": "=4.8.1",
"@openzeppelin/hardhat-upgrades": "^1.22.1",
"@pythnetwork/pyth-sdk-solidity": "workspace:*",
"@pythnetwork/entropy-sdk-solidity": "workspace:*",
"@pythnetwork/contract-manager": "workspace:*",
"@pythnetwork/entropy-sdk-solidity": "workspace:*",
"@pythnetwork/pyth-sdk-solidity": "workspace:*",
"@pythnetwork/xc-admin-common": "workspace:*",
"dotenv": "^10.0.0",
"elliptic": "^6.5.2",
"ethers": "^5.7.2",
Expand All @@ -51,7 +53,7 @@
"web3": "^1.2.2",
"web3-eth-abi": "^1.2.2",
"web3-utils": "^1.2.2",
"@pythnetwork/xc-admin-common": "workspace:*",
"zksync-ethers": "^6.11.2",
"zksync-web3": "^0.13.4"
}
}
2 changes: 1 addition & 1 deletion target_chains/ethereum/sdk/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pythnetwork/pyth-evm-js",
"version": "1.61.0",
"version": "1.62.0",
"description": "Pyth Network EVM Utils in JS",
"homepage": "https://pyth.network",
"author": {
Expand Down
1 change: 1 addition & 0 deletions target_chains/ethereum/sdk/js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const CONTRACT_ADDR: Record<string, string> = {
conflux_espace: "0xe9d69CdD6Fe41e7B621B4A688C5D1a68cB5c8ADc",
core_dao: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
cronos: "0xE0d0e68297772Dd5a1f1D99897c581E2082dbA5B",
cronos_zkevm_mainnet: "0x056f829183ec806a78c26c98961678c24fab71af",
eos: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
evmos: "0x354bF866A4B006C9AF9d9e06d9364217A8616E12",
ethereum: "0x4305FB66699C3B2702D4d05CF36551390A4c69C6",
Expand Down

0 comments on commit acf5a40

Please sign in to comment.