@agoric/builders 0.1.1-dev-83191e7.0 → 0.1.1-dev-9d6cff1.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/builders",
3
- "version": "0.1.1-dev-83191e7.0+83191e7",
3
+ "version": "0.1.1-dev-9d6cff1.0+9d6cff1",
4
4
  "description": "Build scripts for proposals to an Agoric chain",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -23,14 +23,14 @@
23
23
  "author": "Agoric",
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
- "@agoric/ertp": "0.16.3-dev-83191e7.0+83191e7",
27
- "@agoric/fast-usdc": "0.1.1-dev-83191e7.0+83191e7",
28
- "@agoric/internal": "0.3.3-dev-83191e7.0+83191e7",
29
- "@agoric/notifier": "0.6.3-dev-83191e7.0+83191e7",
30
- "@agoric/smart-wallet": "0.5.4-dev-83191e7.0+83191e7",
31
- "@agoric/vat-data": "0.5.3-dev-83191e7.0+83191e7",
32
- "@agoric/vats": "0.15.2-dev-83191e7.0+83191e7",
33
- "@agoric/zoe": "0.26.3-dev-83191e7.0+83191e7",
26
+ "@agoric/ertp": "0.16.3-dev-9d6cff1.0+9d6cff1",
27
+ "@agoric/fast-usdc": "0.1.1-dev-9d6cff1.0+9d6cff1",
28
+ "@agoric/internal": "0.3.3-dev-9d6cff1.0+9d6cff1",
29
+ "@agoric/notifier": "0.6.3-dev-9d6cff1.0+9d6cff1",
30
+ "@agoric/smart-wallet": "0.5.4-dev-9d6cff1.0+9d6cff1",
31
+ "@agoric/vat-data": "0.5.3-dev-9d6cff1.0+9d6cff1",
32
+ "@agoric/vats": "0.15.2-dev-9d6cff1.0+9d6cff1",
33
+ "@agoric/zoe": "0.26.3-dev-9d6cff1.0+9d6cff1",
34
34
  "@endo/bundle-source": "^3.5.0",
35
35
  "@endo/captp": "^4.4.3",
36
36
  "@endo/eventual-send": "^1.2.8",
@@ -43,14 +43,14 @@
43
43
  "import-meta-resolve": "^2.2.1"
44
44
  },
45
45
  "devDependencies": {
46
- "@agoric/deploy-script-support": "0.10.4-dev-83191e7.0+83191e7",
47
- "@agoric/governance": "0.10.4-dev-83191e7.0+83191e7",
48
- "@agoric/inter-protocol": "0.16.2-dev-83191e7.0+83191e7",
49
- "@agoric/orchestration": "0.1.1-dev-83191e7.0+83191e7",
50
- "@agoric/store": "0.9.3-dev-83191e7.0+83191e7",
51
- "@agoric/swing-store": "0.9.2-dev-83191e7.0+83191e7",
52
- "@agoric/swingset-liveslots": "0.10.3-dev-83191e7.0+83191e7",
53
- "@agoric/time": "0.3.3-dev-83191e7.0+83191e7",
46
+ "@agoric/deploy-script-support": "0.10.4-dev-9d6cff1.0+9d6cff1",
47
+ "@agoric/governance": "0.10.4-dev-9d6cff1.0+9d6cff1",
48
+ "@agoric/inter-protocol": "0.16.2-dev-9d6cff1.0+9d6cff1",
49
+ "@agoric/orchestration": "0.1.1-dev-9d6cff1.0+9d6cff1",
50
+ "@agoric/store": "0.9.3-dev-9d6cff1.0+9d6cff1",
51
+ "@agoric/swing-store": "0.9.2-dev-9d6cff1.0+9d6cff1",
52
+ "@agoric/swingset-liveslots": "0.10.3-dev-9d6cff1.0+9d6cff1",
53
+ "@agoric/time": "0.3.3-dev-9d6cff1.0+9d6cff1",
54
54
  "@endo/errors": "^1.2.8",
55
55
  "ava": "^5.3.0",
56
56
  "c8": "^9.1.0"
@@ -83,5 +83,5 @@
83
83
  "typeCoverage": {
84
84
  "atLeast": 89.69
85
85
  },
86
- "gitHead": "83191e72b348e6b4123c8c60916cd981bb024d0b"
86
+ "gitHead": "9d6cff17bb95ce5557758da242ca4646a87ac5b0"
87
87
  }
@@ -22,7 +22,7 @@ import { parseArgs } from 'node:util';
22
22
  const { keys } = Object;
23
23
 
24
24
  /**
25
- * @type {Record<string, Pick<FastUSDCConfig, 'oracles'>>}
25
+ * @type {Record<string, Pick<FastUSDCConfig, 'oracles' | 'feedPolicy'>>}
26
26
  *
27
27
  * TODO: determine OCW operator addresses
28
28
  * meanwhile, use price oracle addresses (from updatePriceFeeds.js).
@@ -34,6 +34,19 @@ const configurations = {
34
34
  gov2: 'agoric1wrfh296eu2z34p6pah7q04jjuyj3mxu9v98277',
35
35
  gov3: 'agoric1ydzxwh6f893jvpaslmaz6l8j2ulup9a7x8qvvq',
36
36
  },
37
+ feedPolicy: {
38
+ nobleAgoricChannelId: 'TODO',
39
+ nobleDomainId: 4,
40
+ chainPolicies: {
41
+ Arbitrum: {
42
+ cctpTokenMessengerAddress:
43
+ '0x19330d10D9Cc8751218eaf51E8885D058642E08A',
44
+ chainId: 42161,
45
+ confirmations: 2,
46
+ nobleContractAddress: '0x19330d10D9Cc8751218eaf51E8885D058642E08A',
47
+ },
48
+ },
49
+ },
37
50
  },
38
51
  MAINNET: {
39
52
  oracles: {
@@ -43,6 +56,19 @@ const configurations = {
43
56
  'Simply Staking': 'agoric1krunjcqfrf7la48zrvdfeeqtls5r00ep68mzkr',
44
57
  P2P: 'agoric1n4fcxsnkxe4gj6e24naec99hzmc4pjfdccy5nj',
45
58
  },
59
+ feedPolicy: {
60
+ nobleAgoricChannelId: 'channel-21',
61
+ nobleDomainId: 4,
62
+ chainPolicies: {
63
+ Arbitrum: {
64
+ cctpTokenMessengerAddress:
65
+ '0x19330d10D9Cc8751218eaf51E8885D058642E08A',
66
+ chainId: 42161,
67
+ confirmations: 2,
68
+ nobleContractAddress: '0x19330d10D9Cc8751218eaf51E8885D058642E08A',
69
+ },
70
+ },
71
+ },
46
72
  },
47
73
  DEVNET: {
48
74
  oracles: {
@@ -52,12 +78,36 @@ const configurations = {
52
78
  'Simply Staking': 'agoric1qj07c7vfk3knqdral0sej7fa6eavkdn8vd8etf',
53
79
  P2P: 'agoric10vjkvkmpp9e356xeh6qqlhrny2htyzp8hf88fk',
54
80
  },
81
+ feedPolicy: {
82
+ nobleAgoricChannelId: 'TODO',
83
+ nobleDomainId: 4,
84
+ chainPolicies: {
85
+ Arbitrum: {
86
+ cctpTokenMessengerAddress: '0xTODO',
87
+ chainId: 421614,
88
+ confirmations: 2,
89
+ nobleContractAddress: '0xTODO',
90
+ },
91
+ },
92
+ },
55
93
  },
56
94
  EMERYNET: {
57
95
  oracles: {
58
96
  gov1: 'agoric1ldmtatp24qlllgxmrsjzcpe20fvlkp448zcuce',
59
97
  gov2: 'agoric140dmkrz2e42ergjj7gyvejhzmjzurvqeq82ang',
60
98
  },
99
+ feedPolicy: {
100
+ nobleAgoricChannelId: 'TODO',
101
+ nobleDomainId: 4,
102
+ chainPolicies: {
103
+ Arbitrum: {
104
+ cctpTokenMessengerAddress: '0xTODO',
105
+ chainId: 421614,
106
+ confirmations: 2,
107
+ nobleContractAddress: '0xTODO',
108
+ },
109
+ },
110
+ },
61
111
  },
62
112
  };
63
113
 
@@ -67,7 +117,7 @@ const options = {
67
117
  variableRate: { type: 'string', default: '0.01' },
68
118
  maxVariableFee: { type: 'string', default: '5' },
69
119
  contractRate: { type: 'string', default: '0.2' },
70
- oracleSet: { type: 'string' },
120
+ net: { type: 'string' },
71
121
  oracle: { type: 'string', multiple: true },
72
122
  usdcDenom: {
73
123
  type: 'string',
@@ -76,15 +126,19 @@ const options = {
76
126
  },
77
127
  };
78
128
  const oraclesUsage = 'use --oracle name:address ...';
129
+
130
+ const feedPolicyUsage = 'use --feedPolicy <policy> ...';
131
+
79
132
  /**
80
133
  * @typedef {{
81
134
  * flatFee: string;
82
135
  * variableRate: string;
83
136
  * maxVariableFee: string;
84
137
  * contractRate: string;
85
- * oracleSet?: string;
138
+ * net?: string;
86
139
  * oracle?: string[];
87
140
  * usdcDenom: string;
141
+ * feedPolicy?: string;
88
142
  * }} FastUSDCOpts
89
143
  */
90
144
 
@@ -126,15 +180,26 @@ export default async (homeP, endowments) => {
126
180
  /** @type {{ values: FastUSDCOpts }} */
127
181
  // @ts-expect-error ensured by options
128
182
  const {
129
- values: { oracle: oracleArgs, oracleSet, usdcDenom, ...fees },
183
+ values: { oracle: oracleArgs, net, usdcDenom, feedPolicy, ...fees },
130
184
  } = parseArgs({ args: scriptArgs, options });
131
185
 
186
+ const parseFeedPolicy = () => {
187
+ if (net) {
188
+ if (!(net in configurations)) {
189
+ throw Error(`${net} not in ${keys(configurations)}`);
190
+ }
191
+ return configurations[net].feedPolicy;
192
+ }
193
+ if (!feedPolicy) throw Error(feedPolicyUsage);
194
+ return JSON.parse(feedPolicy);
195
+ };
196
+
132
197
  const parseOracleArgs = () => {
133
- if (oracleSet) {
134
- if (!(oracleSet in configurations)) {
135
- throw Error(`${oracleSet} not in ${keys(configurations)}`);
198
+ if (net) {
199
+ if (!(net in configurations)) {
200
+ throw Error(`${net} not in ${keys(configurations)}`);
136
201
  }
137
- return configurations[oracleSet].oracles;
202
+ return configurations[net].oracles;
138
203
  }
139
204
  if (!oracleArgs) throw Error(oraclesUsage);
140
205
  return Object.fromEntries(
@@ -168,6 +233,7 @@ export default async (homeP, endowments) => {
168
233
  usdcDenom,
169
234
  },
170
235
  feeConfig: parseFeeConfigArgs(),
236
+ feedPolicy: parseFeedPolicy(),
171
237
  });
172
238
 
173
239
  await writeCoreEval('start-fast-usdc', utils =>