pyth-crosschain/ethereum/migrations/prod-receiver/10_pyth_enable_governance.js

23 lines
804 B
JavaScript

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
*
* This change:
* - Add Governance coming from the Wormhole to manage the contract.
*/
module.exports = async function (deployer) {
const proxy = await PythUpgradable.deployed();
await upgradeProxy(proxy.address, PythUpgradable, { deployer, unsafeSkipStorageCheck: true });
await proxy.updateGovernanceDataSource(governanceChainId, governanceEmitter, 0);
}