@agoric/zoe 0.26.3-dev-97f26d4.0 → 0.26.3-dev-d708d81.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-contractFacet-js-meta.json +84 -84
- package/bundles/bundle-contractFacet.js +1 -1
- package/package.json +12 -12
- package/src/contractSupport/priceAuthorityQuoteMint.js +15 -27
- package/src/zoeService/feeMint.js +20 -14
- package/src/zoeService/makeInvitation.js +21 -20
- package/src/zoeService/zoeStorageManager.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/zoe",
|
|
3
|
-
"version": "0.26.3-dev-
|
|
3
|
+
"version": "0.26.3-dev-d708d81.0+d708d81",
|
|
4
4
|
"description": "Zoe: the Smart Contract Framework for Offer Enforcement",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/zoeService/zoe.js",
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
},
|
|
44
44
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@agoric/assert": "0.6.1-dev-
|
|
47
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
48
|
-
"@agoric/internal": "0.3.3-dev-
|
|
49
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
50
|
-
"@agoric/store": "0.9.3-dev-
|
|
51
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
52
|
-
"@agoric/swingset-vat": "0.32.3-dev-
|
|
53
|
-
"@agoric/time": "0.3.3-dev-
|
|
54
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
46
|
+
"@agoric/assert": "0.6.1-dev-d708d81.0+d708d81",
|
|
47
|
+
"@agoric/ertp": "0.16.3-dev-d708d81.0+d708d81",
|
|
48
|
+
"@agoric/internal": "0.3.3-dev-d708d81.0+d708d81",
|
|
49
|
+
"@agoric/notifier": "0.6.3-dev-d708d81.0+d708d81",
|
|
50
|
+
"@agoric/store": "0.9.3-dev-d708d81.0+d708d81",
|
|
51
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-d708d81.0+d708d81",
|
|
52
|
+
"@agoric/swingset-vat": "0.32.3-dev-d708d81.0+d708d81",
|
|
53
|
+
"@agoric/time": "0.3.3-dev-d708d81.0+d708d81",
|
|
54
|
+
"@agoric/vat-data": "0.5.3-dev-d708d81.0+d708d81",
|
|
55
55
|
"@endo/bundle-source": "^2.7.0",
|
|
56
56
|
"@endo/captp": "^3.1.4",
|
|
57
57
|
"@endo/eventual-send": "^0.17.5",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"yargs-parser": "^21.1.1"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@agoric/kmarshal": "0.1.1-dev-
|
|
67
|
+
"@agoric/kmarshal": "0.1.1-dev-d708d81.0+d708d81",
|
|
68
68
|
"@endo/init": "^0.5.59",
|
|
69
69
|
"ava": "^5.3.0",
|
|
70
70
|
"c8": "^7.13.0",
|
|
@@ -137,5 +137,5 @@
|
|
|
137
137
|
"typeCoverage": {
|
|
138
138
|
"atLeast": 81.5
|
|
139
139
|
},
|
|
140
|
-
"gitHead": "
|
|
140
|
+
"gitHead": "d708d81ab9cee46fe0c2dfa9555cbabd6f6f44f5"
|
|
141
141
|
}
|
|
@@ -1,34 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
makeDurableIssuerKit,
|
|
4
|
-
prepareIssuerKit,
|
|
5
|
-
} from '@agoric/ertp';
|
|
6
|
-
import { makeScalarBigMapStore } from '@agoric/vat-data';
|
|
1
|
+
import { AssetKind, reallyPrepareIssuerKit } from '@agoric/ertp';
|
|
2
|
+
import { provideDurableMapStore } from '@agoric/vat-data';
|
|
7
3
|
|
|
8
4
|
/**
|
|
9
5
|
*
|
|
10
6
|
* @param {import('@agoric/vat-data').Baggage} baggage
|
|
7
|
+
* @returns {ERef<Mint<'set'>>}
|
|
11
8
|
*/
|
|
12
9
|
export const provideQuoteMint = baggage => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
baggage.init(`quoteMintIssuerBaggage`, issuerBaggage);
|
|
26
|
-
baggageQuoteMint = makeDurableIssuerKit(
|
|
27
|
-
issuerBaggage,
|
|
28
|
-
'quote',
|
|
29
|
-
AssetKind.SET,
|
|
30
|
-
).mint;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return baggageQuoteMint;
|
|
10
|
+
const issuerBaggage = provideDurableMapStore(
|
|
11
|
+
baggage,
|
|
12
|
+
'quoteMintIssuerBaggage',
|
|
13
|
+
);
|
|
14
|
+
const issuerKit = reallyPrepareIssuerKit(
|
|
15
|
+
issuerBaggage,
|
|
16
|
+
'quote',
|
|
17
|
+
AssetKind.SET,
|
|
18
|
+
undefined,
|
|
19
|
+
undefined,
|
|
20
|
+
);
|
|
21
|
+
return issuerKit.mint;
|
|
34
22
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
makeDurableIssuerKit,
|
|
3
2
|
AssetKind,
|
|
4
|
-
prepareIssuerKit,
|
|
5
3
|
IssuerShape,
|
|
6
4
|
BrandShape,
|
|
5
|
+
reallyPrepareIssuerKit,
|
|
6
|
+
hasIssuer,
|
|
7
7
|
} from '@agoric/ertp';
|
|
8
8
|
import { initEmpty, M } from '@agoric/store';
|
|
9
9
|
import {
|
|
@@ -13,8 +13,9 @@ import {
|
|
|
13
13
|
} from '@agoric/vat-data';
|
|
14
14
|
import { FeeMintAccessShape } from '../typeGuards.js';
|
|
15
15
|
|
|
16
|
-
const { Fail } = assert;
|
|
16
|
+
const { Fail, quote: q } = assert;
|
|
17
17
|
|
|
18
|
+
/** @deprecated Redundant. Just omit it. */
|
|
18
19
|
const FEE_MINT_KIT = 'FeeMintKit';
|
|
19
20
|
|
|
20
21
|
export const defaultFeeIssuerConfig = harden(
|
|
@@ -32,19 +33,24 @@ export const defaultFeeIssuerConfig = harden(
|
|
|
32
33
|
*/
|
|
33
34
|
const prepareFeeMint = (zoeBaggage, feeIssuerConfig, shutdownZoeVat) => {
|
|
34
35
|
const mintBaggage = provideDurableMapStore(zoeBaggage, 'mintBaggage');
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
if (mintBaggage.has(FEE_MINT_KIT)) {
|
|
37
|
+
hasIssuer(mintBaggage) ||
|
|
38
|
+
Fail`Legacy ${q(
|
|
39
|
+
FEE_MINT_KIT,
|
|
40
|
+
)} must be redundant with normal storing of issuerKit in issuerBaggage`;
|
|
41
|
+
// Upgrade this legacy state by simply deleting it.
|
|
42
|
+
mintBaggage.delete(FEE_MINT_KIT);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const feeIssuerKit = /** @type {IssuerKit<'nat'>} */ (
|
|
46
|
+
reallyPrepareIssuerKit(
|
|
38
47
|
mintBaggage,
|
|
39
48
|
feeIssuerConfig.name,
|
|
40
49
|
feeIssuerConfig.assetKind,
|
|
41
50
|
feeIssuerConfig.displayInfo,
|
|
42
51
|
shutdownZoeVat,
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
} else {
|
|
46
|
-
prepareIssuerKit(mintBaggage, shutdownZoeVat);
|
|
47
|
-
}
|
|
52
|
+
)
|
|
53
|
+
);
|
|
48
54
|
|
|
49
55
|
const FeeMintIKit = harden({
|
|
50
56
|
feeMint: M.interface('FeeMint', {
|
|
@@ -66,13 +72,13 @@ const prepareFeeMint = (zoeBaggage, feeIssuerConfig, shutdownZoeVat) => {
|
|
|
66
72
|
const { facets } = this;
|
|
67
73
|
facets.feeMintAccess === allegedFeeMintAccess ||
|
|
68
74
|
Fail`The object representing access to the fee brand mint was not provided`;
|
|
69
|
-
return
|
|
75
|
+
return feeIssuerKit;
|
|
70
76
|
},
|
|
71
77
|
getFeeIssuer() {
|
|
72
|
-
return
|
|
78
|
+
return feeIssuerKit.issuer;
|
|
73
79
|
},
|
|
74
80
|
getFeeBrand() {
|
|
75
|
-
return
|
|
81
|
+
return feeIssuerKit.brand;
|
|
76
82
|
},
|
|
77
83
|
},
|
|
78
84
|
// feeMintAccess is an opaque durable object representing the right to get
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @jessie-check
|
|
2
2
|
|
|
3
|
+
import { Fail, q } from '@agoric/assert';
|
|
3
4
|
import { provideDurableMapStore } from '@agoric/vat-data';
|
|
4
|
-
import {
|
|
5
|
-
AssetKind,
|
|
6
|
-
makeDurableIssuerKit,
|
|
7
|
-
prepareIssuerKit,
|
|
8
|
-
} from '@agoric/ertp';
|
|
5
|
+
import { AssetKind, hasIssuer, reallyPrepareIssuerKit } from '@agoric/ertp';
|
|
9
6
|
import { InvitationElementShape } from '../typeGuards.js';
|
|
10
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Not deprecated because the first use below is still correct.
|
|
10
|
+
*/
|
|
11
11
|
const ZOE_INVITATION_KIT = 'ZoeInvitationKit';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -15,26 +15,27 @@ const ZOE_INVITATION_KIT = 'ZoeInvitationKit';
|
|
|
15
15
|
* @param {ShutdownWithFailure | undefined} shutdownZoeVat
|
|
16
16
|
*/
|
|
17
17
|
export const prepareInvitationKit = (baggage, shutdownZoeVat = undefined) => {
|
|
18
|
-
/** @type {IssuerKit<'set'> | undefined} */
|
|
19
|
-
let invitationKit;
|
|
20
|
-
|
|
21
18
|
const invitationKitBaggage = provideDurableMapStore(
|
|
22
19
|
baggage,
|
|
23
20
|
ZOE_INVITATION_KIT,
|
|
24
21
|
);
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
);
|
|
34
|
-
invitationKitBaggage.init(ZOE_INVITATION_KIT, invitationKit);
|
|
35
|
-
} else {
|
|
36
|
-
invitationKit = prepareIssuerKit(invitationKitBaggage);
|
|
22
|
+
if (invitationKitBaggage.has(ZOE_INVITATION_KIT)) {
|
|
23
|
+
// This legacy second use of ZOE_INVITATION_KIT is unneeded.
|
|
24
|
+
hasIssuer(invitationKitBaggage) ||
|
|
25
|
+
Fail`Legacy use of ${q(
|
|
26
|
+
ZOE_INVITATION_KIT,
|
|
27
|
+
)} must be redundant with normal storing of issuerKit in issuerBaggage`;
|
|
28
|
+
// Upgrade this legacy state by simply deleting it.
|
|
29
|
+
invitationKitBaggage.delete(ZOE_INVITATION_KIT);
|
|
37
30
|
}
|
|
31
|
+
const invitationKit = reallyPrepareIssuerKit(
|
|
32
|
+
invitationKitBaggage,
|
|
33
|
+
'Zoe Invitation',
|
|
34
|
+
AssetKind.SET,
|
|
35
|
+
undefined,
|
|
36
|
+
shutdownZoeVat,
|
|
37
|
+
{ elementShape: InvitationElementShape },
|
|
38
|
+
);
|
|
38
39
|
|
|
39
40
|
return harden({
|
|
40
41
|
invitationIssuer: invitationKit.issuer,
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
AssetKind,
|
|
4
4
|
makeDurableIssuerKit,
|
|
5
5
|
AmountMath,
|
|
6
|
-
|
|
6
|
+
upgradeIssuerKit,
|
|
7
7
|
} from '@agoric/ertp';
|
|
8
8
|
import {
|
|
9
9
|
makeScalarBigMapStore,
|
|
@@ -122,7 +122,7 @@ export const makeZoeStorageManager = (
|
|
|
122
122
|
'zoeMintBaggageSet',
|
|
123
123
|
);
|
|
124
124
|
for (const issuerBaggage of zoeMintBaggageSet.values()) {
|
|
125
|
-
|
|
125
|
+
upgradeIssuerKit(issuerBaggage);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
const makeZoeMint = prepareExoClass(
|