@agoric/inter-protocol 0.13.2-dev-eb9fb38.0 → 0.13.2-dev-a9d6a3b.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/exported.js CHANGED
@@ -1,3 +1,2 @@
1
- import './src/stakeFactory/types.js';
2
1
  import './src/psm/types.js';
3
2
  import './src/vaultFactory/types.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/inter-protocol",
3
- "version": "0.13.2-dev-eb9fb38.0+eb9fb38",
3
+ "version": "0.13.2-dev-a9d6a3b.0+a9d6a3b",
4
4
  "description": "Core cryptoeconomy contracts",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -29,29 +29,29 @@
29
29
  },
30
30
  "homepage": "https://github.com/Agoric/agoric-sdk#readme",
31
31
  "dependencies": {
32
- "@agoric/assert": "0.5.2-dev-eb9fb38.0+eb9fb38",
33
- "@agoric/ertp": "0.15.4-dev-eb9fb38.0+eb9fb38",
34
- "@agoric/governance": "0.9.2-dev-eb9fb38.0+eb9fb38",
35
- "@agoric/internal": "0.2.2-dev-eb9fb38.0+eb9fb38",
36
- "@agoric/notifier": "0.5.2-dev-eb9fb38.0+eb9fb38",
37
- "@agoric/store": "0.8.4-dev-eb9fb38.0+eb9fb38",
38
- "@agoric/time": "0.2.2-dev-eb9fb38.0+eb9fb38",
39
- "@agoric/vat-data": "0.4.4-dev-eb9fb38.0+eb9fb38",
40
- "@agoric/vats": "0.13.1-dev-eb9fb38.0+eb9fb38",
41
- "@agoric/zoe": "0.25.4-dev-eb9fb38.0+eb9fb38",
32
+ "@agoric/assert": "0.5.2-dev-a9d6a3b.0+a9d6a3b",
33
+ "@agoric/ertp": "0.15.4-dev-a9d6a3b.0+a9d6a3b",
34
+ "@agoric/governance": "0.9.2-dev-a9d6a3b.0+a9d6a3b",
35
+ "@agoric/internal": "0.2.2-dev-a9d6a3b.0+a9d6a3b",
36
+ "@agoric/notifier": "0.5.2-dev-a9d6a3b.0+a9d6a3b",
37
+ "@agoric/store": "0.8.4-dev-a9d6a3b.0+a9d6a3b",
38
+ "@agoric/time": "0.2.2-dev-a9d6a3b.0+a9d6a3b",
39
+ "@agoric/vat-data": "0.4.4-dev-a9d6a3b.0+a9d6a3b",
40
+ "@agoric/vats": "0.13.1-dev-a9d6a3b.0+a9d6a3b",
41
+ "@agoric/zoe": "0.25.4-dev-a9d6a3b.0+a9d6a3b",
42
42
  "@endo/captp": "^3.1.1",
43
43
  "@endo/eventual-send": "^0.17.2",
44
44
  "@endo/far": "^0.2.18",
45
45
  "@endo/marshal": "^0.8.5",
46
46
  "@endo/nat": "^4.1.27",
47
- "agoric": "0.18.3-dev-eb9fb38.0+eb9fb38",
47
+ "agoric": "0.18.3-dev-a9d6a3b.0+a9d6a3b",
48
48
  "jessie.js": "^0.3.2"
49
49
  },
50
50
  "devDependencies": {
51
- "@agoric/deploy-script-support": "0.9.5-dev-eb9fb38.0+eb9fb38",
52
- "@agoric/smart-wallet": "0.4.3-dev-eb9fb38.0+eb9fb38",
53
- "@agoric/swingset-liveslots": "0.9.1-dev-eb9fb38.0+eb9fb38",
54
- "@agoric/swingset-vat": "0.30.3-dev-eb9fb38.0+eb9fb38",
51
+ "@agoric/deploy-script-support": "0.9.5-dev-a9d6a3b.0+a9d6a3b",
52
+ "@agoric/smart-wallet": "0.4.3-dev-a9d6a3b.0+a9d6a3b",
53
+ "@agoric/swingset-liveslots": "0.9.1-dev-a9d6a3b.0+a9d6a3b",
54
+ "@agoric/swingset-vat": "0.30.3-dev-a9d6a3b.0+a9d6a3b",
55
55
  "@endo/bundle-source": "^2.5.1",
56
56
  "@endo/init": "^0.5.56",
57
57
  "@endo/promise-kit": "^0.2.56",
@@ -77,5 +77,5 @@
77
77
  "publishConfig": {
78
78
  "access": "public"
79
79
  },
80
- "gitHead": "eb9fb387ccaf9e2a1c5187c3926601824522b2a3"
80
+ "gitHead": "a9d6a3b0a98c68817b1a4a6a2dea6e5684a7cf91"
81
81
  }
@@ -9,7 +9,6 @@ const contractRefs = [
9
9
  '../../governance/bundles/bundle-contractGovernor.js',
10
10
  '../../governance/bundles/bundle-committee.js',
11
11
  '../../governance/bundles/bundle-binaryVoteCounter.js',
12
- '../bundles/bundle-stakeFactory.js',
13
12
  '../bundles/bundle-vaultFactory.js',
14
13
  '../bundles/bundle-reserve.js',
15
14
  '../bundles/bundle-psm.js',
@@ -29,12 +29,6 @@ const installKeyGroups = {
29
29
  '../../governance/bundles/bundle-binaryVoteCounter.js',
30
30
  ],
31
31
  },
32
- stakeFactory: {
33
- stakeFactory: [
34
- '../src/stakeFactory/stakeFactory.js',
35
- '../bundles/bundle-stakeFactory.js',
36
- ],
37
- },
38
32
  main: {
39
33
  auctioneer: [
40
34
  '../src/auction/auctioneer.js',
@@ -120,7 +114,6 @@ export const mainProposalBuilder = async ({
120
114
  vaultFactoryControllerAddress: VAULT_FACTORY_CONTROLLER_ADDR,
121
115
  installKeys: {
122
116
  ...publishGroup(installKeyGroups.main),
123
- ...publishGroup(installKeyGroups.stakeFactory),
124
117
  },
125
118
  },
126
119
  ],
@@ -179,7 +172,6 @@ export const defaultProposalBuilder = async (
179
172
  econCommitteeOptions,
180
173
  installKeys: {
181
174
  ...publishGroup(installKeyGroups.econCommittee),
182
- ...publishGroup(installKeyGroups.stakeFactory),
183
175
  ...publishGroup(installKeyGroups.main),
184
176
  },
185
177
  },
@@ -107,7 +107,6 @@ const REWARD_MANIFEST = harden({
107
107
  bankManager: true,
108
108
  vaultFactoryKit: true,
109
109
  periodicFeeCollectors: true,
110
- stakeFactoryKit: true,
111
110
  reserveKit: true,
112
111
  zoe: true,
113
112
  },
@@ -119,45 +118,6 @@ const REWARD_MANIFEST = harden({
119
118
  },
120
119
  });
121
120
 
122
- const STAKE_FACTORY_MANIFEST = harden({
123
- [econBehaviors.startLienBridge.name]: {
124
- consume: { bridgeManager: true },
125
- produce: { lienBridge: true },
126
- brand: {
127
- consume: { BLD: 'BLD' },
128
- },
129
- },
130
- [econBehaviors.startStakeFactory.name]: {
131
- consume: {
132
- board: 'board',
133
- chainStorage: true,
134
- zoe: 'zoe',
135
- feeMintAccess: 'zoe',
136
- lienBridge: true,
137
- client: 'provisioning',
138
- chainTimerService: 'timer',
139
- economicCommitteeCreatorFacet: 'economicCommittee',
140
- },
141
- produce: {
142
- stakeFactoryKit: 'stakeFactory',
143
- },
144
- installation: {
145
- consume: { contractGovernor: 'zoe', stakeFactory: 'zoe' },
146
- },
147
- instance: {
148
- produce: { stakeFactory: 'stakeFactory' },
149
- },
150
- brand: {
151
- consume: { BLD: 'BLD', [Stable.symbol]: 'zoe' },
152
- produce: { Attestation: 'stakeFactory' },
153
- },
154
- issuer: {
155
- consume: { BLD: 'BLD' },
156
- produce: { Attestation: 'stakeFactory' },
157
- },
158
- },
159
- });
160
-
161
121
  export const SIM_CHAIN_MANIFEST = harden({});
162
122
 
163
123
  export const getManifestForEconCommittee = (
@@ -230,12 +190,10 @@ export const getManifestForInterProtocol = (
230
190
  ...econCommitteeManifest.manifest,
231
191
  ...mainManifest.manifest,
232
192
  ...REWARD_MANIFEST,
233
- ...STAKE_FACTORY_MANIFEST,
234
193
  },
235
194
  installations: {
236
195
  ...econCommitteeManifest.installations,
237
196
  ...mainManifest.installations,
238
- stakeFactory: restoreRef(installKeys.stakeFactory),
239
197
  },
240
198
  options: {
241
199
  ...econCommitteeManifest.options,
@@ -5,28 +5,21 @@ import '../../exported.js';
5
5
  import { AmountMath } from '@agoric/ertp';
6
6
  import '@agoric/governance/exported.js';
7
7
  import { deeplyFulfilledObject, makeTracer } from '@agoric/internal';
8
+ import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
8
9
  import '@agoric/vats/exported.js';
9
10
  import '@agoric/vats/src/core/types.js';
10
- import { Stable, Stake } from '@agoric/vats/src/tokens.js';
11
- import { makeStorageNodeChild } from '@agoric/internal/src/lib-chainStorage.js';
12
- import { makeRatio } from '@agoric/zoe/src/contractSupport/index.js';
11
+ import { Stable } from '@agoric/vats/src/tokens.js';
13
12
  import { E } from '@endo/far';
14
- import { LienBridgeId, makeStakeReporter } from '../my-lien.js';
13
+ import { makeGovernedTerms as makeGovernedATerms } from '../auction/params.js';
15
14
  import { makeReserveTerms } from '../reserve/params.js';
16
- import { makeStakeFactoryTerms } from '../stakeFactory/params.js';
17
15
  import { makeGovernedTerms as makeGovernedVFTerms } from '../vaultFactory/params.js';
18
- import { makeGovernedTerms as makeGovernedATerms } from '../auction/params.js';
19
16
 
20
17
  const trace = makeTracer('RunEconBehaviors', false);
21
18
 
22
19
  const SECONDS_PER_HOUR = 60n * 60n;
23
20
  const SECONDS_PER_DAY = 24n * SECONDS_PER_HOUR;
24
21
 
25
- const BASIS_POINTS = 10_000n;
26
-
27
22
  /**
28
- * @typedef {GovernedCreatorFacet<import('../stakeFactory/stakeFactory.js').StakeFactoryCreator>} StakeFactoryCreator
29
- * @typedef {import('../stakeFactory/stakeFactory.js').StakeFactoryPublic} StakeFactoryPublic
30
23
  * @typedef {import('../vaultFactory/vaultFactory.js').VaultFactoryContract['publicFacet']} VaultFactoryPublicFacet
31
24
  * @typedef {import('../auction/auctioneer.js').AuctioneerPublicFacet} AuctioneerPublicFacet
32
25
  * @typedef {import('../auction/auctioneer.js').AuctioneerCreatorFacet} AuctioneerCreatorFacet
@@ -63,7 +56,6 @@ const BASIS_POINTS = 10_000n;
63
56
  * anchorBalancePayments: MapStore<Brand, Payment<'nat'>>,
64
57
  * econCharterKit: EconCharterStartResult,
65
58
  * reserveKit: GovernanceFacetKit<import('../reserve/assetReserve.js')['prepare']>,
66
- * stakeFactoryKit: GovernanceFacetKit<import('../stakeFactory/stakeFactory.js')['start']>,
67
59
  * vaultFactoryKit: GovernanceFacetKit<import('../vaultFactory/vaultFactory.js')['prepare']>,
68
60
  * auctioneerKit: AuctioneerKit,
69
61
  * minInitialDebt: NatValue,
@@ -386,7 +378,6 @@ export const startRewardDistributor = async ({
386
378
  bankManager,
387
379
  vaultFactoryKit,
388
380
  periodicFeeCollectors,
389
- stakeFactoryKit,
390
381
  reserveKit,
391
382
  zoe,
392
383
  },
@@ -475,7 +466,6 @@ export const startRewardDistributor = async ({
475
466
 
476
467
  const collectorKit = {
477
468
  vaultFactory: E.get(vaultFactoryKit).creatorFacet,
478
- runStake: E.get(stakeFactoryKit).creatorFacet,
479
469
  };
480
470
  await Promise.all(
481
471
  Object.entries(collectorKit).map(async ([debugName, collectorFacet]) => {
@@ -492,30 +482,6 @@ export const startRewardDistributor = async ({
492
482
  };
493
483
  harden(startRewardDistributor);
494
484
 
495
- /**
496
- * @param {BootstrapPowers & PromiseSpaceOf<{
497
- * lienBridge: StakingAuthority,
498
- * }>} powers
499
- */
500
- export const startLienBridge = async ({
501
- consume: { bridgeManager: bridgeOptP },
502
- produce: { lienBridge },
503
- brand: {
504
- consume: { [Stake.symbol]: bldP },
505
- },
506
- }) => {
507
- trace('lienBridge');
508
-
509
- const bridgeManager = await bridgeOptP;
510
- if (!bridgeManager) {
511
- return;
512
- }
513
- const lienBridgeManager = E(bridgeManager).register(LienBridgeId);
514
- const bldBrand = await bldP;
515
- const reporter = makeStakeReporter(lienBridgeManager, bldBrand);
516
- lienBridge.resolve(reporter);
517
- };
518
-
519
485
  /**
520
486
  * @param {EconomyBootstrapPowers} powers
521
487
  * @param {object} config
@@ -639,164 +605,3 @@ export const startAuctioneer = async (
639
605
 
640
606
  auctionInstance.resolve(governedInstance);
641
607
  };
642
-
643
- /**
644
- * @typedef {EconomyBootstrapPowers & PromiseSpaceOf<{
645
- * client: ClientManager,
646
- * lienBridge: StakingAuthority,
647
- * }>} StakeFactoryBootstrapPowers
648
- */
649
-
650
- /**
651
- * @param {StakeFactoryBootstrapPowers } powers
652
- * @param {object} config
653
- * @param {bigint} [config.debtLimit] count of Minted
654
- * @param {Rational} [config.mintingRatio] ratio of Minted to BLD
655
- * @param {bigint} [config.interestRateBP]
656
- * @param {bigint} [config.mintFeeBP]
657
- * @param {bigint} [config.chargingPeriod]
658
- * @param {bigint} [config.recordingPeriod]
659
- * @typedef {[bigint, bigint]} Rational
660
- * @typedef {Awaited<ReturnType<typeof import('../stakeFactory/stakeFactory.js').start>>} StartStakeFactory
661
- */
662
- export const startStakeFactory = async (
663
- {
664
- consume: {
665
- board,
666
- zoe,
667
- feeMintAccess: feeMintAccessP,
668
- lienBridge,
669
- client,
670
- chainTimerService,
671
- chainStorage,
672
- economicCommitteeCreatorFacet,
673
- },
674
- produce: { stakeFactoryKit },
675
- installation: {
676
- consume: {
677
- contractGovernor: contractGovernorInstallation,
678
- stakeFactory: stakeFactoryInstallation,
679
- },
680
- },
681
- instance: {
682
- produce: { stakeFactory: stakeFactoryInstanceR },
683
- },
684
- brand: {
685
- consume: { [Stake.symbol]: bldBrandP, [Stable.symbol]: runBrandP },
686
- produce: { Attestation: attestationBrandR },
687
- },
688
- issuer: {
689
- consume: { [Stake.symbol]: bldIssuer },
690
- produce: { Attestation: attestationIssuerR },
691
- },
692
- },
693
- {
694
- debtLimit = 1_000_000_000_000n,
695
- mintingRatio = [1n, 4n],
696
- interestRateBP = 250n,
697
- mintFeeBP = 200n,
698
- chargingPeriod = SECONDS_PER_HOUR,
699
- recordingPeriod = SECONDS_PER_DAY,
700
- } = {},
701
- ) => {
702
- const STORAGE_PATH = 'stakeFactory';
703
-
704
- const [bldBrand, runBrand] = await Promise.all([bldBrandP, runBrandP]);
705
-
706
- const poserInvitationP = E(
707
- economicCommitteeCreatorFacet,
708
- ).getPoserInvitation();
709
- const [initialPoserInvitation, electorateInvitationAmount, feeMintAccess] =
710
- await Promise.all([
711
- poserInvitationP,
712
- E(E(zoe).getInvitationIssuer()).getAmountOf(poserInvitationP),
713
- feeMintAccessP,
714
- ]);
715
-
716
- const stakeFactoryTerms = makeStakeFactoryTerms(
717
- {
718
- timerService: chainTimerService,
719
- chargingPeriod,
720
- recordingPeriod,
721
- },
722
- {
723
- debtLimit: AmountMath.make(runBrand, debtLimit),
724
- mintingRatio: makeRatio(
725
- mintingRatio[0],
726
- runBrand,
727
- mintingRatio[1],
728
- bldBrand,
729
- ),
730
- interestRate: makeRatio(interestRateBP, runBrand, BASIS_POINTS),
731
- mintFee: makeRatio(mintFeeBP, runBrand, BASIS_POINTS),
732
- electorateInvitationAmount,
733
- },
734
- );
735
-
736
- const storageNode = await makeStorageNodeChild(chainStorage, STORAGE_PATH);
737
- const marshaller = await E(board).getReadonlyMarshaller();
738
-
739
- const stakeTerms = await deeplyFulfilledObject(
740
- harden({
741
- timer: chainTimerService,
742
- governedContractInstallation: stakeFactoryInstallation,
743
- governed: {
744
- terms: stakeFactoryTerms,
745
- issuerKeywordRecord: { Stake: bldIssuer },
746
- label: 'stakeFactory',
747
- },
748
- }),
749
- );
750
-
751
- /** @type {GovernorStartedInstallationKit<typeof stakeFactoryInstallation>} */
752
- const governorStartResult = await E(zoe).startInstance(
753
- contractGovernorInstallation,
754
- {},
755
- stakeTerms,
756
- {
757
- governed: {
758
- feeMintAccess,
759
- initialPoserInvitation,
760
- lienBridge,
761
- storageNode,
762
- marshaller,
763
- },
764
- },
765
- 'stakeFactory.governor',
766
- );
767
-
768
- const [governedInstance, governedCreatorFacet, governedPublicFacet] =
769
- await Promise.all([
770
- E(governorStartResult.creatorFacet).getInstance(),
771
- E(governorStartResult.creatorFacet).getCreatorFacet(),
772
- E(governorStartResult.creatorFacet).getPublicFacet(),
773
- ]);
774
-
775
- const {
776
- issuers: { Attestation: attIssuer },
777
- brands: { Attestation: attBrand },
778
- } = await E(zoe).getTerms(governedInstance);
779
-
780
- stakeFactoryKit.resolve(
781
- harden({
782
- creatorFacet: governedCreatorFacet,
783
- governorCreatorFacet: governorStartResult.creatorFacet,
784
- adminFacet: governorStartResult.adminFacet,
785
- publicFacet: governedPublicFacet,
786
- governor: governorStartResult.instance,
787
- instance: governedInstance,
788
- }),
789
- );
790
-
791
- stakeFactoryInstanceR.resolve(governedInstance);
792
- attestationBrandR.resolve(attBrand);
793
- attestationIssuerR.resolve(attIssuer);
794
- return Promise.all([
795
- E(client).assignBundle([
796
- address => ({
797
- attMaker: E(governedCreatorFacet).provideAttestationMaker(address),
798
- }),
799
- ]),
800
- ]);
801
- };
802
- harden(startStakeFactory);
@@ -11,6 +11,7 @@
11
11
  * @typedef {import('../auction/auctioneer.js').AuctioneerPublicFacet} AuctioneerPublicFacet
12
12
  * @typedef {import('./vaultFactory.js').VaultFactoryContract['publicFacet']} VaultFactoryPublicFacet
13
13
  *
14
+ * @typedef {import('@agoric/time/src/types').Timestamp} Timestamp
14
15
  * @typedef {import('@agoric/time/src/types').RelativeTime} RelativeTime
15
16
  */
16
17