@agoric/builders 0.1.1-upgrade-18-dev-6ddbef0.0 → 0.1.1-upgrade-19-dev-2a71f04.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +31 -29
- package/scripts/fast-usdc/add-operators.build.js +83 -0
- package/scripts/fast-usdc/fast-usdc-fees.build.js +75 -0
- package/scripts/fast-usdc/fast-usdc-update.build.js +65 -0
- package/scripts/fast-usdc/start-fast-usdc.build.js +207 -0
- package/scripts/inter-protocol/replace-feeDistributor-combo.js +82 -0
- package/scripts/inter-protocol/replace-feeDistributor.js +36 -0
- package/scripts/inter-protocol/updatePriceFeeds.js +11 -1
- package/scripts/orchestration/init-basic-flows.js +42 -2
- package/scripts/testing/add-USD-LEMONS.js +19 -0
- package/scripts/testing/add-USD-OLIVES.js +19 -0
- package/scripts/testing/init-auto-stake-it.js +73 -0
- package/scripts/testing/init-send-anywhere.js +67 -0
- package/scripts/testing/provokeBOYD.js +54 -0
- package/scripts/testing/publish-test-info.js +79 -0
- package/scripts/testing/recorded-retired-instances.js +81 -0
- package/scripts/testing/register-interchain-bank-assets.js +199 -0
- package/scripts/testing/replace-feeDistributor-short.js +33 -0
- package/scripts/testing/test-upgraded-board.js +15 -0
- package/scripts/testing/{fix-buggy-sendAnywhere.js → upgrade-send-anywhere.js} +14 -18
- package/scripts/testing/upgrade-vaultFactory.js +21 -0
- package/scripts/vats/terminate-governor-instance.js +134 -0
- package/scripts/vats/upgrade-agoricNames.js +21 -0
- package/scripts/vats/upgrade-asset-reserve.js +21 -0
- package/scripts/vats/upgrade-bank.js +2 -2
- package/scripts/vats/upgrade-board.js +20 -0
- package/scripts/vats/upgrade-mintHolder.js +105 -0
- package/scripts/vats/{upgrade-orch-core.js → upgrade-orchestration.js} +5 -2
- package/scripts/vats/upgrade-paRegistry.js +21 -0
- package/scripts/vats/upgrade-psm.js +19 -0
- package/scripts/testing/start-auto-stake-it.js +0 -128
- package/scripts/testing/start-buggy-sendAnywhere.js +0 -143
- package/scripts/testing/start-send-anywhere.js +0 -136
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
import { getManifestForTestUpgradedBoard } from '@agoric/vats/src/proposals/testUpgradedBoard.js';
|
|
3
|
+
|
|
4
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
5
|
+
export const defaultProposalBuilder = async () =>
|
|
6
|
+
harden({
|
|
7
|
+
sourceSpec: '@agoric/vats/src/proposals/testUpgradedBoard.js',
|
|
8
|
+
getManifestCall: [getManifestForTestUpgradedBoard.name],
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
12
|
+
export default async (homeP, endowments) => {
|
|
13
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
14
|
+
await writeCoreEval('testUpgradedBoard', defaultProposalBuilder);
|
|
15
|
+
};
|
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
makeTracer,
|
|
8
8
|
NonNullish,
|
|
9
9
|
} from '@agoric/internal';
|
|
10
|
-
import { E
|
|
10
|
+
import { E } from '@endo/far';
|
|
11
11
|
|
|
12
12
|
/// <reference types="@agoric/vats/src/core/types-ambient"/>
|
|
13
13
|
/**
|
|
14
14
|
* @import {Installation, Instance} from '@agoric/zoe/src/zoeService/utils.js';
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
const trace = makeTracer('
|
|
17
|
+
const trace = makeTracer('UpgradeSA', true);
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* @import {start as StartFn} from '@agoric/orchestration/src/examples/send-anywhere.contract.js';
|
|
@@ -30,7 +30,7 @@ const trace = makeTracer('FixBuggySA', true);
|
|
|
30
30
|
* }} powers
|
|
31
31
|
* @param {...any} rest
|
|
32
32
|
*/
|
|
33
|
-
export const
|
|
33
|
+
export const upgradeSendAnywhere = async (
|
|
34
34
|
{
|
|
35
35
|
consume: {
|
|
36
36
|
agoricNames,
|
|
@@ -45,7 +45,7 @@ export const fixSendAnywhere = async (
|
|
|
45
45
|
},
|
|
46
46
|
{ options: { sendAnywhereRef } },
|
|
47
47
|
) => {
|
|
48
|
-
trace(
|
|
48
|
+
trace(upgradeSendAnywhere.name);
|
|
49
49
|
|
|
50
50
|
const saInstance = await instances.consume.sendAnywhere;
|
|
51
51
|
trace('saInstance', saInstance);
|
|
@@ -53,28 +53,24 @@ export const fixSendAnywhere = async (
|
|
|
53
53
|
|
|
54
54
|
const marshaller = await E(board).getReadonlyMarshaller();
|
|
55
55
|
|
|
56
|
-
// This apparently pointless wrapper is to maintain structural parity
|
|
57
|
-
// with the buggy core-eval's wrapper to make lookup() hang.
|
|
58
|
-
const agoricNamesResolves = Far('agoricNames that resolves', {
|
|
59
|
-
lookup: async (...args) => {
|
|
60
|
-
return E(agoricNames).lookup(...args);
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
|
|
64
56
|
const privateArgs = await deeplyFulfilledObject(
|
|
65
57
|
harden({
|
|
66
|
-
agoricNames
|
|
58
|
+
agoricNames,
|
|
67
59
|
localchain,
|
|
68
60
|
marshaller,
|
|
69
61
|
orchestrationService: cosmosInterchainService,
|
|
70
62
|
storageNode: E(NonNullish(await chainStorage)).makeChildNode(
|
|
71
|
-
'
|
|
63
|
+
'send-anywhere',
|
|
72
64
|
),
|
|
73
65
|
timerService: chainTimerService,
|
|
66
|
+
// undefined so `registerKnownChainsAndAssets` does not run again
|
|
67
|
+
chainInfo: undefined,
|
|
68
|
+
assetInfo: undefined,
|
|
74
69
|
}),
|
|
75
70
|
);
|
|
76
71
|
|
|
77
72
|
trace('upgrading...');
|
|
73
|
+
trace('ref', sendAnywhereRef);
|
|
78
74
|
await E(saKit.adminFacet).upgradeContract(
|
|
79
75
|
sendAnywhereRef.bundleID,
|
|
80
76
|
privateArgs,
|
|
@@ -82,13 +78,13 @@ export const fixSendAnywhere = async (
|
|
|
82
78
|
|
|
83
79
|
trace('done');
|
|
84
80
|
};
|
|
85
|
-
harden(
|
|
81
|
+
harden(upgradeSendAnywhere);
|
|
86
82
|
|
|
87
83
|
export const getManifestForValueVow = ({ restoreRef }, { sendAnywhereRef }) => {
|
|
88
84
|
console.log('sendAnywhereRef', sendAnywhereRef);
|
|
89
85
|
return {
|
|
90
86
|
manifest: {
|
|
91
|
-
[
|
|
87
|
+
[upgradeSendAnywhere.name]: {
|
|
92
88
|
consume: {
|
|
93
89
|
agoricNames: true,
|
|
94
90
|
board: true,
|
|
@@ -120,7 +116,7 @@ export const getManifestForValueVow = ({ restoreRef }, { sendAnywhereRef }) => {
|
|
|
120
116
|
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
121
117
|
harden({
|
|
122
118
|
// Somewhat unorthodox, source the exports from this builder module
|
|
123
|
-
sourceSpec: '@agoric/builders/scripts/testing/
|
|
119
|
+
sourceSpec: '@agoric/builders/scripts/testing/upgrade-send-anywhere.js',
|
|
124
120
|
getManifestCall: [
|
|
125
121
|
'getManifestForValueVow',
|
|
126
122
|
{
|
|
@@ -139,5 +135,5 @@ export default async (homeP, endowments) => {
|
|
|
139
135
|
const dspModule = await import('@agoric/deploy-script-support');
|
|
140
136
|
const { makeHelpers } = dspModule;
|
|
141
137
|
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
142
|
-
await writeCoreEval(
|
|
138
|
+
await writeCoreEval(upgradeSendAnywhere.name, defaultProposalBuilder);
|
|
143
139
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
|
|
3
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
4
|
+
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
5
|
+
harden({
|
|
6
|
+
sourceSpec: '@agoric/vats/src/proposals/upgrade-vaultFactory-proposal.js',
|
|
7
|
+
getManifestCall: [
|
|
8
|
+
'getManifestForVaultFactoryUpgrade',
|
|
9
|
+
{
|
|
10
|
+
contractRef: publishRef(
|
|
11
|
+
install('@agoric/inter-protocol/src/vaultFactory/vaultFactory.js'),
|
|
12
|
+
),
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
18
|
+
export default async (homeP, endowments) => {
|
|
19
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
20
|
+
await writeCoreEval('upgrade-vaults', defaultProposalBuilder);
|
|
21
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Terminate price-feed governor instances such as mainnet v110.
|
|
3
|
+
* Functions as both an off-chain builder and an on-chain core-eval.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/// <reference types="@agoric/vats/src/core/types-ambient"/>
|
|
7
|
+
|
|
8
|
+
import { E } from '@endo/far';
|
|
9
|
+
|
|
10
|
+
const SELF = '@agoric/builders/scripts/vats/terminate-governor-instance.js';
|
|
11
|
+
const USAGE = `Usage: agoric run /path/to/terminate-governor-instance.js \\
|
|
12
|
+
<$governorInstanceHandleBoardID:$instanceKitLabel>...`;
|
|
13
|
+
|
|
14
|
+
const repr = val =>
|
|
15
|
+
typeof val === 'string' || (typeof val === 'object' && val !== null)
|
|
16
|
+
? JSON.stringify(val)
|
|
17
|
+
: String(val);
|
|
18
|
+
const defaultMakeError = (strings, ...subs) =>
|
|
19
|
+
Error(
|
|
20
|
+
strings.map((s, i) => `${i === 0 ? '' : repr(subs[i - 1])}${s}`).join(''),
|
|
21
|
+
);
|
|
22
|
+
const makeUsageError = (strings, ...subs) => {
|
|
23
|
+
const err = defaultMakeError(strings, ...subs);
|
|
24
|
+
console.error(err.message);
|
|
25
|
+
console.error(USAGE);
|
|
26
|
+
return err;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const rtarget = /^(?<boardID>board[0-9]+):(?<instanceKitLabel>.+)$/;
|
|
30
|
+
/**
|
|
31
|
+
* @param {string[]} args
|
|
32
|
+
* @param {(strings: TemplateStringsArray | string[], ...subs: unknown[]) => Error} [makeError]
|
|
33
|
+
* @returns {Array<{boardID: string, instanceKitLabel: string}>}
|
|
34
|
+
*/
|
|
35
|
+
const parseTargets = (args = [], makeError = defaultMakeError) => {
|
|
36
|
+
if (!Array.isArray(args)) throw makeError`invalid targets: ${args}`;
|
|
37
|
+
/** @type {Array<{boardID: string, instanceKitLabel: string}>} */
|
|
38
|
+
const targets = [];
|
|
39
|
+
const badTargets = [];
|
|
40
|
+
for (const arg of args) {
|
|
41
|
+
const m = typeof arg === 'string' && arg.match(rtarget);
|
|
42
|
+
if (!m) {
|
|
43
|
+
badTargets.push(arg);
|
|
44
|
+
} else {
|
|
45
|
+
// @ts-expect-error cast
|
|
46
|
+
targets.push(m.groups);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (badTargets.length !== 0) {
|
|
50
|
+
throw makeError`malformed target(s): ${badTargets}`;
|
|
51
|
+
} else if (targets.length === 0) {
|
|
52
|
+
throw makeError`no target(s)`;
|
|
53
|
+
}
|
|
54
|
+
return targets;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @param {BootstrapPowers} powers
|
|
59
|
+
* @param {{ options: { targetSpecifiers: string[] } }} config
|
|
60
|
+
*/
|
|
61
|
+
export const terminateGovernors = async (
|
|
62
|
+
{ consume: { board, governedContractKits } },
|
|
63
|
+
{ options: { targetSpecifiers } },
|
|
64
|
+
) => {
|
|
65
|
+
const { Fail, quote: q } = assert;
|
|
66
|
+
const targets = parseTargets(targetSpecifiers, Fail);
|
|
67
|
+
const doneP = Promise.allSettled(
|
|
68
|
+
targets.map(async ({ boardID, instanceKitLabel }) => {
|
|
69
|
+
const logLabel = [boardID, instanceKitLabel];
|
|
70
|
+
const contractInstanceHandle = await E(board).getValue(boardID);
|
|
71
|
+
const instanceKit = await E(governedContractKits).get(
|
|
72
|
+
// @ts-expect-error TS2345 Property '[tag]' is missing
|
|
73
|
+
contractInstanceHandle,
|
|
74
|
+
);
|
|
75
|
+
console.log(
|
|
76
|
+
`${q(logLabel)} alleged governor contract instance kit`,
|
|
77
|
+
instanceKit,
|
|
78
|
+
);
|
|
79
|
+
const { label, governorAdminFacet, adminFacet } = instanceKit;
|
|
80
|
+
label === instanceKitLabel ||
|
|
81
|
+
Fail`${q(logLabel)} unexpected instanceKit label, got ${label} but wanted ${q(instanceKitLabel)}`;
|
|
82
|
+
(adminFacet && adminFacet !== governorAdminFacet) ||
|
|
83
|
+
Fail`${q(logLabel)} instanceKit adminFacet should have been present and different from governorAdminFacet but was ${adminFacet}`;
|
|
84
|
+
const reason = harden(Error(`core-eval terminating ${label} governor`));
|
|
85
|
+
await E(governorAdminFacet).terminateContract(reason);
|
|
86
|
+
console.log(`${q(logLabel)} terminated governor`);
|
|
87
|
+
}),
|
|
88
|
+
);
|
|
89
|
+
const results = await doneP;
|
|
90
|
+
const problems = targets.flatMap(({ boardID, instanceKitLabel }, i) => {
|
|
91
|
+
if (results[i].status === 'fulfilled') return [];
|
|
92
|
+
return [[boardID, instanceKitLabel, results[i].reason]];
|
|
93
|
+
});
|
|
94
|
+
if (problems.length !== 0) {
|
|
95
|
+
console.error('governor termination(s) failed', problems);
|
|
96
|
+
Fail`governor termination(s) failed: ${problems}`;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
harden(terminateGovernors);
|
|
100
|
+
|
|
101
|
+
export const getManifest = (_powers, targetSpecifiers) => {
|
|
102
|
+
parseTargets(targetSpecifiers);
|
|
103
|
+
return {
|
|
104
|
+
manifest: {
|
|
105
|
+
[terminateGovernors.name]: {
|
|
106
|
+
consume: { board: true, governedContractKits: true },
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
// Provide `terminateGovernors` a second argument like
|
|
110
|
+
// `{ options: { targetSpecifiers } }`.
|
|
111
|
+
options: { targetSpecifiers },
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
116
|
+
export const defaultProposalBuilder = async (_utils, targetSpecifiers) => {
|
|
117
|
+
parseTargets(targetSpecifiers);
|
|
118
|
+
return harden({
|
|
119
|
+
sourceSpec: SELF,
|
|
120
|
+
getManifestCall: ['getManifest', targetSpecifiers],
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
125
|
+
export default async (homeP, endowments) => {
|
|
126
|
+
const { scriptArgs } = endowments;
|
|
127
|
+
parseTargets(scriptArgs, makeUsageError);
|
|
128
|
+
const dspModule = await import('@agoric/deploy-script-support');
|
|
129
|
+
const { makeHelpers } = dspModule;
|
|
130
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
131
|
+
await writeCoreEval(terminateGovernors.name, utils =>
|
|
132
|
+
defaultProposalBuilder(utils, scriptArgs),
|
|
133
|
+
);
|
|
134
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
|
|
3
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
4
|
+
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
5
|
+
harden({
|
|
6
|
+
sourceSpec: '@agoric/vats/src/proposals/upgrade-agoricNames-proposal.js',
|
|
7
|
+
getManifestCall: [
|
|
8
|
+
'getManifestForUpgradingAgoricNames',
|
|
9
|
+
{
|
|
10
|
+
agoricNamesRef: publishRef(
|
|
11
|
+
install('@agoric/vats/src/vat-agoricNames.js'),
|
|
12
|
+
),
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
18
|
+
export default async (homeP, endowments) => {
|
|
19
|
+
const { writeCoreProposal } = await makeHelpers(homeP, endowments);
|
|
20
|
+
await writeCoreProposal('upgrade-agoricNames', defaultProposalBuilder);
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
|
|
3
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
4
|
+
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
5
|
+
harden({
|
|
6
|
+
sourceSpec: '@agoric/vats/src/proposals/upgrade-asset-reserve-proposal.js',
|
|
7
|
+
getManifestCall: [
|
|
8
|
+
'getManifestForUpgradingAssetReserve',
|
|
9
|
+
{
|
|
10
|
+
assetReserveRef: publishRef(
|
|
11
|
+
install('@agoric/inter-protocol/src/reserve/assetReserve.js'),
|
|
12
|
+
),
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
18
|
+
export default async (homeP, endowments) => {
|
|
19
|
+
const { writeCoreProposal } = await makeHelpers(homeP, endowments);
|
|
20
|
+
await writeCoreProposal('upgrade-asset-reserve', defaultProposalBuilder);
|
|
21
|
+
};
|
|
@@ -14,6 +14,6 @@ export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
|
14
14
|
|
|
15
15
|
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
16
16
|
export default async (homeP, endowments) => {
|
|
17
|
-
const {
|
|
18
|
-
await
|
|
17
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
18
|
+
await writeCoreEval('upgrade-bank', defaultProposalBuilder);
|
|
19
19
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
import { getManifestForUpgradingBoard } from '@agoric/vats/src/proposals/upgrade-board-proposal.js';
|
|
3
|
+
|
|
4
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
5
|
+
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
6
|
+
harden({
|
|
7
|
+
sourceSpec: '@agoric/vats/src/proposals/upgrade-board-proposal.js',
|
|
8
|
+
getManifestCall: [
|
|
9
|
+
getManifestForUpgradingBoard.name,
|
|
10
|
+
{
|
|
11
|
+
boardRef: publishRef(install('@agoric/vats/src/vat-board.js')),
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
17
|
+
export default async (homeP, endowments) => {
|
|
18
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
19
|
+
await writeCoreEval('upgrade-board', defaultProposalBuilder);
|
|
20
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { makeHelpers, parseScriptArgs } from '@agoric/deploy-script-support';
|
|
2
|
+
import { getManifestForUpgradingMintHolder } from '@agoric/vats/src/proposals/upgrade-mintHolder-proposal.js';
|
|
3
|
+
|
|
4
|
+
const configurations = {
|
|
5
|
+
A3P_INTEGRATION: {
|
|
6
|
+
labelList: [
|
|
7
|
+
'USDC_axl',
|
|
8
|
+
'USDT_grv',
|
|
9
|
+
'DAI_axl',
|
|
10
|
+
'DAI_grv',
|
|
11
|
+
'stATOM',
|
|
12
|
+
'USDC_grv',
|
|
13
|
+
'ATOM',
|
|
14
|
+
'USDT_axl',
|
|
15
|
+
'USDC',
|
|
16
|
+
'BLD',
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
MAINNET: {
|
|
20
|
+
labelList: [
|
|
21
|
+
'USDT',
|
|
22
|
+
'USDT_axl',
|
|
23
|
+
'USDT_grv',
|
|
24
|
+
'USDC',
|
|
25
|
+
'USDC_axl',
|
|
26
|
+
'USDC_grv',
|
|
27
|
+
'DAI_axl',
|
|
28
|
+
'DAI_grv',
|
|
29
|
+
'ATOM',
|
|
30
|
+
'stATOM',
|
|
31
|
+
'stkATOM',
|
|
32
|
+
'stTIA',
|
|
33
|
+
'stOSMO',
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
DEVNET: {
|
|
37
|
+
labelList: [
|
|
38
|
+
'stATOM3',
|
|
39
|
+
'stATOM',
|
|
40
|
+
'dATOM',
|
|
41
|
+
'stOSMO',
|
|
42
|
+
'stkATOM',
|
|
43
|
+
'stATOM2',
|
|
44
|
+
'STOSMO',
|
|
45
|
+
'stTIA',
|
|
46
|
+
'ATOM',
|
|
47
|
+
'AUSD',
|
|
48
|
+
'USDT_grv',
|
|
49
|
+
'USDC_axl',
|
|
50
|
+
'USDC_grv',
|
|
51
|
+
'USDT_axl',
|
|
52
|
+
'BLD',
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
EMERYNET: {
|
|
56
|
+
labelList: [
|
|
57
|
+
'ATOM',
|
|
58
|
+
'USDT',
|
|
59
|
+
'DAI_axl',
|
|
60
|
+
'DAI_grv',
|
|
61
|
+
'USDC_axl',
|
|
62
|
+
'stOSMO',
|
|
63
|
+
'stATOM',
|
|
64
|
+
'stkATOM',
|
|
65
|
+
'stOSMO2',
|
|
66
|
+
'ToyUSD',
|
|
67
|
+
'BLD',
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const { keys } = Object;
|
|
73
|
+
const knownVariants = keys(configurations);
|
|
74
|
+
|
|
75
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
76
|
+
export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
|
|
77
|
+
const config = opts.config || configurations[opts.variant];
|
|
78
|
+
if (!config) {
|
|
79
|
+
const error = `Unknown variant "${opts.variant}". Expected one of ${knownVariants.join(', ')}`;
|
|
80
|
+
console.error(error);
|
|
81
|
+
throw Error(error);
|
|
82
|
+
}
|
|
83
|
+
const { labelList } = config;
|
|
84
|
+
|
|
85
|
+
return harden({
|
|
86
|
+
sourceSpec: '@agoric/vats/src/proposals/upgrade-mintHolder-proposal.js',
|
|
87
|
+
getManifestCall: [
|
|
88
|
+
getManifestForUpgradingMintHolder.name,
|
|
89
|
+
{
|
|
90
|
+
labelList,
|
|
91
|
+
contractRef: publishRef(install('@agoric/vats/src/mintHolder.js')),
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
98
|
+
export default async (homeP, endowments) => {
|
|
99
|
+
const opts = parseScriptArgs(endowments, 'upgrade-mintHolder', knownVariants);
|
|
100
|
+
|
|
101
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
102
|
+
await writeCoreEval(`upgrade-mintHolder`, utils =>
|
|
103
|
+
defaultProposalBuilder(utils, opts),
|
|
104
|
+
);
|
|
105
|
+
};
|
|
@@ -3,15 +3,18 @@ import { makeHelpers } from '@agoric/deploy-script-support';
|
|
|
3
3
|
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
4
4
|
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
5
5
|
harden({
|
|
6
|
-
sourceSpec: '@agoric/vats/src/proposals/upgrade-
|
|
6
|
+
sourceSpec: '@agoric/vats/src/proposals/upgrade-vats-generic-proposal.js',
|
|
7
7
|
getManifestCall: [
|
|
8
|
-
'
|
|
8
|
+
'getManifestForUpgradingVats',
|
|
9
9
|
{
|
|
10
10
|
bundleRefs: {
|
|
11
11
|
ibc: publishRef(install('@agoric/vats/src/vat-ibc.js')),
|
|
12
12
|
network: publishRef(install('@agoric/vats/src/vat-network.js')),
|
|
13
13
|
localchain: publishRef(install('@agoric/vats/src/vat-localchain.js')),
|
|
14
14
|
transfer: publishRef(install('@agoric/vats/src/vat-transfer.js')),
|
|
15
|
+
orchestration: publishRef(
|
|
16
|
+
install('@agoric/orchestration/src/vat-orchestration.js'),
|
|
17
|
+
),
|
|
15
18
|
},
|
|
16
19
|
},
|
|
17
20
|
],
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
|
|
3
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
4
|
+
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
5
|
+
harden({
|
|
6
|
+
sourceSpec: '@agoric/vats/src/proposals/upgrade-paRegistry-proposal.js',
|
|
7
|
+
getManifestCall: [
|
|
8
|
+
'getManifestForUpgradingRegistry',
|
|
9
|
+
{
|
|
10
|
+
registryRef: publishRef(
|
|
11
|
+
install('@agoric/vats/src/vat-priceAuthority.js'),
|
|
12
|
+
),
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
18
|
+
export default async (homeP, endowments) => {
|
|
19
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
20
|
+
await writeCoreEval('upgrade-paRegistry', defaultProposalBuilder);
|
|
21
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
|
|
3
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
4
|
+
export const defaultProposalBuilder = async ({ publishRef, install }) =>
|
|
5
|
+
harden({
|
|
6
|
+
sourceSpec: '@agoric/vats/src/proposals/upgrade-psm-proposal.js',
|
|
7
|
+
getManifestCall: [
|
|
8
|
+
'getManifestForUpgradingPSM',
|
|
9
|
+
{
|
|
10
|
+
psmRef: publishRef(install('@agoric/inter-protocol/src/psm/psm.js')),
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
16
|
+
export default async (homeP, endowments) => {
|
|
17
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
18
|
+
await writeCoreEval('upgrade-psm', defaultProposalBuilder);
|
|
19
|
+
};
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file A proposal to start the auto-stake-it contract.
|
|
3
|
-
*
|
|
4
|
-
* AutoStakeIt allows users to to create an auto-forwarding address that
|
|
5
|
-
* transfers and stakes tokens on a remote chain when received.
|
|
6
|
-
*/
|
|
7
|
-
import { makeTracer } from '@agoric/internal';
|
|
8
|
-
import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
|
|
9
|
-
import { E } from '@endo/far';
|
|
10
|
-
import { deeplyFulfilled } from '@endo/marshal';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @import {AutoStakeItSF} from '@agoric/orchestration/src/examples/auto-stake-it.contract.js';
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
const contractName = 'autoAutoStakeIt';
|
|
17
|
-
const trace = makeTracer(contractName, true);
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @param {BootstrapPowers} powers
|
|
21
|
-
*/
|
|
22
|
-
export const startAutoStakeIt = async ({
|
|
23
|
-
consume: {
|
|
24
|
-
agoricNames,
|
|
25
|
-
board,
|
|
26
|
-
chainStorage,
|
|
27
|
-
chainTimerService,
|
|
28
|
-
cosmosInterchainService,
|
|
29
|
-
localchain,
|
|
30
|
-
startUpgradable,
|
|
31
|
-
},
|
|
32
|
-
installation: {
|
|
33
|
-
// @ts-expect-error not a WellKnownName
|
|
34
|
-
consume: { [contractName]: installation },
|
|
35
|
-
},
|
|
36
|
-
instance: {
|
|
37
|
-
// @ts-expect-error not a WellKnownName
|
|
38
|
-
produce: { [contractName]: produceInstance },
|
|
39
|
-
},
|
|
40
|
-
}) => {
|
|
41
|
-
trace(`start ${contractName}`);
|
|
42
|
-
await null;
|
|
43
|
-
|
|
44
|
-
const storageNode = await makeStorageNodeChild(chainStorage, contractName);
|
|
45
|
-
const marshaller = await E(board).getPublishingMarshaller();
|
|
46
|
-
|
|
47
|
-
/** @type {StartUpgradableOpts<AutoStakeItSF>} */
|
|
48
|
-
const startOpts = {
|
|
49
|
-
label: 'autoAutoStakeIt',
|
|
50
|
-
installation,
|
|
51
|
-
terms: undefined,
|
|
52
|
-
privateArgs: await deeplyFulfilled(
|
|
53
|
-
// @ts-expect-error
|
|
54
|
-
harden({
|
|
55
|
-
agoricNames,
|
|
56
|
-
orchestrationService: cosmosInterchainService,
|
|
57
|
-
localchain,
|
|
58
|
-
storageNode,
|
|
59
|
-
marshaller,
|
|
60
|
-
timerService: chainTimerService,
|
|
61
|
-
}),
|
|
62
|
-
),
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const { instance } = await E(startUpgradable)(startOpts);
|
|
66
|
-
produceInstance.resolve(instance);
|
|
67
|
-
};
|
|
68
|
-
harden(startAutoStakeIt);
|
|
69
|
-
|
|
70
|
-
export const getManifestForContract = (
|
|
71
|
-
{ restoreRef },
|
|
72
|
-
{ installKeys, ...options },
|
|
73
|
-
) => {
|
|
74
|
-
return {
|
|
75
|
-
manifest: {
|
|
76
|
-
[startAutoStakeIt.name]: {
|
|
77
|
-
consume: {
|
|
78
|
-
agoricNames: true,
|
|
79
|
-
board: true,
|
|
80
|
-
chainStorage: true,
|
|
81
|
-
chainTimerService: true,
|
|
82
|
-
cosmosInterchainService: true,
|
|
83
|
-
localchain: true,
|
|
84
|
-
startUpgradable: true,
|
|
85
|
-
},
|
|
86
|
-
installation: {
|
|
87
|
-
consume: { [contractName]: true },
|
|
88
|
-
},
|
|
89
|
-
instance: {
|
|
90
|
-
produce: { [contractName]: true },
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
installations: {
|
|
95
|
-
[contractName]: restoreRef(installKeys[contractName]),
|
|
96
|
-
},
|
|
97
|
-
options,
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
102
|
-
export const defaultProposalBuilder = async ({ publishRef, install }) => {
|
|
103
|
-
return harden({
|
|
104
|
-
// Somewhat unorthodox, source the exports from this builder module
|
|
105
|
-
sourceSpec: '@agoric/builders/scripts/testing/start-auto-stake-it.js',
|
|
106
|
-
getManifestCall: [
|
|
107
|
-
'getManifestForContract',
|
|
108
|
-
{
|
|
109
|
-
installKeys: {
|
|
110
|
-
autoAutoStakeIt: publishRef(
|
|
111
|
-
install(
|
|
112
|
-
'@agoric/orchestration/src/examples/auto-stake-it.contract.js',
|
|
113
|
-
),
|
|
114
|
-
),
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
});
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
122
|
-
export default async (homeP, endowments) => {
|
|
123
|
-
// import dynamically so the module can work in CoreEval environment
|
|
124
|
-
const dspModule = await import('@agoric/deploy-script-support');
|
|
125
|
-
const { makeHelpers } = dspModule;
|
|
126
|
-
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
127
|
-
await writeCoreEval(startAutoStakeIt.name, defaultProposalBuilder);
|
|
128
|
-
};
|