Skip to content

Commit 4cec02d

Browse files
authored
Upgrade bnb testnet and renounce ownership (#303)
1 parent c9b4a34 commit 4cec02d

File tree

5 files changed

+222
-14
lines changed

5 files changed

+222
-14
lines changed

ethereum/.openzeppelin/unknown-97.json

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,224 @@
943943
}
944944
}
945945
}
946+
},
947+
"13bd50448a4ee3eaa17b015190048d9a79da89d68df26e73e9a211fd7baf6e42": {
948+
"address": "0xba2BF83194AfafB42815AA7B1B97BFE8ddaCEfA0",
949+
"txHash": "0xdf1d8be232239ab3e3ffea9f640f2e287dd88fe8c1ecfe89a69bf7eba1ff63c4",
950+
"layout": {
951+
"storage": [
952+
{
953+
"contract": "Initializable",
954+
"label": "_initialized",
955+
"type": "t_bool",
956+
"src": "../@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:39"
957+
},
958+
{
959+
"contract": "Initializable",
960+
"label": "_initializing",
961+
"type": "t_bool",
962+
"src": "../@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:44"
963+
},
964+
{
965+
"contract": "ContextUpgradeable",
966+
"label": "__gap",
967+
"type": "t_array(t_uint256)50_storage",
968+
"src": "../@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36"
969+
},
970+
{
971+
"contract": "OwnableUpgradeable",
972+
"label": "_owner",
973+
"type": "t_address",
974+
"src": "../@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22"
975+
},
976+
{
977+
"contract": "OwnableUpgradeable",
978+
"label": "__gap",
979+
"type": "t_array(t_uint256)49_storage",
980+
"src": "../@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:87"
981+
},
982+
{
983+
"contract": "ERC1967UpgradeUpgradeable",
984+
"label": "__gap",
985+
"type": "t_array(t_uint256)50_storage",
986+
"src": "../@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:211"
987+
},
988+
{
989+
"contract": "UUPSUpgradeable",
990+
"label": "__gap",
991+
"type": "t_array(t_uint256)50_storage",
992+
"src": "../@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol:107"
993+
},
994+
{
995+
"contract": "PythState",
996+
"label": "_state",
997+
"type": "t_struct(State)5138_storage",
998+
"src": "../project:/contracts/pyth/PythState.sol:46"
999+
}
1000+
],
1001+
"types": {
1002+
"t_struct(State)5138_storage": {
1003+
"label": "struct PythStorage.State",
1004+
"members": [
1005+
{
1006+
"label": "wormhole",
1007+
"type": "t_address"
1008+
},
1009+
{
1010+
"label": "_deprecatedPyth2WormholeChainId",
1011+
"type": "t_uint16"
1012+
},
1013+
{
1014+
"label": "_deprecatedPyth2WormholeEmitter",
1015+
"type": "t_bytes32"
1016+
},
1017+
{
1018+
"label": "_deprecatedLatestPriceInfo",
1019+
"type": "t_mapping(t_bytes32,t_struct(PriceInfo)4978_storage)"
1020+
},
1021+
{
1022+
"label": "validDataSources",
1023+
"type": "t_array(t_struct(DataSource)4983_storage)dyn_storage"
1024+
},
1025+
{
1026+
"label": "isValidDataSource",
1027+
"type": "t_mapping(t_bytes32,t_bool)"
1028+
},
1029+
{
1030+
"label": "singleUpdateFeeInWei",
1031+
"type": "t_uint256"
1032+
},
1033+
{
1034+
"label": "validTimePeriodSeconds",
1035+
"type": "t_uint256"
1036+
},
1037+
{
1038+
"label": "governanceDataSource",
1039+
"type": "t_struct(DataSource)4983_storage"
1040+
},
1041+
{
1042+
"label": "lastExecutedGovernanceSequence",
1043+
"type": "t_uint64"
1044+
},
1045+
{
1046+
"label": "latestPriceInfo",
1047+
"type": "t_mapping(t_bytes32,t_struct(PriceInfo)4978_storage)"
1048+
}
1049+
]
1050+
},
1051+
"t_address": {
1052+
"label": "address"
1053+
},
1054+
"t_uint16": {
1055+
"label": "uint16"
1056+
},
1057+
"t_bytes32": {
1058+
"label": "bytes32"
1059+
},
1060+
"t_mapping(t_bytes32,t_struct(PriceInfo)4978_storage)": {
1061+
"label": "mapping(bytes32 => struct PythInternalStructs.PriceInfo)"
1062+
},
1063+
"t_struct(PriceInfo)4978_storage": {
1064+
"label": "struct PythInternalStructs.PriceInfo",
1065+
"members": [
1066+
{
1067+
"label": "attestationTime",
1068+
"type": "t_uint256"
1069+
},
1070+
{
1071+
"label": "arrivalTime",
1072+
"type": "t_uint256"
1073+
},
1074+
{
1075+
"label": "arrivalBlock",
1076+
"type": "t_uint256"
1077+
},
1078+
{
1079+
"label": "priceFeed",
1080+
"type": "t_struct(PriceFeed)2423_storage"
1081+
}
1082+
]
1083+
},
1084+
"t_array(t_struct(DataSource)4983_storage)dyn_storage": {
1085+
"label": "struct PythInternalStructs.DataSource[]"
1086+
},
1087+
"t_struct(DataSource)4983_storage": {
1088+
"label": "struct PythInternalStructs.DataSource",
1089+
"members": [
1090+
{
1091+
"label": "chainId",
1092+
"type": "t_uint16"
1093+
},
1094+
{
1095+
"label": "emitterAddress",
1096+
"type": "t_bytes32"
1097+
}
1098+
]
1099+
},
1100+
"t_mapping(t_bytes32,t_bool)": {
1101+
"label": "mapping(bytes32 => bool)"
1102+
},
1103+
"t_bool": {
1104+
"label": "bool"
1105+
},
1106+
"t_uint256": {
1107+
"label": "uint256"
1108+
},
1109+
"t_uint64": {
1110+
"label": "uint64"
1111+
},
1112+
"t_struct(PriceFeed)2423_storage": {
1113+
"label": "struct PythStructs.PriceFeed",
1114+
"members": [
1115+
{
1116+
"label": "id",
1117+
"type": "t_bytes32"
1118+
},
1119+
{
1120+
"label": "price",
1121+
"type": "t_struct(Price)2414_storage"
1122+
},
1123+
{
1124+
"label": "emaPrice",
1125+
"type": "t_struct(Price)2414_storage"
1126+
}
1127+
]
1128+
},
1129+
"t_struct(Price)2414_storage": {
1130+
"label": "struct PythStructs.Price",
1131+
"members": [
1132+
{
1133+
"label": "price",
1134+
"type": "t_int64"
1135+
},
1136+
{
1137+
"label": "conf",
1138+
"type": "t_uint64"
1139+
},
1140+
{
1141+
"label": "expo",
1142+
"type": "t_int32"
1143+
},
1144+
{
1145+
"label": "publishTime",
1146+
"type": "t_uint256"
1147+
}
1148+
]
1149+
},
1150+
"t_int64": {
1151+
"label": "int64"
1152+
},
1153+
"t_int32": {
1154+
"label": "int32"
1155+
},
1156+
"t_array(t_uint256)50_storage": {
1157+
"label": "uint256[50]"
1158+
},
1159+
"t_array(t_uint256)49_storage": {
1160+
"label": "uint256[49]"
1161+
}
1162+
}
1163+
}
9461164
}
9471165
}
9481166
}

ethereum/Deploying.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ npx truffle migrate --network $MIGRATIONS_NETWORK --to <step>
3232
# Some steps require executing a governance instruction to be successful, you can use the multisig message builder tool in
3333
# `third_party/pyth` of this repo root to create multisig transaction and execute it to create the VAA.
3434
# Then you can use the VAA (in hex) to execute the governance instruction. To do so, run:
35+
$ npx apply-registry # apparently a deployProxyImpl messes up with correct address of proxy
3536
$ npx truffle console --network $MIGRATIONS_NETWORK
3637
> let p = await PythUpgradable.deployed()
3738
> await p.executeGovernanceInstruction("<VAA in hex like: 0x123002342352>");

ethereum/contracts/pyth/Pyth.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,6 @@ abstract contract Pyth is PythGetters, PythSetters, AbstractPyth {
247247
function deployCommitHash() public pure returns (string memory) {
248248
// This is a place holder for the commit hash and will be replaced
249249
// with the commit hash upon deployment.
250-
return "__DEPLOY_COMMIT_HASH_PLACEHOLER__";
250+
return "9a285cf799ea09eac71704afafc382fc889b0849";
251251
}
252252
}

ethereum/migrations/prod/10_pyth_make_interface_simpler.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@ require('dotenv').config({ path: "../.env" });
33
const governance = require("@pythnetwork/xc-governance-sdk");
44

55
const PythUpgradable = artifacts.require("PythUpgradable");
6-
const governanceChainId = process.env.GOVERNANCE_CHAIN_ID;
7-
const governanceEmitter = process.env.GOVERNANCE_EMITTER;
86
const wormholeChainName = process.env.WORMHOLE_CHAIN_NAME;
9-
assert(governance.CHAINS[wormholeChainName] !== undefined);
10-
11-
console.log("governanceEmitter: " + governanceEmitter);
12-
console.log("governanceChainId: " + governanceChainId);
137

148
const { deployProxyImpl } = require('@openzeppelin/truffle-upgrades/dist/utils');
159
const { assert } = require('chai');
@@ -21,6 +15,8 @@ const { assert } = require('chai');
2115
* - Use pyth-sdk-solidity 1.0.0 which simplifies the PriceFeed interface
2216
*/
2317
module.exports = async function (deployer) {
18+
assert(governance.CHAINS[wormholeChainName] !== undefined);
19+
2420
const proxy = await PythUpgradable.deployed();
2521
const newImpl = (await deployProxyImpl(PythUpgradable, { deployer, unsafeSkipStorageCheck: true }, proxy.address)).impl;
2622
console.log(`New implementation address is: ${newImpl}. Please sign and execute the following encoded ` +

ethereum/migrations/prod/11_pyth_renounce_ownership.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
require('dotenv').config({ path: "../.env" });
22

33
const PythUpgradable = artifacts.require("PythUpgradable");
4-
const governanceChainId = process.env.GOVERNANCE_CHAIN_ID;
5-
const governanceEmitter = process.env.GOVERNANCE_EMITTER;
6-
7-
console.log("governanceEmitter: " + governanceEmitter);
8-
console.log("governanceChainId: " + governanceChainId);
9-
10-
const { upgradeProxy } = require("@openzeppelin/truffle-upgrades");
114

125
/**
136
* Version 1.0.0 - 2nd step

0 commit comments

Comments
 (0)