diff --git a/contract_manager/src/contracts/evm.ts b/contract_manager/src/contracts/evm.ts index 8e1fa48b..95b2efbf 100644 --- a/contract_manager/src/contracts/evm.ts +++ b/contract_manager/src/contracts/evm.ts @@ -240,22 +240,6 @@ export class WormholeEvmContract extends WormholeContract { return currentSet; } - /** - * Checks whether this contract is a deployment of wormhole-receiver or wormhole. - * The wormhole-receiver is a subset of the wormhole contract optimized for just verifying the VAAs. - * The check is done by calling a function that only exists in the wormhole contract and not in the wormhole-receiver. - * If the function call fails, we know that this is a wormhole-receiver contract. - */ - async isWormholeReceiver(): Promise { - const wormholeContract = this.getContract(); - try { - await wormholeContract.methods.messageFee().call(); - return false; - } catch (e) { - return true; - } - } - async upgradeGuardianSets(senderPrivateKey: PrivateKey, vaa: Buffer) { const web3 = new Web3(this.chain.getRpcUrl()); const { address } = web3.eth.accounts.wallet.add(senderPrivateKey); diff --git a/target_chains/cosmwasm/contracts/README.md b/target_chains/cosmwasm/contracts/README.md index 31ce558d..16697d16 100644 --- a/target_chains/cosmwasm/contracts/README.md +++ b/target_chains/cosmwasm/contracts/README.md @@ -20,24 +20,6 @@ A typical query requires to pass the price feed id as a hex string. it will look } ``` -## Contracts and Price Feeds - -Pyth is currently available on the following cosmwasm chains: - -### Testnet - -| Network | Contract address | -| --------- | -------------------------------------------- | -| Injective | `inj1z60tg0tekdzcasenhuuwq3htjcd5slmgf7gpez` | - -Available price feeds on these networks can be find below: - -### Price Feeds - -| Network | Available Price Feeds | -| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------ | -| Injective Testnet | [https://pyth.network/developers/price-feed-ids#injective-testnet](https://pyth.network/developers/price-feed-ids#injective-testnet) | - ## Developing The cosmwasm contract lives in the `pyth` subdirectory. diff --git a/target_chains/ethereum/contracts/.env.prod.development b/target_chains/ethereum/contracts/.env.prod.development index 4c1bce53..858a0157 100644 --- a/target_chains/ethereum/contracts/.env.prod.development +++ b/target_chains/ethereum/contracts/.env.prod.development @@ -1,5 +1,5 @@ # Migrations Metadata -MIGRATIONS_DIR=./migrations/prod +MIGRATIONS_DIR=./migrations/prod-receiver MIGRATIONS_NETWORK=development WORMHOLE_CHAIN_NAME=ethereum CLUSTER=testnet diff --git a/target_chains/ethereum/contracts/.env.template b/target_chains/ethereum/contracts/.env.template index 980dc598..d99d52bf 100644 --- a/target_chains/ethereum/contracts/.env.template +++ b/target_chains/ethereum/contracts/.env.template @@ -1,5 +1,5 @@ # Network Config -MIGRATIONS_DIR= # ./migrations/prod +MIGRATIONS_DIR= # ./migrations/prod-receiver MIGRATIONS_NETWORK= # xyz diff --git a/target_chains/ethereum/contracts/Deploying.md b/target_chains/ethereum/contracts/Deploying.md index 1808814c..27362aca 100644 --- a/target_chains/ethereum/contracts/Deploying.md +++ b/target_chains/ethereum/contracts/Deploying.md @@ -29,7 +29,7 @@ This is the deployment process: 1. Follow the installation instructions in the [README.md](./README.md). 2. As a sanity check on deploying changes for the first time, it is recommended to deploy the migrations - in `migrations/prod` to the Truffle `development` network first. You can do this by using the configuration + in `migrations/prod-receiver` to the Truffle `development` network first. You can do this by using the configuration 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. diff --git a/target_chains/ethereum/contracts/migrations/prod/1_initial_migration.js b/target_chains/ethereum/contracts/migrations/prod/1_initial_migration.js deleted file mode 100644 index 67ced9da..00000000 --- a/target_chains/ethereum/contracts/migrations/prod/1_initial_migration.js +++ /dev/null @@ -1,12 +0,0 @@ -const Migrations = artifacts.require("Migrations"); - -const tdr = require("truffle-deploy-registry"); - -module.exports = async function (deployer, network) { - await deployer.deploy(Migrations); - let migrationsInstance = await Migrations.deployed(); - - if (!tdr.isDryRunNetworkName(network)) { - await tdr.appendInstance(migrationsInstance); - } -}; diff --git a/target_chains/ethereum/contracts/migrations/prod/2_deploy_pyth.js b/target_chains/ethereum/contracts/migrations/prod/2_deploy_pyth.js deleted file mode 100644 index 83c8d5ac..00000000 --- a/target_chains/ethereum/contracts/migrations/prod/2_deploy_pyth.js +++ /dev/null @@ -1,73 +0,0 @@ -const loadEnv = require("../../scripts/loadEnv"); -loadEnv("../../"); - -const PythUpgradable = artifacts.require("PythUpgradable"); -const { deployProxy } = require("@openzeppelin/truffle-upgrades"); -const tdr = require("truffle-deploy-registry"); -const { CONTRACTS } = require("@certusone/wormhole-sdk"); -const { assert } = require("chai"); -const { - saveConfig, - getDefaultConfig, -} = require("../../scripts/contractManagerConfig"); - -const { - governanceEmitter, - governanceChainId, - emitterAddresses, - emitterChainIds, -} = getDefaultConfig(process.env.MIGRATIONS_NETWORK); -// Default value for this field is 0 -const governanceInitialSequence = Number( - process.env.GOVERNANCE_INITIAL_SEQUENCE ?? "0" -); - -const validTimePeriodSeconds = Number(process.env.VALID_TIME_PERIOD_SECONDS); -const singleUpdateFeeInWei = Number(process.env.SINGLE_UPDATE_FEE_IN_WEI); - -console.log("emitterChainIds: " + emitterChainIds); -console.log("emitterAddresses: " + emitterAddresses); -console.log("governanceEmitter: " + governanceEmitter); -console.log("governanceChainId: " + governanceChainId); -console.log("governanceInitialSequence: " + governanceInitialSequence); -console.log("validTimePeriodSeconds: " + validTimePeriodSeconds); -console.log("singleUpdateFeeInWei: " + singleUpdateFeeInWei); - -module.exports = async function (deployer, network) { - const cluster = process.env.CLUSTER; - const chainName = process.env.WORMHOLE_CHAIN_NAME; - - assert(cluster !== undefined && chainName !== undefined); - - const wormholeBridgeAddress = - CONTRACTS[cluster.toUpperCase()][chainName].core; - assert(wormholeBridgeAddress !== undefined); - - console.log("Wormhole bridge address: " + wormholeBridgeAddress); - - // Deploy the proxy. This will return an instance of PythUpgradable, - // with the address field corresponding to the fronting ERC1967Proxy. - let proxyInstance = await deployProxy( - PythUpgradable, - [ - wormholeBridgeAddress, - emitterChainIds, - emitterAddresses, - governanceChainId, - governanceEmitter, - governanceInitialSequence, - validTimePeriodSeconds, - singleUpdateFeeInWei, - ], - { deployer } - ); - - // Add the ERC1967Proxy address to the PythUpgradable contract's - // entry in the registry. This allows us to call upgradeProxy - // functions with the value of PythUpgradable.deployed().address: - // e.g. upgradeProxy(PythUpgradable.deployed().address, NewImplementation) - if (!tdr.isDryRunNetworkName(network)) { - await tdr.appendInstance(proxyInstance); - } - saveConfig(process.env.MIGRATIONS_NETWORK, proxyInstance.address); -};