diff --git a/governance/xc_governance_sdk_js/src/chains.ts b/governance/xc_governance_sdk_js/src/chains.ts index db87dcde..026aead0 100644 --- a/governance/xc_governance_sdk_js/src/chains.ts +++ b/governance/xc_governance_sdk_js/src/chains.ts @@ -7,6 +7,7 @@ export const RECEIVER_CHAINS = { zksync: 60003, shimmer: 60004, gnosis: 60005, + evmos: 60006, }; // If there is any overlapping value the receiver chain will replace the wormhole diff --git a/package-lock.json b/package-lock.json index 12a29b7c..60070308 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49985,7 +49985,7 @@ }, "target_chains/ethereum/sdk/js": { "name": "@pythnetwork/pyth-evm-js", - "version": "1.3.0", + "version": "1.4.0", "license": "Apache-2.0", "dependencies": { "@pythnetwork/price-service-client": "*", diff --git a/target_chains/ethereum/contracts/.env.prod.evmos_testnet b/target_chains/ethereum/contracts/.env.prod.evmos_testnet new file mode 100644 index 00000000..57877890 --- /dev/null +++ b/target_chains/ethereum/contracts/.env.prod.evmos_testnet @@ -0,0 +1,5 @@ +MIGRATIONS_DIR=./migrations/prod-receiver +MIGRATIONS_NETWORK=evmos_testnet +WORMHOLE_CHAIN_NAME=evmos +CLUSTER=testnet +VALID_TIME_PERIOD_SECONDS=60 diff --git a/target_chains/ethereum/contracts/Deploying.md b/target_chains/ethereum/contracts/Deploying.md index a06ec68d..b329d993 100644 --- a/target_chains/ethereum/contracts/Deploying.md +++ b/target_chains/ethereum/contracts/Deploying.md @@ -26,7 +26,7 @@ Each network that Pyth is deployed on has some configuration stored on this repo - `MIGRATIONS_NETWORK`: Network name in the [`truffle-config.js`](./truffle-config.js) file. - `WORMHOLE_CHAIN_NAME`: Chain name in Wormhole. It is either defined in the [Wormhole SDK constants](https://github.com/wormhole-foundation/wormhole/blob/dev.v2/sdk/js/src/utils/consts.ts) - or is defined in [Wormhole Receiver names](../third_party/pyth/xc_governance_sdk_js/src/chains.ts). If the new + or is defined in [Wormhole Receiver names](../../../governance/xc_governance_sdk_js/src/chains.ts). If the new network requires a Receiver contract you need to update the latter file and add the network there. - `CLUSTER`: Cluster of this network. It is either `testnet` or `mainnet`. There are some cluster specific configuration that are loaded from [`.env.cluster.testnet`](./.env.cluster.testnet) or @@ -68,7 +68,10 @@ This is the deployment process: - export the Infura RPC API key to `INFURA_KEY` if you are deploying to a network that uses an Infura RPC. 5. Make sure the deployment account has proper balance on this network and top it up if needed. Search for testnet faucets if it is a testnet network. Sometimes you need to bridge the network token (e.g., L2s). -6. Deploy the new contract or changes using the [`deploy.sh`](./deploy.sh) script. +6. Deploy the new contract or changes using the [`deploy.sh`](./deploy.sh) script. If you have made changes + to [`chains.ts`](../../../governance/xc_governance_sdk_js/src/chains.ts), please make sure to + run `npx lerna run build --scope="@pythnetwork/pyth-evm-contract" --include-dependencies` in the + root directory before running the deployment script. You might need to repeat this script because of busy RPCs. Repeating would not cause any problem even if the changes are already made. Also, sometimes the gases are not adjusted and it will cause the tx to remain on the mempool for a long time (so there is no progress until timeout). Please update them with diff --git a/target_chains/ethereum/contracts/README.md b/target_chains/ethereum/contracts/README.md index ed9e9876..229b96ae 100644 --- a/target_chains/ethereum/contracts/README.md +++ b/target_chains/ethereum/contracts/README.md @@ -20,11 +20,11 @@ Please refer to [Deploying.md](./Deploying.md) for more information. Foundry can be installed by the official installer, or by running our helper script which will automatically pull the correct installation script individually for Foundry and the Solidity compiler for your current OS. This may work better if you are running into networking/firewall issues using Foundry's Solidity installer. To use helper script, run the command below from this directory: ```sh -pyth-crosschain/ethereum $ bash ../scripts/install-foundry.sh +pyth-crosschain/target_chains/ethereum/contracts $ bash ../../../scripts/install-foundry.sh ``` You need to install npm dependencies as described in [Installation](#installation). Also, you need to run the following -command to install forge dependencies: +command in the `contracts` directory to install forge dependencies: ``` npm run install-forge-deps diff --git a/target_chains/ethereum/contracts/networks/9000.json b/target_chains/ethereum/contracts/networks/9000.json new file mode 100644 index 00000000..5eb392f6 --- /dev/null +++ b/target_chains/ethereum/contracts/networks/9000.json @@ -0,0 +1,16 @@ +[ + { + "contractName": "Migrations", + "address": "0x5e92a04Cb8591cb7d9FD40B77B474cde0fE44D36" + }, + { + "contractName": "WormholeReceiver", + "address": "0xfD4EC459371580925319059306388D9753f72405", + "transactionHash": "0x664b5882e14416bae9c40a03dcc4f5ca769eaed41bb44596c31056b1f4386bad" + }, + { + "contractName": "PythUpgradable", + "address": "0x354bF866A4B006C9AF9d9e06d9364217A8616E12", + "transactionHash": "0xeece8e67ba75cdd07348ddafa383e7371b15ad08e2e630c8f040025c72fa6eba" + } +] diff --git a/target_chains/ethereum/contracts/truffle-config.js b/target_chains/ethereum/contracts/truffle-config.js index 999bb37e..521ba362 100644 --- a/target_chains/ethereum/contracts/truffle-config.js +++ b/target_chains/ethereum/contracts/truffle-config.js @@ -208,6 +208,10 @@ module.exports = { apiKey: "", }, }, + evmos_testnet: { + provider: payerProvider(`https://eth.bd.evmos.dev:8545/`), + network_id: 9000, + }, }, compilers: { diff --git a/target_chains/ethereum/sdk/js/package.json b/target_chains/ethereum/sdk/js/package.json index e8b0233f..5035af26 100644 --- a/target_chains/ethereum/sdk/js/package.json +++ b/target_chains/ethereum/sdk/js/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/pyth-evm-js", - "version": "1.3.0", + "version": "1.4.0", "description": "Pyth Network EVM Utils in JS", "homepage": "https://pyth.network", "author": { diff --git a/target_chains/ethereum/sdk/js/src/index.ts b/target_chains/ethereum/sdk/js/src/index.ts index 8218f3db..b8947881 100644 --- a/target_chains/ethereum/sdk/js/src/index.ts +++ b/target_chains/ethereum/sdk/js/src/index.ts @@ -37,4 +37,5 @@ export const CONTRACT_ADDR: Record = { shimmer_testnet: "0x354bF866A4B006C9AF9d9e06d9364217A8616E12", chiado: "0xdDAf6D29b8bc81c1F0798a5e4c264ae89c16a72B", // Gnosis testnet zksync: "0xf087c864AEccFb6A2Bf1Af6A0382B0d0f6c5D834", + evmos_testnet: "0x354bF866A4B006C9AF9d9e06d9364217A8616E12", };