@agoric/zoe 0.26.3-dev-8ef3fde.0 → 0.26.3-dev-2f34a05.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 +219 -219
- package/bundles/bundle-contractFacet.js +1 -1
- package/package.json +14 -14
- package/src/contractFacet/types-ambient.d.ts +0 -57
- package/src/contractFacet/zcfMint.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.js +2 -14
- package/src/contractFacet/zcfSeat.d.ts.map +1 -1
- package/src/contractFacet/zcfSeat.js +7 -188
- package/src/contractFacet/zcfZygote.d.ts.map +1 -1
- package/src/contractFacet/zcfZygote.js +0 -1
- package/src/contractSupport/zoeHelpers.d.ts +1 -1
- package/src/contractSupport/zoeHelpers.d.ts.map +1 -1
- package/src/contractSupport/zoeHelpers.js +2 -2
- package/src/internal-types.d.ts +0 -1
- package/src/internal-types.d.ts.map +1 -1
- package/src/internal-types.js +0 -1
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-2f34a05.0+2f34a05",
|
|
4
4
|
"description": "Zoe: the Smart Contract Framework for Offer Enforcement",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/zoeService/zoe.js",
|
|
@@ -43,17 +43,17 @@
|
|
|
43
43
|
},
|
|
44
44
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@agoric/base-zone": "0.1.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-
|
|
55
|
-
"@agoric/vow": "0.1.1-dev-
|
|
56
|
-
"@agoric/zone": "0.2.3-dev-
|
|
46
|
+
"@agoric/base-zone": "0.1.1-dev-2f34a05.0+2f34a05",
|
|
47
|
+
"@agoric/ertp": "0.16.3-dev-2f34a05.0+2f34a05",
|
|
48
|
+
"@agoric/internal": "0.3.3-dev-2f34a05.0+2f34a05",
|
|
49
|
+
"@agoric/notifier": "0.6.3-dev-2f34a05.0+2f34a05",
|
|
50
|
+
"@agoric/store": "0.9.3-dev-2f34a05.0+2f34a05",
|
|
51
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-2f34a05.0+2f34a05",
|
|
52
|
+
"@agoric/swingset-vat": "0.32.3-dev-2f34a05.0+2f34a05",
|
|
53
|
+
"@agoric/time": "0.3.3-dev-2f34a05.0+2f34a05",
|
|
54
|
+
"@agoric/vat-data": "0.5.3-dev-2f34a05.0+2f34a05",
|
|
55
|
+
"@agoric/vow": "0.1.1-dev-2f34a05.0+2f34a05",
|
|
56
|
+
"@agoric/zone": "0.2.3-dev-2f34a05.0+2f34a05",
|
|
57
57
|
"@endo/bundle-source": "^3.5.1",
|
|
58
58
|
"@endo/captp": "^4.4.4",
|
|
59
59
|
"@endo/common": "^1.2.9",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"yargs-parser": "^21.1.1"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@agoric/kmarshal": "0.1.1-dev-
|
|
73
|
+
"@agoric/kmarshal": "0.1.1-dev-2f34a05.0+2f34a05",
|
|
74
74
|
"@endo/init": "^1.1.8",
|
|
75
75
|
"ava": "^5.3.0",
|
|
76
76
|
"c8": "^10.1.2",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"typeCoverage": {
|
|
101
101
|
"atLeast": 85.11
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "2f34a051458eb123cf2e8d0cef0e318583b60c0e"
|
|
104
104
|
}
|
|
@@ -24,11 +24,6 @@ type ZCF<CT = Record<string, unknown>> = {
|
|
|
24
24
|
* - atomically reallocate amounts among seats.
|
|
25
25
|
*/
|
|
26
26
|
atomicRearrange: (transfers: TransferPart[]) => void;
|
|
27
|
-
/**
|
|
28
|
-
* - reallocate amounts among seats.
|
|
29
|
-
* @deprecated Use atomicRearrange instead.
|
|
30
|
-
*/
|
|
31
|
-
reallocate: Reallocate;
|
|
32
27
|
/**
|
|
33
28
|
* - check
|
|
34
29
|
* whether a keyword is valid and unique and could be added in
|
|
@@ -86,34 +81,6 @@ type ZCF<CT = Record<string, unknown>> = {
|
|
|
86
81
|
getInstance: () => Instance;
|
|
87
82
|
};
|
|
88
83
|
|
|
89
|
-
/**
|
|
90
|
-
* @deprecated Use atomicRearrange instead
|
|
91
|
-
*
|
|
92
|
-
* The contract can reallocate over seats, which commits the staged
|
|
93
|
-
* allocation for each seat. On commit, the staged allocation becomes
|
|
94
|
-
* the current allocation and the staged allocation is deleted.
|
|
95
|
-
*
|
|
96
|
-
* The reallocation will only succeed if the reallocation 1) conserves
|
|
97
|
-
* rights (the amounts specified have the same total value as the
|
|
98
|
-
* current total amount), and 2) is 'offer-safe' for all parties
|
|
99
|
-
* involved. All seats that have staged allocations must be included
|
|
100
|
-
* as arguments to `reallocate`, or an error is thrown. Additionally,
|
|
101
|
-
* an error is thrown if any seats included in `reallocate` do not
|
|
102
|
-
* have a staged allocation.
|
|
103
|
-
*
|
|
104
|
-
* The reallocation is partial, meaning that it applies only to the
|
|
105
|
-
* seats passed in as arguments. By induction, if rights conservation
|
|
106
|
-
* and offer safety hold before, they will hold after a safe
|
|
107
|
-
* reallocation, even though we only re-validate for the seats whose
|
|
108
|
-
* allocations will change. Since rights are conserved for the change,
|
|
109
|
-
* overall rights will be unchanged, and a reallocation can only
|
|
110
|
-
* effect offer safety for seats whose allocations change.
|
|
111
|
-
*/
|
|
112
|
-
type Reallocate = (
|
|
113
|
-
seat1: ZCFSeat,
|
|
114
|
-
seat2: ZCFSeat,
|
|
115
|
-
...seatRest: Array<ZCFSeat>
|
|
116
|
-
) => void;
|
|
117
84
|
type TransferPart = [
|
|
118
85
|
fromSeat?: ZCFSeat,
|
|
119
86
|
toSeat?: ZCFSeat,
|
|
@@ -184,31 +151,7 @@ type ZCFSeat = import('@endo/pass-style').RemotableObject & {
|
|
|
184
151
|
brand?: B,
|
|
185
152
|
) => B extends Brand<infer K> ? Amount<K> : Amount;
|
|
186
153
|
getCurrentAllocation: () => Allocation;
|
|
187
|
-
/**
|
|
188
|
-
* @deprecated Use atomicRearrange instead
|
|
189
|
-
*/
|
|
190
|
-
getStagedAllocation: () => Allocation;
|
|
191
|
-
/**
|
|
192
|
-
* @deprecated Use atomicRearrange instead
|
|
193
|
-
*/
|
|
194
|
-
hasStagedAllocation: () => boolean;
|
|
195
154
|
isOfferSafe: (newAllocation: Allocation) => boolean;
|
|
196
|
-
/**
|
|
197
|
-
* @deprecated Use atomicRearrange instead
|
|
198
|
-
*/
|
|
199
|
-
incrementBy: (
|
|
200
|
-
amountKeywordRecord: AmountKeywordRecord,
|
|
201
|
-
) => AmountKeywordRecord;
|
|
202
|
-
/**
|
|
203
|
-
* @deprecated Use atomicRearrange instead
|
|
204
|
-
*/
|
|
205
|
-
decrementBy: (
|
|
206
|
-
amountKeywordRecord: AmountKeywordRecord,
|
|
207
|
-
) => AmountKeywordRecord;
|
|
208
|
-
/**
|
|
209
|
-
* @deprecated Use atomicRearrange instead
|
|
210
|
-
*/
|
|
211
|
-
clear: () => void;
|
|
212
155
|
};
|
|
213
156
|
type ZcfSeatKit = {
|
|
214
157
|
zcfSeat: ZCFSeat;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zcfMint.d.ts","sourceRoot":"","sources":["zcfMint.js"],"names":[],"mappings":"AAmBO,4CAJI,mBAAmB,gBACnB,YAAY,GACV,MAAM,CAYlB;AASM,0CANI,OAAO,kBAAkB,EAAE,OAAO,gBAClC;IAAE,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,IAAI,CAAA;CAAE,uBACvD,mBAAmB,oBACnB,CAAC,IAAI,CAAC,EAAE,SAAS,KAAK;IAAE,OAAO,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;CAAE,eACnE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"zcfMint.d.ts","sourceRoot":"","sources":["zcfMint.js"],"names":[],"mappings":"AAmBO,4CAJI,mBAAmB,gBACnB,YAAY,GACV,MAAM,CAYlB;AASM,0CANI,OAAO,kBAAkB,EAAE,OAAO,gBAClC;IAAE,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,IAAI,CAAA;CAAE,uBACvD,mBAAmB,oBACnB,CAAC,IAAI,CAAC,EAAE,SAAS,KAAK;IAAE,OAAO,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;CAAE,eACnE,kBAAkB,IA0Gb,SAJH,MAIU,EAAE,UAHZ,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAGK,KAFlB,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAWjC"}
|
|
@@ -87,19 +87,13 @@ export const prepareZcMint = (
|
|
|
87
87
|
gains,
|
|
88
88
|
);
|
|
89
89
|
|
|
90
|
-
// Increment the stagedAllocation if it exists so that the
|
|
91
|
-
// stagedAllocation is kept up to the currentAllocation
|
|
92
|
-
if (zcfSeat.hasStagedAllocation()) {
|
|
93
|
-
zcfSeat.incrementBy(gains);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
90
|
// Offer safety should never be able to be violated here, as
|
|
97
91
|
// we are adding assets. However, we keep this check so that
|
|
98
92
|
// all reallocations are covered by offer safety checks, and
|
|
99
93
|
// that any bug within Zoe that may affect this is caught.
|
|
100
94
|
zcfSeat.isOfferSafe(allocationPlusGains) ||
|
|
101
95
|
Fail`The allocation after minting gains ${allocationPlusGains} for the zcfSeat was not offer safe`;
|
|
102
|
-
// No effects above,
|
|
96
|
+
// No effects above, Note COMMIT POINT within
|
|
103
97
|
// reallocator.reallocate(). The following two steps *should* be
|
|
104
98
|
// committed atomically, but it is not a disaster if they are
|
|
105
99
|
// not. If we minted only, no one would ever get those
|
|
@@ -129,13 +123,7 @@ export const prepareZcMint = (
|
|
|
129
123
|
zcfSeat.isOfferSafe(allocationMinusLosses) ||
|
|
130
124
|
Fail`The allocation after burning losses ${allocationMinusLosses} for the zcfSeat was not offer safe`;
|
|
131
125
|
|
|
132
|
-
//
|
|
133
|
-
// stagedAllocation is kept up to the currentAllocation
|
|
134
|
-
if (zcfSeat.hasStagedAllocation()) {
|
|
135
|
-
zcfSeat.decrementBy(losses);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// No effects above, apart from decrementBy. Note COMMIT POINT within
|
|
126
|
+
// No effects above, Note COMMIT POINT within
|
|
139
127
|
// reallocator.reallocate(). The following two steps *should* be
|
|
140
128
|
// committed atomically, but it is not a disaster if they are
|
|
141
129
|
// not. If we only commit the allocationMinusLosses no one would
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zcfSeat.d.ts","sourceRoot":"","sources":["zcfSeat.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zcfSeat.d.ts","sourceRoot":"","sources":["zcfSeat.js"],"names":[],"mappings":"AAqCO,oDANI,IAAI,CAAC,gBAAgB,CAAC,uBACtB,mBAAmB,uBACnB,OAAO,sBAAsB,EAAE,mBAAmB,cAClD,OAAO,kBAAkB,EAAE,OAAO,GAChC;IAAE,WAAW,EAAE,cAAc,CAAC;IAAC,kBAAkB,EAAE,kBAAkB,CAAA;CAAE,CAuTnF"}
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
prepareExoClass,
|
|
6
6
|
prepareExoClassKit,
|
|
7
7
|
provide,
|
|
8
|
-
provideDurableMapStore,
|
|
9
8
|
provideDurableWeakMapStore,
|
|
10
9
|
} from '@agoric/vat-data';
|
|
11
10
|
import { AmountMath } from '@agoric/ertp';
|
|
@@ -13,8 +12,6 @@ import { initEmpty, M } from '@agoric/store';
|
|
|
13
12
|
|
|
14
13
|
import { isOfferSafe } from './offerSafety.js';
|
|
15
14
|
import { assertRightsConserved } from './rightsConservation.js';
|
|
16
|
-
import { addToAllocation, subtractFromAllocation } from './allocationMath.js';
|
|
17
|
-
import { coerceAmountKeywordRecord } from '../cleanProposal.js';
|
|
18
15
|
import {
|
|
19
16
|
AmountKeywordRecordShape,
|
|
20
17
|
SeatDataShape,
|
|
@@ -46,11 +43,11 @@ export const createSeatManager = (
|
|
|
46
43
|
) => {
|
|
47
44
|
/** @type {WeakMapStore<ZCFSeat, Allocation>} */
|
|
48
45
|
let activeZCFSeats = provideDurableWeakMapStore(zcfBaggage, 'activeZCFSeats');
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
'zcfSeatToStagedAllocations'
|
|
53
|
-
|
|
46
|
+
|
|
47
|
+
// Removed. See #6679
|
|
48
|
+
if (zcfBaggage.has('zcfSeatToStagedAllocations')) {
|
|
49
|
+
zcfBaggage.delete('zcfSeatToStagedAllocations');
|
|
50
|
+
}
|
|
54
51
|
|
|
55
52
|
/** @type {WeakMapStore<ZCFSeat, SeatHandle>} */
|
|
56
53
|
let zcfSeatToSeatHandle = provideDurableWeakMapStore(
|
|
@@ -89,64 +86,6 @@ export const createSeatManager = (
|
|
|
89
86
|
return activeZCFSeats.get(zcfSeat);
|
|
90
87
|
};
|
|
91
88
|
|
|
92
|
-
/**
|
|
93
|
-
* @param {ZCFSeat} zcfSeat
|
|
94
|
-
* @returns {void}
|
|
95
|
-
*/
|
|
96
|
-
const commitStagedAllocation = zcfSeat => {
|
|
97
|
-
// By this point, we have checked that the zcfSeat is a key in
|
|
98
|
-
// activeZCFSeats and in zcfSeatToStagedAllocations.
|
|
99
|
-
activeZCFSeats.set(zcfSeat, zcfSeat.getStagedAllocation());
|
|
100
|
-
zcfSeatToStagedAllocations.delete(zcfSeat);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* @param {ZCFSeat} zcfSeat
|
|
105
|
-
* @returns {Allocation}
|
|
106
|
-
*/
|
|
107
|
-
const hasStagedAllocation = zcfSeatToStagedAllocations.has;
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Get the stagedAllocation. If one does not exist, return the
|
|
111
|
-
* currentAllocation. We return the currentAllocation in this case
|
|
112
|
-
* so that downstream users do not have to check whether the
|
|
113
|
-
* stagedAllocation is defined before adding to it or subtracting
|
|
114
|
-
* from it. To check whether a stagedAllocation exists, use
|
|
115
|
-
* `hasStagedAllocation`
|
|
116
|
-
*
|
|
117
|
-
* @param {ZCFSeat} zcfSeat
|
|
118
|
-
* @returns {Allocation}
|
|
119
|
-
*/
|
|
120
|
-
const getStagedAllocation = zcfSeat => {
|
|
121
|
-
if (zcfSeatToStagedAllocations.has(zcfSeat)) {
|
|
122
|
-
return zcfSeatToStagedAllocations.get(zcfSeat);
|
|
123
|
-
} else {
|
|
124
|
-
return activeZCFSeats.get(zcfSeat);
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
const assertStagedAllocation = zcfSeat => {
|
|
129
|
-
hasStagedAllocation(zcfSeat) ||
|
|
130
|
-
Fail`Reallocate failed because a seat had no staged allocation. Please add or subtract from the seat and then reallocate.`;
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
const setStagedAllocation = (zcfSeat, newStagedAllocation) => {
|
|
134
|
-
if (zcfSeatToStagedAllocations.has(zcfSeat)) {
|
|
135
|
-
zcfSeatToStagedAllocations.set(zcfSeat, newStagedAllocation);
|
|
136
|
-
} else {
|
|
137
|
-
zcfSeatToStagedAllocations.init(zcfSeat, newStagedAllocation);
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
/** @param {ZCFSeat} zcfSeat */
|
|
142
|
-
const assertNoStagedAllocation = zcfSeat => {
|
|
143
|
-
if (hasStagedAllocation(zcfSeat)) {
|
|
144
|
-
Fail`The seat could not be exited with a staged but uncommitted allocation: ${getStagedAllocation(
|
|
145
|
-
zcfSeat,
|
|
146
|
-
)}. Please reallocate over this seat or clear the staged allocation.`;
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
|
|
150
89
|
const ZCFSeatI = M.interface('ZCFSeat', {}, { sloppy: true });
|
|
151
90
|
|
|
152
91
|
const makeZCFSeatInternal = prepareExoClass(
|
|
@@ -168,7 +107,6 @@ export const createSeatManager = (
|
|
|
168
107
|
exit(completion) {
|
|
169
108
|
const { self } = this;
|
|
170
109
|
assertActive(self);
|
|
171
|
-
assertNoStagedAllocation(self);
|
|
172
110
|
doExitSeat(self);
|
|
173
111
|
void E(zoeInstanceAdmin).exitSeat(
|
|
174
112
|
zcfSeatToSeatHandle.get(self),
|
|
@@ -226,10 +164,6 @@ export const createSeatManager = (
|
|
|
226
164
|
const { self } = this;
|
|
227
165
|
return getCurrentAllocation(self);
|
|
228
166
|
},
|
|
229
|
-
getStagedAllocation() {
|
|
230
|
-
const { self } = this;
|
|
231
|
-
return getStagedAllocation(self);
|
|
232
|
-
},
|
|
233
167
|
isOfferSafe(newAllocation) {
|
|
234
168
|
const { state, self } = this;
|
|
235
169
|
assertActive(self);
|
|
@@ -241,53 +175,6 @@ export const createSeatManager = (
|
|
|
241
175
|
|
|
242
176
|
return isOfferSafe(state.proposal, reallocation);
|
|
243
177
|
},
|
|
244
|
-
/**
|
|
245
|
-
* @deprecated switch to zcf.atomicRearrange()
|
|
246
|
-
* @param {AmountKeywordRecord} amountKeywordRecord
|
|
247
|
-
*/
|
|
248
|
-
incrementBy(amountKeywordRecord) {
|
|
249
|
-
const { self } = this;
|
|
250
|
-
assertActive(self);
|
|
251
|
-
amountKeywordRecord = coerceAmountKeywordRecord(
|
|
252
|
-
amountKeywordRecord,
|
|
253
|
-
getAssetKindByBrand,
|
|
254
|
-
);
|
|
255
|
-
setStagedAllocation(
|
|
256
|
-
self,
|
|
257
|
-
addToAllocation(getStagedAllocation(self), amountKeywordRecord),
|
|
258
|
-
);
|
|
259
|
-
return amountKeywordRecord;
|
|
260
|
-
},
|
|
261
|
-
/**
|
|
262
|
-
* @deprecated switch to zcf.atomicRearrange()
|
|
263
|
-
* @param {AmountKeywordRecord} amountKeywordRecord
|
|
264
|
-
*/
|
|
265
|
-
decrementBy(amountKeywordRecord) {
|
|
266
|
-
const { self } = this;
|
|
267
|
-
assertActive(self);
|
|
268
|
-
amountKeywordRecord = coerceAmountKeywordRecord(
|
|
269
|
-
amountKeywordRecord,
|
|
270
|
-
getAssetKindByBrand,
|
|
271
|
-
);
|
|
272
|
-
setStagedAllocation(
|
|
273
|
-
self,
|
|
274
|
-
subtractFromAllocation(
|
|
275
|
-
getStagedAllocation(self),
|
|
276
|
-
amountKeywordRecord,
|
|
277
|
-
),
|
|
278
|
-
);
|
|
279
|
-
return amountKeywordRecord;
|
|
280
|
-
},
|
|
281
|
-
clear() {
|
|
282
|
-
const { self } = this;
|
|
283
|
-
if (zcfSeatToStagedAllocations.has(self)) {
|
|
284
|
-
zcfSeatToStagedAllocations.delete(self);
|
|
285
|
-
}
|
|
286
|
-
},
|
|
287
|
-
hasStagedAllocation() {
|
|
288
|
-
const { self } = this;
|
|
289
|
-
return hasStagedAllocation(self);
|
|
290
|
-
},
|
|
291
178
|
},
|
|
292
179
|
);
|
|
293
180
|
|
|
@@ -301,9 +188,6 @@ export const createSeatManager = (
|
|
|
301
188
|
seatManager: M.interface('ZcfSeatManager', {
|
|
302
189
|
makeZCFSeat: M.call(SeatDataShape).returns(M.remotable('zcfSeat')),
|
|
303
190
|
atomicRearrange: M.call(M.arrayOf(TransferPartShape)).returns(),
|
|
304
|
-
reallocate: M.call(M.remotable('zcfSeat'), M.remotable('zcfSeat'))
|
|
305
|
-
.rest(M.arrayOf(M.remotable('zcfSeat')))
|
|
306
|
-
.returns(),
|
|
307
191
|
dropAllReferences: M.call().returns(),
|
|
308
192
|
}),
|
|
309
193
|
zcfMintReallocator: M.interface('MintReallocator', {
|
|
@@ -355,8 +239,6 @@ export const createSeatManager = (
|
|
|
355
239
|
// ////// All Seats are active /////////////////////////////////
|
|
356
240
|
for (const [seat] of newAllocations) {
|
|
357
241
|
assertActive(seat);
|
|
358
|
-
!seat.hasStagedAllocation() ||
|
|
359
|
-
Fail`Cannot mix atomicRearrange with seat stagings: ${seat}`;
|
|
360
242
|
zcfSeatToSeatHandle.has(seat) ||
|
|
361
243
|
Fail`The seat ${seat} was not recognized`;
|
|
362
244
|
}
|
|
@@ -415,69 +297,6 @@ export const createSeatManager = (
|
|
|
415
297
|
throw err;
|
|
416
298
|
}
|
|
417
299
|
},
|
|
418
|
-
reallocate(/** @type {ZCFSeat[]} */ ...seats) {
|
|
419
|
-
for (const seat of seats) {
|
|
420
|
-
assertActive(seat);
|
|
421
|
-
assertStagedAllocation(seat);
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
// Ensure that rights are conserved overall.
|
|
425
|
-
const flattenAllocations = allocations =>
|
|
426
|
-
allocations.flatMap(Object.values);
|
|
427
|
-
const previousAllocations = seats.map(seat =>
|
|
428
|
-
seat.getCurrentAllocation(),
|
|
429
|
-
);
|
|
430
|
-
const previousAmounts = flattenAllocations(previousAllocations);
|
|
431
|
-
const newAllocations = seats.map(seat => seat.getStagedAllocation());
|
|
432
|
-
const newAmounts = flattenAllocations(newAllocations);
|
|
433
|
-
|
|
434
|
-
assertRightsConserved(previousAmounts, newAmounts);
|
|
435
|
-
|
|
436
|
-
// Ensure that offer safety holds.
|
|
437
|
-
for (const seat of seats) {
|
|
438
|
-
isOfferSafe(seat.getProposal(), seat.getStagedAllocation()) ||
|
|
439
|
-
Fail`Offer safety was violated by the proposed allocation: ${seat.getStagedAllocation()}. Proposal was ${seat.getProposal()}`;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
// Keep track of seats used so far in this call, to prevent aliasing.
|
|
443
|
-
const zcfSeatsSoFar = new Set();
|
|
444
|
-
|
|
445
|
-
for (const seat of seats) {
|
|
446
|
-
zcfSeatToSeatHandle.has(seat) ||
|
|
447
|
-
Fail`The seat ${seat} was not recognized`;
|
|
448
|
-
!zcfSeatsSoFar.has(seat) ||
|
|
449
|
-
Fail`Seat (${seat}) was already an argument to reallocate`;
|
|
450
|
-
zcfSeatsSoFar.add(seat);
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
try {
|
|
454
|
-
// No side effects above. All conditions checked which could have
|
|
455
|
-
// caused us to reject this reallocation.
|
|
456
|
-
// COMMIT POINT
|
|
457
|
-
// All the effects below must succeed "atomically". Scare quotes because
|
|
458
|
-
// the eventual send at the bottom is part of this "atomicity" even
|
|
459
|
-
// though its effects happen later. The send occurs in the order of
|
|
460
|
-
// updates from zcf to zoe, its effects must occur immediately in zoe
|
|
461
|
-
// on reception, and must not fail.
|
|
462
|
-
//
|
|
463
|
-
// Commit the staged allocations (currentAllocation is replaced
|
|
464
|
-
// for each of the seats) and inform Zoe of the
|
|
465
|
-
// newAllocation.
|
|
466
|
-
|
|
467
|
-
for (const seat of seats) {
|
|
468
|
-
commitStagedAllocation(seat);
|
|
469
|
-
}
|
|
470
|
-
const seatHandleAllocations = seats.map(seat => {
|
|
471
|
-
const seatHandle = zcfSeatToSeatHandle.get(seat);
|
|
472
|
-
return { seatHandle, allocation: seat.getCurrentAllocation() };
|
|
473
|
-
});
|
|
474
|
-
|
|
475
|
-
E(zoeInstanceAdmin).replaceAllocations(seatHandleAllocations);
|
|
476
|
-
} catch (err) {
|
|
477
|
-
shutdownWithFailure(err);
|
|
478
|
-
throw err;
|
|
479
|
-
}
|
|
480
|
-
},
|
|
481
300
|
dropAllReferences() {
|
|
482
301
|
activeZCFSeats = replaceDurableWeakMapStore(
|
|
483
302
|
zcfBaggage,
|
|
@@ -490,9 +309,9 @@ export const createSeatManager = (
|
|
|
490
309
|
},
|
|
491
310
|
},
|
|
492
311
|
zcfMintReallocator: {
|
|
493
|
-
// Unlike the zcf.
|
|
312
|
+
// Unlike the zcf.atomicRearrange method, this one does not check
|
|
494
313
|
// conservation, and so can be used internally for reallocations that
|
|
495
|
-
// violate conservation.
|
|
314
|
+
// violate conservation, like minting and burning.
|
|
496
315
|
reallocate(zcfSeat, newAllocation) {
|
|
497
316
|
try {
|
|
498
317
|
// COMMIT POINT
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zcfZygote.d.ts","sourceRoot":"","sources":["zcfZygote.js"],"names":[],"mappings":"AAiDO,sCARI,SAAS,cACT,IAAI,CAAC,UAAU,CAAC,oBAChB,MAAM,CAAC,KAAK,CAAC,iBACb,aAAa,qBACb,SAAS,eACT,OAAO,kBAAkB,EAAE,OAAO,GAChC,OAAO,CAAC,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"zcfZygote.d.ts","sourceRoot":"","sources":["zcfZygote.js"],"names":[],"mappings":"AAiDO,sCARI,SAAS,cACT,IAAI,CAAC,UAAU,CAAC,oBAChB,MAAM,CAAC,KAAK,CAAC,iBACb,aAAa,qBACb,SAAS,eACT,OAAO,kBAAkB,EAAE,OAAO,GAChC,OAAO,CAAC,SAAS,CAAC,CAod9B"}
|
|
@@ -283,7 +283,6 @@ export const makeZCFZygote = async (
|
|
|
283
283
|
/** @type {ZCF} */
|
|
284
284
|
const zcf = prepareExo(zcfBaggage, 'zcf', ZcfI, {
|
|
285
285
|
atomicRearrange: transfers => seatManager.atomicRearrange(transfers),
|
|
286
|
-
reallocate: (...seats) => seatManager.reallocate(...seats),
|
|
287
286
|
assertUniqueKeyword: kwd => getInstanceRecHolder().assertUniqueKeyword(kwd),
|
|
288
287
|
saveIssuer: async (issuerP, keyword) => {
|
|
289
288
|
// TODO: The checks of the keyword for uniqueness are
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const defaultAcceptanceMsg: "The offer has been accepted. Once the contract has been completed, please check your payout";
|
|
5
5
|
export function assertIssuerKeywords(zcf: any, expected: any): void;
|
|
6
|
-
export function satisfies(
|
|
6
|
+
export function satisfies(_ignored: any, seat: ZcfSeatPartial, update: AmountKeywordRecord): 0 | 1;
|
|
7
7
|
/** @type {Swap} */
|
|
8
8
|
export const swap: Swap;
|
|
9
9
|
/** @type {SwapExact} */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zoeHelpers.d.ts","sourceRoot":"","sources":["zoeHelpers.js"],"names":[],"mappings":"AASA;;GAEG;AAEH,iIAAkI;AAI3H,oEAON;AAuBM
|
|
1
|
+
{"version":3,"file":"zoeHelpers.d.ts","sourceRoot":"","sources":["zoeHelpers.js"],"names":[],"mappings":"AASA;;GAEG;AAEH,iIAAkI;AAI3H,oEAON;AAuBM,oCALI,GAAG,QACH,cAAc,UACd,mBAAmB,GACjB,CAAC,GAAC,CAAC,CAOf;AAED,mBAAmB;AACnB,mBADW,IAAI,CAkBb;AAEF,wBAAwB;AACxB,wBADW,SAAS,CAqBlB;AAiBK,uCAHI,OAAO,iBACP,OAAO,QAIgD;AAsB3D,0CAHI,OAAO,YACP,cAAc,QA8BxB;AAGM,+DAGN;AAED,6EAA8E;AAavE,mCANI,GAAG,iBACH,OAAO,WACP,mBAAmB,YACnB,qBAAqB,GACnB,OAAO,CAAC,MAAM,CAAC,CA8B3B;AAYM,sCALI,GAAG,QACH,OAAO,WACP,mBAAmB,GACjB,OAAO,CAAC,qBAAqB,CAAC,CAQ1C;AAWM,oCAJI,GAAG,wBACH,mBAAmB,4EAgB7B;AAED,0BAA0B;AAC1B,0BADW,WAAW,CAYpB;AAiDK,wBAHe,IAAI,kBACJ,MAAM,uBA/BjB,GAAG,cAGH,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,kBAG9B,oBAAoB,GAAG,SAAS,YAKhC,QAAQ,YAGR,OAAO,WAGP,OAAO,cAIP,IAAI,GAGF,OAAO,CAAC;IAAC,eAAe,EAAE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;CAAC,CAAC,CA+D1G;;iBAxVa,MAAM,cAAc;0BACpB,MAAM,UAAU;;;;;;;6BAnBJ,gBAAgB"}
|
|
@@ -40,12 +40,12 @@ export const assertIssuerKeywords = (zcf, expected) => {
|
|
|
40
40
|
* false and 1 for true. When multiples are introduced, any
|
|
41
41
|
* positive return value will mean true.
|
|
42
42
|
*
|
|
43
|
-
* @param {
|
|
43
|
+
* @param {any} _ignored no longer used.
|
|
44
44
|
* @param {ZcfSeatPartial} seat
|
|
45
45
|
* @param {AmountKeywordRecord} update
|
|
46
46
|
* @returns {0|1}
|
|
47
47
|
*/
|
|
48
|
-
export const satisfies = (
|
|
48
|
+
export const satisfies = (_ignored, seat, update) => {
|
|
49
49
|
const currentAllocation = seat.getCurrentAllocation();
|
|
50
50
|
const newAllocation = { ...currentAllocation, ...update };
|
|
51
51
|
const proposal = seat.getProposal();
|
package/src/internal-types.d.ts
CHANGED
|
@@ -143,7 +143,6 @@ type MakeZCFSeat = (seatData: SeatData) => ZCFSeat;
|
|
|
143
143
|
type DropAllReferences = () => void;
|
|
144
144
|
type ZcfSeatManager = {
|
|
145
145
|
makeZCFSeat: MakeZCFSeat;
|
|
146
|
-
reallocate: Reallocate;
|
|
147
146
|
dropAllReferences: DropAllReferences;
|
|
148
147
|
};
|
|
149
148
|
type ZcfMintReallocator = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-types.d.ts","sourceRoot":"","sources":["internal-types.js"],"names":[],"mappings":";cAKc,cAAc;uBACd,UAAU;gBACV,UAAU;gBACV,MAAM;;;;;qCAOT,UAAU,KACR,qBAAqB;;sBAKpB,CAAC,UAAU,EAAC,UAAU,KAAK,qBAAqB;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