diff --git a/ethereum/.openzeppelin/unknown-97.json b/ethereum/.openzeppelin/unknown-97.json index 9b0eb331..883cea89 100644 --- a/ethereum/.openzeppelin/unknown-97.json +++ b/ethereum/.openzeppelin/unknown-97.json @@ -943,6 +943,224 @@ } } } + }, + "13bd50448a4ee3eaa17b015190048d9a79da89d68df26e73e9a211fd7baf6e42": { + "address": "0xba2BF83194AfafB42815AA7B1B97BFE8ddaCEfA0", + "txHash": "0xdf1d8be232239ab3e3ffea9f640f2e287dd88fe8c1ecfe89a69bf7eba1ff63c4", + "layout": { + "storage": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_bool", + "src": "../@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:39" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "../@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:44" + }, + { + "contract": "ContextUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "../@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "contract": "OwnableUpgradeable", + "label": "_owner", + "type": "t_address", + "src": "../@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "contract": "OwnableUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "../@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:87" + }, + { + "contract": "ERC1967UpgradeUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "../@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:211" + }, + { + "contract": "UUPSUpgradeable", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "../@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol:107" + }, + { + "contract": "PythState", + "label": "_state", + "type": "t_struct(State)5138_storage", + "src": "../project:/contracts/pyth/PythState.sol:46" + } + ], + "types": { + "t_struct(State)5138_storage": { + "label": "struct PythStorage.State", + "members": [ + { + "label": "wormhole", + "type": "t_address" + }, + { + "label": "_deprecatedPyth2WormholeChainId", + "type": "t_uint16" + }, + { + "label": "_deprecatedPyth2WormholeEmitter", + "type": "t_bytes32" + }, + { + "label": "_deprecatedLatestPriceInfo", + "type": "t_mapping(t_bytes32,t_struct(PriceInfo)4978_storage)" + }, + { + "label": "validDataSources", + "type": "t_array(t_struct(DataSource)4983_storage)dyn_storage" + }, + { + "label": "isValidDataSource", + "type": "t_mapping(t_bytes32,t_bool)" + }, + { + "label": "singleUpdateFeeInWei", + "type": "t_uint256" + }, + { + "label": "validTimePeriodSeconds", + "type": "t_uint256" + }, + { + "label": "governanceDataSource", + "type": "t_struct(DataSource)4983_storage" + }, + { + "label": "lastExecutedGovernanceSequence", + "type": "t_uint64" + }, + { + "label": "latestPriceInfo", + "type": "t_mapping(t_bytes32,t_struct(PriceInfo)4978_storage)" + } + ] + }, + "t_address": { + "label": "address" + }, + "t_uint16": { + "label": "uint16" + }, + "t_bytes32": { + "label": "bytes32" + }, + "t_mapping(t_bytes32,t_struct(PriceInfo)4978_storage)": { + "label": "mapping(bytes32 => struct PythInternalStructs.PriceInfo)" + }, + "t_struct(PriceInfo)4978_storage": { + "label": "struct PythInternalStructs.PriceInfo", + "members": [ + { + "label": "attestationTime", + "type": "t_uint256" + }, + { + "label": "arrivalTime", + "type": "t_uint256" + }, + { + "label": "arrivalBlock", + "type": "t_uint256" + }, + { + "label": "priceFeed", + "type": "t_struct(PriceFeed)2423_storage" + } + ] + }, + "t_array(t_struct(DataSource)4983_storage)dyn_storage": { + "label": "struct PythInternalStructs.DataSource[]" + }, + "t_struct(DataSource)4983_storage": { + "label": "struct PythInternalStructs.DataSource", + "members": [ + { + "label": "chainId", + "type": "t_uint16" + }, + { + "label": "emitterAddress", + "type": "t_bytes32" + } + ] + }, + "t_mapping(t_bytes32,t_bool)": { + "label": "mapping(bytes32 => bool)" + }, + "t_bool": { + "label": "bool" + }, + "t_uint256": { + "label": "uint256" + }, + "t_uint64": { + "label": "uint64" + }, + "t_struct(PriceFeed)2423_storage": { + "label": "struct PythStructs.PriceFeed", + "members": [ + { + "label": "id", + "type": "t_bytes32" + }, + { + "label": "price", + "type": "t_struct(Price)2414_storage" + }, + { + "label": "emaPrice", + "type": "t_struct(Price)2414_storage" + } + ] + }, + "t_struct(Price)2414_storage": { + "label": "struct PythStructs.Price", + "members": [ + { + "label": "price", + "type": "t_int64" + }, + { + "label": "conf", + "type": "t_uint64" + }, + { + "label": "expo", + "type": "t_int32" + }, + { + "label": "publishTime", + "type": "t_uint256" + } + ] + }, + "t_int64": { + "label": "int64" + }, + "t_int32": { + "label": "int32" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + } + } + } } } } diff --git a/ethereum/Deploying.md b/ethereum/Deploying.md index 3b03aaa5..a7d23913 100644 --- a/ethereum/Deploying.md +++ b/ethereum/Deploying.md @@ -32,6 +32,7 @@ npx truffle migrate --network $MIGRATIONS_NETWORK --to # Some steps require executing a governance instruction to be successful, you can use the multisig message builder tool in # `third_party/pyth` of this repo root to create multisig transaction and execute it to create the VAA. # Then you can use the VAA (in hex) to execute the governance instruction. To do so, run: +$ npx apply-registry # apparently a deployProxyImpl messes up with correct address of proxy $ npx truffle console --network $MIGRATIONS_NETWORK > let p = await PythUpgradable.deployed() > await p.executeGovernanceInstruction(""); diff --git a/ethereum/contracts/pyth/Pyth.sol b/ethereum/contracts/pyth/Pyth.sol index 48cd7919..ddbb4a05 100644 --- a/ethereum/contracts/pyth/Pyth.sol +++ b/ethereum/contracts/pyth/Pyth.sol @@ -247,6 +247,6 @@ abstract contract Pyth is PythGetters, PythSetters, AbstractPyth { function deployCommitHash() public pure returns (string memory) { // This is a place holder for the commit hash and will be replaced // with the commit hash upon deployment. - return "__DEPLOY_COMMIT_HASH_PLACEHOLER__"; + return "9a285cf799ea09eac71704afafc382fc889b0849"; } } diff --git a/ethereum/migrations/prod/10_pyth_make_interface_simpler.js b/ethereum/migrations/prod/10_pyth_make_interface_simpler.js index 787a82cc..21070354 100644 --- a/ethereum/migrations/prod/10_pyth_make_interface_simpler.js +++ b/ethereum/migrations/prod/10_pyth_make_interface_simpler.js @@ -3,13 +3,7 @@ require('dotenv').config({ path: "../.env" }); const governance = require("@pythnetwork/xc-governance-sdk"); const PythUpgradable = artifacts.require("PythUpgradable"); -const governanceChainId = process.env.GOVERNANCE_CHAIN_ID; -const governanceEmitter = process.env.GOVERNANCE_EMITTER; const wormholeChainName = process.env.WORMHOLE_CHAIN_NAME; -assert(governance.CHAINS[wormholeChainName] !== undefined); - -console.log("governanceEmitter: " + governanceEmitter); -console.log("governanceChainId: " + governanceChainId); const { deployProxyImpl } = require('@openzeppelin/truffle-upgrades/dist/utils'); const { assert } = require('chai'); @@ -21,6 +15,8 @@ const { assert } = require('chai'); * - Use pyth-sdk-solidity 1.0.0 which simplifies the PriceFeed interface */ module.exports = async function (deployer) { + assert(governance.CHAINS[wormholeChainName] !== undefined); + const proxy = await PythUpgradable.deployed(); const newImpl = (await deployProxyImpl(PythUpgradable, { deployer, unsafeSkipStorageCheck: true }, proxy.address)).impl; console.log(`New implementation address is: ${newImpl}. Please sign and execute the following encoded ` + diff --git a/ethereum/migrations/prod/11_pyth_renounce_ownership.js b/ethereum/migrations/prod/11_pyth_renounce_ownership.js index 375a064d..760c89e2 100644 --- a/ethereum/migrations/prod/11_pyth_renounce_ownership.js +++ b/ethereum/migrations/prod/11_pyth_renounce_ownership.js @@ -1,13 +1,6 @@ require('dotenv').config({ path: "../.env" }); const PythUpgradable = artifacts.require("PythUpgradable"); -const governanceChainId = process.env.GOVERNANCE_CHAIN_ID; -const governanceEmitter = process.env.GOVERNANCE_EMITTER; - -console.log("governanceEmitter: " + governanceEmitter); -console.log("governanceChainId: " + governanceChainId); - -const { upgradeProxy } = require("@openzeppelin/truffle-upgrades"); /** * Version 1.0.0 - 2nd step