@agoric/fast-usdc 0.1.1-dev-0a9d7f0.0 → 0.1.1-dev-545fc58.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/type-guards.js +1 -2
- package/src/update-noble-ica.core.js +19 -5
- package/src/utils/chain-policies.js +34 -23
- package/src/utils/deploy-config.js +1 -5
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-545fc58.0+545fc58",
|
|
4
4
|
"description": "CLI and library for Fast USDC product",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"lint:eslint": "eslint ."
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
27
|
-
"@agoric/vats": "0.15.2-dev-
|
|
28
|
-
"@agoric/zone": "0.2.3-dev-
|
|
26
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-545fc58.0+545fc58",
|
|
27
|
+
"@agoric/vats": "0.15.2-dev-545fc58.0+545fc58",
|
|
28
|
+
"@agoric/zone": "0.2.3-dev-545fc58.0+545fc58",
|
|
29
29
|
"@fast-check/ava": "^2.0.1",
|
|
30
30
|
"ava": "^5.3.0",
|
|
31
31
|
"c8": "^10.1.2",
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
"ts-blank-space": "^0.4.4"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@agoric/client-utils": "0.1.1-dev-
|
|
37
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
38
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
39
|
-
"@agoric/internal": "0.3.3-dev-
|
|
40
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
41
|
-
"@agoric/orchestration": "0.1.1-dev-
|
|
42
|
-
"@agoric/store": "0.9.3-dev-
|
|
43
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
44
|
-
"@agoric/vow": "0.1.1-dev-
|
|
45
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
36
|
+
"@agoric/client-utils": "0.1.1-dev-545fc58.0+545fc58",
|
|
37
|
+
"@agoric/cosmic-proto": "0.4.1-dev-545fc58.0+545fc58",
|
|
38
|
+
"@agoric/ertp": "0.16.3-dev-545fc58.0+545fc58",
|
|
39
|
+
"@agoric/internal": "0.3.3-dev-545fc58.0+545fc58",
|
|
40
|
+
"@agoric/notifier": "0.6.3-dev-545fc58.0+545fc58",
|
|
41
|
+
"@agoric/orchestration": "0.1.1-dev-545fc58.0+545fc58",
|
|
42
|
+
"@agoric/store": "0.9.3-dev-545fc58.0+545fc58",
|
|
43
|
+
"@agoric/vat-data": "0.5.3-dev-545fc58.0+545fc58",
|
|
44
|
+
"@agoric/vow": "0.1.1-dev-545fc58.0+545fc58",
|
|
45
|
+
"@agoric/zoe": "0.26.3-dev-545fc58.0+545fc58",
|
|
46
46
|
"@cosmjs/proto-signing": "^0.32.4",
|
|
47
47
|
"@cosmjs/stargate": "^0.32.4",
|
|
48
48
|
"@endo/base64": "^1.0.9",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"publishConfig": {
|
|
83
83
|
"access": "public"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "545fc5891467147be545b6d3fa765b2e60dde261"
|
|
86
86
|
}
|
package/src/type-guards.js
CHANGED
|
@@ -150,8 +150,7 @@ harden(ChainPolicyShape);
|
|
|
150
150
|
/**
|
|
151
151
|
* @type {TypedPattern<FeedPolicy>}
|
|
152
152
|
*
|
|
153
|
-
*
|
|
154
|
-
* undefined, remotable, etc.
|
|
153
|
+
* must be CopyData; no Brands or other Remotables
|
|
155
154
|
*/
|
|
156
155
|
export const FeedPolicyShape = M.splitRecord(
|
|
157
156
|
{
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/** @file core-eval to 1) update ChainInfo 2) re-request the Noble ICA `intermediateRecipient` */
|
|
2
2
|
|
|
3
|
-
import { E } from '@endo/far';
|
|
4
3
|
import { makeTracer } from '@agoric/internal';
|
|
4
|
+
import { E } from '@endo/far';
|
|
5
|
+
import { publishFeedPolicy } from './utils/core-eval.js';
|
|
6
|
+
import { feedPolicies } from './utils/chain-policies.js';
|
|
5
7
|
|
|
6
8
|
const trace = makeTracer('FUSD-2', true);
|
|
7
9
|
|
|
@@ -11,7 +13,7 @@ const trace = makeTracer('FUSD-2', true);
|
|
|
11
13
|
* @import {ManifestBundleRef} from '@agoric/deploy-script-support/src/externalTypes.js'
|
|
12
14
|
* @import {BootstrapManifest} from '@agoric/vats/src/core/lib-boot.js'
|
|
13
15
|
* @import {FastUSDCCorePowers} from './start-fast-usdc.core.js'
|
|
14
|
-
* @import {ContractRecord} from './types.js'
|
|
16
|
+
* @import {ContractRecord, FeedPolicy} from './types.js'
|
|
15
17
|
*/
|
|
16
18
|
|
|
17
19
|
/**
|
|
@@ -60,13 +62,13 @@ export const updateNobleICA = async (
|
|
|
60
62
|
} = options;
|
|
61
63
|
const { adminFacet, creatorFacet, privateArgs, publicFacet } =
|
|
62
64
|
await fastUsdcKit;
|
|
63
|
-
trace('
|
|
64
|
-
|
|
65
|
+
trace('upgradeContract follows with privateArgs:', Object.keys(privateArgs));
|
|
65
66
|
const upgraded = await E(adminFacet).upgradeContract(
|
|
66
67
|
fastUsdcCode.bundleID,
|
|
67
68
|
privateArgs,
|
|
68
69
|
);
|
|
69
|
-
trace(
|
|
70
|
+
trace(`DON'T PANIC if you see "CORE_EVAL failed" from v1 above. See #11013`);
|
|
71
|
+
trace('fastUsdc upgraded', upgraded);
|
|
70
72
|
|
|
71
73
|
const { agoric, noble } = privateArgs.chainInfo;
|
|
72
74
|
const nobleICAaddr = await E(creatorFacet).connectToNoble(
|
|
@@ -85,6 +87,15 @@ export const updateNobleICA = async (
|
|
|
85
87
|
void E(contractNode)?.setValue(JSON.stringify(addrs));
|
|
86
88
|
};
|
|
87
89
|
|
|
90
|
+
const contractName = 'fastUsdc';
|
|
91
|
+
|
|
92
|
+
export const updateFeedPolicy = async ({ consume: { chainStorage } }) => {
|
|
93
|
+
trace('updateFeedPolicy');
|
|
94
|
+
const storageNode = await E(chainStorage).makeChildNode(contractName);
|
|
95
|
+
await publishFeedPolicy(storageNode, feedPolicies.MAINNET);
|
|
96
|
+
trace('updateFeedPolicy done');
|
|
97
|
+
};
|
|
98
|
+
|
|
88
99
|
/**
|
|
89
100
|
* @param {unknown} _utils
|
|
90
101
|
* @param {{
|
|
@@ -102,6 +113,9 @@ export const getManifestForUpdateNobleICA = (
|
|
|
102
113
|
[updateNobleICA.name]: {
|
|
103
114
|
consume: { chainStorage: true, fastUsdcKit: true },
|
|
104
115
|
},
|
|
116
|
+
[updateFeedPolicy.name]: {
|
|
117
|
+
consume: { chainStorage: true },
|
|
118
|
+
},
|
|
105
119
|
},
|
|
106
120
|
options: { ...options, fastUsdcCode: installKeys.fastUsdc },
|
|
107
121
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/** @import {ChainPolicy} from '../types.js'; */
|
|
2
2
|
|
|
3
|
+
/** ABI for DepositForBurn event in TokenMessenger contract */
|
|
4
|
+
export const DepositForBurnEvent =
|
|
5
|
+
'DepositForBurn(uint64,address,uint256,address,bytes32,uint32,bytes32,bytes32)';
|
|
6
|
+
|
|
3
7
|
/** @satisfies {Record<'MAINNET'| 'TESTNET', Record<string, ChainPolicy>>} */
|
|
4
8
|
export const ChainPolicies = /** @type {const} */ ({
|
|
5
9
|
MAINNET: {
|
|
@@ -9,12 +13,11 @@ export const ChainPolicies = /** @type {const} */ ({
|
|
|
9
13
|
],
|
|
10
14
|
cctpTokenMessengerAddress: '0x19330d10D9Cc8751218eaf51E8885D058642E08A',
|
|
11
15
|
chainId: 42161,
|
|
12
|
-
|
|
13
|
-
confirmations: 2,
|
|
16
|
+
confirmations: 96,
|
|
14
17
|
rateLimits: {
|
|
15
|
-
blockWindow:
|
|
16
|
-
blockWindowSize:
|
|
17
|
-
tx:
|
|
18
|
+
blockWindow: 50_000_000_000n,
|
|
19
|
+
blockWindowSize: 480,
|
|
20
|
+
tx: 20_000_000_000n,
|
|
18
21
|
},
|
|
19
22
|
},
|
|
20
23
|
Base: {
|
|
@@ -23,12 +26,11 @@ export const ChainPolicies = /** @type {const} */ ({
|
|
|
23
26
|
],
|
|
24
27
|
cctpTokenMessengerAddress: '0x1682Ae6375C4E4A97e4B583BC394c861A46D8962',
|
|
25
28
|
chainId: 8453,
|
|
26
|
-
|
|
27
|
-
confirmations: 2,
|
|
29
|
+
confirmations: 12,
|
|
28
30
|
rateLimits: {
|
|
29
|
-
blockWindow:
|
|
30
|
-
blockWindowSize:
|
|
31
|
-
tx:
|
|
31
|
+
blockWindow: 50_000_000_000n,
|
|
32
|
+
blockWindowSize: 60,
|
|
33
|
+
tx: 20_000_000_000n,
|
|
32
34
|
},
|
|
33
35
|
},
|
|
34
36
|
Ethereum: {
|
|
@@ -37,12 +39,11 @@ export const ChainPolicies = /** @type {const} */ ({
|
|
|
37
39
|
],
|
|
38
40
|
cctpTokenMessengerAddress: '0xBd3fa81B58Ba92a82136038B25aDec7066af3155',
|
|
39
41
|
chainId: 1,
|
|
40
|
-
// TODO confirm confirmations and rateLimits
|
|
41
42
|
confirmations: 2,
|
|
42
43
|
rateLimits: {
|
|
43
|
-
blockWindow:
|
|
44
|
+
blockWindow: 50_000_000_000n,
|
|
44
45
|
blockWindowSize: 10,
|
|
45
|
-
tx:
|
|
46
|
+
tx: 20_000_000_000n,
|
|
46
47
|
},
|
|
47
48
|
},
|
|
48
49
|
Optimism: {
|
|
@@ -51,12 +52,11 @@ export const ChainPolicies = /** @type {const} */ ({
|
|
|
51
52
|
],
|
|
52
53
|
cctpTokenMessengerAddress: '0x2B4069517957735bE00ceE0fadAE88a26365528f',
|
|
53
54
|
chainId: 10,
|
|
54
|
-
|
|
55
|
-
confirmations: 2,
|
|
55
|
+
confirmations: 12,
|
|
56
56
|
rateLimits: {
|
|
57
|
-
blockWindow:
|
|
58
|
-
blockWindowSize:
|
|
59
|
-
tx:
|
|
57
|
+
blockWindow: 50_000_000_000n,
|
|
58
|
+
blockWindowSize: 60,
|
|
59
|
+
tx: 20_000_000_000n,
|
|
60
60
|
},
|
|
61
61
|
},
|
|
62
62
|
Polygon: {
|
|
@@ -65,12 +65,11 @@ export const ChainPolicies = /** @type {const} */ ({
|
|
|
65
65
|
],
|
|
66
66
|
cctpTokenMessengerAddress: '0x9daF8c91AEFAE50b9c0E69629D3F6Ca40cA3B3FE',
|
|
67
67
|
chainId: 137,
|
|
68
|
-
|
|
69
|
-
confirmations: 2,
|
|
68
|
+
confirmations: 12,
|
|
70
69
|
rateLimits: {
|
|
71
|
-
blockWindow:
|
|
72
|
-
blockWindowSize:
|
|
73
|
-
tx:
|
|
70
|
+
blockWindow: 50_000_000_000n,
|
|
71
|
+
blockWindowSize: 60,
|
|
72
|
+
tx: 20_000_000_000n,
|
|
74
73
|
},
|
|
75
74
|
},
|
|
76
75
|
},
|
|
@@ -138,3 +137,15 @@ export const ChainPolicies = /** @type {const} */ ({
|
|
|
138
137
|
},
|
|
139
138
|
});
|
|
140
139
|
harden(ChainPolicies);
|
|
140
|
+
|
|
141
|
+
// XXX copied from deploy-config.js to avoid large / off-chain code in a core eval
|
|
142
|
+
export const feedPolicies = {
|
|
143
|
+
MAINNET: {
|
|
144
|
+
nobleAgoricChannelId: 'channel-21',
|
|
145
|
+
nobleDomainId: 4,
|
|
146
|
+
chainPolicies: ChainPolicies.MAINNET,
|
|
147
|
+
eventFilter: DepositForBurnEvent,
|
|
148
|
+
},
|
|
149
|
+
// TESTNET not needed / used
|
|
150
|
+
};
|
|
151
|
+
harden(feedPolicies);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { denomHash, withChainCapabilities } from '@agoric/orchestration';
|
|
2
2
|
import fetchedChainInfo from '@agoric/orchestration/src/fetched-chain-info.js';
|
|
3
|
-
import { ChainPolicies } from './chain-policies.js';
|
|
3
|
+
import { ChainPolicies, DepositForBurnEvent } from './chain-policies.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @import {FastUSDCConfig} from '@agoric/fast-usdc';
|
|
@@ -26,10 +26,6 @@ export const transferAssetInfo = [
|
|
|
26
26
|
];
|
|
27
27
|
harden(transferAssetInfo);
|
|
28
28
|
|
|
29
|
-
/** ABI for DepositForBurn event in TokenMessenger contract */
|
|
30
|
-
const DepositForBurnEvent =
|
|
31
|
-
'DepositForBurn(uint64,address,uint256,address,bytes32,uint32,bytes32,bytes32)';
|
|
32
|
-
|
|
33
29
|
/**
|
|
34
30
|
* @type {Record<string, Pick<FastUSDCConfig, 'oracles' | 'feedPolicy' | 'chainInfo' | 'assetInfo' >>}
|
|
35
31
|
*
|