Skip to content

Commit 7bd214e

Browse files
authored
(chore:pricefeed) deploy cronos zkevm (#1790)
* wip-temp * d * deployed cronos-zkevm
1 parent 6bc6682 commit 7bd214e

File tree

10 files changed

+108
-29
lines changed

10 files changed

+108
-29
lines changed

contract_manager/scripts/sync_wormhole_guardian_set.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ async function main() {
6868

6969
// TODO: This is a temporary workaround to skip contracts that are in beta channel
7070
// We should have a better way to handle this
71-
if ((await wormhole.getCurrentGuardianSetIndex()) === 0) {
72-
continue;
73-
}
71+
// if ((await wormhole.getCurrentGuardianSetIndex()) === 0) {
72+
// continue;
73+
// }
7474

7575
console.log(
7676
`Current Guardianset for ${contract.getId()}: ${await wormhole.getCurrentGuardianSetIndex()}`

contract_manager/store/chains/EvmChains.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,3 +669,8 @@
669669
rpcUrl: https://rpc.kinto-rpc.com
670670
networkId: 7887
671671
type: EvmChain
672+
- id: cronos_zkevm_testnet
673+
mainnet: false
674+
rpcUrl: https://testnet.zkevm.cronos.org
675+
networkId: 282
676+
type: EvmChain

contract_manager/store/contracts/EvmPriceFeedContracts.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,3 +373,6 @@
373373
- chain: kinto
374374
address: "0x2880aB155794e7179c9eE2e38200202908C17B43"
375375
type: EvmPriceFeedContract
376+
- chain: cronos_zkevm_testnet
377+
address: "0x67DFF3D12dFDCeC9f85fd86f4cBDb0a111fF721A"
378+
type: EvmPriceFeedContract

contract_manager/store/contracts/EvmWormholeContracts.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,3 +358,6 @@
358358
- chain: kinto
359359
address: "0xb27e5ca259702f209a29225d0eDdC131039C9933"
360360
type: EvmWormholeContract
361+
- chain: cronos_zkevm_testnet
362+
address: "0x3f5bB93eEC6E3D6784274291A5816Bc34E851dc8"
363+
type: EvmWormholeContract

governance/xc_admin/packages/xc_admin_common/src/chains.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ export const RECEIVER_CHAINS = {
172172
tabi_testnet: 50088,
173173
movement_suzuka_testnet: 50089,
174174
b3_testnet: 50090,
175+
cronos_zkevm_testnet: 50091,
175176
};
176177

177178
// If there is any overlapping value the receiver chain will replace the wormhole

target_chains/ethereum/contracts/deploy/zkSyncDeploy.ts

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ export default async function (hre: HardhatRuntimeEnvironment) {
8686
`Deployed WormholeReceiver on ${wormholeReceiverContract.address}`
8787
);
8888

89-
const governanceInitialSequence = Number(
90-
process.env.GOVERNANCE_INITIAL_SEQUENCE ?? "0"
91-
);
89+
// Hardcoding the initial sequence number for governance messages.
90+
const governanceInitialSequence = Number("0");
9291

9392
const validTimePeriodSeconds = Number(envOrErr("VALID_TIME_PERIOD_SECONDS"));
9493
const singleUpdateFeeInWei = Number(envOrErr("SINGLE_UPDATE_FEE_IN_WEI"));
@@ -98,6 +97,8 @@ export default async function (hre: HardhatRuntimeEnvironment) {
9897

9998
const pythImplContract = await deployer.deploy(pythImplArtifact);
10099

100+
console.log(`Deployed Pyth implementation on ${pythImplContract.address}`);
101+
101102
const pythInitData = pythImplContract.interface.encodeFunctionData(
102103
"initialize",
103104
[
@@ -119,24 +120,24 @@ export default async function (hre: HardhatRuntimeEnvironment) {
119120

120121
console.log(`Deployed Pyth contract on ${pythProxyContract.address}`);
121122

122-
const networkId = hre.network.config.chainId;
123-
const registryPath = `networks/${networkId}.json`;
124-
console.log(`Saving addresses in ${registryPath}`);
125-
writeFileSync(
126-
registryPath,
127-
JSON.stringify(
128-
[
129-
{
130-
contractName: "WormholeReceiver",
131-
address: wormholeReceiverContract.address,
132-
},
133-
{
134-
contractName: "PythUpgradable",
135-
address: pythProxyContract.address,
136-
},
137-
],
138-
null,
139-
2
140-
)
141-
);
123+
// const networkId = hre.network.config.chainId;
124+
// const registryPath = `networks/${networkId}.json`;
125+
// console.log(`Saving addresses in ${registryPath}`);
126+
// writeFileSync(
127+
// registryPath,
128+
// JSON.stringify(
129+
// [
130+
// {
131+
// contractName: "WormholeReceiver",
132+
// address: wormholeReceiverContract.address,
133+
// },
134+
// {
135+
// contractName: "PythUpgradable",
136+
// address: pythProxyContract.address,
137+
// },
138+
// ],
139+
// null,
140+
// 2
141+
// )
142+
// );
142143
}

target_chains/ethereum/contracts/hardhat.config.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import "@matterlabs/hardhat-zksync-solc";
66

77
module.exports = {
88
zksolc: {
9-
version: "1.3.1",
9+
version: "1.4.1",
1010
compilerSource: "binary",
1111
settings: {
1212
optimizer: {
1313
enabled: true,
1414
},
1515
},
1616
},
17-
defaultNetwork: "zkSyncTestnet",
17+
defaultNetwork: "cronosZkEvmTestnet",
1818
networks: {
1919
[process.env.MIGRATIONS_NETWORK!]: {
2020
url: process.env.RPC_URL,
@@ -43,6 +43,12 @@ module.exports = {
4343
verifyURL:
4444
"https://zksync2-mainnet-explorer.zksync.io/contract_verification",
4545
},
46+
cronosZkEvmTestnet: {
47+
url: "https://testnet.zkevm.cronos.org",
48+
ethNetwork: "sepolia", // or a Sepolia RPC endpoint from Infura/Alchemy/Chainstack etc.
49+
zksync: true,
50+
verifyURL: "https://explorer.zkevm.cronos.org/contract_verification",
51+
},
4652
neon_devnet: {
4753
url: "https://devnet.neonevm.org",
4854
chainId: 245022926,
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
const {
2+
EvmContract,
3+
DefaultStore,
4+
Store,
5+
getDefaultDeploymentConfig,
6+
} = require("@pythnetwork/contract-manager");
7+
8+
function convertAddress(address) {
9+
return "0x" + address;
10+
}
11+
12+
function convertChainId(number) {
13+
return "0x" + number.toString(16);
14+
}
15+
16+
function getDefaultConfig(chainName) {
17+
const chain = DefaultStore.chains[chainName];
18+
console.log("***chain", chain);
19+
const { dataSources, governanceDataSource, wormholeConfig } =
20+
getDefaultDeploymentConfig("stable");
21+
22+
const emitterChainIds = dataSources.map((dataSource) =>
23+
convertChainId(dataSource.emitterChain)
24+
);
25+
const emitterAddresses = dataSources.map((dataSource) =>
26+
convertAddress(dataSource.emitterAddress)
27+
);
28+
const governanceChainId = convertChainId(governanceDataSource.emitterChain);
29+
const governanceEmitter = convertAddress(governanceDataSource.emitterAddress);
30+
31+
const wormholeInitialSigners =
32+
wormholeConfig.initialGuardianSet.map(convertAddress);
33+
const wormholeGovernanceChainId = convertChainId(
34+
wormholeConfig.governanceChainId
35+
);
36+
const wormholeGovernanceContract = convertAddress(
37+
wormholeConfig.governanceContract
38+
);
39+
40+
return {
41+
governanceEmitter,
42+
governanceChainId,
43+
emitterAddresses,
44+
emitterChainIds,
45+
wormholeInitialSigners,
46+
wormholeGovernanceChainId,
47+
wormholeGovernanceContract,
48+
};
49+
}
50+
function saveConfig(chainName, address) {
51+
const chain = DefaultStore.chains[chainName];
52+
const contract = new EvmContract(chain, address);
53+
DefaultStore.contracts[contract.getId()] = contract;
54+
DefaultStore.saveAllContracts();
55+
console.log("Added the following to your evm contract configs");
56+
console.log(Store.serialize(contract));
57+
}
58+
59+
module.exports = { saveConfig, getDefaultConfig };

target_chains/ethereum/sdk/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pythnetwork/pyth-evm-js",
3-
"version": "1.58.0",
3+
"version": "1.59.0",
44
"description": "Pyth Network EVM Utils in JS",
55
"homepage": "https://pyth.network",
66
"author": {

target_chains/ethereum/sdk/js/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export const CONTRACT_ADDR: Record<string, string> = {
8686
conflux_espace_testnet: "0xDd24F84d36BF92C65F92307595335bdFab5Bbd21",
8787
core_dao_testnet: "0x8D254a21b3C86D32F7179855531CE99164721933",
8888
cronos_testnet: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
89+
cronos_zkevm_testnet: "0x67DFF3D12dFDCeC9f85fd86f4cBDb0a111fF721A",
8990
dela_deperp_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
9091
dela_mithreum_deperp_testnet: "0xe9d69CdD6Fe41e7B621B4A688C5D1a68cB5c8ADc",
9192
etherlink_testnet: "0x2880aB155794e7179c9eE2e38200202908C17B43",

0 commit comments

Comments
 (0)