@agoric/fast-usdc 0.2.0-upgrade-20-dev-ef71cfd.0 → 0.2.0-upgrade-19-devnet-dev-5428c4d.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/README.md +91 -17
- package/package.json +29 -22
- package/src/add-operators.core.js +63 -0
- package/src/cli/config.js +1 -1
- package/src/cli/lp-commands.js +2 -2
- package/src/cli/operator-commands.js +4 -1
- package/src/cli/transfer.js +2 -2
- package/src/constants.js +2 -2
- package/src/distribute-fees.core.js +93 -0
- package/src/exos/advancer.js +369 -0
- package/src/exos/liquidity-pool.js +414 -0
- package/src/exos/operator-kit.js +124 -0
- package/src/exos/settler.js +393 -0
- package/src/exos/status-manager.js +427 -0
- package/src/exos/transaction-feed.js +259 -0
- package/src/fast-usdc-policy.core.js +65 -0
- package/src/fast-usdc.contract.js +316 -0
- package/src/fast-usdc.flows.js +23 -0
- package/src/pool-share-math.js +26 -18
- package/src/start-fast-usdc.core.js +246 -0
- package/src/type-guards.js +13 -49
- package/src/types.ts +12 -58
- package/src/utils/chain-policies.js +140 -0
- package/src/utils/config-marshal.js +130 -0
- package/src/utils/core-eval.js +73 -0
- package/src/utils/deploy-config.js +127 -0
- package/src/utils/fees.js +18 -104
- package/src/utils/zoe.js +28 -0
- package/src/operator-kit-interface.js +0 -29
- package/tools/mock-evidence.ts +0 -208
package/tools/mock-evidence.ts
DELETED
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import { encodeAddressHook } from '@agoric/cosmic-proto/address-hooks.js';
|
|
2
|
-
import type { Bech32Address, CosmosChainAddress } from '@agoric/orchestration';
|
|
3
|
-
import type { CctpTxEvidence, EvmAddress } from '../src/types.js';
|
|
4
|
-
|
|
5
|
-
const mockScenarios = [
|
|
6
|
-
'AGORIC_PLUS_OSMO',
|
|
7
|
-
'AGORIC_PLUS_DYDX',
|
|
8
|
-
'AGORIC_PLUS_AGORIC',
|
|
9
|
-
'AGORIC_NO_PARAMS',
|
|
10
|
-
'AGORIC_UNKNOWN_EUD',
|
|
11
|
-
'AGORIC_PLUS_ETHEREUM',
|
|
12
|
-
'AGORIC_PLUS_NOBLE',
|
|
13
|
-
'AGORIC_PLUS_NOBLE_B32EUD',
|
|
14
|
-
] as const;
|
|
15
|
-
|
|
16
|
-
export type MockScenario = (typeof mockScenarios)[number];
|
|
17
|
-
|
|
18
|
-
export const Senders = {
|
|
19
|
-
default: '0xDefaultFakeEthereumAddress',
|
|
20
|
-
} as unknown as Record<string, EvmAddress>;
|
|
21
|
-
|
|
22
|
-
const blockTimestamp = 1632340000n;
|
|
23
|
-
|
|
24
|
-
export const MockCctpTxEvidences: Record<
|
|
25
|
-
MockScenario,
|
|
26
|
-
(receiverAddress?: Bech32Address) => CctpTxEvidence
|
|
27
|
-
> = {
|
|
28
|
-
AGORIC_PLUS_OSMO: (receiverAddress?: Bech32Address) => ({
|
|
29
|
-
blockHash:
|
|
30
|
-
'0x90d7343e04f8160892e94f02d6a9b9f255663ed0ac34caca98544c8143fee665',
|
|
31
|
-
blockNumber: 21037663n,
|
|
32
|
-
blockTimestamp,
|
|
33
|
-
txHash:
|
|
34
|
-
'0xc81bc6105b60a234c7c50ac17816ebcd5561d366df8bf3be59ff387552761702',
|
|
35
|
-
tx: {
|
|
36
|
-
amount: 150000000n,
|
|
37
|
-
forwardingAddress: 'noble1x0ydg69dh6fqvr27xjvp6maqmrldam6yfelqkd',
|
|
38
|
-
sender: Senders.default,
|
|
39
|
-
},
|
|
40
|
-
aux: {
|
|
41
|
-
forwardingChannel: 'channel-21',
|
|
42
|
-
recipientAddress:
|
|
43
|
-
receiverAddress ||
|
|
44
|
-
encodeAddressHook(settlementAddress.value, {
|
|
45
|
-
EUD: 'osmo183dejcnmkka5dzcu9xw6mywq0p2m5peks28men',
|
|
46
|
-
}),
|
|
47
|
-
},
|
|
48
|
-
chainId: 1,
|
|
49
|
-
}),
|
|
50
|
-
AGORIC_PLUS_DYDX: (receiverAddress?: Bech32Address) => ({
|
|
51
|
-
blockHash:
|
|
52
|
-
'0x80d7343e04f8160892e94f02d6a9b9f255663ed0ac34caca98544c8143fee699',
|
|
53
|
-
blockNumber: 21037669n,
|
|
54
|
-
blockTimestamp,
|
|
55
|
-
txHash:
|
|
56
|
-
'0xd81bc6105b60a234c7c50ac17816ebcd5561d366df8bf3be59ff387552761799',
|
|
57
|
-
tx: {
|
|
58
|
-
amount: 300000000n,
|
|
59
|
-
forwardingAddress: 'noble1x0ydg69dh6fqvr27xjvp6maqmrldam6yfelktz',
|
|
60
|
-
sender: Senders.default,
|
|
61
|
-
},
|
|
62
|
-
aux: {
|
|
63
|
-
forwardingChannel: 'channel-21',
|
|
64
|
-
recipientAddress:
|
|
65
|
-
receiverAddress ||
|
|
66
|
-
encodeAddressHook(settlementAddress.value, {
|
|
67
|
-
EUD: 'dydx183dejcnmkka5dzcu9xw6mywq0p2m5peks28men',
|
|
68
|
-
}),
|
|
69
|
-
},
|
|
70
|
-
chainId: 1,
|
|
71
|
-
}),
|
|
72
|
-
AGORIC_PLUS_AGORIC: (receiverAddress?: Bech32Address) => ({
|
|
73
|
-
blockHash:
|
|
74
|
-
'0x80d7343e04f8160892e94f02d6a9b9f255663ed0ac34caca98544c8143fee6z9',
|
|
75
|
-
blockNumber: 21037600n,
|
|
76
|
-
blockTimestamp,
|
|
77
|
-
txHash:
|
|
78
|
-
'0xd81bc6105b60a234c7c50ac17816ebcd5561d366df8bf3be59ff3875527617z9',
|
|
79
|
-
tx: {
|
|
80
|
-
amount: 250000000n,
|
|
81
|
-
forwardingAddress: 'noble17ww3rfusv895d92c0ncgj0fl9trntn70jz7hd5',
|
|
82
|
-
sender: Senders.default,
|
|
83
|
-
},
|
|
84
|
-
aux: {
|
|
85
|
-
forwardingChannel: 'channel-21',
|
|
86
|
-
recipientAddress:
|
|
87
|
-
receiverAddress ||
|
|
88
|
-
encodeAddressHook(settlementAddress.value, {
|
|
89
|
-
EUD: 'agoric13rj0cc0hm5ac2nt0sdup2l7gvkx4v9tyvgq3h2',
|
|
90
|
-
}),
|
|
91
|
-
},
|
|
92
|
-
chainId: 1,
|
|
93
|
-
}),
|
|
94
|
-
AGORIC_NO_PARAMS: (receiverAddress?: Bech32Address) => ({
|
|
95
|
-
blockHash:
|
|
96
|
-
'0x70d7343e04f8160892e94f02d6a9b9f255663ed0ac34caca98544c8143fee699',
|
|
97
|
-
blockNumber: 21037669n,
|
|
98
|
-
blockTimestamp,
|
|
99
|
-
txHash:
|
|
100
|
-
'0xa81bc6105b60a234c7c50ac17816ebcd5561d366df8bf3be59ff387552761799',
|
|
101
|
-
tx: {
|
|
102
|
-
amount: 200000000n,
|
|
103
|
-
forwardingAddress: 'noble1x0ydg69dh6fqvr27xjvp6maqmrldam6yfelyyy',
|
|
104
|
-
sender: Senders.default,
|
|
105
|
-
},
|
|
106
|
-
aux: {
|
|
107
|
-
forwardingChannel: 'channel-21',
|
|
108
|
-
recipientAddress: receiverAddress || settlementAddress.value,
|
|
109
|
-
},
|
|
110
|
-
chainId: 1,
|
|
111
|
-
}),
|
|
112
|
-
AGORIC_UNKNOWN_EUD: (receiverAddress?: Bech32Address) => ({
|
|
113
|
-
blockHash:
|
|
114
|
-
'0x70d7343e04f8160892e94f02d6a9b9f255663ed0ac34caca98544c8143fee699',
|
|
115
|
-
blockNumber: 21037669n,
|
|
116
|
-
blockTimestamp,
|
|
117
|
-
txHash:
|
|
118
|
-
'0xa81bc6105b60a234c7c50ac17816ebcd5561d366df8bf3be59ff387552761799',
|
|
119
|
-
tx: {
|
|
120
|
-
amount: 200000000n,
|
|
121
|
-
forwardingAddress: 'noble1x0ydg69dh6fqvr27xjvp6maqmrldam6yfelyyy',
|
|
122
|
-
sender: Senders.default,
|
|
123
|
-
},
|
|
124
|
-
aux: {
|
|
125
|
-
forwardingChannel: 'channel-21',
|
|
126
|
-
recipientAddress:
|
|
127
|
-
receiverAddress ||
|
|
128
|
-
encodeAddressHook(settlementAddress.value, {
|
|
129
|
-
EUD: 'random1addr',
|
|
130
|
-
}),
|
|
131
|
-
},
|
|
132
|
-
chainId: 1,
|
|
133
|
-
}),
|
|
134
|
-
AGORIC_PLUS_ETHEREUM: (receiverAddress?: Bech32Address) => ({
|
|
135
|
-
blockHash:
|
|
136
|
-
'0x80d7343e04f8160892e94f02d6a9b9f255663ed0ac34caca98544c8143fee6z9',
|
|
137
|
-
blockNumber: 21037600n,
|
|
138
|
-
blockTimestamp,
|
|
139
|
-
txHash:
|
|
140
|
-
'0xe81bc6105b60a234c7c50ac17816ebcd5561d366df8bf3be59ff3875527617z9',
|
|
141
|
-
tx: {
|
|
142
|
-
amount: 950000000n,
|
|
143
|
-
forwardingAddress: 'noble17ww3rfusv895d92c0ncgj0fl9trntn70jz7ee5',
|
|
144
|
-
sender: Senders.default,
|
|
145
|
-
},
|
|
146
|
-
aux: {
|
|
147
|
-
forwardingChannel: 'channel-21',
|
|
148
|
-
recipientAddress:
|
|
149
|
-
receiverAddress ||
|
|
150
|
-
encodeAddressHook(settlementAddress.value, {
|
|
151
|
-
EUD: 'eip155:1:0x1234567890123456789012345678901234567890',
|
|
152
|
-
}),
|
|
153
|
-
},
|
|
154
|
-
chainId: 8453,
|
|
155
|
-
}),
|
|
156
|
-
AGORIC_PLUS_NOBLE: (receiverAddress?: Bech32Address) => ({
|
|
157
|
-
blockHash:
|
|
158
|
-
'0x80d7343e04f8160892e94f02d6a9b9f255663ed0ac34caca98544c8143fee6z9',
|
|
159
|
-
blockNumber: 21037600n,
|
|
160
|
-
blockTimestamp,
|
|
161
|
-
txHash:
|
|
162
|
-
'0xe81bc6105b60a234c7c50ac17816ebcd5561d366df8bf3be59ff3875527617z9',
|
|
163
|
-
tx: {
|
|
164
|
-
amount: 950000000n,
|
|
165
|
-
forwardingAddress: 'noble17ww3rfusv895d92c0ncgj0fl9trntn70jz7ee5',
|
|
166
|
-
sender: Senders.default,
|
|
167
|
-
},
|
|
168
|
-
aux: {
|
|
169
|
-
forwardingChannel: 'channel-21',
|
|
170
|
-
recipientAddress:
|
|
171
|
-
receiverAddress ||
|
|
172
|
-
encodeAddressHook(settlementAddress.value, {
|
|
173
|
-
EUD: 'cosmos:noble-1:noble1u2l9za2wa7wvffhtekgyuvyvum06lwhqxfyr5d',
|
|
174
|
-
}),
|
|
175
|
-
},
|
|
176
|
-
chainId: 8453,
|
|
177
|
-
}),
|
|
178
|
-
/** Identical to AGORIC_PLUS_NOBLE, but the EUD is a bare bech32 */
|
|
179
|
-
AGORIC_PLUS_NOBLE_B32EUD: (receiverAddress?: Bech32Address) => ({
|
|
180
|
-
blockHash:
|
|
181
|
-
'0x80d7343e04f8160892e94f02d6a9b9f255663ed0ac34caca98544c8143fee6z9',
|
|
182
|
-
blockNumber: 21037600n,
|
|
183
|
-
blockTimestamp,
|
|
184
|
-
txHash:
|
|
185
|
-
'0xe81bc6105b60a234c7c50ac17816ebcd5561d366df8bf3be59ff3875527617z9',
|
|
186
|
-
tx: {
|
|
187
|
-
amount: 950000000n,
|
|
188
|
-
forwardingAddress: 'noble17ww3rfusv895d92c0ncgj0fl9trntn70jz7ee5',
|
|
189
|
-
sender: Senders.default,
|
|
190
|
-
},
|
|
191
|
-
aux: {
|
|
192
|
-
forwardingChannel: 'channel-21',
|
|
193
|
-
recipientAddress:
|
|
194
|
-
receiverAddress ||
|
|
195
|
-
encodeAddressHook(settlementAddress.value, {
|
|
196
|
-
EUD: 'noble1u2l9za2wa7wvffhtekgyuvyvum06lwhqxfyr5d',
|
|
197
|
-
}),
|
|
198
|
-
},
|
|
199
|
-
chainId: 8453,
|
|
200
|
-
}),
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
export const settlementAddress: CosmosChainAddress = harden({
|
|
204
|
-
chainId: 'agoric-3',
|
|
205
|
-
encoding: 'bech32' as const,
|
|
206
|
-
// Random value, copied from tests of address hooks
|
|
207
|
-
value: 'agoric16kv2g7snfc4q24vg3pjdlnnqgngtjpwtetd2h689nz09lcklvh5s8u37ek',
|
|
208
|
-
});
|