@agoric/inter-protocol 0.13.2-dev-a3f4ef3.0 → 0.13.2-dev-7ccf3ab.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/bundles/bundle-auctioneer-js-meta.json +113 -113
- package/bundles/bundle-auctioneer.js +1 -1
- package/bundles/bundle-econCommitteeCharter-js-meta.json +70 -70
- package/bundles/bundle-econCommitteeCharter.js +1 -1
- package/bundles/bundle-feeDistributor-js-meta.json +56 -56
- package/bundles/bundle-feeDistributor.js +1 -1
- package/bundles/bundle-fluxAggregatorKit-js-meta.json +108 -108
- package/bundles/bundle-fluxAggregatorKit.js +1 -1
- package/bundles/bundle-psm-js-meta.json +106 -106
- package/bundles/bundle-psm.js +1 -1
- package/bundles/bundle-reserve-js-meta.json +104 -104
- package/bundles/bundle-reserve.js +1 -1
- package/bundles/bundle-scaledPriceAuthority-js-meta.json +77 -77
- package/bundles/bundle-scaledPriceAuthority.js +1 -1
- package/bundles/bundle-stakeFactory-js-meta.json +112 -112
- package/bundles/bundle-stakeFactory.js +1 -1
- package/bundles/bundle-vaultFactory-js-meta.json +129 -129
- package/bundles/bundle-vaultFactory.js +1 -1
- package/package.json +17 -17
- package/src/econCommitteeCharter.js +2 -2
- package/src/feeDistributor.js +1 -1
- package/src/proposals/econ-behaviors.js +10 -35
- package/src/proposals/startPSM.js +1 -1
- package/src/reserve/assetReserve.js +7 -2
- package/src/stakeFactory/stakeFactory.js +7 -4
- package/src/vaultFactory/params.js +4 -4
- package/src/vaultFactory/types.js +1 -1
- package/src/vaultFactory/vaultDirector.js +2 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/inter-protocol",
|
|
3
|
-
"version": "0.13.2-dev-
|
|
3
|
+
"version": "0.13.2-dev-7ccf3ab.0+7ccf3ab",
|
|
4
4
|
"description": "Core cryptoeconomy contracts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -29,28 +29,28 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@agoric/assert": "0.5.2-dev-
|
|
33
|
-
"@agoric/ertp": "0.15.4-dev-
|
|
34
|
-
"@agoric/governance": "0.9.2-dev-
|
|
35
|
-
"@agoric/internal": "0.2.2-dev-
|
|
36
|
-
"@agoric/notifier": "0.5.2-dev-
|
|
37
|
-
"@agoric/store": "0.8.4-dev-
|
|
38
|
-
"@agoric/time": "0.2.2-dev-
|
|
39
|
-
"@agoric/vat-data": "0.4.4-dev-
|
|
40
|
-
"@agoric/vats": "0.13.1-dev-
|
|
41
|
-
"@agoric/zoe": "0.25.4-dev-
|
|
32
|
+
"@agoric/assert": "0.5.2-dev-7ccf3ab.0+7ccf3ab",
|
|
33
|
+
"@agoric/ertp": "0.15.4-dev-7ccf3ab.0+7ccf3ab",
|
|
34
|
+
"@agoric/governance": "0.9.2-dev-7ccf3ab.0+7ccf3ab",
|
|
35
|
+
"@agoric/internal": "0.2.2-dev-7ccf3ab.0+7ccf3ab",
|
|
36
|
+
"@agoric/notifier": "0.5.2-dev-7ccf3ab.0+7ccf3ab",
|
|
37
|
+
"@agoric/store": "0.8.4-dev-7ccf3ab.0+7ccf3ab",
|
|
38
|
+
"@agoric/time": "0.2.2-dev-7ccf3ab.0+7ccf3ab",
|
|
39
|
+
"@agoric/vat-data": "0.4.4-dev-7ccf3ab.0+7ccf3ab",
|
|
40
|
+
"@agoric/vats": "0.13.1-dev-7ccf3ab.0+7ccf3ab",
|
|
41
|
+
"@agoric/zoe": "0.25.4-dev-7ccf3ab.0+7ccf3ab",
|
|
42
42
|
"@endo/captp": "^3.1.0",
|
|
43
43
|
"@endo/eventual-send": "^0.17.1",
|
|
44
44
|
"@endo/far": "^0.2.17",
|
|
45
45
|
"@endo/marshal": "^0.8.4",
|
|
46
46
|
"@endo/nat": "^4.1.26",
|
|
47
|
-
"agoric": "0.18.3-dev-
|
|
47
|
+
"agoric": "0.18.3-dev-7ccf3ab.0+7ccf3ab"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@agoric/deploy-script-support": "0.9.5-dev-
|
|
51
|
-
"@agoric/smart-wallet": "0.4.3-dev-
|
|
52
|
-
"@agoric/swingset-liveslots": "0.9.1-dev-
|
|
53
|
-
"@agoric/swingset-vat": "0.30.3-dev-
|
|
50
|
+
"@agoric/deploy-script-support": "0.9.5-dev-7ccf3ab.0+7ccf3ab",
|
|
51
|
+
"@agoric/smart-wallet": "0.4.3-dev-7ccf3ab.0+7ccf3ab",
|
|
52
|
+
"@agoric/swingset-liveslots": "0.9.1-dev-7ccf3ab.0+7ccf3ab",
|
|
53
|
+
"@agoric/swingset-vat": "0.30.3-dev-7ccf3ab.0+7ccf3ab",
|
|
54
54
|
"@endo/bundle-source": "^2.5.0",
|
|
55
55
|
"@endo/init": "^0.5.55",
|
|
56
56
|
"@endo/promise-kit": "^0.2.55",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"publishConfig": {
|
|
77
77
|
"access": "public"
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "7ccf3ab26ea33c1d148401e0f2a87691a2a7a8e5"
|
|
80
80
|
}
|
|
@@ -40,7 +40,7 @@ const ParamChangesOfferArgsShape = M.splitRecord(
|
|
|
40
40
|
*/
|
|
41
41
|
export const start = async zcf => {
|
|
42
42
|
const { binaryVoteCounterInstallation: counter } = zcf.getTerms();
|
|
43
|
-
/** @type {MapStore<Instance,
|
|
43
|
+
/** @type {MapStore<Instance, GovernorCreatorFacet<any>>} */
|
|
44
44
|
const instanceToGovernor = makeScalarMapStore();
|
|
45
45
|
|
|
46
46
|
const makeParamInvitation = () => {
|
|
@@ -140,7 +140,7 @@ export const start = async zcf => {
|
|
|
140
140
|
const creatorFacet = makeExo('Charter creatorFacet', charterCreatorI, {
|
|
141
141
|
/**
|
|
142
142
|
* @param {Instance} governedInstance
|
|
143
|
-
* @param {
|
|
143
|
+
* @param {GovernorCreatorFacet<any>} governorFacet
|
|
144
144
|
* @param {string} [label] for diagnostic use only
|
|
145
145
|
*/
|
|
146
146
|
addInstance: (governedInstance, governorFacet, label) => {
|
package/src/feeDistributor.js
CHANGED
|
@@ -38,7 +38,7 @@ export const customTermsShape = harden({
|
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* @typedef {object} CollectibleContractFacet
|
|
41
|
-
* @property {() => Promise<Invitation
|
|
41
|
+
* @property {() => Promise<Invitation<string, never>>} makeCollectFeesInvitation
|
|
42
42
|
*/
|
|
43
43
|
|
|
44
44
|
/**
|
|
@@ -35,17 +35,13 @@ const BASIS_POINTS = 10_000n;
|
|
|
35
35
|
* @typedef {object} PSMKit
|
|
36
36
|
* @property {Instance} psm
|
|
37
37
|
* @property {Instance} psmGovernor
|
|
38
|
-
* @property {Awaited<ReturnType<import('../psm/psm.js').start>>['creatorFacet']} psmCreatorFacet
|
|
39
|
-
* @property {
|
|
38
|
+
* @property {Awaited<ReturnType<Awaited<ReturnType<import('../psm/psm.js').start>>['creatorFacet']['getLimitedCreatorFacet']>>} psmCreatorFacet
|
|
39
|
+
* @property {GovernorCreatorFacet<import('../../src/psm/psm.js')['start']>} psmGovernorCreatorFacet
|
|
40
40
|
* @property {AdminFacet} psmAdminFacet
|
|
41
41
|
*/
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* @typedef {
|
|
45
|
-
* @property {Awaited<ReturnType<import('../auction/auctioneer.js').start>>['creatorFacet']} creatorFacet
|
|
46
|
-
* @property {Awaited<ReturnType<import('../auction/auctioneer.js').start>>['publicFacet']} publicFacet
|
|
47
|
-
* @property {GovernedContractFacetAccess<{},{}>} governorCreatorFacet
|
|
48
|
-
* @property {AdminFacet} adminFacet
|
|
44
|
+
* @typedef {GovernanceFacetKit<import('../auction/auctioneer.js').start>} AuctioneerKit
|
|
49
45
|
*/
|
|
50
46
|
|
|
51
47
|
/**
|
|
@@ -63,24 +59,9 @@ const BASIS_POINTS = 10_000n;
|
|
|
63
59
|
* bankMints: Mint[],
|
|
64
60
|
* psmKit: MapStore<Brand, PSMKit>,
|
|
65
61
|
* econCharterKit: EconCharterStartResult,
|
|
66
|
-
* reserveKit:
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* governorCreatorFacet: GovernedAssetReserveFacetAccess,
|
|
70
|
-
* adminFacet: AdminFacet,
|
|
71
|
-
* },
|
|
72
|
-
* stakeFactoryKit: {
|
|
73
|
-
* creatorFacet: StakeFactoryCreator,
|
|
74
|
-
* governorCreatorFacet: GovernedContractFacetAccess<{}, {}>,
|
|
75
|
-
* adminFacet: AdminFacet,
|
|
76
|
-
* publicFacet: StakeFactoryPublic,
|
|
77
|
-
* },
|
|
78
|
-
* vaultFactoryKit: {
|
|
79
|
-
* publicFacet: VaultFactoryPublicFacet,
|
|
80
|
-
* creatorFacet: VaultFactoryCreatorFacet,
|
|
81
|
-
* governorCreatorFacet: GovernedContractFacetAccess<VaultFactoryPublicFacet, VaultFactoryCreatorFacet>,
|
|
82
|
-
* adminFacet: AdminFacet,
|
|
83
|
-
* },
|
|
62
|
+
* reserveKit: GovernanceFacetKit<import('../reserve/assetReserve.js')['start']>,
|
|
63
|
+
* stakeFactoryKit: GovernanceFacetKit<import('../stakeFactory/stakeFactory.js')['start']>,
|
|
64
|
+
* vaultFactoryKit: GovernanceFacetKit<import('../vaultFactory/vaultFactory.js')['start']>,
|
|
84
65
|
* auctioneerKit: AuctioneerKit,
|
|
85
66
|
* minInitialDebt: NatValue,
|
|
86
67
|
* }>} EconomyBootstrapSpace
|
|
@@ -149,8 +130,7 @@ export const setupReserve = async ({
|
|
|
149
130
|
},
|
|
150
131
|
}),
|
|
151
132
|
);
|
|
152
|
-
/** @type {
|
|
153
|
-
// @ts-expect-error XXX governance types https://github.com/Agoric/agoric-sdk/issues/7178
|
|
133
|
+
/** @type {GovernorStartedInstallationKit<typeof reserveInstallation>} */
|
|
154
134
|
const g = await E(zoe).startInstance(
|
|
155
135
|
governorInstallation,
|
|
156
136
|
{},
|
|
@@ -287,6 +267,7 @@ export const startVaultFactory = async (
|
|
|
287
267
|
}),
|
|
288
268
|
);
|
|
289
269
|
|
|
270
|
+
/** @type {GovernorStartedInstallationKit<typeof vaultFactoryInstallation>} */
|
|
290
271
|
const {
|
|
291
272
|
creatorFacet: governorCreatorFacet,
|
|
292
273
|
instance: governorInstance,
|
|
@@ -294,7 +275,6 @@ export const startVaultFactory = async (
|
|
|
294
275
|
} = await E(zoe).startInstance(
|
|
295
276
|
contractGovernorInstallation,
|
|
296
277
|
undefined,
|
|
297
|
-
// @ts-expect-error XXX governance types https://github.com/Agoric/agoric-sdk/issues/7178
|
|
298
278
|
governorTerms,
|
|
299
279
|
harden({
|
|
300
280
|
electorateCreatorFacet,
|
|
@@ -317,7 +297,6 @@ export const startVaultFactory = async (
|
|
|
317
297
|
]);
|
|
318
298
|
|
|
319
299
|
vaultFactoryKit.resolve(
|
|
320
|
-
// @ts-expect-error XXX governance types https://github.com/Agoric/agoric-sdk/issues/7178
|
|
321
300
|
harden({
|
|
322
301
|
creatorFacet: vaultFactoryCreator,
|
|
323
302
|
governorCreatorFacet,
|
|
@@ -590,12 +569,10 @@ export const startAuctioneer = async (
|
|
|
590
569
|
}),
|
|
591
570
|
);
|
|
592
571
|
|
|
593
|
-
/** @type {
|
|
594
|
-
// @ts-expect-error XXX governance types https://github.com/Agoric/agoric-sdk/issues/7178
|
|
572
|
+
/** @type {GovernorStartedInstallationKit<typeof auctionInstallation>} */
|
|
595
573
|
const governorStartResult = await E(zoe).startInstance(
|
|
596
574
|
contractGovernorInstallation,
|
|
597
575
|
undefined,
|
|
598
|
-
// @ts-expect-error XXX governance types https://github.com/Agoric/agoric-sdk/issues/7178
|
|
599
576
|
governorTerms,
|
|
600
577
|
harden({
|
|
601
578
|
electorateCreatorFacet,
|
|
@@ -735,12 +712,10 @@ export const startStakeFactory = async (
|
|
|
735
712
|
}),
|
|
736
713
|
);
|
|
737
714
|
|
|
738
|
-
/** @type {
|
|
739
|
-
// @ts-expect-error XXX governance types https://github.com/Agoric/agoric-sdk/issues/7178
|
|
715
|
+
/** @type {GovernorStartedInstallationKit<typeof stakeFactoryInstallation>} */
|
|
740
716
|
const governorStartResult = await E(zoe).startInstance(
|
|
741
717
|
contractGovernorInstallation,
|
|
742
718
|
{},
|
|
743
|
-
// @ts-expect-error XXX governance types https://github.com/Agoric/agoric-sdk/issues/7178
|
|
744
719
|
stakeTerms,
|
|
745
720
|
{
|
|
746
721
|
governed: {
|
|
@@ -145,6 +145,7 @@ export const startPSM = async (
|
|
|
145
145
|
},
|
|
146
146
|
}),
|
|
147
147
|
);
|
|
148
|
+
/** @type {GovernorStartedInstallationKit<typeof psmInstall>} */
|
|
148
149
|
const governorFacets = await E(zoe).startInstance(
|
|
149
150
|
contractGovernor,
|
|
150
151
|
{},
|
|
@@ -174,7 +175,6 @@ export const startPSM = async (
|
|
|
174
175
|
psmGovernor: governorFacets.instance,
|
|
175
176
|
psmCreatorFacet,
|
|
176
177
|
psmAdminFacet,
|
|
177
|
-
// @ts-expect-error XXX governance types https://github.com/Agoric/agoric-sdk/issues/7178
|
|
178
178
|
psmGovernorCreatorFacet: governorFacets.creatorFacet,
|
|
179
179
|
};
|
|
180
180
|
|
|
@@ -295,7 +295,12 @@ const start = async (zcf, privateArgs, baggage) => {
|
|
|
295
295
|
});
|
|
296
296
|
|
|
297
297
|
const { creatorFacet, publicFacet: pFacet } = makeAssetReserve();
|
|
298
|
-
return {
|
|
298
|
+
return {
|
|
299
|
+
/** @type {GovernedCreatorFacet<OriginalAssetReserveCreatorFacet>} */
|
|
300
|
+
// @ts-expect-error cast
|
|
301
|
+
creatorFacet,
|
|
302
|
+
publicFacet: pFacet,
|
|
303
|
+
};
|
|
299
304
|
};
|
|
300
305
|
|
|
301
306
|
harden(start);
|
|
@@ -325,4 +330,4 @@ export { start };
|
|
|
325
330
|
/** @typedef {Awaited<ReturnType<typeof start>>['publicFacet']} AssetReservePublicFacet */
|
|
326
331
|
/** @typedef {Awaited<ReturnType<typeof start>>['creatorFacet']} AssetReserveCreatorFacet the creator facet for the governor */
|
|
327
332
|
/** @typedef {OriginalAssetReserveCreatorFacet} AssetReserveLimitedCreatorFacet */
|
|
328
|
-
/** @typedef {
|
|
333
|
+
/** @typedef {GovernorCreatorFacet<typeof start>} GovernedAssetReserveFacetAccess */
|
|
@@ -71,11 +71,15 @@ import { makeStakeFactoryManager } from './stakeFactoryManager.js';
|
|
|
71
71
|
* authorizes placing a lien some of the staked assets in that account.
|
|
72
72
|
* @typedef {{
|
|
73
73
|
* provideAttestationMaker: (addr: string) => AttestationTool,
|
|
74
|
-
* makeCollectFeesInvitation: () => Promise<Invitation
|
|
74
|
+
* makeCollectFeesInvitation: () => Promise<Invitation<string, never>>,
|
|
75
75
|
* }} StakeFactoryCreator
|
|
76
76
|
*
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
* @param {ZCF<StakeFactoryTerms>} zcf
|
|
82
|
+
* @param {StakeFactoryPrivateArgs} privateArgs
|
|
79
83
|
*/
|
|
80
84
|
export const start = async (
|
|
81
85
|
zcf,
|
|
@@ -168,7 +172,6 @@ export const start = async (
|
|
|
168
172
|
zcf,
|
|
169
173
|
debtMint,
|
|
170
174
|
harden({ Attestation: attestBrand, debt: debtBrand, Stake: stakeBrand }),
|
|
171
|
-
// @ts-expect-error xxx governance types https://github.com/Agoric/agoric-sdk/issues/7178
|
|
172
175
|
mintPowers,
|
|
173
176
|
{ timerService, chargingPeriod, recordingPeriod, startTimeStamp },
|
|
174
177
|
);
|
|
@@ -32,9 +32,9 @@ export const vaultDirectorParamTypes = {
|
|
|
32
32
|
harden(vaultDirectorParamTypes);
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* @param {Amount} electorateInvitationAmount
|
|
35
|
+
* @param {Amount<'set'>} electorateInvitationAmount
|
|
36
36
|
* @param {Amount<'nat'>} minInitialDebt
|
|
37
|
-
* @param {Amount} shortfallInvitationAmount
|
|
37
|
+
* @param {Amount<'set'>} shortfallInvitationAmount
|
|
38
38
|
* @param {string} endorsedUi
|
|
39
39
|
* @param {InterestTiming} interestTiming
|
|
40
40
|
*/
|
|
@@ -119,14 +119,14 @@ export const vaultParamPattern = M.splitRecord(
|
|
|
119
119
|
/**
|
|
120
120
|
* @param {{
|
|
121
121
|
* auctioneerPublicFacet: ERef<AuctioneerPublicFacet>,
|
|
122
|
-
* electorateInvitationAmount: Amount
|
|
122
|
+
* electorateInvitationAmount: Amount<'set'>,
|
|
123
123
|
* minInitialDebt: Amount<'nat'>,
|
|
124
124
|
* bootstrapPaymentValue: bigint,
|
|
125
125
|
* priceAuthority: ERef<PriceAuthority>,
|
|
126
126
|
* timer: ERef<import('@agoric/time/src/types').TimerService>,
|
|
127
127
|
* reservePublicFacet: AssetReservePublicFacet,
|
|
128
128
|
* interestTiming: InterestTiming,
|
|
129
|
-
* shortfallInvitationAmount: Amount
|
|
129
|
+
* shortfallInvitationAmount: Amount<'set'>,
|
|
130
130
|
* endorsedUi?: string,
|
|
131
131
|
* }} opts
|
|
132
132
|
*/
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
* @typedef {object} VaultFactoryCreatorFacet
|
|
52
52
|
* @property {AddVaultType} addVaultType
|
|
53
53
|
* @property {() => Allocation} getRewardAllocation
|
|
54
|
-
* @property {() => Promise<Invitation
|
|
54
|
+
* @property {() => Promise<Invitation<string, never>>} makeCollectFeesInvitation
|
|
55
55
|
* @property {() => void} updateMetrics
|
|
56
56
|
* @property {() => import('@agoric/time/src/types').TimerWaker} makeLiquidationWaker
|
|
57
57
|
* @property {() => import('@agoric/time/src/types').TimerWaker} makePriceLockWaker
|
|
@@ -223,7 +223,6 @@ export const prepareVaultDirector = (
|
|
|
223
223
|
getGovernedParams: M.call({ collateralBrand: BrandShape }).returns(
|
|
224
224
|
M.record(),
|
|
225
225
|
),
|
|
226
|
-
getContractGovernor: M.call().returns(M.remotable()),
|
|
227
226
|
getInvitationAmount: M.call(M.string()).returns(AmountShape),
|
|
228
227
|
getPublicTopics: M.call().returns(TopicsRecordShape),
|
|
229
228
|
}),
|
|
@@ -258,7 +257,9 @@ export const prepareVaultDirector = (
|
|
|
258
257
|
getLimitedCreatorFacet() {
|
|
259
258
|
return this.facets.machine;
|
|
260
259
|
},
|
|
260
|
+
/** @returns {ERef<GovernedApis>} */
|
|
261
261
|
getGovernedApis() {
|
|
262
|
+
// @ts-expect-error cast
|
|
262
263
|
return Far('governedAPIs', {});
|
|
263
264
|
},
|
|
264
265
|
getGovernedApiNames() {
|
|
@@ -507,15 +508,6 @@ export const prepareVaultDirector = (
|
|
|
507
508
|
// TODO use named getters of TypedParamManager
|
|
508
509
|
return vaultParamManagers.get(collateralBrand).getParams();
|
|
509
510
|
},
|
|
510
|
-
/**
|
|
511
|
-
* @returns {Promise<GovernorPublic>}
|
|
512
|
-
*/
|
|
513
|
-
getContractGovernor() {
|
|
514
|
-
// PERF consider caching
|
|
515
|
-
return E(zcf.getZoeService()).getPublicFacet(
|
|
516
|
-
zcf.getTerms().electionManager,
|
|
517
|
-
);
|
|
518
|
-
},
|
|
519
511
|
/**
|
|
520
512
|
* @param {string} name
|
|
521
513
|
*/
|