@agoric/inter-protocol 0.17.0-u17.1 → 0.17.0-u18.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 +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 -38
- 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, econCharterKit,
|
|
1
|
+
export function addAuction({ consume: { agoricNamesAdmin, auctioneerKit: legacyKitP, board, chainStorage, chainTimerService, economicCommitteeCreatorFacet: electorateCreatorFacet, econCharterKit, 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,knBATI,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,iBAuLH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BG;AASI,yDAHJ;IAAmB,UAAU,EAArB,GAAG;CACX,0CAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBb;8BA/PY,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
|
{
|
|
@@ -27,49 +34,50 @@ export const addAuction = async (
|
|
|
27
34
|
chainTimerService,
|
|
28
35
|
economicCommitteeCreatorFacet: electorateCreatorFacet,
|
|
29
36
|
econCharterKit,
|
|
30
|
-
|
|
37
|
+
governedContractKits: governedContractKitsP,
|
|
38
|
+
priceAuthority8400,
|
|
31
39
|
zoe,
|
|
32
40
|
},
|
|
33
|
-
produce: {
|
|
41
|
+
produce: {
|
|
42
|
+
auctioneerKit: produceAuctioneerKit,
|
|
43
|
+
auctionUpgradeNewInstance,
|
|
44
|
+
auctionUpgradeNewGovCreator,
|
|
45
|
+
newContractGovBundleId,
|
|
46
|
+
},
|
|
34
47
|
instance: {
|
|
35
48
|
consume: { reserve: reserveInstance },
|
|
36
49
|
produce: { auctioneer: auctionInstance },
|
|
37
50
|
},
|
|
38
51
|
installation: {
|
|
39
|
-
consume: {
|
|
40
|
-
produce: { auctioneer: produceInstallation },
|
|
52
|
+
consume: { auctioneer: auctioneerInstallationP },
|
|
41
53
|
},
|
|
42
54
|
issuer: {
|
|
43
55
|
consume: { [Stable.symbol]: stableIssuerP },
|
|
44
56
|
},
|
|
45
57
|
},
|
|
46
|
-
{
|
|
58
|
+
{
|
|
59
|
+
options: {
|
|
60
|
+
contractGovernorRef: contractGovernorBundle,
|
|
61
|
+
contractGovernorInstallation,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
47
64
|
) => {
|
|
48
|
-
trace('addAuction start'
|
|
65
|
+
trace('addAuction start');
|
|
49
66
|
const STORAGE_PATH = 'auction';
|
|
50
|
-
const { auctionsRef } = options;
|
|
51
67
|
|
|
52
68
|
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
69
|
const [
|
|
64
70
|
initialPoserInvitation,
|
|
65
71
|
electorateInvitationAmount,
|
|
66
72
|
stableIssuer,
|
|
67
73
|
legacyKit,
|
|
74
|
+
auctioneerInstallation,
|
|
68
75
|
] = await Promise.all([
|
|
69
76
|
poserInvitationP,
|
|
70
77
|
E(E(zoe).getInvitationIssuer()).getAmountOf(poserInvitationP),
|
|
71
78
|
stableIssuerP,
|
|
72
79
|
legacyKitP,
|
|
80
|
+
auctioneerInstallationP,
|
|
73
81
|
]);
|
|
74
82
|
|
|
75
83
|
// Each field has an extra layer of type + value:
|
|
@@ -95,7 +103,7 @@ export const addAuction = async (
|
|
|
95
103
|
const auctionTerms = makeGovernedATerms(
|
|
96
104
|
{ storageNode, marshaller },
|
|
97
105
|
chainTimerService,
|
|
98
|
-
|
|
106
|
+
priceAuthority8400,
|
|
99
107
|
reservePublicFacet,
|
|
100
108
|
{
|
|
101
109
|
...params,
|
|
@@ -104,12 +112,10 @@ export const addAuction = async (
|
|
|
104
112
|
},
|
|
105
113
|
);
|
|
106
114
|
|
|
107
|
-
const installation = await installationP;
|
|
108
|
-
|
|
109
115
|
const governorTerms = await deeplyFulfilledObject(
|
|
110
116
|
harden({
|
|
111
117
|
timer: chainTimerService,
|
|
112
|
-
governedContractInstallation:
|
|
118
|
+
governedContractInstallation: auctioneerInstallation,
|
|
113
119
|
governed: {
|
|
114
120
|
terms: auctionTerms,
|
|
115
121
|
issuerKeywordRecord: { Bid: stableIssuer },
|
|
@@ -120,7 +126,12 @@ export const addAuction = async (
|
|
|
120
126
|
}),
|
|
121
127
|
);
|
|
122
128
|
|
|
123
|
-
|
|
129
|
+
const bundleIdFromZoe = await E(zoe).getBundleIDFromInstallation(
|
|
130
|
+
contractGovernorInstallation,
|
|
131
|
+
);
|
|
132
|
+
trace('governor bundle ID', bundleIdFromZoe, contractGovernorBundle.bundleID);
|
|
133
|
+
|
|
134
|
+
/** @type {GovernorStartedInstallationKit<typeof auctioneerInstallationP>} */
|
|
124
135
|
const governorStartResult = await E(zoe).startInstance(
|
|
125
136
|
contractGovernorInstallation,
|
|
126
137
|
undefined,
|
|
@@ -136,12 +147,17 @@ export const addAuction = async (
|
|
|
136
147
|
'auctioneer.governor',
|
|
137
148
|
);
|
|
138
149
|
|
|
139
|
-
const [
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
150
|
+
const [
|
|
151
|
+
governedInstance,
|
|
152
|
+
governedCreatorFacet,
|
|
153
|
+
governedPublicFacet,
|
|
154
|
+
governedAdminFacet,
|
|
155
|
+
] = await Promise.all([
|
|
156
|
+
E(governorStartResult.creatorFacet).getInstance(),
|
|
157
|
+
E(governorStartResult.creatorFacet).getCreatorFacet(),
|
|
158
|
+
E(governorStartResult.creatorFacet).getPublicFacet(),
|
|
159
|
+
E(governorStartResult.creatorFacet).getAdminFacet(),
|
|
160
|
+
]);
|
|
145
161
|
|
|
146
162
|
const allIssuers = await E(zoe).getIssuers(legacyKit.instance);
|
|
147
163
|
const { Bid: _istIssuer, ...auctionIssuers } = allIssuers;
|
|
@@ -157,7 +173,7 @@ export const addAuction = async (
|
|
|
157
173
|
const kit = harden({
|
|
158
174
|
label: 'auctioneer',
|
|
159
175
|
creatorFacet: governedCreatorFacet,
|
|
160
|
-
adminFacet:
|
|
176
|
+
adminFacet: governedAdminFacet,
|
|
161
177
|
publicFacet: governedPublicFacet,
|
|
162
178
|
instance: governedInstance,
|
|
163
179
|
|
|
@@ -184,7 +200,11 @@ export const addAuction = async (
|
|
|
184
200
|
governedInstance,
|
|
185
201
|
);
|
|
186
202
|
|
|
203
|
+
const governedContractKits = await governedContractKitsP;
|
|
204
|
+
governedContractKits.init(kit.instance, kit);
|
|
187
205
|
auctionUpgradeNewInstance.resolve(governedInstance);
|
|
206
|
+
auctionUpgradeNewGovCreator.resolve(kit.governorCreatorFacet);
|
|
207
|
+
newContractGovBundleId.resolve(contractGovernorBundle.bundleID);
|
|
188
208
|
};
|
|
189
209
|
|
|
190
210
|
export const ADD_AUCTION_MANIFEST = harden({
|
|
@@ -197,22 +217,22 @@ export const ADD_AUCTION_MANIFEST = harden({
|
|
|
197
217
|
chainTimerService: true,
|
|
198
218
|
econCharterKit: true,
|
|
199
219
|
economicCommitteeCreatorFacet: true,
|
|
200
|
-
|
|
220
|
+
governedContractKits: true,
|
|
221
|
+
priceAuthority8400: true,
|
|
201
222
|
zoe: true,
|
|
202
223
|
},
|
|
203
224
|
produce: {
|
|
204
225
|
auctioneerKit: true,
|
|
205
226
|
auctionUpgradeNewInstance: true,
|
|
227
|
+
auctionUpgradeNewGovCreator: true,
|
|
228
|
+
newContractGovBundleId: true,
|
|
206
229
|
},
|
|
207
230
|
instance: {
|
|
208
231
|
consume: { reserve: true },
|
|
209
232
|
produce: { auctioneer: true },
|
|
210
233
|
},
|
|
211
234
|
installation: {
|
|
212
|
-
consume: {
|
|
213
|
-
contractGovernor: true,
|
|
214
|
-
},
|
|
215
|
-
produce: { auctioneer: true },
|
|
235
|
+
consume: { contractGovernor: true, auctioneer: true },
|
|
216
236
|
},
|
|
217
237
|
issuer: {
|
|
218
238
|
consume: { [Stable.symbol]: true },
|
|
@@ -223,12 +243,23 @@ export const ADD_AUCTION_MANIFEST = harden({
|
|
|
223
243
|
/**
|
|
224
244
|
* Add a new auction to a chain that already has one.
|
|
225
245
|
*
|
|
226
|
-
* @param {object}
|
|
246
|
+
* @param {object} utils
|
|
247
|
+
* @param {any} utils.restoreRef
|
|
227
248
|
* @param {any} addAuctionOptions
|
|
228
249
|
*/
|
|
229
|
-
export const getManifestForAddAuction = async (
|
|
250
|
+
export const getManifestForAddAuction = async (
|
|
251
|
+
{ restoreRef },
|
|
252
|
+
{ auctioneerRef, contractGovernorRef },
|
|
253
|
+
) => {
|
|
254
|
+
const contractGovernorInstallation = restoreRef(contractGovernorRef);
|
|
230
255
|
return {
|
|
231
256
|
manifest: ADD_AUCTION_MANIFEST,
|
|
232
|
-
|
|
257
|
+
// XXX we should be able to receive contractGovernorInstallation via
|
|
258
|
+
// installations.consume, but the received installation isn't right.
|
|
259
|
+
options: { contractGovernorRef, contractGovernorInstallation },
|
|
260
|
+
installations: {
|
|
261
|
+
auctioneer: restoreRef(auctioneerRef),
|
|
262
|
+
contractGovernor: restoreRef(contractGovernorRef),
|
|
263
|
+
},
|
|
233
264
|
};
|
|
234
265
|
};
|
|
@@ -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"}
|