@agoric/inter-protocol 0.17.0 → 0.17.1-upgrade-23-dev-bd79330.0.bd79330
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 +23 -27
- package/source-spec-registry.js +67 -0
- package/src/auction/util.d.ts +3 -1
- package/src/auction/util.d.ts.map +1 -1
- package/src/auction/util.js +1 -2
- package/src/clientSupport.d.ts +29 -73
- package/src/clientSupport.d.ts.map +1 -1
- package/src/clientSupport.js +25 -129
- package/src/collectFees.d.ts +4 -0
- package/src/collectFees.d.ts.map +1 -1
- package/src/collectFees.js +5 -2
- package/src/contractSupport.d.ts +10 -2
- package/src/contractSupport.d.ts.map +1 -1
- package/src/contractSupport.js +8 -3
- package/src/econCommitteeCharter.d.ts +19 -8
- package/src/econCommitteeCharter.d.ts.map +1 -1
- package/src/econCommitteeCharter.js +12 -12
- package/src/feeDistributor.d.ts +56 -52
- package/src/feeDistributor.d.ts.map +1 -1
- package/src/feeDistributor.js +5 -3
- package/src/index.js +0 -3
- package/src/interest-math.d.ts +1 -0
- package/src/interest-math.d.ts.map +1 -1
- package/src/interest-math.js +1 -2
- package/src/interest.d.ts +13 -1
- package/src/interest.d.ts.map +1 -1
- package/src/interest.js +6 -3
- package/src/price/fluxAggregatorContract.d.ts +38 -14
- package/src/price/fluxAggregatorContract.d.ts.map +1 -1
- package/src/price/fluxAggregatorContract.js +26 -12
- package/src/price/fluxAggregatorKit.d.ts +18 -8
- package/src/price/fluxAggregatorKit.d.ts.map +1 -1
- package/src/price/fluxAggregatorKit.js +22 -8
- package/src/price/priceOracleKit.d.ts +3 -1
- package/src/price/priceOracleKit.d.ts.map +1 -1
- package/src/price/priceOracleKit.js +3 -1
- package/src/price/roundsManager.d.ts +15 -8
- package/src/price/roundsManager.d.ts.map +1 -1
- package/src/price/roundsManager.js +9 -2
- package/src/proposals/addAssetToVault.js +17 -105
- package/src/proposals/committee-proposal.js +14 -14
- package/src/proposals/core-proposal.js +12 -37
- package/src/proposals/deploy-price-feeds.js +12 -5
- package/src/proposals/econ-behaviors.js +23 -154
- package/src/proposals/price-feed-proposal.js +14 -4
- package/src/proposals/replace-fee-distributor.js +8 -4
- package/src/proposals/replace-scaledPriceAuthorities.js +8 -2
- package/src/proposals/replaceElectorate.js +7 -1
- package/src/proposals/startEconCommittee.js +5 -1
- package/src/proposals/startPSM.js +15 -6
- package/src/proposals/upgrade-scaledPriceAuthorities.js +5 -0
- package/src/proposals/utils.d.ts +10 -4
- package/src/proposals/utils.d.ts.map +1 -1
- package/src/proposals/utils.js +16 -8
- package/src/proposals/withdraw-reserve-proposal.js +6 -1
- package/src/provisionPool.d.ts +36 -18
- package/src/provisionPool.d.ts.map +1 -1
- package/src/provisionPool.js +19 -12
- package/src/provisionPoolKit.d.ts +29 -77
- package/src/provisionPoolKit.d.ts.map +1 -1
- package/src/provisionPoolKit.js +33 -23
- package/src/psm/psm.d.ts +36 -24
- package/src/psm/psm.d.ts.map +1 -1
- package/src/psm/psm.js +19 -15
- package/src/reserve/assetReserve.d.ts +16 -6
- package/src/reserve/assetReserve.d.ts.map +1 -1
- package/src/reserve/assetReserve.js +17 -9
- package/src/reserve/assetReserveKit.d.ts +13 -10
- package/src/reserve/assetReserveKit.d.ts.map +1 -1
- package/src/reserve/assetReserveKit.js +7 -5
- package/src/reserve/params.d.ts +1 -1
- package/src/reserve/params.d.ts.map +1 -1
- package/src/reserve/params.js +1 -3
- package/src/vaultFactory/burn.d.ts +4 -1
- package/src/vaultFactory/burn.d.ts.map +1 -1
- package/src/vaultFactory/burn.js +5 -4
- package/src/vaultFactory/math.d.ts +2 -0
- package/src/vaultFactory/math.d.ts.map +1 -1
- package/src/vaultFactory/math.js +5 -3
- package/src/vaultFactory/orderedVaultStore.d.ts +36 -36
- package/src/vaultFactory/params.d.ts +37 -10
- package/src/vaultFactory/params.d.ts.map +1 -1
- package/src/vaultFactory/params.js +34 -13
- package/src/vaultFactory/prioritizedVaults.d.ts +98 -95
- package/src/vaultFactory/prioritizedVaults.d.ts.map +1 -1
- package/src/vaultFactory/prioritizedVaults.js +3 -2
- package/src/vaultFactory/storeUtils.d.ts +8 -3
- package/src/vaultFactory/storeUtils.d.ts.map +1 -1
- package/src/vaultFactory/storeUtils.js +8 -4
- package/src/vaultFactory/{types-ambient.d.ts → types.d.ts} +40 -40
- package/src/vaultFactory/types.d.ts.map +1 -0
- package/src/vaultFactory/{types-ambient.js → types.js} +26 -25
- package/src/vaultFactory/vault.d.ts +51 -35
- package/src/vaultFactory/vault.d.ts.map +1 -1
- package/src/vaultFactory/vault.js +29 -17
- package/src/vaultFactory/vaultDirector.d.ts +102 -112
- package/src/vaultFactory/vaultDirector.d.ts.map +1 -1
- package/src/vaultFactory/vaultDirector.js +40 -82
- package/src/vaultFactory/vaultFactory.d.ts +47 -95
- package/src/vaultFactory/vaultFactory.d.ts.map +1 -1
- package/src/vaultFactory/vaultFactory.js +27 -27
- package/src/vaultFactory/vaultHolder.d.ts +62 -55
- package/src/vaultFactory/vaultHolder.d.ts.map +1 -1
- package/src/vaultFactory/vaultHolder.js +10 -4
- package/src/vaultFactory/vaultKit.d.ts +15 -10
- package/src/vaultFactory/vaultKit.d.ts.map +1 -1
- package/src/vaultFactory/vaultKit.js +8 -7
- package/src/vaultFactory/vaultManager.d.ts +112 -262
- package/src/vaultFactory/vaultManager.d.ts.map +1 -1
- package/src/vaultFactory/vaultManager.js +42 -319
- package/NEWS.md +0 -0
- package/scripts/build-bundles.js +0 -22
- package/src/auction/auctionBook.d.ts +0 -147
- package/src/auction/auctionBook.d.ts.map +0 -1
- package/src/auction/auctionBook.js +0 -794
- package/src/auction/auctionMath.d.ts +0 -17
- package/src/auction/auctionMath.d.ts.map +0 -1
- package/src/auction/auctionMath.js +0 -81
- package/src/auction/auctioneer.d.ts +0 -70
- package/src/auction/auctioneer.d.ts.map +0 -1
- package/src/auction/auctioneer.js +0 -733
- package/src/auction/offerBook.d.ts +0 -46
- package/src/auction/offerBook.d.ts.map +0 -1
- package/src/auction/offerBook.js +0 -226
- package/src/auction/params.d.ts +0 -145
- package/src/auction/params.d.ts.map +0 -1
- package/src/auction/params.js +0 -176
- package/src/auction/scheduleMath.d.ts +0 -5
- package/src/auction/scheduleMath.d.ts.map +0 -1
- package/src/auction/scheduleMath.js +0 -169
- package/src/auction/scheduler.d.ts +0 -50
- package/src/auction/scheduler.d.ts.map +0 -1
- package/src/auction/scheduler.js +0 -376
- package/src/auction/sortedOffers.d.ts +0 -8
- package/src/auction/sortedOffers.d.ts.map +0 -1
- package/src/auction/sortedOffers.js +0 -137
- package/src/proposals/add-auction.js +0 -285
- package/src/proposals/upgrade-vaults.js +0 -207
- package/src/psm/types-ambient.d.ts +0 -2
- package/src/psm/types-ambient.d.ts.map +0 -1
- package/src/psm/types-ambient.js +0 -3
- package/src/vaultFactory/liquidation.d.ts +0 -25
- package/src/vaultFactory/liquidation.d.ts.map +0 -1
- package/src/vaultFactory/liquidation.js +0 -309
- package/src/vaultFactory/proceeds.d.ts +0 -35
- package/src/vaultFactory/proceeds.d.ts.map +0 -1
- package/src/vaultFactory/proceeds.js +0 -282
- package/src/vaultFactory/types-ambient.d.ts.map +0 -1
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
// @jessie-check
|
|
2
1
|
// @ts-check
|
|
3
2
|
|
|
4
|
-
import { q } from '@endo/errors';
|
|
5
|
-
import { ToFarFunction } from '@endo/captp';
|
|
6
|
-
import { Far } from '@endo/marshal';
|
|
7
3
|
import { AmountMath, AssetKind } from '@agoric/ertp';
|
|
4
|
+
import { parseRatio } from '@agoric/ertp/src/ratio.js';
|
|
8
5
|
import { deeplyFulfilledObject } from '@agoric/internal';
|
|
6
|
+
import { Stable } from '@agoric/internal/src/tokens.js';
|
|
9
7
|
import { makeRatio } from '@agoric/zoe/src/contractSupport/index.js';
|
|
10
|
-
import { parseRatio } from '@agoric/ertp/src/ratio.js';
|
|
11
8
|
import { E } from '@endo/far';
|
|
12
|
-
import { Stable } from '@agoric/internal/src/tokens.js';
|
|
13
|
-
import { TimeMath } from '@agoric/time/src/timeMath.js';
|
|
14
|
-
import { makePromiseKit } from '@endo/promise-kit';
|
|
15
9
|
|
|
16
10
|
import {
|
|
17
11
|
oracleBrandFeedName,
|
|
@@ -34,7 +28,14 @@ export * from './startPSM.js';
|
|
|
34
28
|
* @property {number} [initialPrice]
|
|
35
29
|
*/
|
|
36
30
|
|
|
37
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* @import {EconomyBootstrapPowers} from './econ-behaviors.js'
|
|
33
|
+
* @import {TimerService} from '@agoric/time';
|
|
34
|
+
* @import {Issuer, IssuerKit} from '@agoric/ertp';
|
|
35
|
+
* @import {prepare} from '@agoric/zoe/src/contracts/scaledPriceAuthority.js';
|
|
36
|
+
* @import {BootstrapPowers} from '@agoric/vats/src/core/types.js';
|
|
37
|
+
* @import {StartedInstanceKit} from '@agoric/zoe/src/zoeService/utils.js';
|
|
38
|
+
*/
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
41
|
* @param {BootstrapPowers} powers
|
|
@@ -124,7 +125,7 @@ export const publishInterchainAssetFromBank = async (
|
|
|
124
125
|
};
|
|
125
126
|
|
|
126
127
|
/**
|
|
127
|
-
* @param {
|
|
128
|
+
* @param {EconomyBootstrapPowers} powers
|
|
128
129
|
* @param {object} config
|
|
129
130
|
* @param {object} config.options
|
|
130
131
|
* @param {InterchainAssetOptions} config.options.interchainAssetOptions
|
|
@@ -216,6 +217,7 @@ export const startScaledPriceAuthority = async (
|
|
|
216
217
|
|
|
217
218
|
const label = scaledPriceFeedName(issuerName);
|
|
218
219
|
|
|
220
|
+
/** @type {StartedInstanceKit<prepare>} */
|
|
219
221
|
const spaKit = await E(startUpgradable)({
|
|
220
222
|
installation: scaledPriceAuthority,
|
|
221
223
|
label,
|
|
@@ -223,7 +225,6 @@ export const startScaledPriceAuthority = async (
|
|
|
223
225
|
});
|
|
224
226
|
|
|
225
227
|
await E(priceAuthorityAdmin).registerPriceAuthority(
|
|
226
|
-
// @ts-expect-error The public facet should have getPriceAuthority
|
|
227
228
|
E(spaKit.publicFacet).getPriceAuthority(),
|
|
228
229
|
interchainBrand,
|
|
229
230
|
stableBrand,
|
|
@@ -234,7 +235,7 @@ export const startScaledPriceAuthority = async (
|
|
|
234
235
|
};
|
|
235
236
|
|
|
236
237
|
/**
|
|
237
|
-
* @param {
|
|
238
|
+
* @param {EconomyBootstrapPowers} powers
|
|
238
239
|
* @param {object} config
|
|
239
240
|
* @param {object} config.options
|
|
240
241
|
*/
|
|
@@ -251,77 +252,8 @@ export const registerScaledPriceAuthority = async (powers, { options }) => {
|
|
|
251
252
|
|
|
252
253
|
// publish into agoricNames so that others can await its presence.
|
|
253
254
|
// This must stay after registerPriceAuthority above so it's evidence of registration.
|
|
254
|
-
// eslint-disable-next-line no-restricted-syntax -- computed property
|
|
255
|
-
produceInstance[label].resolve(spaKit.instance);
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
// wait a short while after end to allow things to settle
|
|
259
|
-
const BUFFER = 5n * 60n;
|
|
260
|
-
// let's insist on 20 minutes leeway for running the scripts
|
|
261
|
-
const COMPLETION = 20n * 60n;
|
|
262
255
|
|
|
263
|
-
|
|
264
|
-
* This function works around an issue identified in #8307 and #8296, and fixed
|
|
265
|
-
* in #8301. The fix is needed until #8301 makes it into production.
|
|
266
|
-
*
|
|
267
|
-
* If there is a liveSchedule, 1) run now if start is far enough away,
|
|
268
|
-
* otherwise, 2) run after endTime. If neither liveSchedule nor nextSchedule is
|
|
269
|
-
* defined, 3) run now. If there is only a nextSchedule, 4) run now if startTime
|
|
270
|
-
* is far enough away, else 5) run after endTime
|
|
271
|
-
*
|
|
272
|
-
* @param {import('../auction/scheduler.js').FullSchedule} schedules
|
|
273
|
-
* @param {ERef<import('@agoric/time').TimerService>} timer
|
|
274
|
-
* @param {() => void} thunk
|
|
275
|
-
*/
|
|
276
|
-
const whenQuiescent = async (schedules, timer, thunk) => {
|
|
277
|
-
const { nextAuctionSchedule, liveAuctionSchedule } = schedules;
|
|
278
|
-
const now = await E(timer).getCurrentTimestamp();
|
|
279
|
-
|
|
280
|
-
const waker = Far('addAssetWaker', { wake: () => thunk() });
|
|
281
|
-
|
|
282
|
-
if (liveAuctionSchedule) {
|
|
283
|
-
const safeStart = TimeMath.subtractAbsRel(
|
|
284
|
-
liveAuctionSchedule.startTime,
|
|
285
|
-
COMPLETION,
|
|
286
|
-
);
|
|
287
|
-
|
|
288
|
-
if (TimeMath.compareAbs(safeStart, now) < 0) {
|
|
289
|
-
// case 2
|
|
290
|
-
console.warn(
|
|
291
|
-
`Add Asset after live schedule's endtime: ${q(
|
|
292
|
-
liveAuctionSchedule.endTime,
|
|
293
|
-
)}`,
|
|
294
|
-
);
|
|
295
|
-
|
|
296
|
-
return E(timer).setWakeup(
|
|
297
|
-
TimeMath.addAbsRel(liveAuctionSchedule.endTime, BUFFER),
|
|
298
|
-
waker,
|
|
299
|
-
);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
if (!liveAuctionSchedule && nextAuctionSchedule) {
|
|
304
|
-
const safeStart = TimeMath.subtractAbsRel(
|
|
305
|
-
nextAuctionSchedule.startTime,
|
|
306
|
-
COMPLETION,
|
|
307
|
-
);
|
|
308
|
-
if (TimeMath.compareAbs(safeStart, now) < 0) {
|
|
309
|
-
// case 5
|
|
310
|
-
console.warn(
|
|
311
|
-
`Add Asset after next schedule's endtime: ${q(
|
|
312
|
-
nextAuctionSchedule.endTime,
|
|
313
|
-
)}`,
|
|
314
|
-
);
|
|
315
|
-
return E(timer).setWakeup(
|
|
316
|
-
TimeMath.addAbsRel(nextAuctionSchedule.endTime, BUFFER),
|
|
317
|
-
waker,
|
|
318
|
-
);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
// cases 1, 3, and 4 fall through to here.
|
|
323
|
-
console.warn(`Add Asset immediately`, thunk);
|
|
324
|
-
return thunk();
|
|
256
|
+
produceInstance[label].resolve(spaKit.instance);
|
|
325
257
|
};
|
|
326
258
|
|
|
327
259
|
/**
|
|
@@ -334,12 +266,7 @@ const whenQuiescent = async (schedules, timer, thunk) => {
|
|
|
334
266
|
*/
|
|
335
267
|
export const addAssetToVault = async (
|
|
336
268
|
{
|
|
337
|
-
consume: {
|
|
338
|
-
vaultFactoryKit,
|
|
339
|
-
agoricNamesAdmin,
|
|
340
|
-
auctioneerKit,
|
|
341
|
-
chainTimerService,
|
|
342
|
-
},
|
|
269
|
+
consume: { vaultFactoryKit, agoricNamesAdmin },
|
|
343
270
|
brand: {
|
|
344
271
|
consume: { [Stable.symbol]: stableP },
|
|
345
272
|
},
|
|
@@ -370,25 +297,11 @@ export const addAssetToVault = async (
|
|
|
370
297
|
);
|
|
371
298
|
|
|
372
299
|
// don't add the collateral offering to vaultFactory until its price feed is available
|
|
373
|
-
|
|
300
|
+
|
|
374
301
|
await consumeInstance[oracleBrandFeedName(oracleBrand, 'USD')];
|
|
375
302
|
// await also the negotiable brand
|
|
376
|
-
// eslint-disable-next-line no-restricted-syntax -- allow this computed property
|
|
377
|
-
await consumeInstance[scaledPriceFeedName(issuerName)];
|
|
378
|
-
|
|
379
|
-
const auctioneerCreator = E.get(auctioneerKit).creatorFacet;
|
|
380
|
-
const schedules = await E(auctioneerCreator).getSchedule();
|
|
381
303
|
|
|
382
|
-
|
|
383
|
-
const addBrandThenResolve = ToFarFunction('addBrandThenResolve', async () => {
|
|
384
|
-
await E(auctioneerCreator).addBrand(interchainIssuer, keyword);
|
|
385
|
-
finishPromiseKit.resolve(undefined);
|
|
386
|
-
});
|
|
387
|
-
|
|
388
|
-
// schedules actions on a timer (or does it immediately).
|
|
389
|
-
// finishPromiseKit signals completion.
|
|
390
|
-
void whenQuiescent(schedules, chainTimerService, addBrandThenResolve);
|
|
391
|
-
await finishPromiseKit.promise;
|
|
304
|
+
await consumeInstance[scaledPriceFeedName(issuerName)];
|
|
392
305
|
|
|
393
306
|
const stable = await stableP;
|
|
394
307
|
const vaultFactoryCreator = E.get(vaultFactoryKit).creatorFacet;
|
|
@@ -460,7 +373,6 @@ export const getManifestForAddAssetToVault = (
|
|
|
460
373
|
},
|
|
461
374
|
[addAssetToVault.name]: {
|
|
462
375
|
consume: {
|
|
463
|
-
auctioneerKit: 'auctioneer',
|
|
464
376
|
vaultFactoryKit: 'vaultFactory',
|
|
465
377
|
agoricNamesAdmin: true,
|
|
466
378
|
chainTimerService: true,
|
|
@@ -2,6 +2,12 @@ import { deeplyFulfilledObject } from '@agoric/internal';
|
|
|
2
2
|
import { E } from '@endo/far';
|
|
3
3
|
import { reserveThenDeposit } from './utils.js';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @import {EconomyBootstrapPowers} from './econ-behaviors.js';
|
|
7
|
+
* @import {EconCharterStartResult} from './econ-behaviors.js';
|
|
8
|
+
* @import {Invitation} from '@agoric/zoe';
|
|
9
|
+
*/
|
|
10
|
+
|
|
5
11
|
const { values } = Object;
|
|
6
12
|
|
|
7
13
|
/** @type {<X, Y>(xs: X[], ys: Y[]) => [X, Y][]} */
|
|
@@ -10,7 +16,7 @@ const zip = (xs, ys) => xs.map((x, i) => [x, ys[i]]);
|
|
|
10
16
|
const EC_HIGH_PRIORITY_SENDERS_NAMESPACE = 'economicCommittee';
|
|
11
17
|
|
|
12
18
|
/**
|
|
13
|
-
* @param {
|
|
19
|
+
* @param {EconomyBootstrapPowers} powers
|
|
14
20
|
* @param {{ options: { voterAddresses: Record<string, string> } }} param1
|
|
15
21
|
*/
|
|
16
22
|
export const inviteCommitteeMembers = async (
|
|
@@ -51,7 +57,7 @@ export const inviteCommitteeMembers = async (
|
|
|
51
57
|
|
|
52
58
|
harden(inviteCommitteeMembers);
|
|
53
59
|
|
|
54
|
-
/** @param {
|
|
60
|
+
/** @param {EconomyBootstrapPowers} powers */
|
|
55
61
|
export const startEconCharter = async ({
|
|
56
62
|
consume: { zoe },
|
|
57
63
|
produce: { econCharterKit },
|
|
@@ -72,7 +78,7 @@ export const startEconCharter = async ({
|
|
|
72
78
|
}),
|
|
73
79
|
);
|
|
74
80
|
|
|
75
|
-
/** @type {Promise<
|
|
81
|
+
/** @type {Promise<EconCharterStartResult>} */
|
|
76
82
|
const startResult = E(zoe).startInstance(
|
|
77
83
|
charterInstall,
|
|
78
84
|
undefined,
|
|
@@ -88,12 +94,12 @@ harden(startEconCharter);
|
|
|
88
94
|
/**
|
|
89
95
|
* Introduce charter to governed creator facets.
|
|
90
96
|
*
|
|
91
|
-
* @param {
|
|
97
|
+
* @param {EconomyBootstrapPowers} powers
|
|
92
98
|
*/
|
|
93
99
|
export const addGovernorsToEconCharter = async ({
|
|
94
|
-
consume: { reserveKit, vaultFactoryKit, econCharterKit
|
|
100
|
+
consume: { reserveKit, vaultFactoryKit, econCharterKit },
|
|
95
101
|
instance: {
|
|
96
|
-
consume: { reserve, VaultFactory
|
|
102
|
+
consume: { reserve, VaultFactory },
|
|
97
103
|
},
|
|
98
104
|
}) => {
|
|
99
105
|
const { creatorFacet } = E.get(econCharterKit);
|
|
@@ -110,11 +116,6 @@ export const addGovernorsToEconCharter = async ({
|
|
|
110
116
|
instanceP: VaultFactory,
|
|
111
117
|
facetP: E.get(vaultFactoryKit).governorCreatorFacet,
|
|
112
118
|
},
|
|
113
|
-
{
|
|
114
|
-
label: 'auctioneer',
|
|
115
|
-
instanceP: auctioneer,
|
|
116
|
-
facetP: E.get(auctioneerKit).governorCreatorFacet,
|
|
117
|
-
},
|
|
118
119
|
].map(async ({ label, instanceP, facetP }) => {
|
|
119
120
|
const [instance, govFacet] = await Promise.all([instanceP, facetP]);
|
|
120
121
|
|
|
@@ -126,7 +127,7 @@ export const addGovernorsToEconCharter = async ({
|
|
|
126
127
|
harden(addGovernorsToEconCharter);
|
|
127
128
|
|
|
128
129
|
/**
|
|
129
|
-
* @param {
|
|
130
|
+
* @param {EconomyBootstrapPowers} powers
|
|
130
131
|
* @param {{ options: { voterAddresses: Record<string, string> } }} param1
|
|
131
132
|
*/
|
|
132
133
|
export const inviteToEconCharter = async (
|
|
@@ -175,7 +176,6 @@ export const getManifestForInviteCommittee = async (
|
|
|
175
176
|
},
|
|
176
177
|
[addGovernorsToEconCharter.name]: {
|
|
177
178
|
consume: {
|
|
178
|
-
auctioneerKit: t,
|
|
179
179
|
econCharterKit: t,
|
|
180
180
|
zoe: t,
|
|
181
181
|
agoricNames: t,
|
|
@@ -188,7 +188,7 @@ export const getManifestForInviteCommittee = async (
|
|
|
188
188
|
consume: { binaryVoteCounter: t },
|
|
189
189
|
},
|
|
190
190
|
instance: {
|
|
191
|
-
consume: {
|
|
191
|
+
consume: { reserve: t, VaultFactory: t },
|
|
192
192
|
},
|
|
193
193
|
},
|
|
194
194
|
[inviteToEconCharter.name]: {
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
// @jessie-check
|
|
2
|
-
|
|
3
1
|
import { Stable } from '@agoric/internal/src/tokens.js';
|
|
4
2
|
import * as econBehaviors from './econ-behaviors.js';
|
|
5
3
|
import { ECON_COMMITTEE_MANIFEST } from './startEconCommittee.js';
|
|
6
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @import {EconomyBootstrapPowers} from './econ-behaviors.js';
|
|
7
|
+
* @import {BootstrapManifest} from '@agoric/vats/src/core/lib-boot.js';
|
|
8
|
+
* @import {BootstrapManifestPermit} from '@agoric/vats/src/core/lib-boot.js';
|
|
9
|
+
* @import {Instance} from '@agoric/zoe';
|
|
10
|
+
* @import {MapStore} from '@agoric/store';
|
|
11
|
+
*/
|
|
12
|
+
|
|
7
13
|
export * from './econ-behaviors.js';
|
|
8
14
|
export * from './startPSM.js';
|
|
9
15
|
export * from './startEconCommittee.js';
|
|
@@ -13,7 +19,7 @@ export * from './startEconCommittee.js';
|
|
|
13
19
|
// require updating a lot of tests. So for now, we just
|
|
14
20
|
// grab the kits afterward and store them.
|
|
15
21
|
|
|
16
|
-
/** @param {
|
|
22
|
+
/** @param {EconomyBootstrapPowers} powers */
|
|
17
23
|
export const storeInterContractStartKits = async ({
|
|
18
24
|
consume: {
|
|
19
25
|
contractKits,
|
|
@@ -21,7 +27,6 @@ export const storeInterContractStartKits = async ({
|
|
|
21
27
|
econCharterKit,
|
|
22
28
|
economicCommitteeKit,
|
|
23
29
|
feeDistributorKit,
|
|
24
|
-
auctioneerKit,
|
|
25
30
|
reserveKit,
|
|
26
31
|
vaultFactoryKit,
|
|
27
32
|
},
|
|
@@ -43,16 +48,12 @@ export const storeInterContractStartKits = async ({
|
|
|
43
48
|
econCharterKit,
|
|
44
49
|
feeDistributorKit,
|
|
45
50
|
]);
|
|
46
|
-
await storeAll(governedContractKits, [
|
|
47
|
-
auctioneerKit,
|
|
48
|
-
reserveKit,
|
|
49
|
-
vaultFactoryKit,
|
|
50
|
-
]);
|
|
51
|
+
await storeAll(governedContractKits, [reserveKit, vaultFactoryKit]);
|
|
51
52
|
};
|
|
52
53
|
|
|
53
|
-
/** @type {
|
|
54
|
+
/** @type {BootstrapManifest} */
|
|
54
55
|
const SHARED_MAIN_MANIFEST = harden({
|
|
55
|
-
/** @type {
|
|
56
|
+
/** @type {BootstrapManifestPermit} */
|
|
56
57
|
[econBehaviors.startVaultFactory.name]: {
|
|
57
58
|
consume: {
|
|
58
59
|
board: 'board',
|
|
@@ -64,7 +65,6 @@ const SHARED_MAIN_MANIFEST = harden({
|
|
|
64
65
|
priceAuthority: 'priceAuthority',
|
|
65
66
|
economicCommitteeCreatorFacet: 'economicCommittee',
|
|
66
67
|
reserveKit: 'reserve',
|
|
67
|
-
auctioneerKit: 'auction',
|
|
68
68
|
},
|
|
69
69
|
produce: { vaultFactoryKit: 'VaultFactory' },
|
|
70
70
|
brand: { consume: { [Stable.symbol]: 'zoe' } },
|
|
@@ -78,7 +78,6 @@ const SHARED_MAIN_MANIFEST = harden({
|
|
|
78
78
|
instance: {
|
|
79
79
|
consume: {
|
|
80
80
|
reserve: 'reserve',
|
|
81
|
-
auctioneer: 'auction',
|
|
82
81
|
},
|
|
83
82
|
produce: {
|
|
84
83
|
VaultFactory: 'VaultFactory',
|
|
@@ -118,28 +117,6 @@ const SHARED_MAIN_MANIFEST = harden({
|
|
|
118
117
|
},
|
|
119
118
|
},
|
|
120
119
|
|
|
121
|
-
[econBehaviors.startAuctioneer.name]: {
|
|
122
|
-
consume: {
|
|
123
|
-
zoe: 'zoe',
|
|
124
|
-
board: 'board',
|
|
125
|
-
chainTimerService: 'timer',
|
|
126
|
-
priceAuthority: 'priceAuthority',
|
|
127
|
-
chainStorage: true,
|
|
128
|
-
economicCommitteeCreatorFacet: 'economicCommittee',
|
|
129
|
-
},
|
|
130
|
-
produce: { auctioneerKit: 'auction' },
|
|
131
|
-
instance: {
|
|
132
|
-
produce: { auctioneer: 'auction' },
|
|
133
|
-
consume: { reserve: 'auction' },
|
|
134
|
-
},
|
|
135
|
-
installation: {
|
|
136
|
-
consume: { contractGovernor: 'zoe', auctioneer: 'zoe' },
|
|
137
|
-
},
|
|
138
|
-
issuer: {
|
|
139
|
-
consume: { [Stable.symbol]: 'zoe' },
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
|
|
143
120
|
[storeInterContractStartKits.name]: {
|
|
144
121
|
consume: {
|
|
145
122
|
contractKits: true,
|
|
@@ -147,7 +124,6 @@ const SHARED_MAIN_MANIFEST = harden({
|
|
|
147
124
|
econCharterKit: true,
|
|
148
125
|
economicCommitteeKit: true,
|
|
149
126
|
feeDistributorKit: true,
|
|
150
|
-
auctioneerKit: true,
|
|
151
127
|
reserveKit: true,
|
|
152
128
|
vaultFactoryKit: true,
|
|
153
129
|
},
|
|
@@ -205,7 +181,6 @@ export const getManifestForMain = (
|
|
|
205
181
|
manifest: SHARED_MAIN_MANIFEST,
|
|
206
182
|
installations: {
|
|
207
183
|
VaultFactory: restoreRef(installKeys.vaultFactory),
|
|
208
|
-
auctioneer: restoreRef(installKeys.auctioneer),
|
|
209
184
|
feeDistributor: restoreRef(installKeys.feeDistributor),
|
|
210
185
|
reserve: restoreRef(installKeys.reserve),
|
|
211
186
|
},
|
|
@@ -23,8 +23,16 @@ export const DEFAULT_CONTRACT_TERMS = {
|
|
|
23
23
|
maxSubmissionValue: 2 ** 256,
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
/**
|
|
27
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @import {EconomyBootstrapPowers} from './econ-behaviors.js';
|
|
28
|
+
* @import {ChainlinkConfig} from '@agoric/inter-protocol/src/price/fluxAggregatorKit.js';
|
|
29
|
+
* @import {StartedInstanceKit} from '@agoric/zoe/src/zoeService/utils.js';
|
|
30
|
+
* @import {Installation, Instance} from '@agoric/zoe';
|
|
31
|
+
* @import {Brand} from '@agoric/ertp';
|
|
32
|
+
* @import {MapStore} from '@agoric/store';
|
|
33
|
+
* @import {NamedVatPowers} from '@agoric/vats/src/core/types.js';
|
|
34
|
+
* @import {PromiseSpaceOf} from '@agoric/vats/src/core/types.js';
|
|
35
|
+
*/
|
|
28
36
|
/** @import {FluxStartFn} from '@agoric/inter-protocol/src/price/fluxAggregatorContract.js'; */
|
|
29
37
|
|
|
30
38
|
const trace = makeTracer('DeployPriceFeed', true);
|
|
@@ -89,7 +97,7 @@ export const ensureOracleBrand = async (
|
|
|
89
97
|
* PromiseSpaceOf<{ retiredContractInstances: MapStore<string, Instance> }>} powers
|
|
90
98
|
* @param {{
|
|
91
99
|
* AGORIC_INSTANCE_NAME: string;
|
|
92
|
-
* contractTerms:
|
|
100
|
+
* contractTerms: ChainlinkConfig;
|
|
93
101
|
* brandIn: Brand<'nat'>;
|
|
94
102
|
* brandOut: Brand<'nat'>;
|
|
95
103
|
* }} config
|
|
@@ -176,7 +184,7 @@ const startPriceAggregatorInstance = async (
|
|
|
176
184
|
);
|
|
177
185
|
trace('added', label, 'instance to econCharter');
|
|
178
186
|
|
|
179
|
-
/** @type {
|
|
187
|
+
/** @type {StartedInstanceKit<FluxStartFn>} */
|
|
180
188
|
// @ts-expect-error
|
|
181
189
|
const { instance, publicFacet, creatorFacet } = governedKit;
|
|
182
190
|
|
|
@@ -284,7 +292,6 @@ export const deployPriceFeeds = async (powers, config) => {
|
|
|
284
292
|
);
|
|
285
293
|
}
|
|
286
294
|
|
|
287
|
-
// @ts-expect-error replaceScaledPriceAuthorities uses a subset of the powers.
|
|
288
295
|
await replaceScaledPriceAuthorities(powers, {
|
|
289
296
|
options: { scaledPARef },
|
|
290
297
|
});
|