From 6fc11fc289cc4a818d76f8eba8dbee3b90bfb9f5 Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Wed, 10 Aug 2022 18:28:13 +0430 Subject: [PATCH] Upgrade testnet contracts (#248) * Upgrade testnet contracts And fixes some issues for it. Specially it uses unsafeSkipStorage to skip OZ collision check as they are very conservative and doesn't cover our valid memory changes. We should be very careful in memory changes now that we cannot use OZ collision check. * Address Tom comments --- ethereum/.openzeppelin/goerli.json | 237 ++++++++++++++++++ ethereum/.openzeppelin/ropsten.json | 237 ++++++++++++++++++ .../.openzeppelin/unknown-1313161555.json | 237 ++++++++++++++++++ ethereum/.openzeppelin/unknown-4002.json | 237 ++++++++++++++++++ ethereum/.openzeppelin/unknown-43113.json | 237 ++++++++++++++++++ ethereum/.openzeppelin/unknown-80001.json | 237 ++++++++++++++++++ ethereum/.openzeppelin/unknown-97.json | 237 ++++++++++++++++++ ethereum/Deploying.md | 18 ++ .../prod-receiver/4_pyth_multiple_emitters.js | 6 +- .../5_pyth_add_events_and_update_fee.js | 2 +- .../prod/3_pyth_multiple_emitters.js | 6 +- .../prod/4_pyth_add_events_and_update_fee.js | 2 +- .../test/4_pyth_multiple_emitters.js | 2 +- .../test/5_pyth_add_events_and_update_fee.js | 2 +- ethereum/truffle-config.js | 3 +- 15 files changed, 1689 insertions(+), 11 deletions(-) diff --git a/ethereum/.openzeppelin/goerli.json b/ethereum/.openzeppelin/goerli.json index 1c0ac784..b47a72d1 100644 --- a/ethereum/.openzeppelin/goerli.json +++ b/ethereum/.openzeppelin/goerli.json @@ -216,6 +216,243 @@ } } } + }, + "3c985b75452a5df848682f7c4086f55b3bc5ca6309b336e21c37a1fb62ac5c8d": { + "address": "0xBAEA4A1A2Eaa4E9bb78f2303C213Da152933170E", + "txHash": "0x8942f96cd80407b10d80b35af1f333b3b40da897c401e528e6bb1aee80ab4d96", + "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)3914_storage", + "src": "../project:/contracts/pyth/PythState.sol:30" + } + ], + "types": { + "t_struct(State)3914_storage": { + "label": "struct PythStorage.State", + "members": [ + { + "label": "wormhole", + "type": "t_address" + }, + { + "label": "_deprecatedPyth2WormholeChainId", + "type": "t_uint16" + }, + { + "label": "_deprecatedPyth2WormholeEmitter", + "type": "t_bytes32" + }, + { + "label": "latestPriceInfo", + "type": "t_mapping(t_bytes32,t_struct(PriceInfo)3809_storage)" + }, + { + "label": "validDataSources", + "type": "t_array(t_struct(DataSource)3814_storage)dyn_storage" + }, + { + "label": "isValidDataSource", + "type": "t_mapping(t_bytes32,t_bool)" + }, + { + "label": "singleUpdateFeeInWei", + "type": "t_uint256" + } + ] + }, + "t_address": { + "label": "address" + }, + "t_uint16": { + "label": "uint16" + }, + "t_bytes32": { + "label": "bytes32" + }, + "t_mapping(t_bytes32,t_struct(PriceInfo)3809_storage)": { + "label": "mapping(bytes32 => struct PythInternalStructs.PriceInfo)" + }, + "t_struct(PriceInfo)3809_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)2275_storage" + } + ] + }, + "t_array(t_struct(DataSource)3814_storage)dyn_storage": { + "label": "struct PythInternalStructs.DataSource[]" + }, + "t_struct(DataSource)3814_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_struct(PriceFeed)2275_storage": { + "label": "struct PythStructs.PriceFeed", + "members": [ + { + "label": "id", + "type": "t_bytes32" + }, + { + "label": "productId", + "type": "t_bytes32" + }, + { + "label": "price", + "type": "t_int64" + }, + { + "label": "conf", + "type": "t_uint64" + }, + { + "label": "expo", + "type": "t_int32" + }, + { + "label": "status", + "type": "t_enum(PriceStatus)2280" + }, + { + "label": "maxNumPublishers", + "type": "t_uint32" + }, + { + "label": "numPublishers", + "type": "t_uint32" + }, + { + "label": "emaPrice", + "type": "t_int64" + }, + { + "label": "emaConf", + "type": "t_uint64" + }, + { + "label": "publishTime", + "type": "t_uint64" + }, + { + "label": "prevPrice", + "type": "t_int64" + }, + { + "label": "prevConf", + "type": "t_uint64" + }, + { + "label": "prevPublishTime", + "type": "t_uint64" + } + ] + }, + "t_int64": { + "label": "int64" + }, + "t_uint64": { + "label": "uint64" + }, + "t_int32": { + "label": "int32" + }, + "t_enum(PriceStatus)2280": { + "label": "enum PythStructs.PriceStatus", + "members": [ + "UNKNOWN", + "TRADING", + "HALTED", + "AUCTION" + ] + }, + "t_uint32": { + "label": "uint32" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + } + } + } } } } diff --git a/ethereum/.openzeppelin/ropsten.json b/ethereum/.openzeppelin/ropsten.json index 02f3e4df..a75b26a4 100644 --- a/ethereum/.openzeppelin/ropsten.json +++ b/ethereum/.openzeppelin/ropsten.json @@ -216,6 +216,243 @@ } } } + }, + "3c985b75452a5df848682f7c4086f55b3bc5ca6309b336e21c37a1fb62ac5c8d": { + "address": "0xE5483Bf7fc740675B44dCd4b0f90983F8689D804", + "txHash": "0xdf8ea29c814297c22443fff9f923eb49dfb1161f4730f25d2cff7376f6f0146a", + "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)3914_storage", + "src": "../project:/contracts/pyth/PythState.sol:30" + } + ], + "types": { + "t_struct(State)3914_storage": { + "label": "struct PythStorage.State", + "members": [ + { + "label": "wormhole", + "type": "t_address" + }, + { + "label": "_deprecatedPyth2WormholeChainId", + "type": "t_uint16" + }, + { + "label": "_deprecatedPyth2WormholeEmitter", + "type": "t_bytes32" + }, + { + "label": "latestPriceInfo", + "type": "t_mapping(t_bytes32,t_struct(PriceInfo)3809_storage)" + }, + { + "label": "validDataSources", + "type": "t_array(t_struct(DataSource)3814_storage)dyn_storage" + }, + { + "label": "isValidDataSource", + "type": "t_mapping(t_bytes32,t_bool)" + }, + { + "label": "singleUpdateFeeInWei", + "type": "t_uint256" + } + ] + }, + "t_address": { + "label": "address" + }, + "t_uint16": { + "label": "uint16" + }, + "t_bytes32": { + "label": "bytes32" + }, + "t_mapping(t_bytes32,t_struct(PriceInfo)3809_storage)": { + "label": "mapping(bytes32 => struct PythInternalStructs.PriceInfo)" + }, + "t_struct(PriceInfo)3809_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)2275_storage" + } + ] + }, + "t_array(t_struct(DataSource)3814_storage)dyn_storage": { + "label": "struct PythInternalStructs.DataSource[]" + }, + "t_struct(DataSource)3814_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_struct(PriceFeed)2275_storage": { + "label": "struct PythStructs.PriceFeed", + "members": [ + { + "label": "id", + "type": "t_bytes32" + }, + { + "label": "productId", + "type": "t_bytes32" + }, + { + "label": "price", + "type": "t_int64" + }, + { + "label": "conf", + "type": "t_uint64" + }, + { + "label": "expo", + "type": "t_int32" + }, + { + "label": "status", + "type": "t_enum(PriceStatus)2280" + }, + { + "label": "maxNumPublishers", + "type": "t_uint32" + }, + { + "label": "numPublishers", + "type": "t_uint32" + }, + { + "label": "emaPrice", + "type": "t_int64" + }, + { + "label": "emaConf", + "type": "t_uint64" + }, + { + "label": "publishTime", + "type": "t_uint64" + }, + { + "label": "prevPrice", + "type": "t_int64" + }, + { + "label": "prevConf", + "type": "t_uint64" + }, + { + "label": "prevPublishTime", + "type": "t_uint64" + } + ] + }, + "t_int64": { + "label": "int64" + }, + "t_uint64": { + "label": "uint64" + }, + "t_int32": { + "label": "int32" + }, + "t_enum(PriceStatus)2280": { + "label": "enum PythStructs.PriceStatus", + "members": [ + "UNKNOWN", + "TRADING", + "HALTED", + "AUCTION" + ] + }, + "t_uint32": { + "label": "uint32" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + } + } + } } } } diff --git a/ethereum/.openzeppelin/unknown-1313161555.json b/ethereum/.openzeppelin/unknown-1313161555.json index ec7de60c..7fd36fb7 100644 --- a/ethereum/.openzeppelin/unknown-1313161555.json +++ b/ethereum/.openzeppelin/unknown-1313161555.json @@ -216,6 +216,243 @@ } } } + }, + "3c985b75452a5df848682f7c4086f55b3bc5ca6309b336e21c37a1fb62ac5c8d": { + "address": "0xE0d0e68297772Dd5a1f1D99897c581E2082dbA5B", + "txHash": "0xddcd81c3937367050473639ea5daec50d0c958dbfa3c0e23065a5b4cdd546e45", + "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)3914_storage", + "src": "../project:/contracts/pyth/PythState.sol:30" + } + ], + "types": { + "t_struct(State)3914_storage": { + "label": "struct PythStorage.State", + "members": [ + { + "label": "wormhole", + "type": "t_address" + }, + { + "label": "_deprecatedPyth2WormholeChainId", + "type": "t_uint16" + }, + { + "label": "_deprecatedPyth2WormholeEmitter", + "type": "t_bytes32" + }, + { + "label": "latestPriceInfo", + "type": "t_mapping(t_bytes32,t_struct(PriceInfo)3809_storage)" + }, + { + "label": "validDataSources", + "type": "t_array(t_struct(DataSource)3814_storage)dyn_storage" + }, + { + "label": "isValidDataSource", + "type": "t_mapping(t_bytes32,t_bool)" + }, + { + "label": "singleUpdateFeeInWei", + "type": "t_uint256" + } + ] + }, + "t_address": { + "label": "address" + }, + "t_uint16": { + "label": "uint16" + }, + "t_bytes32": { + "label": "bytes32" + }, + "t_mapping(t_bytes32,t_struct(PriceInfo)3809_storage)": { + "label": "mapping(bytes32 => struct PythInternalStructs.PriceInfo)" + }, + "t_struct(PriceInfo)3809_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)2275_storage" + } + ] + }, + "t_array(t_struct(DataSource)3814_storage)dyn_storage": { + "label": "struct PythInternalStructs.DataSource[]" + }, + "t_struct(DataSource)3814_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_struct(PriceFeed)2275_storage": { + "label": "struct PythStructs.PriceFeed", + "members": [ + { + "label": "id", + "type": "t_bytes32" + }, + { + "label": "productId", + "type": "t_bytes32" + }, + { + "label": "price", + "type": "t_int64" + }, + { + "label": "conf", + "type": "t_uint64" + }, + { + "label": "expo", + "type": "t_int32" + }, + { + "label": "status", + "type": "t_enum(PriceStatus)2280" + }, + { + "label": "maxNumPublishers", + "type": "t_uint32" + }, + { + "label": "numPublishers", + "type": "t_uint32" + }, + { + "label": "emaPrice", + "type": "t_int64" + }, + { + "label": "emaConf", + "type": "t_uint64" + }, + { + "label": "publishTime", + "type": "t_uint64" + }, + { + "label": "prevPrice", + "type": "t_int64" + }, + { + "label": "prevConf", + "type": "t_uint64" + }, + { + "label": "prevPublishTime", + "type": "t_uint64" + } + ] + }, + "t_int64": { + "label": "int64" + }, + "t_uint64": { + "label": "uint64" + }, + "t_int32": { + "label": "int32" + }, + "t_enum(PriceStatus)2280": { + "label": "enum PythStructs.PriceStatus", + "members": [ + "UNKNOWN", + "TRADING", + "HALTED", + "AUCTION" + ] + }, + "t_uint32": { + "label": "uint32" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + } + } + } } } } diff --git a/ethereum/.openzeppelin/unknown-4002.json b/ethereum/.openzeppelin/unknown-4002.json index 4c5469fc..bcbe91e8 100644 --- a/ethereum/.openzeppelin/unknown-4002.json +++ b/ethereum/.openzeppelin/unknown-4002.json @@ -216,6 +216,243 @@ } } } + }, + "3c985b75452a5df848682f7c4086f55b3bc5ca6309b336e21c37a1fb62ac5c8d": { + "address": "0xE5483Bf7fc740675B44dCd4b0f90983F8689D804", + "txHash": "0xe6dc6ac42bda62a999ab8cadecc3e675306fc92ba81ab5cb72adc56ff9ad30c5", + "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)3914_storage", + "src": "../project:/contracts/pyth/PythState.sol:30" + } + ], + "types": { + "t_struct(State)3914_storage": { + "label": "struct PythStorage.State", + "members": [ + { + "label": "wormhole", + "type": "t_address" + }, + { + "label": "_deprecatedPyth2WormholeChainId", + "type": "t_uint16" + }, + { + "label": "_deprecatedPyth2WormholeEmitter", + "type": "t_bytes32" + }, + { + "label": "latestPriceInfo", + "type": "t_mapping(t_bytes32,t_struct(PriceInfo)3809_storage)" + }, + { + "label": "validDataSources", + "type": "t_array(t_struct(DataSource)3814_storage)dyn_storage" + }, + { + "label": "isValidDataSource", + "type": "t_mapping(t_bytes32,t_bool)" + }, + { + "label": "singleUpdateFeeInWei", + "type": "t_uint256" + } + ] + }, + "t_address": { + "label": "address" + }, + "t_uint16": { + "label": "uint16" + }, + "t_bytes32": { + "label": "bytes32" + }, + "t_mapping(t_bytes32,t_struct(PriceInfo)3809_storage)": { + "label": "mapping(bytes32 => struct PythInternalStructs.PriceInfo)" + }, + "t_struct(PriceInfo)3809_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)2275_storage" + } + ] + }, + "t_array(t_struct(DataSource)3814_storage)dyn_storage": { + "label": "struct PythInternalStructs.DataSource[]" + }, + "t_struct(DataSource)3814_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_struct(PriceFeed)2275_storage": { + "label": "struct PythStructs.PriceFeed", + "members": [ + { + "label": "id", + "type": "t_bytes32" + }, + { + "label": "productId", + "type": "t_bytes32" + }, + { + "label": "price", + "type": "t_int64" + }, + { + "label": "conf", + "type": "t_uint64" + }, + { + "label": "expo", + "type": "t_int32" + }, + { + "label": "status", + "type": "t_enum(PriceStatus)2280" + }, + { + "label": "maxNumPublishers", + "type": "t_uint32" + }, + { + "label": "numPublishers", + "type": "t_uint32" + }, + { + "label": "emaPrice", + "type": "t_int64" + }, + { + "label": "emaConf", + "type": "t_uint64" + }, + { + "label": "publishTime", + "type": "t_uint64" + }, + { + "label": "prevPrice", + "type": "t_int64" + }, + { + "label": "prevConf", + "type": "t_uint64" + }, + { + "label": "prevPublishTime", + "type": "t_uint64" + } + ] + }, + "t_int64": { + "label": "int64" + }, + "t_uint64": { + "label": "uint64" + }, + "t_int32": { + "label": "int32" + }, + "t_enum(PriceStatus)2280": { + "label": "enum PythStructs.PriceStatus", + "members": [ + "UNKNOWN", + "TRADING", + "HALTED", + "AUCTION" + ] + }, + "t_uint32": { + "label": "uint32" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + } + } + } } } } diff --git a/ethereum/.openzeppelin/unknown-43113.json b/ethereum/.openzeppelin/unknown-43113.json index 68cc973b..bcbcf84d 100644 --- a/ethereum/.openzeppelin/unknown-43113.json +++ b/ethereum/.openzeppelin/unknown-43113.json @@ -216,6 +216,243 @@ } } } + }, + "3c985b75452a5df848682f7c4086f55b3bc5ca6309b336e21c37a1fb62ac5c8d": { + "address": "0xE5483Bf7fc740675B44dCd4b0f90983F8689D804", + "txHash": "0x5e03897e9d718be35421b0121c142b30414d6c2e7cc442330d8539ae234dc4fe", + "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)3914_storage", + "src": "../project:/contracts/pyth/PythState.sol:30" + } + ], + "types": { + "t_struct(State)3914_storage": { + "label": "struct PythStorage.State", + "members": [ + { + "label": "wormhole", + "type": "t_address" + }, + { + "label": "_deprecatedPyth2WormholeChainId", + "type": "t_uint16" + }, + { + "label": "_deprecatedPyth2WormholeEmitter", + "type": "t_bytes32" + }, + { + "label": "latestPriceInfo", + "type": "t_mapping(t_bytes32,t_struct(PriceInfo)3809_storage)" + }, + { + "label": "validDataSources", + "type": "t_array(t_struct(DataSource)3814_storage)dyn_storage" + }, + { + "label": "isValidDataSource", + "type": "t_mapping(t_bytes32,t_bool)" + }, + { + "label": "singleUpdateFeeInWei", + "type": "t_uint256" + } + ] + }, + "t_address": { + "label": "address" + }, + "t_uint16": { + "label": "uint16" + }, + "t_bytes32": { + "label": "bytes32" + }, + "t_mapping(t_bytes32,t_struct(PriceInfo)3809_storage)": { + "label": "mapping(bytes32 => struct PythInternalStructs.PriceInfo)" + }, + "t_struct(PriceInfo)3809_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)2275_storage" + } + ] + }, + "t_array(t_struct(DataSource)3814_storage)dyn_storage": { + "label": "struct PythInternalStructs.DataSource[]" + }, + "t_struct(DataSource)3814_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_struct(PriceFeed)2275_storage": { + "label": "struct PythStructs.PriceFeed", + "members": [ + { + "label": "id", + "type": "t_bytes32" + }, + { + "label": "productId", + "type": "t_bytes32" + }, + { + "label": "price", + "type": "t_int64" + }, + { + "label": "conf", + "type": "t_uint64" + }, + { + "label": "expo", + "type": "t_int32" + }, + { + "label": "status", + "type": "t_enum(PriceStatus)2280" + }, + { + "label": "maxNumPublishers", + "type": "t_uint32" + }, + { + "label": "numPublishers", + "type": "t_uint32" + }, + { + "label": "emaPrice", + "type": "t_int64" + }, + { + "label": "emaConf", + "type": "t_uint64" + }, + { + "label": "publishTime", + "type": "t_uint64" + }, + { + "label": "prevPrice", + "type": "t_int64" + }, + { + "label": "prevConf", + "type": "t_uint64" + }, + { + "label": "prevPublishTime", + "type": "t_uint64" + } + ] + }, + "t_int64": { + "label": "int64" + }, + "t_uint64": { + "label": "uint64" + }, + "t_int32": { + "label": "int32" + }, + "t_enum(PriceStatus)2280": { + "label": "enum PythStructs.PriceStatus", + "members": [ + "UNKNOWN", + "TRADING", + "HALTED", + "AUCTION" + ] + }, + "t_uint32": { + "label": "uint32" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + } + } + } } } } diff --git a/ethereum/.openzeppelin/unknown-80001.json b/ethereum/.openzeppelin/unknown-80001.json index b6068bc2..be69596e 100644 --- a/ethereum/.openzeppelin/unknown-80001.json +++ b/ethereum/.openzeppelin/unknown-80001.json @@ -216,6 +216,243 @@ } } } + }, + "3c985b75452a5df848682f7c4086f55b3bc5ca6309b336e21c37a1fb62ac5c8d": { + "address": "0xE5483Bf7fc740675B44dCd4b0f90983F8689D804", + "txHash": "0x149f439c31d6c66d4bfdba2be0b91be5fb7ff4821688bc6f45b5b702cf5aa97c", + "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)3914_storage", + "src": "../project:/contracts/pyth/PythState.sol:30" + } + ], + "types": { + "t_struct(State)3914_storage": { + "label": "struct PythStorage.State", + "members": [ + { + "label": "wormhole", + "type": "t_address" + }, + { + "label": "_deprecatedPyth2WormholeChainId", + "type": "t_uint16" + }, + { + "label": "_deprecatedPyth2WormholeEmitter", + "type": "t_bytes32" + }, + { + "label": "latestPriceInfo", + "type": "t_mapping(t_bytes32,t_struct(PriceInfo)3809_storage)" + }, + { + "label": "validDataSources", + "type": "t_array(t_struct(DataSource)3814_storage)dyn_storage" + }, + { + "label": "isValidDataSource", + "type": "t_mapping(t_bytes32,t_bool)" + }, + { + "label": "singleUpdateFeeInWei", + "type": "t_uint256" + } + ] + }, + "t_address": { + "label": "address" + }, + "t_uint16": { + "label": "uint16" + }, + "t_bytes32": { + "label": "bytes32" + }, + "t_mapping(t_bytes32,t_struct(PriceInfo)3809_storage)": { + "label": "mapping(bytes32 => struct PythInternalStructs.PriceInfo)" + }, + "t_struct(PriceInfo)3809_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)2275_storage" + } + ] + }, + "t_array(t_struct(DataSource)3814_storage)dyn_storage": { + "label": "struct PythInternalStructs.DataSource[]" + }, + "t_struct(DataSource)3814_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_struct(PriceFeed)2275_storage": { + "label": "struct PythStructs.PriceFeed", + "members": [ + { + "label": "id", + "type": "t_bytes32" + }, + { + "label": "productId", + "type": "t_bytes32" + }, + { + "label": "price", + "type": "t_int64" + }, + { + "label": "conf", + "type": "t_uint64" + }, + { + "label": "expo", + "type": "t_int32" + }, + { + "label": "status", + "type": "t_enum(PriceStatus)2280" + }, + { + "label": "maxNumPublishers", + "type": "t_uint32" + }, + { + "label": "numPublishers", + "type": "t_uint32" + }, + { + "label": "emaPrice", + "type": "t_int64" + }, + { + "label": "emaConf", + "type": "t_uint64" + }, + { + "label": "publishTime", + "type": "t_uint64" + }, + { + "label": "prevPrice", + "type": "t_int64" + }, + { + "label": "prevConf", + "type": "t_uint64" + }, + { + "label": "prevPublishTime", + "type": "t_uint64" + } + ] + }, + "t_int64": { + "label": "int64" + }, + "t_uint64": { + "label": "uint64" + }, + "t_int32": { + "label": "int32" + }, + "t_enum(PriceStatus)2280": { + "label": "enum PythStructs.PriceStatus", + "members": [ + "UNKNOWN", + "TRADING", + "HALTED", + "AUCTION" + ] + }, + "t_uint32": { + "label": "uint32" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + } + } + } } } } diff --git a/ethereum/.openzeppelin/unknown-97.json b/ethereum/.openzeppelin/unknown-97.json index 7b2ebbc2..1aca2863 100644 --- a/ethereum/.openzeppelin/unknown-97.json +++ b/ethereum/.openzeppelin/unknown-97.json @@ -216,6 +216,243 @@ } } } + }, + "3c985b75452a5df848682f7c4086f55b3bc5ca6309b336e21c37a1fb62ac5c8d": { + "address": "0xEBAc5275A0EED4148049d632705089733D5e767d", + "txHash": "0xe49369e4ace4e8353b1afe4c62a3d3f79e1f4a247d890e518d7e24ee057a9a90", + "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)3914_storage", + "src": "../project:/contracts/pyth/PythState.sol:30" + } + ], + "types": { + "t_struct(State)3914_storage": { + "label": "struct PythStorage.State", + "members": [ + { + "label": "wormhole", + "type": "t_address" + }, + { + "label": "_deprecatedPyth2WormholeChainId", + "type": "t_uint16" + }, + { + "label": "_deprecatedPyth2WormholeEmitter", + "type": "t_bytes32" + }, + { + "label": "latestPriceInfo", + "type": "t_mapping(t_bytes32,t_struct(PriceInfo)3809_storage)" + }, + { + "label": "validDataSources", + "type": "t_array(t_struct(DataSource)3814_storage)dyn_storage" + }, + { + "label": "isValidDataSource", + "type": "t_mapping(t_bytes32,t_bool)" + }, + { + "label": "singleUpdateFeeInWei", + "type": "t_uint256" + } + ] + }, + "t_address": { + "label": "address" + }, + "t_uint16": { + "label": "uint16" + }, + "t_bytes32": { + "label": "bytes32" + }, + "t_mapping(t_bytes32,t_struct(PriceInfo)3809_storage)": { + "label": "mapping(bytes32 => struct PythInternalStructs.PriceInfo)" + }, + "t_struct(PriceInfo)3809_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)2275_storage" + } + ] + }, + "t_array(t_struct(DataSource)3814_storage)dyn_storage": { + "label": "struct PythInternalStructs.DataSource[]" + }, + "t_struct(DataSource)3814_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_struct(PriceFeed)2275_storage": { + "label": "struct PythStructs.PriceFeed", + "members": [ + { + "label": "id", + "type": "t_bytes32" + }, + { + "label": "productId", + "type": "t_bytes32" + }, + { + "label": "price", + "type": "t_int64" + }, + { + "label": "conf", + "type": "t_uint64" + }, + { + "label": "expo", + "type": "t_int32" + }, + { + "label": "status", + "type": "t_enum(PriceStatus)2280" + }, + { + "label": "maxNumPublishers", + "type": "t_uint32" + }, + { + "label": "numPublishers", + "type": "t_uint32" + }, + { + "label": "emaPrice", + "type": "t_int64" + }, + { + "label": "emaConf", + "type": "t_uint64" + }, + { + "label": "publishTime", + "type": "t_uint64" + }, + { + "label": "prevPrice", + "type": "t_int64" + }, + { + "label": "prevConf", + "type": "t_uint64" + }, + { + "label": "prevPublishTime", + "type": "t_uint64" + } + ] + }, + "t_int64": { + "label": "int64" + }, + "t_uint64": { + "label": "uint64" + }, + "t_int32": { + "label": "int32" + }, + "t_enum(PriceStatus)2280": { + "label": "enum PythStructs.PriceStatus", + "members": [ + "UNKNOWN", + "TRADING", + "HALTED", + "AUCTION" + ] + }, + "t_uint32": { + "label": "uint32" + }, + "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 aaff933a..ceceb83d 100644 --- a/ethereum/Deploying.md +++ b/ethereum/Deploying.md @@ -68,6 +68,24 @@ module.exports = async function (deployer) { } ``` +**When changing the storage, you might need to disable the storage checks because Open Zeppelin is very conservative, +and appending to the Pyth State struct is considered illegal.** Pyth `_state` variable is a Pyth State +struct that contains all Pyth variables inside it. It is the last variable in the contract +and is safe to append fields inside it. However, Open Zeppelin only allows appending variables +in the contract surface and does not allow appending in the nested structs. + +To disable security checks, you can add +`unsafeSkipStorageCheck: true` option in `upgradeProxy` call. **If you do such a thing, +make sure that your change to the contract won't cause any collision**. For example: +- Renaming a variable is fine. +- Changing a variable type to another type with the same size is ok. +- Appending to the contract variables is ok. If the last variable is a struct, it is also fine + to append to that struct. +- Appending to a mapping value is ok as the contract stores mapping values in a random (hashed) location. + +Anything other than the operations above will probably cause a collision. Please refer to Open Zeppelin Upgradeable +(documentations)[https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable] for more information. + # Testing The [pyth-js][] repository contains an example with documentation and a code sample showing how to relay your own prices to a diff --git a/ethereum/migrations/prod-receiver/4_pyth_multiple_emitters.js b/ethereum/migrations/prod-receiver/4_pyth_multiple_emitters.js index 0eb82249..411789fb 100644 --- a/ethereum/migrations/prod-receiver/4_pyth_multiple_emitters.js +++ b/ethereum/migrations/prod-receiver/4_pyth_multiple_emitters.js @@ -9,9 +9,9 @@ const { upgradeProxy } = require("@openzeppelin/truffle-upgrades"); */ module.exports = async function (deployer) { const proxy = await PythUpgradable.deployed(); - await upgradeProxy(proxy.address, PythUpgradable, { deployer }); + await upgradeProxy(proxy.address, PythUpgradable, { deployer, unsafeSkipStorageCheck: true }); await proxy.addDataSource( - proxy.pyth2WormholeChainId(), - proxy.pyth2WormholeEmitter() + await proxy.pyth2WormholeChainId(), + await proxy.pyth2WormholeEmitter() ); }; diff --git a/ethereum/migrations/prod-receiver/5_pyth_add_events_and_update_fee.js b/ethereum/migrations/prod-receiver/5_pyth_add_events_and_update_fee.js index cc873030..36f317d0 100644 --- a/ethereum/migrations/prod-receiver/5_pyth_add_events_and_update_fee.js +++ b/ethereum/migrations/prod-receiver/5_pyth_add_events_and_update_fee.js @@ -12,5 +12,5 @@ const { upgradeProxy } = require("@openzeppelin/truffle-upgrades"); */ module.exports = async function (deployer) { const proxy = await PythUpgradable.deployed(); - await upgradeProxy(proxy.address, PythUpgradable, { deployer }); + await upgradeProxy(proxy.address, PythUpgradable, { deployer, unsafeSkipStorageCheck: true }); } diff --git a/ethereum/migrations/prod/3_pyth_multiple_emitters.js b/ethereum/migrations/prod/3_pyth_multiple_emitters.js index 0eb82249..411789fb 100644 --- a/ethereum/migrations/prod/3_pyth_multiple_emitters.js +++ b/ethereum/migrations/prod/3_pyth_multiple_emitters.js @@ -9,9 +9,9 @@ const { upgradeProxy } = require("@openzeppelin/truffle-upgrades"); */ module.exports = async function (deployer) { const proxy = await PythUpgradable.deployed(); - await upgradeProxy(proxy.address, PythUpgradable, { deployer }); + await upgradeProxy(proxy.address, PythUpgradable, { deployer, unsafeSkipStorageCheck: true }); await proxy.addDataSource( - proxy.pyth2WormholeChainId(), - proxy.pyth2WormholeEmitter() + await proxy.pyth2WormholeChainId(), + await proxy.pyth2WormholeEmitter() ); }; diff --git a/ethereum/migrations/prod/4_pyth_add_events_and_update_fee.js b/ethereum/migrations/prod/4_pyth_add_events_and_update_fee.js index cc873030..36f317d0 100644 --- a/ethereum/migrations/prod/4_pyth_add_events_and_update_fee.js +++ b/ethereum/migrations/prod/4_pyth_add_events_and_update_fee.js @@ -12,5 +12,5 @@ const { upgradeProxy } = require("@openzeppelin/truffle-upgrades"); */ module.exports = async function (deployer) { const proxy = await PythUpgradable.deployed(); - await upgradeProxy(proxy.address, PythUpgradable, { deployer }); + await upgradeProxy(proxy.address, PythUpgradable, { deployer, unsafeSkipStorageCheck: true }); } diff --git a/ethereum/migrations/test/4_pyth_multiple_emitters.js b/ethereum/migrations/test/4_pyth_multiple_emitters.js index a5fd2791..411789fb 100644 --- a/ethereum/migrations/test/4_pyth_multiple_emitters.js +++ b/ethereum/migrations/test/4_pyth_multiple_emitters.js @@ -9,7 +9,7 @@ const { upgradeProxy } = require("@openzeppelin/truffle-upgrades"); */ module.exports = async function (deployer) { const proxy = await PythUpgradable.deployed(); - await upgradeProxy(proxy.address, PythUpgradable, { deployer }); + await upgradeProxy(proxy.address, PythUpgradable, { deployer, unsafeSkipStorageCheck: true }); await proxy.addDataSource( await proxy.pyth2WormholeChainId(), await proxy.pyth2WormholeEmitter() diff --git a/ethereum/migrations/test/5_pyth_add_events_and_update_fee.js b/ethereum/migrations/test/5_pyth_add_events_and_update_fee.js index cc873030..36f317d0 100644 --- a/ethereum/migrations/test/5_pyth_add_events_and_update_fee.js +++ b/ethereum/migrations/test/5_pyth_add_events_and_update_fee.js @@ -12,5 +12,5 @@ const { upgradeProxy } = require("@openzeppelin/truffle-upgrades"); */ module.exports = async function (deployer) { const proxy = await PythUpgradable.deployed(); - await upgradeProxy(proxy.address, PythUpgradable, { deployer }); + await upgradeProxy(proxy.address, PythUpgradable, { deployer, unsafeSkipStorageCheck: true }); } diff --git a/ethereum/truffle-config.js b/ethereum/truffle-config.js index 240dc3e0..0e38d0ec 100644 --- a/ethereum/truffle-config.js +++ b/ethereum/truffle-config.js @@ -56,6 +56,7 @@ module.exports = { network_id: "5", gas: 4465030, gasPrice: 10000000000, + skipDryRun: true, }, bnb: { provider: () => { @@ -94,7 +95,7 @@ module.exports = { provider: () => { return new HDWalletProvider( process.env.MNEMONIC, - "https://matic-mumbai.chainstacklabs.com") + "https://polygon-testnet-rpc.allthatnode.com:8545") }, network_id: "80001", },