@agoric/inter-protocol 0.17.0-u17.1 → 0.17.0-u18.1
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 +26 -26
- package/src/auction/auctionBook.d.ts +2 -2
- package/src/auction/auctionBook.d.ts.map +1 -1
- package/src/auction/auctionBook.js +26 -33
- package/src/auction/auctionMath.d.ts +3 -3
- package/src/auction/auctioneer.d.ts +9 -9
- package/src/auction/auctioneer.d.ts.map +1 -1
- package/src/auction/offerBook.d.ts.map +1 -1
- package/src/auction/params.d.ts +2 -2
- package/src/auction/scheduler.d.ts +4 -3
- package/src/auction/scheduler.d.ts.map +1 -1
- package/src/auction/scheduler.js +1 -1
- package/src/auction/util.d.ts +6 -8
- package/src/auction/util.d.ts.map +1 -1
- package/src/auction/util.js +4 -3
- package/src/clientSupport.d.ts.map +1 -1
- package/src/econCommitteeCharter.d.ts +4 -3
- package/src/econCommitteeCharter.d.ts.map +1 -1
- package/src/econCommitteeCharter.js +1 -1
- package/src/feeDistributor.d.ts.map +1 -1
- package/src/interest.d.ts.map +1 -1
- package/src/price/fluxAggregatorContract.d.ts +2 -1
- package/src/price/fluxAggregatorContract.d.ts.map +1 -1
- package/src/price/fluxAggregatorContract.js +2 -0
- package/src/price/fluxAggregatorKit.d.ts +1 -1
- package/src/price/fluxAggregatorKit.d.ts.map +1 -1
- package/src/price/priceOracleKit.d.ts.map +1 -1
- package/src/price/roundsManager.d.ts +6 -6
- package/src/price/roundsManager.d.ts.map +1 -1
- package/src/price/roundsManager.js +53 -4
- package/src/proposals/add-auction.d.ts +24 -10
- package/src/proposals/add-auction.d.ts.map +1 -1
- package/src/proposals/add-auction.js +69 -47
- package/src/proposals/addAssetToVault.d.ts +14 -1
- package/src/proposals/addAssetToVault.d.ts.map +1 -1
- package/src/proposals/addAssetToVault.js +22 -3
- package/src/proposals/deploy-price-feeds.d.ts +76 -0
- package/src/proposals/deploy-price-feeds.d.ts.map +1 -0
- package/src/proposals/deploy-price-feeds.js +316 -0
- package/src/proposals/econ-behaviors.d.ts +27 -27
- package/src/proposals/econ-behaviors.d.ts.map +1 -1
- package/src/proposals/price-feed-proposal.d.ts.map +1 -1
- package/src/proposals/price-feed-proposal.js +2 -1
- package/src/proposals/replace-scaledPriceAuthorities.d.ts +30 -0
- package/src/proposals/replace-scaledPriceAuthorities.d.ts.map +1 -0
- package/src/proposals/replace-scaledPriceAuthorities.js +124 -0
- package/src/proposals/replaceElectorate.d.ts +55 -0
- package/src/proposals/replaceElectorate.d.ts.map +1 -0
- package/src/proposals/replaceElectorate.js +521 -0
- package/src/proposals/upgrade-vaults.d.ts +16 -14
- package/src/proposals/upgrade-vaults.d.ts.map +1 -1
- package/src/proposals/upgrade-vaults.js +75 -91
- package/src/proposals/utils.d.ts +4 -2
- package/src/proposals/utils.d.ts.map +1 -1
- package/src/proposals/utils.js +10 -2
- package/src/provisionPool.d.ts +4 -8
- package/src/provisionPool.d.ts.map +1 -1
- package/src/provisionPoolKit.d.ts +10 -18
- package/src/provisionPoolKit.d.ts.map +1 -1
- package/src/psm/psm.d.ts +2 -2
- package/src/psm/psm.d.ts.map +1 -1
- package/src/reserve/assetReserve.d.ts.map +1 -1
- package/src/reserve/assetReserveKit.d.ts +1 -1
- package/src/reserve/assetReserveKit.d.ts.map +1 -1
- package/src/vaultFactory/liquidation.d.ts.map +1 -1
- package/src/vaultFactory/math.d.ts +4 -4
- package/src/vaultFactory/orderedVaultStore.d.ts +8 -8
- package/src/vaultFactory/orderedVaultStore.d.ts.map +1 -1
- package/src/vaultFactory/params.d.ts +6 -6
- package/src/vaultFactory/params.d.ts.map +1 -1
- package/src/vaultFactory/prioritizedVaults.d.ts +17 -17
- package/src/vaultFactory/prioritizedVaults.d.ts.map +1 -1
- package/src/vaultFactory/proceeds.d.ts.map +1 -1
- package/src/vaultFactory/storeUtils.d.ts +2 -2
- package/src/vaultFactory/storeUtils.d.ts.map +1 -1
- package/src/vaultFactory/types-ambient.d.ts.map +1 -1
- package/src/vaultFactory/vault.d.ts +30 -19
- package/src/vaultFactory/vault.d.ts.map +1 -1
- package/src/vaultFactory/vault.js +6 -5
- package/src/vaultFactory/vaultDirector.d.ts +18 -18
- package/src/vaultFactory/vaultDirector.d.ts.map +1 -1
- package/src/vaultFactory/vaultFactory.d.ts +7 -7
- package/src/vaultFactory/vaultFactory.d.ts.map +1 -1
- package/src/vaultFactory/vaultHolder.d.ts +6 -6
- package/src/vaultFactory/vaultHolder.d.ts.map +1 -1
- package/src/vaultFactory/vaultKit.d.ts +2 -2
- package/src/vaultFactory/vaultManager.d.ts +18 -18
- package/src/vaultFactory/vaultManager.d.ts.map +1 -1
- package/src/vaultFactory/vaultManager.js +1 -0
|
@@ -26,7 +26,7 @@ const V3_NO_DATA_ERROR = 'No data present';
|
|
|
26
26
|
/** @type {bigint} */
|
|
27
27
|
export const ROUND_MAX = BigInt(2 ** 32 - 1);
|
|
28
28
|
|
|
29
|
-
const trace = makeTracer('RoundsM',
|
|
29
|
+
const trace = makeTracer('RoundsM', true);
|
|
30
30
|
|
|
31
31
|
/** @param {bigint} roundId */
|
|
32
32
|
const validRoundId = roundId => {
|
|
@@ -172,10 +172,13 @@ export const prepareRoundsManagerKit = baggage =>
|
|
|
172
172
|
rounds,
|
|
173
173
|
unitIn,
|
|
174
174
|
};
|
|
175
|
+
|
|
176
|
+
const roundId = 0n;
|
|
177
|
+
|
|
175
178
|
return {
|
|
176
179
|
...immutable,
|
|
177
180
|
lastValueOutForUnitIn: null,
|
|
178
|
-
reportingRoundId:
|
|
181
|
+
reportingRoundId: roundId,
|
|
179
182
|
};
|
|
180
183
|
},
|
|
181
184
|
{
|
|
@@ -600,8 +603,8 @@ export const prepareRoundsManagerKit = baggage =>
|
|
|
600
603
|
|
|
601
604
|
/**
|
|
602
605
|
* a method to provide all current info oracleStatuses need. Intended
|
|
603
|
-
* only
|
|
604
|
-
*
|
|
606
|
+
* only to be callable by oracleStatuses. Not for use by contracts to
|
|
607
|
+
* read state.
|
|
605
608
|
*
|
|
606
609
|
* @param {OracleStatus} status
|
|
607
610
|
* @param {Timestamp} blockTimestamp
|
|
@@ -728,4 +731,50 @@ export const prepareRoundsManagerKit = baggage =>
|
|
|
728
731
|
},
|
|
729
732
|
},
|
|
730
733
|
},
|
|
734
|
+
{
|
|
735
|
+
finish: ({ state }) => {
|
|
736
|
+
const { details, rounds, timerPresence } = state;
|
|
737
|
+
// Zero is treated as special as roundId and in times. It's hard to
|
|
738
|
+
// avoid on restart and in tests, so make 1 the minimum
|
|
739
|
+
|
|
740
|
+
const firstRound = 1n;
|
|
741
|
+
state.reportingRoundId = firstRound;
|
|
742
|
+
details.init(
|
|
743
|
+
firstRound,
|
|
744
|
+
harden({
|
|
745
|
+
submissions: [],
|
|
746
|
+
maxSubmissions: state.maxSubmissionCount,
|
|
747
|
+
minSubmissions: state.minSubmissionCount,
|
|
748
|
+
roundTimeout: state.timeout,
|
|
749
|
+
}),
|
|
750
|
+
);
|
|
751
|
+
|
|
752
|
+
// Cannot await in first crank. Fail if no timestamp available
|
|
753
|
+
void E.when(
|
|
754
|
+
E(timerPresence).getCurrentTimestamp(),
|
|
755
|
+
nowMaybe => {
|
|
756
|
+
const now =
|
|
757
|
+
TimeMath.compareAbs(nowMaybe, 1n) < 0
|
|
758
|
+
? TimeMath.coerceTimestampRecord(1n, nowMaybe.timerBrand)
|
|
759
|
+
: nowMaybe;
|
|
760
|
+
|
|
761
|
+
const round = harden({
|
|
762
|
+
answer: 0n,
|
|
763
|
+
startedAt: now,
|
|
764
|
+
updatedAt: 0n,
|
|
765
|
+
answeredInRound: 0n,
|
|
766
|
+
});
|
|
767
|
+
rounds.init(firstRound, round);
|
|
768
|
+
|
|
769
|
+
// In case this is a replacement priceFeed, set roundId in vstorage.
|
|
770
|
+
void state.latestRoundPublisher.write({
|
|
771
|
+
roundId: firstRound,
|
|
772
|
+
startedAt: round.startedAt,
|
|
773
|
+
startedBy: 'uninitialized',
|
|
774
|
+
});
|
|
775
|
+
},
|
|
776
|
+
reason => Fail`need a timestamp to start roundsManager ${reason}`,
|
|
777
|
+
);
|
|
778
|
+
},
|
|
779
|
+
},
|
|
731
780
|
);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export function addAuction({ consume: { agoricNamesAdmin, auctioneerKit: legacyKitP, board, chainStorage, chainTimerService, economicCommitteeCreatorFacet: electorateCreatorFacet,
|
|
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, }, }: {
|
|
2
2
|
options: {
|
|
3
|
-
|
|
3
|
+
contractGovernorRef: {
|
|
4
4
|
bundleID: string;
|
|
5
5
|
};
|
|
6
|
+
contractGovernorInstallation: Installation;
|
|
6
7
|
};
|
|
7
8
|
}): Promise<void>;
|
|
8
9
|
export const ADD_AUCTION_MANIFEST: {
|
|
@@ -15,12 +16,15 @@ export const ADD_AUCTION_MANIFEST: {
|
|
|
15
16
|
chainTimerService: boolean;
|
|
16
17
|
econCharterKit: boolean;
|
|
17
18
|
economicCommitteeCreatorFacet: boolean;
|
|
18
|
-
|
|
19
|
+
governedContractKits: boolean;
|
|
20
|
+
priceAuthority8400: boolean;
|
|
19
21
|
zoe: boolean;
|
|
20
22
|
};
|
|
21
23
|
produce: {
|
|
22
24
|
auctioneerKit: boolean;
|
|
23
25
|
auctionUpgradeNewInstance: boolean;
|
|
26
|
+
auctionUpgradeNewGovCreator: boolean;
|
|
27
|
+
newContractGovBundleId: boolean;
|
|
24
28
|
};
|
|
25
29
|
instance: {
|
|
26
30
|
consume: {
|
|
@@ -33,8 +37,6 @@ export const ADD_AUCTION_MANIFEST: {
|
|
|
33
37
|
installation: {
|
|
34
38
|
consume: {
|
|
35
39
|
contractGovernor: boolean;
|
|
36
|
-
};
|
|
37
|
-
produce: {
|
|
38
40
|
auctioneer: boolean;
|
|
39
41
|
};
|
|
40
42
|
};
|
|
@@ -45,7 +47,9 @@ export const ADD_AUCTION_MANIFEST: {
|
|
|
45
47
|
};
|
|
46
48
|
};
|
|
47
49
|
};
|
|
48
|
-
export function getManifestForAddAuction(
|
|
50
|
+
export function getManifestForAddAuction({ restoreRef }: {
|
|
51
|
+
restoreRef: any;
|
|
52
|
+
}, { auctioneerRef, contractGovernorRef }: any): Promise<{
|
|
49
53
|
manifest: {
|
|
50
54
|
[x: string]: {
|
|
51
55
|
consume: {
|
|
@@ -56,12 +60,15 @@ export function getManifestForAddAuction(_ign: object, addAuctionOptions: any):
|
|
|
56
60
|
chainTimerService: boolean;
|
|
57
61
|
econCharterKit: boolean;
|
|
58
62
|
economicCommitteeCreatorFacet: boolean;
|
|
59
|
-
|
|
63
|
+
governedContractKits: boolean;
|
|
64
|
+
priceAuthority8400: boolean;
|
|
60
65
|
zoe: boolean;
|
|
61
66
|
};
|
|
62
67
|
produce: {
|
|
63
68
|
auctioneerKit: boolean;
|
|
64
69
|
auctionUpgradeNewInstance: boolean;
|
|
70
|
+
auctionUpgradeNewGovCreator: boolean;
|
|
71
|
+
newContractGovBundleId: boolean;
|
|
65
72
|
};
|
|
66
73
|
instance: {
|
|
67
74
|
consume: {
|
|
@@ -74,8 +81,6 @@ export function getManifestForAddAuction(_ign: object, addAuctionOptions: any):
|
|
|
74
81
|
installation: {
|
|
75
82
|
consume: {
|
|
76
83
|
contractGovernor: boolean;
|
|
77
|
-
};
|
|
78
|
-
produce: {
|
|
79
84
|
auctioneer: boolean;
|
|
80
85
|
};
|
|
81
86
|
};
|
|
@@ -86,10 +91,19 @@ export function getManifestForAddAuction(_ign: object, addAuctionOptions: any):
|
|
|
86
91
|
};
|
|
87
92
|
};
|
|
88
93
|
};
|
|
89
|
-
options:
|
|
94
|
+
options: {
|
|
95
|
+
contractGovernorRef: any;
|
|
96
|
+
contractGovernorInstallation: any;
|
|
97
|
+
};
|
|
98
|
+
installations: {
|
|
99
|
+
auctioneer: any;
|
|
100
|
+
contractGovernor: any;
|
|
101
|
+
};
|
|
90
102
|
}>;
|
|
91
103
|
export type interlockPowers = PromiseSpaceOf<{
|
|
92
104
|
auctionUpgradeNewInstance: Instance;
|
|
105
|
+
auctionUpgradeNewGovCreator: any;
|
|
106
|
+
newContractGovBundleId: string;
|
|
93
107
|
}>;
|
|
94
108
|
import { Stable } from '@agoric/internal/src/tokens.js';
|
|
95
109
|
//# 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":"AA0BO,kmBATI,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,iBA8KH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BG;AASI,yDAHJ;IAAmB,UAAU,EAArB,GAAG;CACX,0CAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBb;8BAtPY,cAAc,CAAC;IACvB,yBAAyB,EAAE,QAAQ,CAAC;IACpC,2BAA2B,EAAE,GAAG,CAAC;IACjC,sBAAsB,EAAE,MAAM,CAAC;CAChC,CAAC;uBAVkB,gCAAgC"}
|
|
@@ -9,13 +9,20 @@ const trace = makeTracer('NewAuction', true);
|
|
|
9
9
|
/**
|
|
10
10
|
* @typedef {PromiseSpaceOf<{
|
|
11
11
|
* auctionUpgradeNewInstance: Instance;
|
|
12
|
+
* auctionUpgradeNewGovCreator: any;
|
|
13
|
+
* newContractGovBundleId: string;
|
|
12
14
|
* }>} interlockPowers
|
|
13
15
|
*/
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* @param {import('./econ-behaviors.js').EconomyBootstrapPowers &
|
|
17
19
|
* interlockPowers} powers
|
|
18
|
-
* @param {{
|
|
20
|
+
* @param {{
|
|
21
|
+
* options: {
|
|
22
|
+
* contractGovernorRef: { bundleID: string };
|
|
23
|
+
* contractGovernorInstallation: Installation;
|
|
24
|
+
* };
|
|
25
|
+
* }} options
|
|
19
26
|
*/
|
|
20
27
|
export const addAuction = async (
|
|
21
28
|
{
|
|
@@ -26,50 +33,50 @@ export const addAuction = async (
|
|
|
26
33
|
chainStorage,
|
|
27
34
|
chainTimerService,
|
|
28
35
|
economicCommitteeCreatorFacet: electorateCreatorFacet,
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
governedContractKits: governedContractKitsP,
|
|
37
|
+
priceAuthority8400,
|
|
31
38
|
zoe,
|
|
32
39
|
},
|
|
33
|
-
produce: {
|
|
40
|
+
produce: {
|
|
41
|
+
auctioneerKit: produceAuctioneerKit,
|
|
42
|
+
auctionUpgradeNewInstance,
|
|
43
|
+
auctionUpgradeNewGovCreator,
|
|
44
|
+
newContractGovBundleId,
|
|
45
|
+
},
|
|
34
46
|
instance: {
|
|
35
47
|
consume: { reserve: reserveInstance },
|
|
36
48
|
produce: { auctioneer: auctionInstance },
|
|
37
49
|
},
|
|
38
50
|
installation: {
|
|
39
|
-
consume: {
|
|
40
|
-
produce: { auctioneer: produceInstallation },
|
|
51
|
+
consume: { auctioneer: auctioneerInstallationP },
|
|
41
52
|
},
|
|
42
53
|
issuer: {
|
|
43
54
|
consume: { [Stable.symbol]: stableIssuerP },
|
|
44
55
|
},
|
|
45
56
|
},
|
|
46
|
-
{
|
|
57
|
+
{
|
|
58
|
+
options: {
|
|
59
|
+
contractGovernorRef: contractGovernorBundle,
|
|
60
|
+
contractGovernorInstallation,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
47
63
|
) => {
|
|
48
|
-
trace('addAuction start'
|
|
64
|
+
trace('addAuction start');
|
|
49
65
|
const STORAGE_PATH = 'auction';
|
|
50
|
-
const { auctionsRef } = options;
|
|
51
66
|
|
|
52
67
|
const poserInvitationP = E(electorateCreatorFacet).getPoserInvitation();
|
|
53
|
-
const bundleID = auctionsRef.bundleID;
|
|
54
|
-
/**
|
|
55
|
-
* @type {Promise<
|
|
56
|
-
* Installation<import('../../src/auction/auctioneer.js')['start']>
|
|
57
|
-
* >}
|
|
58
|
-
*/
|
|
59
|
-
const installationP = E(zoe).installBundleID(bundleID);
|
|
60
|
-
produceInstallation.reset();
|
|
61
|
-
produceInstallation.resolve(installationP);
|
|
62
|
-
|
|
63
68
|
const [
|
|
64
69
|
initialPoserInvitation,
|
|
65
70
|
electorateInvitationAmount,
|
|
66
71
|
stableIssuer,
|
|
67
72
|
legacyKit,
|
|
73
|
+
auctioneerInstallation,
|
|
68
74
|
] = await Promise.all([
|
|
69
75
|
poserInvitationP,
|
|
70
76
|
E(E(zoe).getInvitationIssuer()).getAmountOf(poserInvitationP),
|
|
71
77
|
stableIssuerP,
|
|
72
78
|
legacyKitP,
|
|
79
|
+
auctioneerInstallationP,
|
|
73
80
|
]);
|
|
74
81
|
|
|
75
82
|
// Each field has an extra layer of type + value:
|
|
@@ -95,7 +102,7 @@ export const addAuction = async (
|
|
|
95
102
|
const auctionTerms = makeGovernedATerms(
|
|
96
103
|
{ storageNode, marshaller },
|
|
97
104
|
chainTimerService,
|
|
98
|
-
|
|
105
|
+
priceAuthority8400,
|
|
99
106
|
reservePublicFacet,
|
|
100
107
|
{
|
|
101
108
|
...params,
|
|
@@ -104,12 +111,10 @@ export const addAuction = async (
|
|
|
104
111
|
},
|
|
105
112
|
);
|
|
106
113
|
|
|
107
|
-
const installation = await installationP;
|
|
108
|
-
|
|
109
114
|
const governorTerms = await deeplyFulfilledObject(
|
|
110
115
|
harden({
|
|
111
116
|
timer: chainTimerService,
|
|
112
|
-
governedContractInstallation:
|
|
117
|
+
governedContractInstallation: auctioneerInstallation,
|
|
113
118
|
governed: {
|
|
114
119
|
terms: auctionTerms,
|
|
115
120
|
issuerKeywordRecord: { Bid: stableIssuer },
|
|
@@ -120,7 +125,12 @@ export const addAuction = async (
|
|
|
120
125
|
}),
|
|
121
126
|
);
|
|
122
127
|
|
|
123
|
-
|
|
128
|
+
const bundleIdFromZoe = await E(zoe).getBundleIDFromInstallation(
|
|
129
|
+
contractGovernorInstallation,
|
|
130
|
+
);
|
|
131
|
+
trace('governor bundle ID', bundleIdFromZoe, contractGovernorBundle.bundleID);
|
|
132
|
+
|
|
133
|
+
/** @type {GovernorStartedInstallationKit<typeof auctioneerInstallationP>} */
|
|
124
134
|
const governorStartResult = await E(zoe).startInstance(
|
|
125
135
|
contractGovernorInstallation,
|
|
126
136
|
undefined,
|
|
@@ -136,12 +146,17 @@ export const addAuction = async (
|
|
|
136
146
|
'auctioneer.governor',
|
|
137
147
|
);
|
|
138
148
|
|
|
139
|
-
const [
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
149
|
+
const [
|
|
150
|
+
governedInstance,
|
|
151
|
+
governedCreatorFacet,
|
|
152
|
+
governedPublicFacet,
|
|
153
|
+
governedAdminFacet,
|
|
154
|
+
] = await Promise.all([
|
|
155
|
+
E(governorStartResult.creatorFacet).getInstance(),
|
|
156
|
+
E(governorStartResult.creatorFacet).getCreatorFacet(),
|
|
157
|
+
E(governorStartResult.creatorFacet).getPublicFacet(),
|
|
158
|
+
E(governorStartResult.creatorFacet).getAdminFacet(),
|
|
159
|
+
]);
|
|
145
160
|
|
|
146
161
|
const allIssuers = await E(zoe).getIssuers(legacyKit.instance);
|
|
147
162
|
const { Bid: _istIssuer, ...auctionIssuers } = allIssuers;
|
|
@@ -157,7 +172,7 @@ export const addAuction = async (
|
|
|
157
172
|
const kit = harden({
|
|
158
173
|
label: 'auctioneer',
|
|
159
174
|
creatorFacet: governedCreatorFacet,
|
|
160
|
-
adminFacet:
|
|
175
|
+
adminFacet: governedAdminFacet,
|
|
161
176
|
publicFacet: governedPublicFacet,
|
|
162
177
|
instance: governedInstance,
|
|
163
178
|
|
|
@@ -168,14 +183,6 @@ export const addAuction = async (
|
|
|
168
183
|
produceAuctioneerKit.reset();
|
|
169
184
|
produceAuctioneerKit.resolve(kit);
|
|
170
185
|
|
|
171
|
-
// introduce economic committee charter to new auctioneer
|
|
172
|
-
// cf addGovernorsToEconCharter() in committee-proposal.js
|
|
173
|
-
await E(E.get(econCharterKit).creatorFacet).addInstance(
|
|
174
|
-
kit.instance,
|
|
175
|
-
kit.governorCreatorFacet,
|
|
176
|
-
kit.label,
|
|
177
|
-
);
|
|
178
|
-
|
|
179
186
|
auctionInstance.reset();
|
|
180
187
|
await auctionInstance.resolve(governedInstance);
|
|
181
188
|
// belt and suspenders; the above is supposed to also do this
|
|
@@ -184,7 +191,11 @@ export const addAuction = async (
|
|
|
184
191
|
governedInstance,
|
|
185
192
|
);
|
|
186
193
|
|
|
194
|
+
const governedContractKits = await governedContractKitsP;
|
|
195
|
+
governedContractKits.init(kit.instance, kit);
|
|
187
196
|
auctionUpgradeNewInstance.resolve(governedInstance);
|
|
197
|
+
auctionUpgradeNewGovCreator.resolve(kit.governorCreatorFacet);
|
|
198
|
+
newContractGovBundleId.resolve(contractGovernorBundle.bundleID);
|
|
188
199
|
};
|
|
189
200
|
|
|
190
201
|
export const ADD_AUCTION_MANIFEST = harden({
|
|
@@ -197,22 +208,22 @@ export const ADD_AUCTION_MANIFEST = harden({
|
|
|
197
208
|
chainTimerService: true,
|
|
198
209
|
econCharterKit: true,
|
|
199
210
|
economicCommitteeCreatorFacet: true,
|
|
200
|
-
|
|
211
|
+
governedContractKits: true,
|
|
212
|
+
priceAuthority8400: true,
|
|
201
213
|
zoe: true,
|
|
202
214
|
},
|
|
203
215
|
produce: {
|
|
204
216
|
auctioneerKit: true,
|
|
205
217
|
auctionUpgradeNewInstance: true,
|
|
218
|
+
auctionUpgradeNewGovCreator: true,
|
|
219
|
+
newContractGovBundleId: true,
|
|
206
220
|
},
|
|
207
221
|
instance: {
|
|
208
222
|
consume: { reserve: true },
|
|
209
223
|
produce: { auctioneer: true },
|
|
210
224
|
},
|
|
211
225
|
installation: {
|
|
212
|
-
consume: {
|
|
213
|
-
contractGovernor: true,
|
|
214
|
-
},
|
|
215
|
-
produce: { auctioneer: true },
|
|
226
|
+
consume: { contractGovernor: true, auctioneer: true },
|
|
216
227
|
},
|
|
217
228
|
issuer: {
|
|
218
229
|
consume: { [Stable.symbol]: true },
|
|
@@ -223,12 +234,23 @@ export const ADD_AUCTION_MANIFEST = harden({
|
|
|
223
234
|
/**
|
|
224
235
|
* Add a new auction to a chain that already has one.
|
|
225
236
|
*
|
|
226
|
-
* @param {object}
|
|
237
|
+
* @param {object} utils
|
|
238
|
+
* @param {any} utils.restoreRef
|
|
227
239
|
* @param {any} addAuctionOptions
|
|
228
240
|
*/
|
|
229
|
-
export const getManifestForAddAuction = async (
|
|
241
|
+
export const getManifestForAddAuction = async (
|
|
242
|
+
{ restoreRef },
|
|
243
|
+
{ auctioneerRef, contractGovernorRef },
|
|
244
|
+
) => {
|
|
245
|
+
const contractGovernorInstallation = restoreRef(contractGovernorRef);
|
|
230
246
|
return {
|
|
231
247
|
manifest: ADD_AUCTION_MANIFEST,
|
|
232
|
-
|
|
248
|
+
// XXX we should be able to receive contractGovernorInstallation via
|
|
249
|
+
// installations.consume, but the received installation isn't right.
|
|
250
|
+
options: { contractGovernorRef, contractGovernorInstallation },
|
|
251
|
+
installations: {
|
|
252
|
+
auctioneer: restoreRef(auctioneerRef),
|
|
253
|
+
contractGovernor: restoreRef(contractGovernorRef),
|
|
254
|
+
},
|
|
233
255
|
};
|
|
234
256
|
};
|
|
@@ -9,10 +9,23 @@ export function publishInterchainAssetFromBank({ consume: { bankManager, agoricN
|
|
|
9
9
|
interchainAssetOptions: InterchainAssetOptions;
|
|
10
10
|
};
|
|
11
11
|
}): Promise<void>;
|
|
12
|
-
export function
|
|
12
|
+
export function startScaledPriceAuthority({ consume: { agoricNamesAdmin, startUpgradable, priceAuthorityAdmin, priceAuthority, }, }: BootstrapPowers, { options: { interchainAssetOptions } }: {
|
|
13
13
|
options: {
|
|
14
14
|
interchainAssetOptions: InterchainAssetOptions;
|
|
15
15
|
};
|
|
16
|
+
}): Promise<{
|
|
17
|
+
instance: import("@agoric/zoe/src/zoeService/utils.js").Instance<import("@agoric/zoe/src/zoeService/utils.js").ContractStartFunction>;
|
|
18
|
+
adminFacet: import("@agoric/zoe/src/zoeService/utils.js").AdminFacet<import("@agoric/zoe/src/zoeService/utils.js").ContractStartFunction>;
|
|
19
|
+
creatorFacet: {};
|
|
20
|
+
publicFacet: {};
|
|
21
|
+
} & {
|
|
22
|
+
creatorFacet?: {};
|
|
23
|
+
publicFacet?: {};
|
|
24
|
+
} & {
|
|
25
|
+
label: string;
|
|
26
|
+
}>;
|
|
27
|
+
export function registerScaledPriceAuthority(powers: BootstrapPowers, { options }: {
|
|
28
|
+
options: object;
|
|
16
29
|
}): Promise<void>;
|
|
17
30
|
export function addAssetToVault({ consume: { vaultFactoryKit, agoricNamesAdmin, auctioneerKit, chainTimerService, }, brand: { consume: { [Stable.symbol]: stableP }, }, instance: { consume: consumeInstance }, }: EconomyBootstrapPowers, { options: { debtLimitValue, interestRateValue, interchainAssetOptions, }, }: {
|
|
18
31
|
options: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addAssetToVault.d.ts","sourceRoot":"","sources":["addAssetToVault.js"],"names":[],"mappings":";AA4CO,4FALI,eAAe,2CAEvB;IAAuB,OAAO,EAC9B;QAA+C,sBAAsB,EAA7D,sBAAsB;KAChC;CAAA,yBAsBA;AAQM,yKALI,sBAAsB,2CAE9B;IAAuB,OAAO,EAC9B;QAA+C,sBAAsB,EAA7D,sBAAsB;KAChC;CAAA,iBAmDA;AAQM,
|
|
1
|
+
{"version":3,"file":"addAssetToVault.d.ts","sourceRoot":"","sources":["addAssetToVault.js"],"names":[],"mappings":";AA4CO,4FALI,eAAe,2CAEvB;IAAuB,OAAO,EAC9B;QAA+C,sBAAsB,EAA7D,sBAAsB;KAChC;CAAA,yBAsBA;AAQM,yKALI,sBAAsB,2CAE9B;IAAuB,OAAO,EAC9B;QAA+C,sBAAsB,EAA7D,sBAAsB;KAChC;CAAA,iBAmDA;AAQM,qIALI,eAAe,2CAEvB;IAAuB,OAAO,EAC9B;QAA+C,sBAAsB,EAA7D,sBAAsB;KAChC;CAAA;;;;;;;;;;GAuGA;AAOM,qDAJI,eAAe,eAEvB;IAAuB,OAAO,EAAtB,MAAM;CAChB,iBAgBA;AA+EM,mNAPI,sBAAsB,gFAE9B;IAAuB,OAAO,EAC9B;QAA+C,sBAAsB,EAA7D,sBAAsB;QACmB,cAAc,EAAvD,MAAM,GAAG,MAAM,GAAG,MAAM;QACD,iBAAiB,EAAxC,MAAM;KAChB;CAAA,iBAyEA;AAEM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8EN;;;;;;;;aA1ca,MAAM;;;;;;;;;;;;;;;;4CAQsB,qBAAqB;uBAzBxC,gCAAgC"}
|
|
@@ -129,7 +129,7 @@ export const publishInterchainAssetFromBank = async (
|
|
|
129
129
|
* @param {object} config.options
|
|
130
130
|
* @param {InterchainAssetOptions} config.options.interchainAssetOptions
|
|
131
131
|
*/
|
|
132
|
-
export const
|
|
132
|
+
export const startScaledPriceAuthority = async (
|
|
133
133
|
{
|
|
134
134
|
consume: {
|
|
135
135
|
agoricNamesAdmin,
|
|
@@ -137,7 +137,6 @@ export const registerScaledPriceAuthority = async (
|
|
|
137
137
|
priceAuthorityAdmin,
|
|
138
138
|
priceAuthority,
|
|
139
139
|
},
|
|
140
|
-
instance: { produce: produceInstance },
|
|
141
140
|
},
|
|
142
141
|
{ options: { interchainAssetOptions } },
|
|
143
142
|
) => {
|
|
@@ -170,8 +169,9 @@ export const registerScaledPriceAuthority = async (
|
|
|
170
169
|
]),
|
|
171
170
|
]);
|
|
172
171
|
|
|
172
|
+
// TODO get unit amounts elsewhere https://github.com/Agoric/agoric-sdk/issues/10235
|
|
173
173
|
// We need "unit amounts" of each brand in order to get the ratios right. You
|
|
174
|
-
// can ignore
|
|
174
|
+
// can ignore unit amounts when adding and subtracting a brand with itself,
|
|
175
175
|
// but not when creating ratios.
|
|
176
176
|
const getDecimalP = async brand => {
|
|
177
177
|
const displayInfo = E(brand).getDisplayInfo();
|
|
@@ -230,6 +230,25 @@ export const registerScaledPriceAuthority = async (
|
|
|
230
230
|
true, // force
|
|
231
231
|
);
|
|
232
232
|
|
|
233
|
+
return spaKit;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* @param {BootstrapPowers} powers
|
|
238
|
+
* @param {object} config
|
|
239
|
+
* @param {object} config.options
|
|
240
|
+
*/
|
|
241
|
+
export const registerScaledPriceAuthority = async (powers, { options }) => {
|
|
242
|
+
const {
|
|
243
|
+
instance: { produce: produceInstance },
|
|
244
|
+
} = powers;
|
|
245
|
+
|
|
246
|
+
const { keyword, issuerName = keyword } = options.interchainAssetOptions;
|
|
247
|
+
|
|
248
|
+
const spaKit = await startScaledPriceAuthority(powers, { options });
|
|
249
|
+
|
|
250
|
+
const label = scaledPriceFeedName(issuerName);
|
|
251
|
+
|
|
233
252
|
// publish into agoricNames so that others can await its presence.
|
|
234
253
|
// This must stay after registerPriceAuthority above so it's evidence of registration.
|
|
235
254
|
// eslint-disable-next-line no-restricted-syntax -- computed property
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/** @type {ChainlinkConfig} */
|
|
2
|
+
export const DEFAULT_CONTRACT_TERMS: ChainlinkConfig;
|
|
3
|
+
export function ensureOracleBrand({ namedVat: { consume: { agoricNames }, }, oracleBrand: { produce: oracleBrandProduce }, }: EconomyBootstrapPowers & NamedVatPowers, { name, decimalPlaces }: {
|
|
4
|
+
name: string;
|
|
5
|
+
decimalPlaces: number;
|
|
6
|
+
}): Promise<Brand<"nat">>;
|
|
7
|
+
export function deployPriceFeeds(powers: EconomyBootstrapPowers & NamedVatPowers, config: {
|
|
8
|
+
options: PriceFeedConfig & {
|
|
9
|
+
priceAggregatorRef: {
|
|
10
|
+
bundleID: string;
|
|
11
|
+
};
|
|
12
|
+
scaledPARef: {
|
|
13
|
+
bundleID: string;
|
|
14
|
+
};
|
|
15
|
+
inBrandsDecimals?: number;
|
|
16
|
+
contractTerms?: ChainlinkConfig;
|
|
17
|
+
outBrandName?: string;
|
|
18
|
+
outBrandDecimals?: number;
|
|
19
|
+
};
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
export function getManifestForPriceFeeds({ restoreRef: _restoreRef }: {
|
|
22
|
+
restoreRef: any;
|
|
23
|
+
}, priceFeedOptions: PriceFeedConfig & {
|
|
24
|
+
priceAggregatorRef: any;
|
|
25
|
+
}): Promise<{
|
|
26
|
+
manifest: {
|
|
27
|
+
[x: string]: {
|
|
28
|
+
namedVat: string;
|
|
29
|
+
consume: {
|
|
30
|
+
agoricNamesAdmin: string;
|
|
31
|
+
agoricNames: string;
|
|
32
|
+
board: string;
|
|
33
|
+
chainStorage: string;
|
|
34
|
+
chainTimerService: string;
|
|
35
|
+
contractKits: string;
|
|
36
|
+
econCharterKit: string;
|
|
37
|
+
highPrioritySendersManager: string;
|
|
38
|
+
instancePrivateArgs: string;
|
|
39
|
+
namesByAddressAdmin: string;
|
|
40
|
+
priceAuthority: string;
|
|
41
|
+
priceAuthorityAdmin: string;
|
|
42
|
+
startGovernedUpgradable: string;
|
|
43
|
+
startUpgradable: string;
|
|
44
|
+
zoe: string;
|
|
45
|
+
};
|
|
46
|
+
installation: {
|
|
47
|
+
produce: {
|
|
48
|
+
priceAggregator: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
instance: {
|
|
52
|
+
produce: string;
|
|
53
|
+
};
|
|
54
|
+
oracleBrand: {
|
|
55
|
+
produce: string;
|
|
56
|
+
};
|
|
57
|
+
produce: {
|
|
58
|
+
priceAuthority8400: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
options: {
|
|
63
|
+
oracleAddresses: string[];
|
|
64
|
+
inBrandNames: string[];
|
|
65
|
+
contractTerms?: Partial<ChainlinkConfig>;
|
|
66
|
+
priceAggregatorRef: any;
|
|
67
|
+
};
|
|
68
|
+
}>;
|
|
69
|
+
export type PriceFeedConfig = {
|
|
70
|
+
oracleAddresses: string[];
|
|
71
|
+
inBrandNames: string[];
|
|
72
|
+
contractTerms?: Partial<ChainlinkConfig>;
|
|
73
|
+
};
|
|
74
|
+
import type { ChainlinkConfig } from '@agoric/inter-protocol/src/price/fluxAggregatorKit.js';
|
|
75
|
+
import type { EconomyBootstrapPowers } from './econ-behaviors.js';
|
|
76
|
+
//# sourceMappingURL=deploy-price-feeds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-price-feeds.d.ts","sourceRoot":"","sources":["deploy-price-feeds.js"],"names":[],"mappings":"AAcA,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;AA0HM,yCAZI,sBAAsB,GAAG,cAAc,UACvC;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAxPlC,MAAM,EAAE;sBACX,MAAM,EAAE;wBACN,OAAO,CAAC,eAAe,CAAC;4BAsPM,GAAG;;GAmCpD;8BA5RW;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"}
|