diff --git a/golang/cosmos/app/upgrade.go b/golang/cosmos/app/upgrade.go index 89857e26166..38a8adbaf6f 100644 --- a/golang/cosmos/app/upgrade.go +++ b/golang/cosmos/app/upgrade.go @@ -262,6 +262,9 @@ func unreleasedUpgradeHandler(app *GaiaApp, targetUpgrade string) func(sdk.Conte // vm.CoreProposalStepForModules( // "@agoric/builders/scripts/vats/upgrade-asset-reserve.js", // ), + // vm.CoreProposalStepForModules( + // "@agoric/builders/scripts/vats/terminate-original-stkATOM-USD-price-feed-governor.js", + // ), // ) } diff --git a/packages/builders/scripts/vats/terminate-original-stkATOM-USD-price-feed-governor.js b/packages/builders/scripts/vats/terminate-original-stkATOM-USD-price-feed-governor.js new file mode 100644 index 00000000000..ede4bcaefb7 --- /dev/null +++ b/packages/builders/scripts/vats/terminate-original-stkATOM-USD-price-feed-governor.js @@ -0,0 +1,62 @@ +/** + * @file Terminate v110 zcf-b1-9f877-stkATOM-USD_price_feed-governor. + */ + +import { E } from '@endo/far'; + +/// + +/** + * @param {BootstrapPowers} powers + */ +export const terminateOriginalStkATOMPriceFeedGovernor = async ({ + consume: { board, governedContractKits }, +}) => { + const { Fail, quote: q } = assert; + const expectedLabel = 'stkATOM-USD_price_feed'; + const contractInstanceHandle = await E(board).getValue('board052184'); + // @ts-expect-error Property '[tag]' is missing + const instanceKit = await E(governedContractKits).get(contractInstanceHandle); + console.log( + `alleged ${q(expectedLabel)} governor contract instance kit`, + instanceKit, + ); + const { label, governorAdminFacet, adminFacet } = instanceKit; + label === expectedLabel || + Fail`unexpected instanceKit label, got ${label} but wanted ${q(expectedLabel)}`; + (adminFacet && adminFacet !== governorAdminFacet) || + Fail`instanceKit adminFacet should have been present and different from governorAdminFacet but was ${adminFacet}`; + const reason = harden(Error(`core-eval terminating ${label} governor`)); + await E(governorAdminFacet).terminateContract(reason); + console.log(`terminated ${label} governor`); +}; +harden(terminateOriginalStkATOMPriceFeedGovernor); + +export const getManifest = () => { + return { + manifest: { + [terminateOriginalStkATOMPriceFeedGovernor.name]: { + consume: { board: true, governedContractKits: true }, + }, + }, + }; +}; + +/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */ +export const defaultProposalBuilder = async () => + harden({ + sourceSpec: + '@agoric/builders/scripts/vats/terminate-original-stkATOM-USD-price-feed-governor.js', + getManifestCall: ['getManifest'], + }); + +/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */ +export default async (homeP, endowments) => { + const dspModule = await import('@agoric/deploy-script-support'); + const { makeHelpers } = dspModule; + const { writeCoreEval } = await makeHelpers(homeP, endowments); + await writeCoreEval( + terminateOriginalStkATOMPriceFeedGovernor.name, + defaultProposalBuilder, + ); +};