@agoric/builders 0.1.1-dev-cbcea8c.0.cbcea8c → 0.1.1-dev-04baeed.0.04baeed

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.
Files changed (27) hide show
  1. package/package.json +18 -19
  2. package/scripts/testing/register-interchain-bank-assets.builder.js +41 -0
  3. package/scripts/vats/init-core.js +2 -2
  4. package/scripts/vats/invite-committee.js +45 -0
  5. package/scripts/vats/start-econ-committee.js +46 -0
  6. package/scripts/inter-protocol/add-collateral-core.js +0 -132
  7. package/scripts/inter-protocol/init-core.js +0 -233
  8. package/scripts/inter-protocol/invite-committee-core.js +0 -52
  9. package/scripts/inter-protocol/manual-price-feed.js +0 -131
  10. package/scripts/inter-protocol/price-feed-core.js +0 -113
  11. package/scripts/inter-protocol/replace-electorate-core.js +0 -173
  12. package/scripts/inter-protocol/replace-feeDistributor-combo.js +0 -87
  13. package/scripts/inter-protocol/replace-feeDistributor.js +0 -41
  14. package/scripts/inter-protocol/updatePriceFeeds.js +0 -141
  15. package/scripts/inter-protocol/withdraw-reserve.build.js +0 -73
  16. package/scripts/inter-protocol/withdraw-vbank-reserve-permit.json +0 -6
  17. package/scripts/inter-protocol/withdraw-vbank-reserve.js +0 -72
  18. package/scripts/testing/replace-feeDistributor-short.js +0 -38
  19. package/scripts/vats/priceFeedSupport.js +0 -99
  20. package/scripts/vats/updateAtomPriceFeed.js +0 -27
  21. package/scripts/vats/updateStAtomPriceFeed.js +0 -27
  22. package/scripts/vats/updateStOsmoPriceFeed.js +0 -27
  23. package/scripts/vats/updateStTiaPriceFeed.js +0 -27
  24. package/scripts/vats/updateStkAtomPriceFeed.js +0 -27
  25. package/scripts/vats/upgrade-asset-reserve.js +0 -26
  26. package/scripts/vats/upgrade-psm.js +0 -24
  27. package/scripts/vats/upgradeScaledPriceAuthorities.js +0 -28
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/builders",
3
- "version": "0.1.1-dev-cbcea8c.0.cbcea8c",
3
+ "version": "0.1.1-dev-04baeed.0.04baeed",
4
4
  "description": "Build scripts for proposals to an Agoric chain",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -20,14 +20,14 @@
20
20
  "author": "Agoric",
21
21
  "license": "Apache-2.0",
22
22
  "dependencies": {
23
- "@agoric/client-utils": "0.1.1-dev-cbcea8c.0.cbcea8c",
24
- "@agoric/ertp": "0.16.3-dev-cbcea8c.0.cbcea8c",
25
- "@agoric/internal": "0.3.3-dev-cbcea8c.0.cbcea8c",
26
- "@agoric/notifier": "0.6.3-dev-cbcea8c.0.cbcea8c",
27
- "@agoric/smart-wallet": "0.5.4-dev-cbcea8c.0.cbcea8c",
28
- "@agoric/vat-data": "0.5.3-dev-cbcea8c.0.cbcea8c",
29
- "@agoric/vats": "0.15.2-dev-cbcea8c.0.cbcea8c",
30
- "@agoric/zoe": "0.26.3-dev-cbcea8c.0.cbcea8c",
23
+ "@agoric/client-utils": "0.1.1-dev-04baeed.0.04baeed",
24
+ "@agoric/ertp": "0.16.3-dev-04baeed.0.04baeed",
25
+ "@agoric/internal": "0.3.3-dev-04baeed.0.04baeed",
26
+ "@agoric/notifier": "0.6.3-dev-04baeed.0.04baeed",
27
+ "@agoric/smart-wallet": "0.5.4-dev-04baeed.0.04baeed",
28
+ "@agoric/vat-data": "0.5.3-dev-04baeed.0.04baeed",
29
+ "@agoric/vats": "0.15.2-dev-04baeed.0.04baeed",
30
+ "@agoric/zoe": "0.26.3-dev-04baeed.0.04baeed",
31
31
  "@endo/bundle-source": "^4.3.2",
32
32
  "@endo/captp": "^4.5.1",
33
33
  "@endo/eventual-send": "^1.5.0",
@@ -41,15 +41,14 @@
41
41
  "import-meta-resolve": "^4.1.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@agoric/deploy-script-support": "0.10.4-dev-cbcea8c.0.cbcea8c",
45
- "@agoric/governance": "0.10.4-dev-cbcea8c.0.cbcea8c",
46
- "@agoric/inter-protocol": "0.16.2-dev-cbcea8c.0.cbcea8c",
47
- "@agoric/orchestration": "0.1.1-dev-cbcea8c.0.cbcea8c",
48
- "@agoric/store": "0.9.3-dev-cbcea8c.0.cbcea8c",
49
- "@agoric/swing-store": "0.9.2-dev-cbcea8c.0.cbcea8c",
50
- "@agoric/swingset-liveslots": "0.10.3-dev-cbcea8c.0.cbcea8c",
51
- "@agoric/swingset-vat": "0.32.3-dev-cbcea8c.0.cbcea8c",
52
- "@agoric/time": "0.3.3-dev-cbcea8c.0.cbcea8c",
44
+ "@agoric/deploy-script-support": "0.10.4-dev-04baeed.0.04baeed",
45
+ "@agoric/governance": "0.10.4-dev-04baeed.0.04baeed",
46
+ "@agoric/orchestration": "0.1.1-dev-04baeed.0.04baeed",
47
+ "@agoric/store": "0.9.3-dev-04baeed.0.04baeed",
48
+ "@agoric/swing-store": "0.9.2-dev-04baeed.0.04baeed",
49
+ "@agoric/swingset-liveslots": "0.10.3-dev-04baeed.0.04baeed",
50
+ "@agoric/swingset-vat": "0.32.3-dev-04baeed.0.04baeed",
51
+ "@agoric/time": "0.3.3-dev-04baeed.0.04baeed",
53
52
  "@endo/errors": "^1.3.1",
54
53
  "ava": "^7.0.0",
55
54
  "c8": "^10.1.3"
@@ -79,5 +78,5 @@
79
78
  "typeCoverage": {
80
79
  "atLeast": 89.7
81
80
  },
82
- "gitHead": "cbcea8c2415f2c9c4bc1ea9ff90730f2773bafaa"
81
+ "gitHead": "04baeedd0adc9b2480dd9d272e8daffebc408662"
83
82
  }
@@ -0,0 +1,41 @@
1
+ import { makeHelpers } from '@agoric/deploy-script-support';
2
+ import { parseArgs } from 'node:util';
3
+
4
+ /**
5
+ * @import {ParseArgsConfig} from 'node:util';
6
+ * @import {CoreEvalBuilder, DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
7
+ */
8
+
9
+ /** @type {ParseArgsConfig['options']} */
10
+ const parserOpts = {
11
+ assets: { type: 'string' },
12
+ };
13
+
14
+ /** @type {CoreEvalBuilder} */
15
+ export const defaultProposalBuilder = async (_, options) =>
16
+ harden({
17
+ sourceSpec:
18
+ '@agoric/builders/scripts/testing/register-interchain-bank-assets.js',
19
+ getManifestCall: ['getManifestCall', options],
20
+ });
21
+
22
+ /** @type {DeployScriptFunction} */
23
+ export default async (homeP, endowments) => {
24
+ const { scriptArgs } = endowments;
25
+
26
+ const {
27
+ values: { assets },
28
+ } = parseArgs({ args: scriptArgs, options: parserOpts });
29
+
30
+ if (typeof assets !== 'string') {
31
+ throw Error(
32
+ 'must provide --assets=JSON.stringify({ denom; issuerName; decimalPlaces }[])',
33
+ );
34
+ }
35
+ const opts = harden({ assets: JSON.parse(assets) });
36
+
37
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
38
+ await writeCoreEval('eval-register-interchain-bank-assets', utils =>
39
+ defaultProposalBuilder(utils, opts),
40
+ );
41
+ };
@@ -1,5 +1,5 @@
1
1
  import { makeHelpers } from '@agoric/deploy-script-support';
2
- import { interProtocolBundleSpecs } from '@agoric/inter-protocol/source-spec-registry.js';
2
+ import { vatsSourceSpecRegistry } from '@agoric/vats/source-spec-registry.js';
3
3
  import { smartWalletSourceSpecRegistry } from '@agoric/smart-wallet/source-spec-registry.js';
4
4
  import { buildBundlePath } from '../lib/build-bundle.js';
5
5
 
@@ -10,7 +10,7 @@ import { buildBundlePath } from '../lib/build-bundle.js';
10
10
 
11
11
  /** @type {CoreEvalBuilder} */
12
12
  export const defaultProposalBuilder = async ({ publishRef, install }) => {
13
- const provisionPool = interProtocolBundleSpecs.provisionPool;
13
+ const provisionPool = vatsSourceSpecRegistry.provisionPool;
14
14
  const walletFactory = smartWalletSourceSpecRegistry.walletFactory;
15
15
  const provisionPoolPath = await buildBundlePath(
16
16
  import.meta.url,
@@ -0,0 +1,45 @@
1
+ import { makeHelpers } from '@agoric/deploy-script-support';
2
+
3
+ /**
4
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
5
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
6
+ */
7
+
8
+ /**
9
+ * Invite the economic committee members and stand up the charter through which
10
+ * they govern provisionPool. Formerly inter-protocol's invite-committee-core
11
+ * builder; the behavior now lives in `@agoric/vats` and the charter contract
12
+ * in `@agoric/governance`.
13
+ *
14
+ * @type {CoreEvalBuilder}
15
+ */
16
+ export const defaultProposalBuilder = async (
17
+ { publishRef, install },
18
+ options = {},
19
+ ) => {
20
+ const {
21
+ ECON_COMMITTEE_ADDRESSES = process.env.ECON_COMMITTEE_ADDRESSES,
22
+ voterAddresses = ECON_COMMITTEE_ADDRESSES
23
+ ? JSON.parse(ECON_COMMITTEE_ADDRESSES)
24
+ : {},
25
+ } = options;
26
+
27
+ return harden({
28
+ sourceSpec: '@agoric/vats/src/proposals/invite-committee.js',
29
+ getManifestCall: [
30
+ 'getManifestForInviteCommittee',
31
+ {
32
+ voterAddresses,
33
+ econCommitteeCharterRef: publishRef(
34
+ install('@agoric/governance/src/econCommitteeCharter.js'),
35
+ ),
36
+ },
37
+ ],
38
+ });
39
+ };
40
+
41
+ /** @type {DeployScriptFunction} */
42
+ export default async (homeP, endowments) => {
43
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
44
+ await writeCoreEval('gov-invite-committee', defaultProposalBuilder);
45
+ };
@@ -0,0 +1,46 @@
1
+ import { makeHelpers } from '@agoric/deploy-script-support';
2
+
3
+ /**
4
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
5
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
6
+ */
7
+
8
+ /**
9
+ * Start the Economic Committee electorate plus the governance installations
10
+ * (contractGovernor, committee, binaryVoteCounter) that governed contracts such
11
+ * as provisionPool depend on. Formerly part of inter-protocol's init-core
12
+ * builder; the behavior now lives in `@agoric/vats` and the contracts in
13
+ * `@agoric/governance`.
14
+ *
15
+ * @type {CoreEvalBuilder}
16
+ */
17
+ export const defaultProposalBuilder = async (
18
+ { publishRef, install },
19
+ options = {},
20
+ ) => {
21
+ const { econCommitteeOptions } = options;
22
+ return harden({
23
+ sourceSpec: '@agoric/vats/src/proposals/start-econ-committee.js',
24
+ getManifestCall: [
25
+ 'getManifestForEconCommittee',
26
+ {
27
+ econCommitteeOptions,
28
+ installKeys: {
29
+ contractGovernor: publishRef(
30
+ install('@agoric/governance/src/contractGovernor.js'),
31
+ ),
32
+ committee: publishRef(install('@agoric/governance/src/committee.js')),
33
+ binaryVoteCounter: publishRef(
34
+ install('@agoric/governance/src/binaryVoteCounter.js'),
35
+ ),
36
+ },
37
+ },
38
+ ],
39
+ });
40
+ };
41
+
42
+ /** @type {DeployScriptFunction} */
43
+ export default async (homeP, endowments) => {
44
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
45
+ await writeCoreEval('gov-econ-committee', defaultProposalBuilder);
46
+ };
@@ -1,132 +0,0 @@
1
- /* eslint-env node */
2
- import { makeHelpers } from '@agoric/deploy-script-support';
3
-
4
- import { interProtocolBundleSpecs } from '@agoric/inter-protocol/source-spec-registry.js';
5
- import { getManifestForAddAssetToVault } from '@agoric/inter-protocol/src/proposals/addAssetToVault.js';
6
- import { getManifestForPsm } from '@agoric/inter-protocol/src/proposals/startPSM.js';
7
- import { makeInstallCache } from '@agoric/inter-protocol/src/proposals/utils.js';
8
- import { vatsSourceSpecRegistry } from '@agoric/vats/source-spec-registry.js';
9
- import { buildBundlePath } from '../lib/build-bundle.js';
10
-
11
- /**
12
- * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
13
- * @import {InterchainAssetOptions} from '@agoric/inter-protocol/src/proposals/addAssetToVault.js';
14
- * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
15
- */
16
-
17
- /** @type {CoreEvalBuilder} */
18
- export const defaultProposalBuilder = async (
19
- { publishRef, install: install0, wrapInstall },
20
- {
21
- debtLimitValue = undefined,
22
- interestRateValue = undefined,
23
- interchainAssetOptions = /** @type {object} */ ({}),
24
- } = {},
25
- { env = process.env } = {},
26
- ) => {
27
- /** @type {InterchainAssetOptions} */
28
- const {
29
- issuerBoardId = env.INTERCHAIN_ISSUER_BOARD_ID,
30
- denom = env.INTERCHAIN_DENOM,
31
- keyword = 'ATOM',
32
- issuerName = keyword,
33
- oracleBrand = issuerName,
34
- decimalPlaces = 6,
35
- proposedName = issuerName,
36
- initialPrice = undefined,
37
- } = interchainAssetOptions;
38
-
39
- if (!denom) {
40
- assert(issuerBoardId, 'INTERCHAIN_ISSUER_BOARD_ID is required');
41
- }
42
-
43
- const install = wrapInstall ? wrapInstall(install0) : install0;
44
- const scaledPriceAuthorityPath = await buildBundlePath(
45
- import.meta.url,
46
- '@agoric/zoe/src/contracts/scaledPriceAuthority.js',
47
- 'scaledPriceAuthority',
48
- );
49
-
50
- return harden({
51
- sourceSpec: '@agoric/inter-protocol/src/proposals/addAssetToVault.js',
52
- getManifestCall: [
53
- getManifestForAddAssetToVault.name,
54
- {
55
- debtLimitValue: debtLimitValue && BigInt(debtLimitValue),
56
- interestRateValue: interestRateValue && BigInt(interestRateValue),
57
- interchainAssetOptions: {
58
- denom,
59
- issuerBoardId,
60
- decimalPlaces,
61
- initialPrice,
62
- keyword,
63
- issuerName,
64
- proposedName,
65
- oracleBrand,
66
- },
67
- scaledPriceAuthorityRef: publishRef(
68
- install(
69
- '@agoric/zoe/src/contracts/scaledPriceAuthority.js',
70
- scaledPriceAuthorityPath,
71
- { persist: true },
72
- ),
73
- ),
74
- },
75
- ],
76
- });
77
- };
78
-
79
- /** @type {CoreEvalBuilder} */
80
- export const psmProposalBuilder = async (
81
- { publishRef, install: install0, wrapInstall },
82
- { anchorOptions = /** @type {object} */ ({}) } = {},
83
- { env = process.env } = {},
84
- ) => {
85
- const { denom = env.ANCHOR_DENOM, decimalPlaces = 6 } = anchorOptions;
86
-
87
- assert(denom, 'ANCHOR_DENOM is required');
88
-
89
- const install = wrapInstall ? wrapInstall(install0) : install0;
90
- const psm = interProtocolBundleSpecs.psm;
91
- const mintHolder = vatsSourceSpecRegistry.mintHolder;
92
- const psmPath = await buildBundlePath(import.meta.url, psm);
93
- const mintHolderPath = await buildBundlePath(import.meta.url, mintHolder);
94
-
95
- return harden({
96
- sourceSpec: '@agoric/inter-protocol/src/proposals/startPSM.js',
97
- getManifestCall: [
98
- getManifestForPsm.name,
99
- {
100
- anchorOptions: {
101
- ...anchorOptions,
102
- denom,
103
- decimalPlaces,
104
- },
105
- installKeys: {
106
- psm: publishRef(install(psm.packagePath, psmPath)),
107
- mintHolder: publishRef(
108
- install(mintHolder.packagePath, mintHolderPath),
109
- ),
110
- },
111
- },
112
- ],
113
- });
114
- };
115
-
116
- /** @type {DeployScriptFunction} */
117
- export default async (homeP, endowments) => {
118
- const { writeCoreEval } = await makeHelpers(homeP, endowments);
119
-
120
- const tool = await makeInstallCache(homeP, {
121
- loadBundle: spec => import(spec),
122
- });
123
-
124
- await writeCoreEval('gov-add-collateral', defaultProposalBuilder);
125
- await writeCoreEval('gov-start-psm', opts =>
126
- psmProposalBuilder({
127
- ...opts,
128
- // @ts-expect-error XXX makeInstallCache types
129
- wrapInstall: tool.wrapInstall,
130
- }),
131
- );
132
- };
@@ -1,233 +0,0 @@
1
- /* eslint-env node */
2
- /**
3
- * @file can be run with `agoric deploy` after a chain is running (depends on
4
- * chain state) Only works with "local" chain and not sim-chain b/c it needs
5
- * governance votes (n/a on sim-chain).
6
- */
7
- import { makeHelpers } from '@agoric/deploy-script-support';
8
- import { governanceSourceSpecRegistry } from '@agoric/governance/source-spec-registry.js';
9
- import { interProtocolBundleSpecs } from '@agoric/inter-protocol/source-spec-registry.js';
10
-
11
- import {
12
- getManifestForInterProtocol,
13
- getManifestForEconCommittee,
14
- getManifestForMain,
15
- } from '@agoric/inter-protocol/src/proposals/core-proposal.js';
16
- import { makeInstallCache } from '@agoric/inter-protocol/src/proposals/utils.js';
17
- import { buildBundlePath } from '../lib/build-bundle.js';
18
-
19
- /**
20
- * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
21
- * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
22
- */
23
-
24
- // TODO end inter-package filesystem references https://github.com/Agoric/agoric-sdk/issues/8178
25
-
26
- /**
27
- * @typedef {{
28
- * sourceSpec?: string;
29
- * packagePath?: string;
30
- * bundleName?: string;
31
- * }} BundleRegistryEntry
32
- */
33
-
34
- /** @type {Record<string, Record<string, BundleRegistryEntry>>} */
35
- const installKeyGroups = {
36
- econCommittee: {
37
- contractGovernor: governanceSourceSpecRegistry.contractGovernor,
38
- committee: governanceSourceSpecRegistry.committee,
39
- binaryVoteCounter: governanceSourceSpecRegistry.binaryVoteCounter,
40
- },
41
- main: {
42
- vaultFactory: interProtocolBundleSpecs.vaultFactory,
43
- feeDistributor: interProtocolBundleSpecs.feeDistributor,
44
- reserve: interProtocolBundleSpecs.reserve,
45
- },
46
- };
47
-
48
- /**
49
- * @template I
50
- * @template R
51
- * @param {object} opts
52
- * @param {(i: I) => R} opts.publishRef
53
- * @param {(m: string, b: string, opts?: any) => I} opts.install
54
- * @param {Record<string, BundleRegistryEntry>} opts.group
55
- * @param {boolean} [opts.persist]
56
- */
57
- const publishInstallGroup = async ({ publishRef, install, group, persist }) =>
58
- Object.fromEntries(
59
- // eslint-disable-next-line @jessie.js/safe-await-separator
60
- await Promise.all(
61
- Object.entries(group).map(async ([key, entry]) => {
62
- const bundlePath = await buildBundlePath(import.meta.url, entry);
63
- assert(entry.packagePath, `${key} missing packagePath`);
64
- return [
65
- key,
66
- publishRef(
67
- install(
68
- entry.packagePath,
69
- bundlePath,
70
- persist === undefined ? undefined : { persist },
71
- ),
72
- ),
73
- ];
74
- }),
75
- ),
76
- );
77
-
78
- /**
79
- * @template I
80
- * @template R
81
- * @param {object} opts
82
- * @param {(i: I) => R} opts.publishRef
83
- * @param {(m: string, b: string, opts?: any) => I} opts.install
84
- * @param {<T>(f: T) => T} [opts.wrapInstall]
85
- * @param {object} [options]
86
- * @param {{ committeeName?: string; committeeSize?: number }} [options.econCommitteeOptions]
87
- */
88
- export const committeeProposalBuilder = async (
89
- { publishRef, install: install0, wrapInstall },
90
- { econCommitteeOptions } = {},
91
- ) => {
92
- const install = wrapInstall ? wrapInstall(install0) : install0;
93
- const econCommitteeInstallKeys = await publishInstallGroup({
94
- publishRef,
95
- install,
96
- group: installKeyGroups.econCommittee,
97
- persist: true,
98
- });
99
- return harden({
100
- sourceSpec: '@agoric/inter-protocol/src/proposals/core-proposal.js',
101
- getManifestCall: [
102
- getManifestForEconCommittee.name,
103
- {
104
- econCommitteeOptions,
105
- installKeys: {
106
- ...econCommitteeInstallKeys,
107
- },
108
- },
109
- ],
110
- });
111
- };
112
-
113
- /**
114
- * @template I
115
- * @template R
116
- * @param {object} opts
117
- * @param {(i: I) => R} opts.publishRef
118
- * @param {(m: string, b: string, opts?: any) => I} opts.install
119
- * @param {<T>(f: T) => T} [opts.wrapInstall]
120
- */
121
- export const mainProposalBuilder = async ({
122
- publishRef,
123
- install: install0,
124
- wrapInstall,
125
- }) => {
126
- const { VAULT_FACTORY_CONTROLLER_ADDR } = process.env;
127
-
128
- const install = wrapInstall ? wrapInstall(install0) : install0;
129
- const mainInstallKeys = await publishInstallGroup({
130
- publishRef,
131
- install,
132
- group: installKeyGroups.main,
133
- persist: true,
134
- });
135
- return harden({
136
- sourceSpec: '@agoric/inter-protocol/src/proposals/core-proposal.js',
137
- getManifestCall: [
138
- getManifestForMain.name,
139
- {
140
- vaultFactoryControllerAddress: VAULT_FACTORY_CONTROLLER_ADDR,
141
- installKeys: {
142
- ...mainInstallKeys,
143
- },
144
- },
145
- ],
146
- });
147
- };
148
-
149
- // Build proposal for sim-chain etc.
150
- /** @type {CoreEvalBuilder} */
151
- export const defaultProposalBuilder = async (
152
- { publishRef, install },
153
- options = {},
154
- { env = process.env } = {},
155
- ) => {
156
- /** @param {string | undefined} s */
157
- const optBigInt = s => s && BigInt(s);
158
- const {
159
- vaultFactoryControllerAddress = env.VAULT_FACTORY_CONTROLLER_ADDR,
160
- minInitialPoolLiquidity = env.MIN_INITIAL_POOL_LIQUIDITY,
161
- referencedUi,
162
- anchorOptions: {
163
- anchorDenom = env.ANCHOR_DENOM,
164
- anchorDecimalPlaces = '6',
165
- anchorKeyword = 'AUSD',
166
- anchorProposedName = anchorKeyword,
167
- initialPrice = undefined,
168
- } = {},
169
- econCommitteeOptions: {
170
- committeeSize: econCommitteeSize = env.ECON_COMMITTEE_SIZE || '3',
171
- } = {},
172
- } = options;
173
-
174
- const anchorOptions = anchorDenom && {
175
- denom: anchorDenom,
176
- decimalPlaces: parseInt(anchorDecimalPlaces, 10),
177
- initialPrice,
178
- keyword: anchorKeyword,
179
- proposedName: anchorProposedName,
180
- };
181
-
182
- const econCommitteeOptions = {
183
- committeeSize: parseInt(econCommitteeSize, 10),
184
- };
185
- const econCommitteeInstallKeys = await publishInstallGroup({
186
- publishRef,
187
- install,
188
- group: installKeyGroups.econCommittee,
189
- });
190
- const mainInstallKeys = await publishInstallGroup({
191
- publishRef,
192
- install,
193
- group: installKeyGroups.main,
194
- });
195
-
196
- return harden({
197
- sourceSpec: '@agoric/inter-protocol/src/proposals/core-proposal.js',
198
- getManifestCall: [
199
- getManifestForInterProtocol.name,
200
- {
201
- vaultFactoryControllerAddress,
202
- minInitialPoolLiquidity: optBigInt(minInitialPoolLiquidity),
203
- referencedUi,
204
- anchorOptions,
205
- econCommitteeOptions,
206
- installKeys: {
207
- ...econCommitteeInstallKeys,
208
- ...mainInstallKeys,
209
- },
210
- },
211
- ],
212
- });
213
- };
214
-
215
- /** @type {DeployScriptFunction} */
216
- export default async (homeP, endowments) => {
217
- const { writeCoreEval } = await makeHelpers(homeP, endowments);
218
-
219
- const tool = await makeInstallCache(homeP, {
220
- loadBundle: spec => import(spec),
221
- });
222
- await Promise.all([
223
- writeCoreEval('gov-econ-committee', opts =>
224
- // @ts-expect-error XXX makeInstallCache types
225
- committeeProposalBuilder({ ...opts, wrapInstall: tool.wrapInstall }),
226
- ),
227
- writeCoreEval('gov-amm-vaults-etc', opts =>
228
- // @ts-expect-error XXX makeInstallCache types
229
- mainProposalBuilder({ ...opts, wrapInstall: tool.wrapInstall }),
230
- ),
231
- ]);
232
- await tool.saveCache();
233
- };
@@ -1,52 +0,0 @@
1
- /* eslint-env node */
2
- import { makeHelpers } from '@agoric/deploy-script-support';
3
-
4
- import { getManifestForInviteCommittee } from '@agoric/inter-protocol/src/proposals/committee-proposal.js';
5
- import { interProtocolBundleSpecs } from '@agoric/inter-protocol/source-spec-registry.js';
6
- import { buildBundlePath } from '../lib/build-bundle.js';
7
-
8
- /**
9
- * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
10
- * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
11
- */
12
-
13
- // Build proposal for sim-chain etc.
14
- /** @type {CoreEvalBuilder} */
15
- export const defaultProposalBuilder = async (
16
- { publishRef, install },
17
- options = {},
18
- ) => {
19
- const {
20
- ECON_COMMITTEE_ADDRESSES = process.env.ECON_COMMITTEE_ADDRESSES,
21
- voterAddresses = JSON.parse(ECON_COMMITTEE_ADDRESSES),
22
- } = options;
23
-
24
- assert(voterAddresses, 'ECON_COMMITTEE_ADDRESSES is required');
25
-
26
- const econCommitteeCharter = interProtocolBundleSpecs.econCommitteeCharter;
27
- const econCommitteeCharterPath = await buildBundlePath(
28
- import.meta.url,
29
- econCommitteeCharter,
30
- );
31
-
32
- return harden({
33
- sourceSpec: '@agoric/inter-protocol/src/proposals/committee-proposal.js',
34
- getManifestCall: [
35
- getManifestForInviteCommittee.name,
36
- {
37
- voterAddresses,
38
- econCommitteeCharterRef: publishRef(
39
- install(econCommitteeCharter.packagePath, econCommitteeCharterPath, {
40
- persist: true,
41
- }),
42
- ),
43
- },
44
- ],
45
- });
46
- };
47
-
48
- /** @type {DeployScriptFunction} */
49
- export default async (homeP, endowments) => {
50
- const { writeCoreEval } = await makeHelpers(homeP, endowments);
51
- await writeCoreEval('gov-invite-committee', defaultProposalBuilder);
52
- };