@agoric/fast-usdc 0.1.1-dev-c1d2b71.0 → 0.1.1-dev-7b7ceb9.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 +15 -15
- package/src/exos/advancer.js +9 -2
- package/src/fast-usdc.contract.js +7 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/fast-usdc",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-7b7ceb9.0+7b7ceb9",
|
|
4
4
|
"description": "CLI and library for Fast USDC product",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"lint:eslint": "eslint ."
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
26
|
-
"@agoric/vats": "0.15.2-dev-
|
|
27
|
-
"@agoric/zone": "0.2.3-dev-
|
|
25
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-7b7ceb9.0+7b7ceb9",
|
|
26
|
+
"@agoric/vats": "0.15.2-dev-7b7ceb9.0+7b7ceb9",
|
|
27
|
+
"@agoric/zone": "0.2.3-dev-7b7ceb9.0+7b7ceb9",
|
|
28
28
|
"@fast-check/ava": "^2.0.1",
|
|
29
29
|
"ava": "^5.3.0",
|
|
30
30
|
"c8": "^10.1.2",
|
|
@@ -32,16 +32,16 @@
|
|
|
32
32
|
"ts-blank-space": "^0.4.4"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@agoric/client-utils": "0.1.1-dev-
|
|
36
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
37
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
38
|
-
"@agoric/internal": "0.3.3-dev-
|
|
39
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
40
|
-
"@agoric/orchestration": "0.1.1-dev-
|
|
41
|
-
"@agoric/store": "0.9.3-dev-
|
|
42
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
43
|
-
"@agoric/vow": "0.1.1-dev-
|
|
44
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
35
|
+
"@agoric/client-utils": "0.1.1-dev-7b7ceb9.0+7b7ceb9",
|
|
36
|
+
"@agoric/cosmic-proto": "0.4.1-dev-7b7ceb9.0+7b7ceb9",
|
|
37
|
+
"@agoric/ertp": "0.16.3-dev-7b7ceb9.0+7b7ceb9",
|
|
38
|
+
"@agoric/internal": "0.3.3-dev-7b7ceb9.0+7b7ceb9",
|
|
39
|
+
"@agoric/notifier": "0.6.3-dev-7b7ceb9.0+7b7ceb9",
|
|
40
|
+
"@agoric/orchestration": "0.1.1-dev-7b7ceb9.0+7b7ceb9",
|
|
41
|
+
"@agoric/store": "0.9.3-dev-7b7ceb9.0+7b7ceb9",
|
|
42
|
+
"@agoric/vat-data": "0.5.3-dev-7b7ceb9.0+7b7ceb9",
|
|
43
|
+
"@agoric/vow": "0.1.1-dev-7b7ceb9.0+7b7ceb9",
|
|
44
|
+
"@agoric/zoe": "0.26.3-dev-7b7ceb9.0+7b7ceb9",
|
|
45
45
|
"@cosmjs/proto-signing": "^0.32.4",
|
|
46
46
|
"@cosmjs/stargate": "^0.32.4",
|
|
47
47
|
"@endo/base64": "^1.0.9",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "7b7ceb911dff780df7b4e562b7d87ed2fd628b92"
|
|
85
85
|
}
|
package/src/exos/advancer.js
CHANGED
|
@@ -6,6 +6,7 @@ import { pickFacet } from '@agoric/vat-data';
|
|
|
6
6
|
import { VowShape } from '@agoric/vow';
|
|
7
7
|
import { E } from '@endo/far';
|
|
8
8
|
import { M, mustMatch } from '@endo/patterns';
|
|
9
|
+
import { Fail, q } from '@endo/errors';
|
|
9
10
|
import {
|
|
10
11
|
CctpTxEvidenceShape,
|
|
11
12
|
AddressHookShape,
|
|
@@ -116,6 +117,7 @@ export const prepareAdvancerKit = (
|
|
|
116
117
|
* notifyFacet: import('./settler.js').SettlerKit['notify'];
|
|
117
118
|
* borrowerFacet: LiquidityPoolKit['borrower'];
|
|
118
119
|
* poolAccount: HostInterface<OrchestrationAccount<{chainId: 'agoric'}>>;
|
|
120
|
+
* settlementAddress: ChainAddress;
|
|
119
121
|
* intermediateRecipient?: ChainAddress;
|
|
120
122
|
* }} config
|
|
121
123
|
*/
|
|
@@ -145,10 +147,14 @@ export const prepareAdvancerKit = (
|
|
|
145
147
|
return;
|
|
146
148
|
}
|
|
147
149
|
|
|
148
|
-
const { borrowerFacet, poolAccount } =
|
|
150
|
+
const { borrowerFacet, poolAccount, settlementAddress } =
|
|
151
|
+
this.state;
|
|
149
152
|
const { recipientAddress } = evidence.aux;
|
|
150
153
|
const decoded = decodeAddressHook(recipientAddress);
|
|
151
154
|
mustMatch(decoded, AddressHookShape);
|
|
155
|
+
if (decoded.baseAddress !== settlementAddress.value) {
|
|
156
|
+
throw Fail`⚠️ baseAddress of address hook ${q(decoded.baseAddress)} does not match the expected address ${q(settlementAddress.value)}`;
|
|
157
|
+
}
|
|
152
158
|
const { EUD } = /** @type {AddressHook['query']} */ (decoded.query);
|
|
153
159
|
log(`decoded EUD: ${EUD}`);
|
|
154
160
|
// throws if the bech32 prefix is not found
|
|
@@ -172,10 +178,10 @@ export const prepareAdvancerKit = (
|
|
|
172
178
|
harden({ USDC: advanceAmount }),
|
|
173
179
|
);
|
|
174
180
|
void watch(depositV, this.facets.depositHandler, {
|
|
175
|
-
fullAmount,
|
|
176
181
|
advanceAmount,
|
|
177
182
|
destination,
|
|
178
183
|
forwardingAddress: evidence.tx.forwardingAddress,
|
|
184
|
+
fullAmount,
|
|
179
185
|
tmpSeat,
|
|
180
186
|
txHash: evidence.txHash,
|
|
181
187
|
});
|
|
@@ -271,6 +277,7 @@ export const prepareAdvancerKit = (
|
|
|
271
277
|
borrowerFacet: M.remotable(),
|
|
272
278
|
poolAccount: M.remotable(),
|
|
273
279
|
intermediateRecipient: M.opt(ChainAddressShape),
|
|
280
|
+
settlementAddress: M.opt(ChainAddressShape),
|
|
274
281
|
}),
|
|
275
282
|
},
|
|
276
283
|
);
|
|
@@ -179,16 +179,12 @@ export const contract = async (zcf, privateArgs, zone, tools) => {
|
|
|
179
179
|
},
|
|
180
180
|
async publishAddresses() {
|
|
181
181
|
!baggage.has(ADDRESSES_BAGGAGE_KEY) || Fail`Addresses already published`;
|
|
182
|
-
const [poolAccountAddress
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
E(poolAccount).getAddress(),
|
|
186
|
-
E(settlementAccount).getAddress(),
|
|
187
|
-
]),
|
|
188
|
-
);
|
|
182
|
+
const [poolAccountAddress] = await vowTools.when(
|
|
183
|
+
vowTools.all([E(poolAccount).getAddress()]),
|
|
184
|
+
);
|
|
189
185
|
const addresses = harden({
|
|
190
186
|
poolAccount: poolAccountAddress.value,
|
|
191
|
-
settlementAccount:
|
|
187
|
+
settlementAccount: settlementAddress.value,
|
|
192
188
|
});
|
|
193
189
|
baggage.init(ADDRESSES_BAGGAGE_KEY, addresses);
|
|
194
190
|
await publishAddresses(storageNode, addresses);
|
|
@@ -284,6 +280,8 @@ export const contract = async (zcf, privateArgs, zone, tools) => {
|
|
|
284
280
|
);
|
|
285
281
|
trace('settlementAccount', settlementAccount);
|
|
286
282
|
trace('poolAccount', poolAccount);
|
|
283
|
+
const settlementAddress = await E(settlementAccount).getAddress();
|
|
284
|
+
trace('settlementAddress', settlementAddress);
|
|
287
285
|
|
|
288
286
|
const [_agoric, _noble, agToNoble] = await vowTools.when(
|
|
289
287
|
chainHub.getChainsAndConnection('agoric', 'noble'),
|
|
@@ -300,6 +298,7 @@ export const contract = async (zcf, privateArgs, zone, tools) => {
|
|
|
300
298
|
borrowerFacet: poolKit.borrower,
|
|
301
299
|
notifyFacet: settlerKit.notify,
|
|
302
300
|
poolAccount,
|
|
301
|
+
settlementAddress,
|
|
303
302
|
}),
|
|
304
303
|
);
|
|
305
304
|
// Connect evidence stream to advancer
|