@agoric/inter-protocol 0.16.2-dev-6e25d9f.0 → 0.16.2-dev-d35659b.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 +15 -15
- package/src/proposals/add-auction.d.ts +6 -1
- package/src/proposals/add-auction.d.ts.map +1 -1
- package/src/proposals/add-auction.js +17 -1
- package/src/proposals/deploy-price-feeds.d.ts +6 -1
- package/src/proposals/deploy-price-feeds.d.ts.map +1 -1
- package/src/proposals/deploy-price-feeds.js +28 -3
- package/src/proposals/replaceElectorate.d.ts +7 -0
- package/src/proposals/replaceElectorate.d.ts.map +1 -1
- package/src/proposals/replaceElectorate.js +35 -5
- package/src/proposals/utils.d.ts +1 -0
- package/src/proposals/utils.d.ts.map +1 -1
- package/src/proposals/utils.js +20 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/inter-protocol",
|
|
3
|
-
"version": "0.16.2-dev-
|
|
3
|
+
"version": "0.16.2-dev-d35659b.0+d35659b",
|
|
4
4
|
"description": "Core cryptoeconomy contracts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
35
|
-
"@agoric/governance": "0.10.4-dev-
|
|
36
|
-
"@agoric/internal": "0.3.3-dev-
|
|
37
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
38
|
-
"@agoric/store": "0.9.3-dev-
|
|
39
|
-
"@agoric/time": "0.3.3-dev-
|
|
40
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
41
|
-
"@agoric/vats": "0.15.2-dev-
|
|
42
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
43
|
-
"@agoric/zone": "0.2.3-dev-
|
|
34
|
+
"@agoric/ertp": "0.16.3-dev-d35659b.0+d35659b",
|
|
35
|
+
"@agoric/governance": "0.10.4-dev-d35659b.0+d35659b",
|
|
36
|
+
"@agoric/internal": "0.3.3-dev-d35659b.0+d35659b",
|
|
37
|
+
"@agoric/notifier": "0.6.3-dev-d35659b.0+d35659b",
|
|
38
|
+
"@agoric/store": "0.9.3-dev-d35659b.0+d35659b",
|
|
39
|
+
"@agoric/time": "0.3.3-dev-d35659b.0+d35659b",
|
|
40
|
+
"@agoric/vat-data": "0.5.3-dev-d35659b.0+d35659b",
|
|
41
|
+
"@agoric/vats": "0.15.2-dev-d35659b.0+d35659b",
|
|
42
|
+
"@agoric/zoe": "0.26.3-dev-d35659b.0+d35659b",
|
|
43
|
+
"@agoric/zone": "0.2.3-dev-d35659b.0+d35659b",
|
|
44
44
|
"@endo/captp": "^4.4.3",
|
|
45
45
|
"@endo/errors": "^1.2.8",
|
|
46
46
|
"@endo/eventual-send": "^1.2.8",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"jessie.js": "^0.3.4"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@agoric/smart-wallet": "0.5.4-dev-
|
|
55
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
56
|
-
"@agoric/swingset-vat": "0.32.3-dev-
|
|
54
|
+
"@agoric/smart-wallet": "0.5.4-dev-d35659b.0+d35659b",
|
|
55
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-d35659b.0+d35659b",
|
|
56
|
+
"@agoric/swingset-vat": "0.32.3-dev-d35659b.0+d35659b",
|
|
57
57
|
"@endo/bundle-source": "^3.5.0",
|
|
58
58
|
"@endo/init": "^1.1.7",
|
|
59
59
|
"@endo/promise-kit": "^1.1.8",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"typeCoverage": {
|
|
85
85
|
"atLeast": 95.58
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "d35659b6ab227f11f952d864d38add58dd464825"
|
|
88
88
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function addAuction({ consume: { agoricNamesAdmin, auctioneerKit: legacyKitP, board, chainStorage, chainTimerService, economicCommitteeCreatorFacet: electorateCreatorFacet, governedContractKits: governedContractKitsP, priceAuthority8400, zoe, }, produce: { auctioneerKit: produceAuctioneerKit, auctionUpgradeNewInstance, auctionUpgradeNewGovCreator, newContractGovBundleId, }, instance: { consume: { reserve: reserveInstance }, produce: { auctioneer: auctionInstance }, }, installation: { consume: { auctioneer: auctioneerInstallationP }, }, issuer: { consume: { [Stable.symbol]: stableIssuerP }, }, }: import("./econ-behaviors.js").EconomyBootstrapPowers & interlockPowers, { options: { contractGovernorRef: contractGovernorBundle, contractGovernorInstallation, }, }: {
|
|
1
|
+
export function addAuction({ consume: { agoricNamesAdmin, auctioneerKit: legacyKitP, board, chainStorage, chainTimerService, economicCommitteeCreatorFacet: electorateCreatorFacet, governedContractKits: governedContractKitsP, priceAuthority8400, retiredContractInstances: retiredContractInstancesP, zoe, }, produce: { auctioneerKit: produceAuctioneerKit, auctionUpgradeNewInstance, auctionUpgradeNewGovCreator, newContractGovBundleId, retiredContractInstances: produceRetiredInstances, }, instance: { consume: { reserve: reserveInstance }, produce: { auctioneer: auctionInstance }, }, installation: { consume: { auctioneer: auctioneerInstallationP }, }, issuer: { consume: { [Stable.symbol]: stableIssuerP }, }, }: import("./econ-behaviors.js").EconomyBootstrapPowers & interlockPowers, { options: { contractGovernorRef: contractGovernorBundle, contractGovernorInstallation, }, }: {
|
|
2
2
|
options: {
|
|
3
3
|
contractGovernorRef: {
|
|
4
4
|
bundleID: string;
|
|
@@ -18,6 +18,7 @@ export const ADD_AUCTION_MANIFEST: {
|
|
|
18
18
|
economicCommitteeCreatorFacet: boolean;
|
|
19
19
|
governedContractKits: boolean;
|
|
20
20
|
priceAuthority8400: boolean;
|
|
21
|
+
retiredContractInstances: boolean;
|
|
21
22
|
zoe: boolean;
|
|
22
23
|
};
|
|
23
24
|
produce: {
|
|
@@ -25,6 +26,7 @@ export const ADD_AUCTION_MANIFEST: {
|
|
|
25
26
|
auctionUpgradeNewInstance: boolean;
|
|
26
27
|
auctionUpgradeNewGovCreator: boolean;
|
|
27
28
|
newContractGovBundleId: boolean;
|
|
29
|
+
retiredContractInstances: boolean;
|
|
28
30
|
};
|
|
29
31
|
instance: {
|
|
30
32
|
consume: {
|
|
@@ -62,6 +64,7 @@ export function getManifestForAddAuction({ restoreRef }: {
|
|
|
62
64
|
economicCommitteeCreatorFacet: boolean;
|
|
63
65
|
governedContractKits: boolean;
|
|
64
66
|
priceAuthority8400: boolean;
|
|
67
|
+
retiredContractInstances: boolean;
|
|
65
68
|
zoe: boolean;
|
|
66
69
|
};
|
|
67
70
|
produce: {
|
|
@@ -69,6 +72,7 @@ export function getManifestForAddAuction({ restoreRef }: {
|
|
|
69
72
|
auctionUpgradeNewInstance: boolean;
|
|
70
73
|
auctionUpgradeNewGovCreator: boolean;
|
|
71
74
|
newContractGovBundleId: boolean;
|
|
75
|
+
retiredContractInstances: boolean;
|
|
72
76
|
};
|
|
73
77
|
instance: {
|
|
74
78
|
consume: {
|
|
@@ -104,6 +108,7 @@ export type interlockPowers = PromiseSpaceOf<{
|
|
|
104
108
|
auctionUpgradeNewInstance: Instance;
|
|
105
109
|
auctionUpgradeNewGovCreator: any;
|
|
106
110
|
newContractGovBundleId: string;
|
|
111
|
+
retiredContractInstances: MapStore<string, Instance>;
|
|
107
112
|
}>;
|
|
108
113
|
import { Stable } from '@agoric/internal/src/tokens.js';
|
|
109
114
|
//# sourceMappingURL=add-auction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-auction.d.ts","sourceRoot":"","sources":["add-auction.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add-auction.d.ts","sourceRoot":"","sources":["add-auction.js"],"names":[],"mappings":"AA4BO,0sBATI,OAAO,qBAAqB,EAAE,sBAAsB,GAC1D,eAAe,gGACT;IACN,OAAO,EAAE;QACP,mBAAmB,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC;QAC1C,4BAA4B,EAAE,YAAY,CAAC;KAC5C,CAAC;CACH,iBA0LH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCG;AASI,yDAHJ;IAAmB,UAAU,EAArB,GAAG;CACX,0CAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBb;8BArQY,cAAc,CAAC;IACvB,yBAAyB,EAAE,QAAQ,CAAC;IACpC,2BAA2B,EAAE,GAAG,CAAC;IACjC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,wBAAwB,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CACtD,CAAC;uBAbkB,gCAAgC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { deeplyFulfilledObject, makeTracer } from '@agoric/internal';
|
|
2
2
|
import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
|
|
3
|
-
import { E } from '@endo/far';
|
|
4
3
|
import { Stable } from '@agoric/internal/src/tokens.js';
|
|
4
|
+
import { E } from '@endo/far';
|
|
5
5
|
import { makeGovernedTerms as makeGovernedATerms } from '../auction/params.js';
|
|
6
|
+
import { provideRetiredInstances } from './utils.js';
|
|
6
7
|
|
|
7
8
|
const trace = makeTracer('NewAuction', true);
|
|
8
9
|
|
|
@@ -11,6 +12,7 @@ const trace = makeTracer('NewAuction', true);
|
|
|
11
12
|
* auctionUpgradeNewInstance: Instance;
|
|
12
13
|
* auctionUpgradeNewGovCreator: any;
|
|
13
14
|
* newContractGovBundleId: string;
|
|
15
|
+
* retiredContractInstances: MapStore<string, Instance>;
|
|
14
16
|
* }>} interlockPowers
|
|
15
17
|
*/
|
|
16
18
|
|
|
@@ -35,6 +37,7 @@ export const addAuction = async (
|
|
|
35
37
|
economicCommitteeCreatorFacet: electorateCreatorFacet,
|
|
36
38
|
governedContractKits: governedContractKitsP,
|
|
37
39
|
priceAuthority8400,
|
|
40
|
+
retiredContractInstances: retiredContractInstancesP,
|
|
38
41
|
zoe,
|
|
39
42
|
},
|
|
40
43
|
produce: {
|
|
@@ -42,6 +45,7 @@ export const addAuction = async (
|
|
|
42
45
|
auctionUpgradeNewInstance,
|
|
43
46
|
auctionUpgradeNewGovCreator,
|
|
44
47
|
newContractGovBundleId,
|
|
48
|
+
retiredContractInstances: produceRetiredInstances,
|
|
45
49
|
},
|
|
46
50
|
instance: {
|
|
47
51
|
consume: { reserve: reserveInstance },
|
|
@@ -79,6 +83,16 @@ export const addAuction = async (
|
|
|
79
83
|
auctioneerInstallationP,
|
|
80
84
|
]);
|
|
81
85
|
|
|
86
|
+
const retiredInstances = await provideRetiredInstances(
|
|
87
|
+
retiredContractInstancesP,
|
|
88
|
+
produceRetiredInstances,
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
// save the auctioneer instance so we can manage it later
|
|
92
|
+
const boardID = await E(board).getId(legacyKit.instance);
|
|
93
|
+
const identifier = `auctioneer-${boardID}`;
|
|
94
|
+
retiredInstances.init(identifier, legacyKit.instance);
|
|
95
|
+
|
|
82
96
|
// Each field has an extra layer of type + value:
|
|
83
97
|
// AuctionStartDelay: { type: 'relativeTime', value: { relValue: 2n, timerBrand: Object [Alleged: timerBrand] {} } }
|
|
84
98
|
/** @type {any} */
|
|
@@ -210,6 +224,7 @@ export const ADD_AUCTION_MANIFEST = harden({
|
|
|
210
224
|
economicCommitteeCreatorFacet: true,
|
|
211
225
|
governedContractKits: true,
|
|
212
226
|
priceAuthority8400: true,
|
|
227
|
+
retiredContractInstances: true,
|
|
213
228
|
zoe: true,
|
|
214
229
|
},
|
|
215
230
|
produce: {
|
|
@@ -217,6 +232,7 @@ export const ADD_AUCTION_MANIFEST = harden({
|
|
|
217
232
|
auctionUpgradeNewInstance: true,
|
|
218
233
|
auctionUpgradeNewGovCreator: true,
|
|
219
234
|
newContractGovBundleId: true,
|
|
235
|
+
retiredContractInstances: true,
|
|
220
236
|
},
|
|
221
237
|
instance: {
|
|
222
238
|
consume: { reserve: true },
|
|
@@ -4,7 +4,9 @@ export function ensureOracleBrand({ namedVat: { consume: { agoricNames }, }, ora
|
|
|
4
4
|
name: string;
|
|
5
5
|
decimalPlaces: number;
|
|
6
6
|
}): Promise<Brand<"nat">>;
|
|
7
|
-
export function deployPriceFeeds(powers: EconomyBootstrapPowers & NamedVatPowers
|
|
7
|
+
export function deployPriceFeeds(powers: EconomyBootstrapPowers & NamedVatPowers & PromiseSpaceOf<{
|
|
8
|
+
retiredContractInstances: MapStore<string, Instance>;
|
|
9
|
+
}>, config: {
|
|
8
10
|
options: PriceFeedConfig & {
|
|
9
11
|
priceAggregatorRef: {
|
|
10
12
|
bundleID: string;
|
|
@@ -39,6 +41,7 @@ export function getManifestForPriceFeeds({ restoreRef: _restoreRef }: {
|
|
|
39
41
|
namesByAddressAdmin: string;
|
|
40
42
|
priceAuthority: string;
|
|
41
43
|
priceAuthorityAdmin: string;
|
|
44
|
+
retiredContractInstances: string;
|
|
42
45
|
startGovernedUpgradable: string;
|
|
43
46
|
startUpgradable: string;
|
|
44
47
|
zoe: string;
|
|
@@ -50,12 +53,14 @@ export function getManifestForPriceFeeds({ restoreRef: _restoreRef }: {
|
|
|
50
53
|
};
|
|
51
54
|
instance: {
|
|
52
55
|
produce: string;
|
|
56
|
+
consume: string;
|
|
53
57
|
};
|
|
54
58
|
oracleBrand: {
|
|
55
59
|
produce: string;
|
|
56
60
|
};
|
|
57
61
|
produce: {
|
|
58
62
|
priceAuthority8400: string;
|
|
63
|
+
retiredContractInstances: string;
|
|
59
64
|
};
|
|
60
65
|
};
|
|
61
66
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-price-feeds.d.ts","sourceRoot":"","sources":["deploy-price-feeds.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deploy-price-feeds.d.ts","sourceRoot":"","sources":["deploy-price-feeds.js"],"names":[],"mappings":"AAeA,8BAA8B;AAC9B,qCADW,eAAe,CAQxB;AA4CK,8HAJI,sBAAsB,GAAG,cAAc,2BACvC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GACrC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAmBjC;AAgJM,yCAdI,sBAAsB,GAC5B,cAAc,GACd,cAAc,CAAC;IAAE,wBAAwB,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;CAAE,CAAC,UAClE;IACN,OAAO,EAAE,eAAe,GAAG;QACzB,kBAAkB,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC;QACzC,WAAW,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC;QAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,aAAa,CAAC,EAAE,eAAe,CAAC;QAChC,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH,iBAoEH;AAWM,sEAHJ;IAAmB,UAAU,EAArB,GAAG;CACX,oBAAQ,eAAe,GAAG;IAAE,kBAAkB,EAAE,GAAG,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA9QlC,MAAM,EAAE;sBACX,MAAM,EAAE;wBACN,OAAO,CAAC,eAAe,CAAC;4BA4QM,GAAG;;GAqCpD;8BApTW;IACR,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CAC1C;qCAV+B,uDAAuD;4CADhD,qBAAqB"}
|
|
@@ -5,6 +5,7 @@ import { E } from '@endo/far';
|
|
|
5
5
|
import { unitAmount } from '@agoric/zoe/src/contractSupport/priceQuote.js';
|
|
6
6
|
import {
|
|
7
7
|
oracleBrandFeedName,
|
|
8
|
+
provideRetiredInstances,
|
|
8
9
|
reserveThenDeposit,
|
|
9
10
|
sanitizePathSegment,
|
|
10
11
|
} from './utils.js';
|
|
@@ -84,7 +85,8 @@ export const ensureOracleBrand = async (
|
|
|
84
85
|
};
|
|
85
86
|
|
|
86
87
|
/**
|
|
87
|
-
* @param {EconomyBootstrapPowers
|
|
88
|
+
* @param {EconomyBootstrapPowers &
|
|
89
|
+
* PromiseSpaceOf<{ retiredContractInstances: MapStore<string, Instance> }>} powers
|
|
88
90
|
* @param {{
|
|
89
91
|
* AGORIC_INSTANCE_NAME: string;
|
|
90
92
|
* contractTerms: import('@agoric/inter-protocol/src/price/fluxAggregatorKit.js').ChainlinkConfig;
|
|
@@ -96,6 +98,7 @@ export const ensureOracleBrand = async (
|
|
|
96
98
|
const startPriceAggregatorInstance = async (
|
|
97
99
|
{
|
|
98
100
|
consume: {
|
|
101
|
+
agoricNames,
|
|
99
102
|
board,
|
|
100
103
|
chainStorage,
|
|
101
104
|
chainTimerService,
|
|
@@ -103,8 +106,10 @@ const startPriceAggregatorInstance = async (
|
|
|
103
106
|
highPrioritySendersManager,
|
|
104
107
|
namesByAddressAdmin,
|
|
105
108
|
startGovernedUpgradable,
|
|
109
|
+
retiredContractInstances: retiredContractInstancesP,
|
|
106
110
|
},
|
|
107
111
|
instance: { produce: produceInstance },
|
|
112
|
+
produce: { retiredContractInstances: produceRetiredInstances },
|
|
108
113
|
},
|
|
109
114
|
{ AGORIC_INSTANCE_NAME, contractTerms, brandIn, brandOut },
|
|
110
115
|
installation,
|
|
@@ -139,6 +144,22 @@ const startPriceAggregatorInstance = async (
|
|
|
139
144
|
// @ts-expect-error GovernableStartFn vs. fluxAggregatorContract.js start
|
|
140
145
|
installation,
|
|
141
146
|
});
|
|
147
|
+
const retiredContractInstances = await provideRetiredInstances(
|
|
148
|
+
retiredContractInstancesP,
|
|
149
|
+
produceRetiredInstances,
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
// save the instance so we can manage it later
|
|
153
|
+
const retiringInstance = await E(agoricNames).lookup(
|
|
154
|
+
'instance',
|
|
155
|
+
AGORIC_INSTANCE_NAME,
|
|
156
|
+
);
|
|
157
|
+
const boardID = await E(board).getId(retiringInstance);
|
|
158
|
+
retiredContractInstances.init(
|
|
159
|
+
`priceFeed-${AGORIC_INSTANCE_NAME}-${boardID}`,
|
|
160
|
+
retiringInstance,
|
|
161
|
+
);
|
|
162
|
+
|
|
142
163
|
produceInstance[AGORIC_INSTANCE_NAME].reset();
|
|
143
164
|
produceInstance[AGORIC_INSTANCE_NAME].resolve(governedKit.instance);
|
|
144
165
|
trace(
|
|
@@ -191,7 +212,9 @@ const distributeInvitations = async (
|
|
|
191
212
|
};
|
|
192
213
|
|
|
193
214
|
/**
|
|
194
|
-
* @param {EconomyBootstrapPowers &
|
|
215
|
+
* @param {EconomyBootstrapPowers &
|
|
216
|
+
* NamedVatPowers &
|
|
217
|
+
* PromiseSpaceOf<{ retiredContractInstances: MapStore<string, Instance> }>} powers
|
|
195
218
|
* @param {{
|
|
196
219
|
* options: PriceFeedConfig & {
|
|
197
220
|
* priceAggregatorRef: { bundleID: string };
|
|
@@ -300,6 +323,7 @@ export const getManifestForPriceFeeds = async (
|
|
|
300
323
|
namesByAddressAdmin: t,
|
|
301
324
|
priceAuthority: t,
|
|
302
325
|
priceAuthorityAdmin: t,
|
|
326
|
+
retiredContractInstances: t,
|
|
303
327
|
startGovernedUpgradable: t,
|
|
304
328
|
startUpgradable: t,
|
|
305
329
|
zoe: t,
|
|
@@ -307,9 +331,10 @@ export const getManifestForPriceFeeds = async (
|
|
|
307
331
|
installation: { produce: { priceAggregator: t } },
|
|
308
332
|
instance: {
|
|
309
333
|
produce: t,
|
|
334
|
+
consume: t,
|
|
310
335
|
},
|
|
311
336
|
oracleBrand: { produce: t },
|
|
312
|
-
produce: { priceAuthority8400: t },
|
|
337
|
+
produce: { priceAuthority8400: t, retiredContractInstances: t },
|
|
313
338
|
},
|
|
314
339
|
},
|
|
315
340
|
options: { ...priceFeedOptions },
|
|
@@ -14,6 +14,7 @@ export function getManifestForReplaceAllElectorates({ economicCommitteeRef: _eco
|
|
|
14
14
|
manifest: {
|
|
15
15
|
[x: string]: {
|
|
16
16
|
consume: {
|
|
17
|
+
agoricNames: boolean;
|
|
17
18
|
auctionUpgradeNewGovCreator: boolean;
|
|
18
19
|
auctionUpgradeNewInstance: boolean;
|
|
19
20
|
psmKit: boolean;
|
|
@@ -21,6 +22,7 @@ export function getManifestForReplaceAllElectorates({ economicCommitteeRef: _eco
|
|
|
21
22
|
chainStorage: boolean;
|
|
22
23
|
highPrioritySendersManager: boolean;
|
|
23
24
|
namesByAddressAdmin: boolean;
|
|
25
|
+
retiredContractInstances: boolean;
|
|
24
26
|
board: boolean;
|
|
25
27
|
startUpgradable: boolean;
|
|
26
28
|
};
|
|
@@ -29,6 +31,7 @@ export function getManifestForReplaceAllElectorates({ economicCommitteeRef: _eco
|
|
|
29
31
|
economicCommitteeKit: boolean;
|
|
30
32
|
economicCommitteeCreatorFacet: boolean;
|
|
31
33
|
auctionUpgradeNewGovCreator: boolean;
|
|
34
|
+
retiredContractInstances: boolean;
|
|
32
35
|
};
|
|
33
36
|
installation: {
|
|
34
37
|
consume: {
|
|
@@ -42,6 +45,9 @@ export function getManifestForReplaceAllElectorates({ economicCommitteeRef: _eco
|
|
|
42
45
|
economicCommittee: boolean;
|
|
43
46
|
econCommitteeCharter: boolean;
|
|
44
47
|
};
|
|
48
|
+
consume: {
|
|
49
|
+
economicCommittee: boolean;
|
|
50
|
+
};
|
|
45
51
|
};
|
|
46
52
|
};
|
|
47
53
|
};
|
|
@@ -50,6 +56,7 @@ export function getManifestForReplaceAllElectorates({ economicCommitteeRef: _eco
|
|
|
50
56
|
export type interlockPowers = PromiseSpaceOf<{
|
|
51
57
|
auctionUpgradeNewInstance: Instance;
|
|
52
58
|
auctionUpgradeNewGovCreator: any;
|
|
59
|
+
retiredContractInstances: MapStore<string, Instance>;
|
|
53
60
|
}>;
|
|
54
61
|
import type { EconomyBootstrapPowers } from './econ-behaviors.js';
|
|
55
62
|
//# sourceMappingURL=replaceElectorate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replaceElectorate.d.ts","sourceRoot":"","sources":["replaceElectorate.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"replaceElectorate.d.ts","sourceRoot":"","sources":["replaceElectorate.js"],"names":[],"mappings":"AAkbO,uDAlBI,sBAAsB,GAAG,eAAe,UAGxC;IACN,OAAO,EAAE;QACP,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACvC,yBAAyB,EAAE;YACzB,cAAc,EAAE,MAAM,EAAE,CAAC;YACzB,iBAAiB,EAAE,MAAM,EAAE,CAAC;SAC7B,CAAC;KACH,CAAC;CACH,GAGS,OAAO,CAAC,IAAI,CAAC,CAuEzB;AAIM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CL;8BAzNW,cAAc,CAAC;IACvB,yBAAyB,EAAE,QAAQ,CAAC;IACpC,2BAA2B,EAAE,GAAG,CAAC;IACjC,wBAAwB,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CACtD,CAAC;4CA9TqC,qBAAqB"}
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
assertPathSegment,
|
|
16
16
|
makeStorageNodeChild,
|
|
17
17
|
} from '@agoric/internal/src/lib-chainStorage.js';
|
|
18
|
-
import { reserveThenDeposit } from './utils.js';
|
|
18
|
+
import { provideRetiredInstances, reserveThenDeposit } from './utils.js';
|
|
19
19
|
|
|
20
20
|
/** @import {EconomyBootstrapPowers} from './econ-behaviors.js' */
|
|
21
21
|
/** @import {EconCharterStartResult} from './econ-behaviors.js' */
|
|
@@ -181,8 +181,10 @@ const inviteToEconCharter = async (
|
|
|
181
181
|
* Starts a new Economic Committee (EC) by creating an instance with the
|
|
182
182
|
* provided committee specifications.
|
|
183
183
|
*
|
|
184
|
-
* @param {EconomyBootstrapPowers
|
|
185
|
-
*
|
|
184
|
+
* @param {EconomyBootstrapPowers &
|
|
185
|
+
* PromiseSpaceOf<{ retiredContractInstances: MapStore<string, Instance> }>} powers
|
|
186
|
+
* - The resources and capabilities required to start the committee.
|
|
187
|
+
*
|
|
186
188
|
* @param {{
|
|
187
189
|
* options: {
|
|
188
190
|
* committeeName: string;
|
|
@@ -196,12 +198,22 @@ const inviteToEconCharter = async (
|
|
|
196
198
|
*/
|
|
197
199
|
const startNewEconomicCommittee = async (
|
|
198
200
|
{
|
|
199
|
-
consume: {
|
|
200
|
-
|
|
201
|
+
consume: {
|
|
202
|
+
board,
|
|
203
|
+
chainStorage,
|
|
204
|
+
startUpgradable,
|
|
205
|
+
retiredContractInstances: retiredInstancesP,
|
|
206
|
+
},
|
|
207
|
+
produce: {
|
|
208
|
+
economicCommitteeKit,
|
|
209
|
+
economicCommitteeCreatorFacet,
|
|
210
|
+
retiredContractInstances: produceRetiredInstances,
|
|
211
|
+
},
|
|
201
212
|
installation: {
|
|
202
213
|
consume: { committee },
|
|
203
214
|
},
|
|
204
215
|
instance: {
|
|
216
|
+
consume: { economicCommittee: economicCommitteeOriginalP },
|
|
205
217
|
produce: { economicCommittee },
|
|
206
218
|
},
|
|
207
219
|
},
|
|
@@ -214,6 +226,19 @@ const startNewEconomicCommittee = async (
|
|
|
214
226
|
trace(`committeeName ${committeeName}`);
|
|
215
227
|
trace(`committeeSize ${committeeSize}`);
|
|
216
228
|
|
|
229
|
+
const retiredInstances = await provideRetiredInstances(
|
|
230
|
+
retiredInstancesP,
|
|
231
|
+
produceRetiredInstances,
|
|
232
|
+
);
|
|
233
|
+
|
|
234
|
+
// Record the retired electorate instance so we can manage it later.
|
|
235
|
+
const economicCommitteeOriginal = await economicCommitteeOriginalP;
|
|
236
|
+
const boardID = await E(board).getId(economicCommitteeOriginal);
|
|
237
|
+
retiredInstances.init(
|
|
238
|
+
`economicCommittee-${boardID}`,
|
|
239
|
+
economicCommitteeOriginal,
|
|
240
|
+
);
|
|
241
|
+
|
|
217
242
|
const committeesNode = await makeStorageNodeChild(
|
|
218
243
|
chainStorage,
|
|
219
244
|
COMMITTEES_ROOT,
|
|
@@ -309,6 +334,7 @@ const startNewEconCharter = async ({
|
|
|
309
334
|
* @typedef {PromiseSpaceOf<{
|
|
310
335
|
* auctionUpgradeNewInstance: Instance;
|
|
311
336
|
* auctionUpgradeNewGovCreator: any;
|
|
337
|
+
* retiredContractInstances: MapStore<string, Instance>;
|
|
312
338
|
* }>} interlockPowers
|
|
313
339
|
*/
|
|
314
340
|
|
|
@@ -485,6 +511,7 @@ export const getManifestForReplaceAllElectorates = async (
|
|
|
485
511
|
manifest: {
|
|
486
512
|
[replaceAllElectorates.name]: {
|
|
487
513
|
consume: {
|
|
514
|
+
agoricNames: true,
|
|
488
515
|
auctionUpgradeNewGovCreator: true,
|
|
489
516
|
auctionUpgradeNewInstance: true,
|
|
490
517
|
psmKit: true,
|
|
@@ -492,6 +519,7 @@ export const getManifestForReplaceAllElectorates = async (
|
|
|
492
519
|
chainStorage: true,
|
|
493
520
|
highPrioritySendersManager: true,
|
|
494
521
|
namesByAddressAdmin: true,
|
|
522
|
+
retiredContractInstances: true,
|
|
495
523
|
// Rest of these are designed to be widely shared
|
|
496
524
|
board: true,
|
|
497
525
|
startUpgradable: true,
|
|
@@ -501,6 +529,7 @@ export const getManifestForReplaceAllElectorates = async (
|
|
|
501
529
|
economicCommitteeKit: true,
|
|
502
530
|
economicCommitteeCreatorFacet: true,
|
|
503
531
|
auctionUpgradeNewGovCreator: true,
|
|
532
|
+
retiredContractInstances: true,
|
|
504
533
|
},
|
|
505
534
|
installation: {
|
|
506
535
|
consume: {
|
|
@@ -514,6 +543,7 @@ export const getManifestForReplaceAllElectorates = async (
|
|
|
514
543
|
economicCommittee: true,
|
|
515
544
|
econCommitteeCharter: true,
|
|
516
545
|
},
|
|
546
|
+
consume: { economicCommittee: true },
|
|
517
547
|
},
|
|
518
548
|
},
|
|
519
549
|
},
|
package/src/proposals/utils.d.ts
CHANGED
|
@@ -16,4 +16,5 @@ export function oracleBrandFeedName(inBrandName: any, outBrandName: any): string
|
|
|
16
16
|
export function scaledPriceFeedName(issuerName: any): string;
|
|
17
17
|
/** @type {(name: string) => string} */
|
|
18
18
|
export const sanitizePathSegment: (name: string) => string;
|
|
19
|
+
export function provideRetiredInstances(consume: Promise<MapStore>, produce: Producer<MapStore>): Promise<MapStore>;
|
|
19
20
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.js"],"names":[],"mappings":"AAaO,mDAHI,IAAI,CAAC,OAAO,cAAc,EAAE,SAAS,CAAC,SACtC,MAAM,EAAE,EAAE,kBA+BpB;AAMM,+CAHI,IAAI,CAAC,OAAO,cAAc,EAAE,SAAS,CAAC,SACtC,MAAM,EAAE,kBAMhB;AAQI,8CALI,MAAM,uBACN,IAAI,CAAC,OAAO,cAAc,EAAE,SAAS,CAAC,QACtC,MAAM,YACN,IAAI,CAAC,OAAO,CAAC,EAAE,iBAuBzB;AA6BM,wCAPI,OAAO,CAAC;IACd,OAAO,EAAE,IAAI,CAAC,OAAO,iCAAiC,EAAE,UAAU,CAAC,CAAC;CACrE,CAAC,mCAEF;IAAkE,UAAU,EAApE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,eAAe;CAAC;;;GAoDxC;AAEM,iFACsC;AAEtC,6DAC+B;AAEtC,uCAAuC;AACvC,kCADW,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAKjC;AAUK,iDAJI,OAAO,CAAC,QAAQ,CAAC,WACjB,QAAQ,CAAC,QAAQ,CAAC,GAChB,OAAO,CAAC,QAAQ,CAAC,CAW7B"}
|
package/src/proposals/utils.js
CHANGED
|
@@ -3,6 +3,7 @@ import { E } from '@endo/far';
|
|
|
3
3
|
import { WalletName } from '@agoric/internal';
|
|
4
4
|
import { getCopyMapEntries, makeCopyMap } from '@agoric/store';
|
|
5
5
|
import { assertPathSegment } from '@agoric/internal/src/lib-chainStorage.js';
|
|
6
|
+
import { makeScalarBigMapStore } from '@agoric/vat-data';
|
|
6
7
|
|
|
7
8
|
/** @import {CopyMap} from '@endo/patterns'; */
|
|
8
9
|
|
|
@@ -171,3 +172,22 @@ export const sanitizePathSegment = name => {
|
|
|
171
172
|
assertPathSegment(candidate);
|
|
172
173
|
return candidate;
|
|
173
174
|
};
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Idempotently provide an empty MapStore for the `retiredContractInstances`
|
|
178
|
+
* value in promise space
|
|
179
|
+
*
|
|
180
|
+
* @param {Promise<MapStore>} consume
|
|
181
|
+
* @param {Producer<MapStore>} produce
|
|
182
|
+
* @returns {Promise<MapStore>}
|
|
183
|
+
*/
|
|
184
|
+
export const provideRetiredInstances = async (consume, produce) => {
|
|
185
|
+
// Promise space has no way to look for an existing value other than awaiting a promise,
|
|
186
|
+
// but it does allow extra production so it's safe to do this redundantly.
|
|
187
|
+
produce.resolve(
|
|
188
|
+
makeScalarBigMapStore('retiredContractInstances', {
|
|
189
|
+
durable: true,
|
|
190
|
+
}),
|
|
191
|
+
);
|
|
192
|
+
return consume;
|
|
193
|
+
};
|