Skip to content

Commit dd3f5a5

Browse files
authored
Abehjati/fix-deployment-bugs (#272)
* Fix migration files * Use another rpc endpoint for bnb * Fix the bogus commit hash replacement instruction * Use a more clear placeholder
1 parent 15f3175 commit dd3f5a5

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

ethereum/Deploying.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ rm -f .env; ln -s .env.prod.xyz .env && set -o allexport && source .env set && s
1212
# The Secret Recovery Phrase for the wallet the contract will be deployed from.
1313
export MNEMONIC=...
1414

15+
# Set the deploy commit hash in the contract (used for debugging purposes)
16+
sed -i "s/__DEPLOY_COMMIT_HASH_PLACEHOLER__/$(git rev-parse HEAD)/g" ./contracts/pyth/Pyth.sol
17+
1518
# Ensure that we deploy a fresh build with up-to-date dependencies.
1619
rm -rf build && npx truffle compile --all
1720

1821
# Merge the network addresses into the artifacts, if some contracts are already deployed.
1922
npx apply-registry
2023

21-
# Set the deploy commit hash in the contract binary (used for debugging purposes)
22-
sed -i "s/dead0beaf0deb10700c0331700da5d00deadbead/$(git rev-parse HEAD)/g" build/contracts/*
23-
2424
# Perform the migration
2525
npx truffle migrate --network $MIGRATIONS_NETWORK
2626

ethereum/contracts/pyth/Pyth.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ abstract contract Pyth is PythGetters, PythSetters, AbstractPyth {
231231
return "0.1.0";
232232
}
233233

234-
function deployCommitHash() public pure returns (bytes20) {
234+
function deployCommitHash() public pure returns (string memory) {
235235
// This is a place holder for the commit hash and will be replaced
236236
// with the commit hash upon deployment.
237-
return hex"dead0beaf0deb10700c0331700da5d00deadbead";
237+
return "__DEPLOY_COMMIT_HASH_PLACEHOLER__";
238238
}
239239
}

ethereum/migrations/prod-receiver/9_pyth_add_pythnet_datasource.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ console.log("pythnetChainId: " + pythnetChainId);
1212
* This change:
1313
* - Adds PythNet data source.
1414
*/
15-
module.exports = async function () {
15+
module.exports = async function (_deployer) {
1616
const proxy = await PythUpgradable.deployed();
1717
await proxy.addDataSource(
1818
pythnetChainId,

ethereum/migrations/prod/8_pyth_add_pythnet_datasource.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ console.log("pythnetChainId: " + pythnetChainId);
1212
* This change:
1313
* - Adds PythNet data source.
1414
*/
15-
module.exports = async function () {
15+
module.exports = async function (_deployer) {
1616
const proxy = await PythUpgradable.deployed();
1717
await proxy.addDataSource(
1818
pythnetChainId,

ethereum/truffle-config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module.exports = {
6262
provider: () => {
6363
return new HDWalletProvider(
6464
process.env.MNEMONIC,
65-
"https://bsc-dataseed.binance.org/"
65+
"https://bsc-dataseed2.binance.org"
6666
);
6767
},
6868
network_id: "56",
@@ -207,5 +207,6 @@ module.exports = {
207207

208208
api_keys: {
209209
etherscan: process.env.ETHERSCAN_KEY,
210+
bscscan: process.env.BSCSCAN_KEY,
210211
},
211212
};

0 commit comments

Comments
 (0)