@agoric/builders 0.1.1-upgrade-18-dev-d7c994b.0 → 0.1.1-upgrade-18-dev-a0f4883.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/builders",
3
- "version": "0.1.1-upgrade-18-dev-d7c994b.0+d7c994b",
3
+ "version": "0.1.1-upgrade-18-dev-a0f4883.0+a0f4883",
4
4
  "description": "Build scripts for proposals to an Agoric chain",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -23,13 +23,13 @@
23
23
  "author": "Agoric",
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
- "@agoric/ertp": "0.16.3-upgrade-18-dev-d7c994b.0+d7c994b",
27
- "@agoric/internal": "0.3.3-upgrade-18-dev-d7c994b.0+d7c994b",
28
- "@agoric/notifier": "0.6.3-upgrade-18-dev-d7c994b.0+d7c994b",
29
- "@agoric/smart-wallet": "0.5.4-upgrade-18-dev-d7c994b.0+d7c994b",
30
- "@agoric/vat-data": "0.5.3-upgrade-18-dev-d7c994b.0+d7c994b",
31
- "@agoric/vats": "0.15.2-upgrade-18-dev-d7c994b.0+d7c994b",
32
- "@agoric/zoe": "0.26.3-upgrade-18-dev-d7c994b.0+d7c994b",
26
+ "@agoric/ertp": "0.16.3-upgrade-18-dev-a0f4883.0+a0f4883",
27
+ "@agoric/internal": "0.3.3-upgrade-18-dev-a0f4883.0+a0f4883",
28
+ "@agoric/notifier": "0.6.3-upgrade-18-dev-a0f4883.0+a0f4883",
29
+ "@agoric/smart-wallet": "0.5.4-upgrade-18-dev-a0f4883.0+a0f4883",
30
+ "@agoric/vat-data": "0.5.3-upgrade-18-dev-a0f4883.0+a0f4883",
31
+ "@agoric/vats": "0.15.2-upgrade-18-dev-a0f4883.0+a0f4883",
32
+ "@agoric/zoe": "0.26.3-upgrade-18-dev-a0f4883.0+a0f4883",
33
33
  "@endo/bundle-source": "^3.4.2",
34
34
  "@endo/captp": "^4.4.2",
35
35
  "@endo/eventual-send": "^1.2.7",
@@ -41,14 +41,14 @@
41
41
  "import-meta-resolve": "^2.2.1"
42
42
  },
43
43
  "devDependencies": {
44
- "@agoric/deploy-script-support": "0.10.4-upgrade-18-dev-d7c994b.0+d7c994b",
45
- "@agoric/governance": "0.10.4-upgrade-18-dev-d7c994b.0+d7c994b",
46
- "@agoric/inter-protocol": "0.16.2-upgrade-18-dev-d7c994b.0+d7c994b",
47
- "@agoric/orchestration": "0.1.1-upgrade-18-dev-d7c994b.0+d7c994b",
48
- "@agoric/store": "0.9.3-upgrade-18-dev-d7c994b.0+d7c994b",
49
- "@agoric/swing-store": "0.9.2-upgrade-18-dev-d7c994b.0+d7c994b",
50
- "@agoric/swingset-liveslots": "0.10.3-upgrade-18-dev-d7c994b.0+d7c994b",
51
- "@agoric/time": "0.3.3-upgrade-18-dev-d7c994b.0+d7c994b",
44
+ "@agoric/deploy-script-support": "0.10.4-upgrade-18-dev-a0f4883.0+a0f4883",
45
+ "@agoric/governance": "0.10.4-upgrade-18-dev-a0f4883.0+a0f4883",
46
+ "@agoric/inter-protocol": "0.16.2-upgrade-18-dev-a0f4883.0+a0f4883",
47
+ "@agoric/orchestration": "0.1.1-upgrade-18-dev-a0f4883.0+a0f4883",
48
+ "@agoric/store": "0.9.3-upgrade-18-dev-a0f4883.0+a0f4883",
49
+ "@agoric/swing-store": "0.9.2-upgrade-18-dev-a0f4883.0+a0f4883",
50
+ "@agoric/swingset-liveslots": "0.10.3-upgrade-18-dev-a0f4883.0+a0f4883",
51
+ "@agoric/time": "0.3.3-upgrade-18-dev-a0f4883.0+a0f4883",
52
52
  "@endo/errors": "^1.2.7",
53
53
  "ava": "^5.3.0",
54
54
  "c8": "^9.1.0"
@@ -81,5 +81,5 @@
81
81
  "typeCoverage": {
82
82
  "atLeast": 82.43
83
83
  },
84
- "gitHead": "d7c994b8d33c0cd22b257f3e33b579588ab6c6d8"
84
+ "gitHead": "a0f4883edbdc9809543c6f63a6a49d5390b40902"
85
85
  }
@@ -6,16 +6,19 @@
6
6
  * where [ENVIRONMENT] is one of the following:
7
7
  * - MAINNET
8
8
  * - DEVNET
9
+ * - EMERYNET
9
10
  * - A3P_INTEGRATION
10
11
  * - BOOTSTRAP_TEST
11
12
  *
12
13
  * Example:
13
14
  * agoric run replace-electorate-core.js MAINNET
14
15
  */
15
- /* global process */
16
16
  import { makeHelpers } from '@agoric/deploy-script-support';
17
17
  import { getManifestForReplaceAllElectorates } from '@agoric/inter-protocol/src/proposals/replaceElectorate.js';
18
18
 
19
+ /** @typedef {Parameters<typeof import('@agoric/inter-protocol/src/proposals/replaceElectorate.js').replaceAllElectorates>[1]['options']} ReplaceElectorateOptions */
20
+
21
+ /** @type {Record<string, ReplaceElectorateOptions>} */
19
22
  const configurations = {
20
23
  MAINNET: {
21
24
  committeeName: 'Economic Committee',
@@ -45,6 +48,18 @@ const configurations = {
45
48
  addressesToRemove: ['agoric1w8wktaur4zf8qmmtn3n7x3r0jhsjkjntcm3u6h'],
46
49
  },
47
50
  },
51
+ EMERYNET: {
52
+ committeeName: 'Economic Committee',
53
+ voterAddresses: {
54
+ gov1: 'agoric1ldmtatp24qlllgxmrsjzcpe20fvlkp448zcuce',
55
+ gov2: 'agoric140dmkrz2e42ergjj7gyvejhzmjzurvqeq82ang',
56
+ gov4: 'agoric1f0h5zgxyg3euxsqzs0506uj4cmu56y30pqx46s',
57
+ },
58
+ highPrioritySendersConfig: {
59
+ addressesToAdd: ['agoric1f0h5zgxyg3euxsqzs0506uj4cmu56y30pqx46s'],
60
+ addressesToRemove: ['agoric1w8wktaur4zf8qmmtn3n7x3r0jhsjkjntcm3u6h'],
61
+ },
62
+ },
48
63
  A3P_INTEGRATION: {
49
64
  committeeName: 'Economic Committee',
50
65
  voterAddresses: {
@@ -76,20 +91,33 @@ const configurations = {
76
91
  };
77
92
 
78
93
  const { keys } = Object;
79
- const Usage = `agoric run replace-electorate-core.js ${keys(configurations).join(' | ')}`;
94
+ const knownVariants = keys(configurations);
95
+
80
96
  /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
81
97
  export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
82
- const config = configurations[opts.variant];
98
+ const config = opts.config || configurations[opts.variant];
83
99
  if (!config) {
84
- console.error(Usage);
85
- process.exit(1);
100
+ const error = `Unknown variant "${opts.variant}". Expected one of ${knownVariants.join(', ')}`;
101
+ console.error(error);
102
+ throw Error(error);
86
103
  }
104
+ const { committeeName, voterAddresses, highPrioritySendersConfig } = config;
105
+ console.log(
106
+ 'Generating replace committee proposal with config',
107
+ JSON.stringify({
108
+ committeeName,
109
+ voterAddresses,
110
+ highPrioritySendersConfig,
111
+ }),
112
+ );
87
113
  return harden({
88
114
  sourceSpec: '@agoric/inter-protocol/src/proposals/replaceElectorate.js',
89
115
  getManifestCall: [
90
116
  getManifestForReplaceAllElectorates.name,
91
117
  {
92
- ...config,
118
+ committeeName,
119
+ voterAddresses,
120
+ highPrioritySendersConfig,
93
121
  economicCommitteeRef: publishRef(
94
122
  install(
95
123
  '@agoric/governance/src/committee.js',
@@ -101,15 +129,35 @@ export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
101
129
  });
102
130
  };
103
131
 
132
+ const Usage = `agoric run replace-electorate-core.js ${[...knownVariants, '<json-config>'].join(' | ')}`;
133
+
104
134
  /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
105
135
  export default async (homeP, endowments) => {
106
136
  const { scriptArgs } = endowments;
107
- const variant = scriptArgs?.[0];
108
- console.log('replace-committee', scriptArgs, variant);
137
+ const variantOrConfig = scriptArgs?.[0];
138
+ console.log('replace-electorate-core.js', variantOrConfig);
139
+
140
+ const opts = {};
141
+
142
+ if (typeof variantOrConfig === 'string') {
143
+ if (variantOrConfig[0] === '{') {
144
+ try {
145
+ opts.config = JSON.parse(variantOrConfig);
146
+ } catch (err) {
147
+ throw Error(`Failed to parse config argument ${variantOrConfig}`);
148
+ }
149
+ } else {
150
+ opts.variant = variantOrConfig;
151
+ }
152
+ } else {
153
+ console.error(Usage);
154
+ throw Error(Usage);
155
+ }
109
156
 
110
157
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
111
158
 
112
- await writeCoreEval(`replace-committee-${variant}`, (utils, opts) =>
113
- defaultProposalBuilder(utils, { ...opts, variant }),
159
+ await writeCoreEval(
160
+ `replace-committee-${opts.variant || 'from-config'}`,
161
+ utils => defaultProposalBuilder(utils, opts),
114
162
  );
115
163
  };
@@ -13,7 +13,7 @@ const configurations = {
13
13
  ],
14
14
  inBrandNames: ['ATOM', 'stATOM'],
15
15
  },
16
- main: {
16
+ MAINNET: {
17
17
  oracleAddresses: [
18
18
  'agoric144rrhh4m09mh7aaffhm6xy223ym76gve2x7y78', // DSRV
19
19
  'agoric19d6gnr9fyp6hev4tlrg87zjrzsd5gzr5qlfq2p', // Stakin
@@ -24,7 +24,7 @@ const configurations = {
24
24
  inBrandNames: ['ATOM', 'stATOM', 'stOSMO', 'stTIA', 'stkATOM'],
25
25
  contractTerms: { minSubmissionCount: 3 },
26
26
  },
27
- devnet: {
27
+ DEVNET: {
28
28
  oracleAddresses: [
29
29
  'agoric1lw4e4aas9q84tq0q92j85rwjjjapf8dmnllnft', // DSRV
30
30
  'agoric1zj6vrrrjq4gsyr9lw7dplv4vyejg3p8j2urm82', // Stakin
@@ -34,23 +34,39 @@ const configurations = {
34
34
  ],
35
35
  inBrandNames: ['ATOM', 'stTIA', 'stkATOM'],
36
36
  },
37
+ EMERYNET: {
38
+ oracleAddresses: [
39
+ 'agoric1ldmtatp24qlllgxmrsjzcpe20fvlkp448zcuce', // GOV1
40
+ 'agoric140dmkrz2e42ergjj7gyvejhzmjzurvqeq82ang', // GOV2
41
+ ],
42
+ inBrandNames: ['ATOM', 'stATOM', 'stOSMO', 'stTIA', 'stkATOM'],
43
+ },
37
44
  };
38
45
 
39
46
  const { keys } = Object;
40
- const Usage = `agoric run updatePriceFeed.js ${keys(configurations).join(' | ')}`;
47
+ const knownVariants = keys(configurations);
48
+
41
49
  /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
42
50
  export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
43
- const config = configurations[opts.variant];
51
+ const config = opts.config || configurations[opts.variant];
44
52
  if (!config) {
45
- console.error(Usage);
46
- throw Error(Usage);
53
+ const error = `Unknown variant "${opts.variant}". Expected one of ${knownVariants.join(', ')}`;
54
+ console.error(error);
55
+ throw Error(error);
47
56
  }
57
+ const { oracleAddresses, inBrandNames, contractTerms } = config;
58
+ console.log(
59
+ 'Generating price feeds update proposal with config',
60
+ JSON.stringify({ oracleAddresses, inBrandNames, contractTerms }),
61
+ );
48
62
  return harden({
49
63
  sourceSpec: '@agoric/inter-protocol/src/proposals/deploy-price-feeds.js',
50
64
  getManifestCall: [
51
65
  getManifestForPriceFeeds.name,
52
66
  {
53
- ...config,
67
+ oracleAddresses,
68
+ inBrandNames,
69
+ contractTerms,
54
70
  priceAggregatorRef: publishRef(
55
71
  install(
56
72
  '@agoric/inter-protocol/src/price/fluxAggregatorContract.js',
@@ -68,15 +84,35 @@ export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
68
84
  });
69
85
  };
70
86
 
87
+ const Usage = `agoric run updatePriceFeeds.js ${[...knownVariants, '<json-config>'].join(' | ')}`;
88
+
71
89
  /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
72
90
  export default async (homeP, endowments) => {
73
91
  const { scriptArgs } = endowments;
74
- const variant = scriptArgs?.[0];
75
- console.log('updatePriceFeeds', scriptArgs, variant);
92
+ const variantOrConfig = scriptArgs?.[0];
93
+ console.log('updatePriceFeeds.js', variantOrConfig);
94
+
95
+ const opts = {};
96
+
97
+ if (typeof variantOrConfig === 'string') {
98
+ if (variantOrConfig[0] === '{') {
99
+ try {
100
+ opts.config = JSON.parse(variantOrConfig);
101
+ } catch (err) {
102
+ throw Error(`Failed to parse config argument ${variantOrConfig}`);
103
+ }
104
+ } else {
105
+ opts.variant = variantOrConfig;
106
+ }
107
+ } else {
108
+ console.error(Usage);
109
+ throw Error(Usage);
110
+ }
76
111
 
77
112
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
78
113
 
79
- await writeCoreEval(`gov-price-feeds-${variant}`, (utils, opts) =>
80
- defaultProposalBuilder(utils, { ...opts, variant }),
114
+ await writeCoreEval(
115
+ `gov-price-feeds-${opts.variant || 'from-config'}`,
116
+ utils => defaultProposalBuilder(utils, opts),
81
117
  );
82
118
  };