Переглянути джерело

[evm] Polygon ZKEVM deployment (#711)

* gr

* doc

* add zkevm deployment

* gr

* zkevm deployment

* add zkevm testnet
Jayant Krishnamurthy 2 роки тому
батько
коміт
c45664c951

+ 1 - 1
governance/xc_governance_sdk_js/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@pythnetwork/xc-governance-sdk",
-  "version": "0.2.0",
+  "version": "0.4.0",
   "description": "Pyth Cross-chain Governance SDK",
   "private": "true",
   "homepage": "https://pyth.network",

+ 1 - 0
governance/xc_governance_sdk_js/src/chains.ts

@@ -9,6 +9,7 @@ export const RECEIVER_CHAINS = {
   gnosis: 60005,
   evmos: 60006,
   neon: 60007,
+  polygon_zkevm: 60008,
 };
 
 // If there is any overlapping value the receiver chain will replace the wormhole

+ 1 - 1
package-lock.json

@@ -1599,7 +1599,7 @@
     },
     "governance/xc_governance_sdk_js": {
       "name": "@pythnetwork/xc-governance-sdk",
-      "version": "0.2.0",
+      "version": "0.4.0",
       "license": "Apache-2.0",
       "dependencies": {
         "@certusone/wormhole-sdk": "^0.6.2",

+ 5 - 0
target_chains/ethereum/contracts/.env.prod.polygon_zkevm_testnet

@@ -0,0 +1,5 @@
+MIGRATIONS_DIR=./migrations/prod-receiver
+MIGRATIONS_NETWORK=polygon_zkevm_testnet
+WORMHOLE_CHAIN_NAME=polygon_zkevm
+CLUSTER=testnet
+VALID_TIME_PERIOD_SECONDS=60

+ 1 - 1
target_chains/ethereum/contracts/Deploying.md

@@ -54,7 +54,7 @@ This is the deployment process:
    values in [`.env.prod.development`](.env.prod.development).
 3. If you have changed the contract make sure that:
    - The change is not breaking the storage.
-   - If it is making a backward incomptabile change, the legacy methods/storages are still used. For example,
+   - If it is making a backward incompatible change, the legacy methods/storages are still used. For example,
      if the PriceInfos are now stored in a separate storage slot, the old PriceInfo should be accessible when
      the new one is not populated.
    - the contract version is updated both in [`Pyth.sol`](./contracts/pyth/Pyth.sol) and [`package.json`](./package.json).

+ 16 - 0
target_chains/ethereum/contracts/networks/1442.json

@@ -0,0 +1,16 @@
+[
+  {
+    "contractName": "Migrations",
+    "address": "0xA4D48066e3B206E380c989ccB59B887691796e57"
+  },
+  {
+    "contractName": "WormholeReceiver",
+    "address": "0xb13722A7a87D9f5F080a133eb322A4deCC68f088",
+    "transactionHash": "0xc9d6c850e0e1d2f514cfbd6864b410e2bdb9a09d24ceb4355f1e4da325df0da0"
+  },
+  {
+    "contractName": "PythUpgradable",
+    "address": "0xd54bf1758b1C932F86B178F8b1D5d1A7e2F62C2E",
+    "transactionHash": "0x6fa1950947ef8fdb40e8ffd5423207f6abbf1d79dd436dfe2575d4e7cfe3dddb"
+  }
+]

+ 7 - 0
target_chains/ethereum/contracts/truffle-config.js

@@ -11,6 +11,9 @@ function payerProvider(url) {
     new HDWalletProvider({
       mnemonic: process.env.MNEMONIC,
       providerOrUrl: url,
+      // This option makes deployments more reliable (by avoiding rate limiting errors) at the cost of
+      // taking a little longer.
+      pollingInterval: 12000,
     });
 }
 
@@ -181,6 +184,10 @@ module.exports = {
       provider: payerProvider(`https://evm-t3.cronos.org`),
       network_id: 338,
     },
+    polygon_zkevm_testnet: {
+      provider: payerProvider(`https://rpc.public.zkevm-test.net/`),
+      network_id: 1442,
+    },
     shimmer_testnet: {
       provider: payerProvider(`https://json-rpc.evm.testnet.shimmer.network`),
       network_id: 1070,

+ 1 - 1
target_chains/ethereum/sdk/js/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@pythnetwork/pyth-evm-js",
-  "version": "1.7.0",
+  "version": "1.8.0",
   "description": "Pyth Network EVM Utils in JS",
   "homepage": "https://pyth.network",
   "author": {

+ 1 - 0
target_chains/ethereum/sdk/js/src/index.ts

@@ -40,4 +40,5 @@ export const CONTRACT_ADDR: Record<string, string> = {
   evmos: "0x354bF866A4B006C9AF9d9e06d9364217A8616E12",
   evmos_testnet: "0x354bF866A4B006C9AF9d9e06d9364217A8616E12",
   neon_devnet: "0x2FF312f50689ad279ABb164dB255Eb568733BD6c",
+  polygon_zkevm_testnet: "0xd54bf1758b1C932F86B178F8b1D5d1A7e2F62C2E",
 };