@agoric/builders 0.1.1-other-dev-3eb1a1d.0 → 0.1.1-other-dev-d15096d.0.d15096d

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.
Files changed (91) hide show
  1. package/package.json +38 -37
  2. package/scripts/inter-protocol/add-STARS.js +8 -3
  3. package/scripts/inter-protocol/add-collateral-core.js +10 -4
  4. package/scripts/inter-protocol/init-core.js +7 -2
  5. package/scripts/inter-protocol/invite-committee-core.js +7 -2
  6. package/scripts/inter-protocol/manual-price-feed.js +5 -1
  7. package/scripts/inter-protocol/price-feed-core.js +5 -1
  8. package/scripts/inter-protocol/replace-electorate-core.js +9 -3
  9. package/scripts/inter-protocol/replace-feeDistributor-combo.js +87 -0
  10. package/scripts/inter-protocol/replace-feeDistributor.js +19 -6
  11. package/scripts/inter-protocol/updatePriceFeeds.js +18 -4
  12. package/scripts/inter-protocol/withdraw-reserve.build.js +73 -0
  13. package/scripts/inter-protocol/withdraw-vbank-reserve-permit.json +6 -0
  14. package/scripts/inter-protocol/withdraw-vbank-reserve.js +67 -0
  15. package/scripts/orchestration/axelar-gmp.build.js +83 -0
  16. package/scripts/orchestration/get-chain-config.js +121 -0
  17. package/scripts/orchestration/helpers.js +46 -0
  18. package/scripts/orchestration/hook-localchain-msg-send.js +35 -0
  19. package/scripts/orchestration/init-basic-flows.js +18 -4
  20. package/scripts/orchestration/init-stakeAtom.js +18 -4
  21. package/scripts/orchestration/init-stakeBld.js +7 -2
  22. package/scripts/orchestration/init-stakeOsmo.js +18 -4
  23. package/scripts/orchestration/write-chain-info.js +7 -2
  24. package/scripts/pegasus/init-core.js +7 -2
  25. package/scripts/smart-wallet/build-game1-start.js +7 -2
  26. package/scripts/smart-wallet/build-wallet-factory2-upgrade.js +7 -2
  27. package/scripts/smart-wallet/build-walletFactory-upgrade.js +7 -2
  28. package/scripts/testing/add-LEMONS.js +7 -2
  29. package/scripts/testing/add-OLIVES.js +7 -2
  30. package/scripts/testing/add-USD-LEMONS.js +23 -0
  31. package/scripts/testing/add-USD-OLIVES.js +23 -0
  32. package/scripts/testing/append-chain-info.js +12 -4
  33. package/scripts/testing/init-auto-stake-it.js +47 -0
  34. package/scripts/testing/init-send-anywhere.js +41 -0
  35. package/scripts/testing/init-swap-anything.js +41 -0
  36. package/scripts/testing/provokeBOYD.js +58 -0
  37. package/scripts/testing/publish-test-info.js +84 -0
  38. package/scripts/testing/recorded-retired-instances.js +86 -0
  39. package/scripts/testing/register-interchain-bank-assets.js +199 -0
  40. package/scripts/testing/replace-feeDistributor-short.js +14 -3
  41. package/scripts/testing/restart-axelar-gmp.js +96 -0
  42. package/scripts/testing/restart-basic-flows.js +5 -3
  43. package/scripts/testing/restart-send-anywhere.js +5 -3
  44. package/scripts/testing/restart-stakeAtom.js +5 -3
  45. package/scripts/testing/restart-valueVow.js +7 -4
  46. package/scripts/testing/start-query-flows.js +47 -25
  47. package/scripts/testing/start-valueVow.js +7 -4
  48. package/scripts/testing/test-upgraded-board.js +20 -0
  49. package/scripts/testing/tweak-chain-info.js +15 -4
  50. package/scripts/testing/{fix-buggy-sendAnywhere.js → upgrade-send-anywhere.js} +19 -21
  51. package/scripts/testing/upgrade-vaultFactory.js +26 -0
  52. package/scripts/vats/add-auction.js +7 -2
  53. package/scripts/vats/init-core.js +7 -2
  54. package/scripts/vats/init-localchain.js +7 -2
  55. package/scripts/vats/init-network.js +7 -2
  56. package/scripts/vats/init-orchestration.js +7 -2
  57. package/scripts/vats/init-transfer.js +7 -2
  58. package/scripts/vats/priceFeedSupport.js +7 -3
  59. package/scripts/vats/probe-zcf-bundle.js +7 -2
  60. package/scripts/vats/replace-provisioning.js +7 -2
  61. package/scripts/vats/replace-zoe.js +7 -2
  62. package/scripts/vats/restart-vats.js +7 -2
  63. package/scripts/vats/revive-kread.js +7 -2
  64. package/scripts/vats/test-localchain.js +7 -2
  65. package/scripts/vats/test-vtransfer.js +7 -2
  66. package/scripts/vats/updateAtomPriceFeed.js +7 -2
  67. package/scripts/vats/updateStAtomPriceFeed.js +7 -2
  68. package/scripts/vats/updateStOsmoPriceFeed.js +7 -2
  69. package/scripts/vats/updateStTiaPriceFeed.js +7 -2
  70. package/scripts/vats/updateStkAtomPriceFeed.js +7 -2
  71. package/scripts/vats/upgrade-agoricNames.js +26 -0
  72. package/scripts/vats/upgrade-asset-reserve.js +26 -0
  73. package/scripts/vats/upgrade-bank.js +9 -4
  74. package/scripts/vats/upgrade-board.js +25 -0
  75. package/scripts/vats/upgrade-mintHolder.js +110 -0
  76. package/scripts/vats/upgrade-orchestration.js +26 -0
  77. package/scripts/vats/upgrade-paRegistry.js +26 -0
  78. package/scripts/vats/upgrade-provisionPool-to-BLD.js +30 -0
  79. package/scripts/vats/upgrade-provisionPool.js +7 -2
  80. package/scripts/vats/upgrade-psm.js +24 -0
  81. package/scripts/vats/upgrade-vats.js +53 -0
  82. package/scripts/vats/upgrade-zcf.js +7 -2
  83. package/scripts/vats/upgrade-zoe.js +7 -2
  84. package/scripts/vats/upgradeScaledPriceAuthorities.js +7 -2
  85. package/scripts/vats/upgradeVaults.js +7 -2
  86. package/index.js +0 -0
  87. package/scripts/fast-usdc/init-fast-usdc.js +0 -242
  88. package/scripts/testing/start-auto-stake-it.js +0 -128
  89. package/scripts/testing/start-buggy-sendAnywhere.js +0 -143
  90. package/scripts/testing/start-send-anywhere.js +0 -136
  91. package/scripts/vats/upgrade-orch-core.js +0 -24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/builders",
3
- "version": "0.1.1-other-dev-3eb1a1d.0+3eb1a1d",
3
+ "version": "0.1.1-other-dev-d15096d.0.d15096d",
4
4
  "description": "Build scripts for proposals to an Agoric chain",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -10,50 +10,51 @@
10
10
  "build:add-STARS-proposal": "echo This command has been deprecated. Please run this instead: agoric run scripts/inter-protocol/add-STARS.js",
11
11
  "build:restart-vats-proposal": "echo This command has been deprecated. Please run this instead: agoric run scripts/vats/restart-vats.js",
12
12
  "build:zcf-proposal": "echo This command has been deprecated. Please run this instead: agoric run scripts/vats/replace-zoe.js",
13
- "prepack": "tsc --build tsconfig.build.json",
14
- "postpack": "git clean -f '*.d.ts*' '*.tsbuildinfo'",
13
+ "prepack": "yarn run -T tsc --build tsconfig.build.json",
14
+ "postpack": "git clean -f '*.d.*ts*' '*.tsbuildinfo'",
15
15
  "test": "ava",
16
16
  "test:xs": "exit 0",
17
17
  "lint-fix": "yarn lint:eslint --fix",
18
- "lint": "run-s --continue-on-error lint:*",
19
- "lint:types": "tsc",
20
- "lint:eslint": "eslint ."
18
+ "lint": "yarn run -T run-s --continue-on-error 'lint:*'",
19
+ "lint:types": "yarn run -T tsc",
20
+ "lint:eslint": "yarn run -T eslint ."
21
21
  },
22
22
  "keywords": [],
23
23
  "author": "Agoric",
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
- "@agoric/ertp": "0.16.3-other-dev-3eb1a1d.0+3eb1a1d",
27
- "@agoric/fast-usdc": "0.1.1-other-dev-3eb1a1d.0+3eb1a1d",
28
- "@agoric/internal": "0.3.3-other-dev-3eb1a1d.0+3eb1a1d",
29
- "@agoric/notifier": "0.6.3-other-dev-3eb1a1d.0+3eb1a1d",
30
- "@agoric/smart-wallet": "0.5.4-other-dev-3eb1a1d.0+3eb1a1d",
31
- "@agoric/vat-data": "0.5.3-other-dev-3eb1a1d.0+3eb1a1d",
32
- "@agoric/vats": "0.15.2-other-dev-3eb1a1d.0+3eb1a1d",
33
- "@agoric/zoe": "0.26.3-other-dev-3eb1a1d.0+3eb1a1d",
34
- "@endo/bundle-source": "^3.5.0",
35
- "@endo/captp": "^4.4.3",
36
- "@endo/eventual-send": "^1.2.8",
37
- "@endo/far": "^1.1.9",
38
- "@endo/init": "^1.1.7",
39
- "@endo/marshal": "^1.6.2",
40
- "@endo/patterns": "^1.4.7",
41
- "@endo/promise-kit": "^1.1.8",
42
- "@endo/stream": "^1.2.8",
43
- "import-meta-resolve": "^2.2.1"
26
+ "@agoric/client-utils": "0.1.1-other-dev-d15096d.0.d15096d",
27
+ "@agoric/ertp": "0.16.3-other-dev-d15096d.0.d15096d",
28
+ "@agoric/internal": "0.3.3-other-dev-d15096d.0.d15096d",
29
+ "@agoric/notifier": "0.6.3-other-dev-d15096d.0.d15096d",
30
+ "@agoric/smart-wallet": "0.5.4-other-dev-d15096d.0.d15096d",
31
+ "@agoric/vat-data": "0.5.3-other-dev-d15096d.0.d15096d",
32
+ "@agoric/vats": "0.15.2-other-dev-d15096d.0.d15096d",
33
+ "@agoric/zoe": "0.26.3-other-dev-d15096d.0.d15096d",
34
+ "@endo/bundle-source": "^4.1.2",
35
+ "@endo/captp": "^4.4.8",
36
+ "@endo/eventual-send": "^1.3.4",
37
+ "@endo/far": "^1.1.14",
38
+ "@endo/init": "^1.1.12",
39
+ "@endo/marshal": "^1.8.0",
40
+ "@endo/nat": "^5.1.3",
41
+ "@endo/patterns": "^1.7.0",
42
+ "@endo/promise-kit": "^1.1.13",
43
+ "@endo/stream": "^1.2.13",
44
+ "import-meta-resolve": "^4.1.0"
44
45
  },
45
46
  "devDependencies": {
46
- "@agoric/deploy-script-support": "0.10.4-other-dev-3eb1a1d.0+3eb1a1d",
47
- "@agoric/governance": "0.10.4-other-dev-3eb1a1d.0+3eb1a1d",
48
- "@agoric/inter-protocol": "0.16.2-other-dev-3eb1a1d.0+3eb1a1d",
49
- "@agoric/orchestration": "0.1.1-other-dev-3eb1a1d.0+3eb1a1d",
50
- "@agoric/store": "0.9.3-other-dev-3eb1a1d.0+3eb1a1d",
51
- "@agoric/swing-store": "0.9.2-other-dev-3eb1a1d.0+3eb1a1d",
52
- "@agoric/swingset-liveslots": "0.10.3-other-dev-3eb1a1d.0+3eb1a1d",
53
- "@agoric/time": "0.3.3-other-dev-3eb1a1d.0+3eb1a1d",
54
- "@endo/errors": "^1.2.8",
47
+ "@agoric/deploy-script-support": "0.10.4-other-dev-d15096d.0.d15096d",
48
+ "@agoric/governance": "0.10.4-other-dev-d15096d.0.d15096d",
49
+ "@agoric/inter-protocol": "0.16.2-other-dev-d15096d.0.d15096d",
50
+ "@agoric/orchestration": "0.1.1-other-dev-d15096d.0.d15096d",
51
+ "@agoric/store": "0.9.3-other-dev-d15096d.0.d15096d",
52
+ "@agoric/swing-store": "0.9.2-other-dev-d15096d.0.d15096d",
53
+ "@agoric/swingset-liveslots": "0.10.3-other-dev-d15096d.0.d15096d",
54
+ "@agoric/time": "0.3.3-other-dev-d15096d.0.d15096d",
55
+ "@endo/errors": "^1.2.13",
55
56
  "ava": "^5.3.0",
56
- "c8": "^10.1.2"
57
+ "c8": "^10.1.3"
57
58
  },
58
59
  "files": [
59
60
  "CHANGELOG.md",
@@ -68,7 +69,7 @@
68
69
  "access": "public"
69
70
  },
70
71
  "engines": {
71
- "node": "^18.12 || ^20.9"
72
+ "node": "^20.9 || ^22.11"
72
73
  },
73
74
  "ava": {
74
75
  "files": [
@@ -81,7 +82,7 @@
81
82
  "workerThreads": false
82
83
  },
83
84
  "typeCoverage": {
84
- "atLeast": 89.69
85
+ "atLeast": 90.26
85
86
  },
86
- "gitHead": "3eb1a1d2d75b2b4a94807cd3bf759bc9fc531f05"
87
+ "gitHead": "d15096dc4ff8b96e9b6cd11954c20d3a9efbb393"
87
88
  }
@@ -2,7 +2,12 @@ import { makeHelpers } from '@agoric/deploy-script-support';
2
2
  import { defaultProposalBuilder as vaultProposalBuilder } from './add-collateral-core.js';
3
3
  import { defaultProposalBuilder as oraclesProposalBuilder } from './price-feed-core.js';
4
4
 
5
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
5
+ /**
6
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
7
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
8
+ */
9
+
10
+ /** @type {CoreEvalBuilder} */
6
11
  const starsVaultProposalBuilder = async powers => {
7
12
  return vaultProposalBuilder(powers, {
8
13
  interchainAssetOptions: {
@@ -17,7 +22,7 @@ const starsVaultProposalBuilder = async powers => {
17
22
  });
18
23
  };
19
24
 
20
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
25
+ /** @type {CoreEvalBuilder} */
21
26
  const starsOraclesProposalBuilder = async powers => {
22
27
  return oraclesProposalBuilder(powers, {
23
28
  AGORIC_INSTANCE_NAME: `STARS-USD price feed`,
@@ -36,7 +41,7 @@ const starsOraclesProposalBuilder = async powers => {
36
41
  });
37
42
  };
38
43
 
39
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
44
+ /** @type {DeployScriptFunction} */
40
45
  export default async (homeP, endowments) => {
41
46
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
42
47
  await writeCoreEval('add-STARS', starsVaultProposalBuilder);
@@ -5,7 +5,13 @@ import { getManifestForAddAssetToVault } from '@agoric/inter-protocol/src/propos
5
5
  import { getManifestForPsm } from '@agoric/inter-protocol/src/proposals/startPSM.js';
6
6
  import { makeInstallCache } from '@agoric/inter-protocol/src/proposals/utils.js';
7
7
 
8
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
8
+ /**
9
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
10
+ * @import {InterchainAssetOptions} from '@agoric/inter-protocol/src/proposals/addAssetToVault.js';
11
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
12
+ */
13
+
14
+ /** @type {CoreEvalBuilder} */
9
15
  export const defaultProposalBuilder = async (
10
16
  { publishRef, install: install0, wrapInstall },
11
17
  {
@@ -15,7 +21,7 @@ export const defaultProposalBuilder = async (
15
21
  } = {},
16
22
  { env = process.env } = {},
17
23
  ) => {
18
- /** @type {import('@agoric/inter-protocol/src/proposals/addAssetToVault.js').InterchainAssetOptions} */
24
+ /** @type {InterchainAssetOptions} */
19
25
  const {
20
26
  issuerBoardId = env.INTERCHAIN_ISSUER_BOARD_ID,
21
27
  denom = env.INTERCHAIN_DENOM,
@@ -62,7 +68,7 @@ export const defaultProposalBuilder = async (
62
68
  });
63
69
  };
64
70
 
65
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
71
+ /** @type {CoreEvalBuilder} */
66
72
  export const psmProposalBuilder = async (
67
73
  { publishRef, install: install0, wrapInstall },
68
74
  { anchorOptions = /** @type {object} */ ({}) } = {},
@@ -103,7 +109,7 @@ export const psmProposalBuilder = async (
103
109
  });
104
110
  };
105
111
 
106
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
112
+ /** @type {DeployScriptFunction} */
107
113
  export default async (homeP, endowments) => {
108
114
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
109
115
 
@@ -14,6 +14,11 @@ import {
14
14
  } from '@agoric/inter-protocol/src/proposals/core-proposal.js';
15
15
  import { makeInstallCache } from '@agoric/inter-protocol/src/proposals/utils.js';
16
16
 
17
+ /**
18
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
19
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
20
+ */
21
+
17
22
  // TODO end inter-package filesystem references https://github.com/Agoric/agoric-sdk/issues/8178
18
23
 
19
24
  /** @type {Record<string, Record<string, [string, string]>>} */
@@ -125,7 +130,7 @@ export const mainProposalBuilder = async ({
125
130
  };
126
131
 
127
132
  // Build proposal for sim-chain etc.
128
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
133
+ /** @type {CoreEvalBuilder} */
129
134
  export const defaultProposalBuilder = async (
130
135
  { publishRef, install },
131
136
  options = {},
@@ -184,7 +189,7 @@ export const defaultProposalBuilder = async (
184
189
  });
185
190
  };
186
191
 
187
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
192
+ /** @type {DeployScriptFunction} */
188
193
  export default async (homeP, endowments) => {
189
194
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
190
195
 
@@ -3,8 +3,13 @@ import { makeHelpers } from '@agoric/deploy-script-support';
3
3
 
4
4
  import { getManifestForInviteCommittee } from '@agoric/inter-protocol/src/proposals/committee-proposal.js';
5
5
 
6
+ /**
7
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
8
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
9
+ */
10
+
6
11
  // Build proposal for sim-chain etc.
7
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
12
+ /** @type {CoreEvalBuilder} */
8
13
  export const defaultProposalBuilder = async (
9
14
  { publishRef, install },
10
15
  options = {},
@@ -36,7 +41,7 @@ export const defaultProposalBuilder = async (
36
41
  });
37
42
  };
38
43
 
39
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
44
+ /** @type {DeployScriptFunction} */
40
45
  export default async (homeP, endowments) => {
41
46
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
42
47
  await writeCoreEval('gov-invite-committee', defaultProposalBuilder);
@@ -4,6 +4,10 @@ import { makeNotifierFromAsyncIterable } from '@agoric/notifier';
4
4
 
5
5
  import process from 'process';
6
6
 
7
+ /**
8
+ * @import {Board} from '@agoric/vats';
9
+ */
10
+
7
11
  /**
8
12
  * After extracting the oracleAdmins to entries in home.scratch, you can use one
9
13
  * from the REPL like:
@@ -22,7 +26,7 @@ import process from 'process';
22
26
  * E(qn).getUpdateSince()
23
27
  *
24
28
  * @typedef {{
25
- * board: import('@agoric/vats').Board;
29
+ * board: Board;
26
30
  * chainTimerService;
27
31
  * scratch;
28
32
  * zoe;
@@ -1,6 +1,10 @@
1
1
  /* eslint-env node */
2
2
  import { makeHelpers } from '@agoric/deploy-script-support';
3
3
 
4
+ /**
5
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
6
+ */
7
+
4
8
  export const DEFAULT_CONTRACT_TERMS = {
5
9
  POLL_INTERVAL: 30n,
6
10
  maxSubmissionCount: 1000,
@@ -11,7 +15,7 @@ export const DEFAULT_CONTRACT_TERMS = {
11
15
  maxSubmissionValue: 2n ** 256n,
12
16
  };
13
17
 
14
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
18
+ /** @type {CoreEvalBuilder} */
15
19
  export const defaultProposalBuilder = async (
16
20
  { publishRef, install },
17
21
  options = {},
@@ -16,7 +16,13 @@
16
16
  import { makeHelpers } from '@agoric/deploy-script-support';
17
17
  import { getManifestForReplaceAllElectorates } from '@agoric/inter-protocol/src/proposals/replaceElectorate.js';
18
18
 
19
- /** @typedef {Parameters<typeof import('@agoric/inter-protocol/src/proposals/replaceElectorate.js').replaceAllElectorates>[1]['options']} ReplaceElectorateOptions */
19
+ /**
20
+ * @import {replaceAllElectorates} from '@agoric/inter-protocol/src/proposals/replaceElectorate.js';
21
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
22
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
23
+ */
24
+
25
+ /** @typedef {Parameters<typeof replaceAllElectorates>[1]['options']} ReplaceElectorateOptions */
20
26
 
21
27
  /** @type {Record<string, ReplaceElectorateOptions>} */
22
28
  const configurations = {
@@ -93,7 +99,7 @@ const configurations = {
93
99
  const { keys } = Object;
94
100
  const knownVariants = keys(configurations);
95
101
 
96
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
102
+ /** @type {CoreEvalBuilder} */
97
103
  export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
98
104
  const config = opts.config || configurations[opts.variant];
99
105
  if (!config) {
@@ -131,7 +137,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
131
137
 
132
138
  const Usage = `agoric run replace-electorate-core.js ${[...knownVariants, '<json-config>'].join(' | ')}`;
133
139
 
134
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
140
+ /** @type {DeployScriptFunction} */
135
141
  export default async (homeP, endowments) => {
136
142
  const { scriptArgs } = endowments;
137
143
  const variantOrConfig = scriptArgs?.[0];
@@ -0,0 +1,87 @@
1
+ import { parseScriptArgs, makeHelpers } from '@agoric/deploy-script-support';
2
+ import { getManifestForReplaceFeeDistributor } from '@agoric/inter-protocol/src/proposals/replace-fee-distributor.js';
3
+ import { SECONDS_PER_HOUR } from '@agoric/inter-protocol/src/proposals/econ-behaviors.js';
4
+
5
+ /**
6
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
7
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
8
+ */
9
+
10
+ const configurations = {
11
+ A3P_INTEGRATION: {
12
+ params: {
13
+ collectionInterval: 30n,
14
+ keywordShares: {
15
+ RewardDistributor: 0n,
16
+ Reserve: 1n,
17
+ },
18
+ },
19
+ },
20
+ MAINNET: {
21
+ params: {
22
+ collectionInterval: 1n * SECONDS_PER_HOUR,
23
+ keywordShares: {
24
+ RewardDistributor: 0n,
25
+ Reserve: 1n,
26
+ },
27
+ },
28
+ },
29
+ DEVNET: {
30
+ params: {
31
+ collectionInterval: 1n * SECONDS_PER_HOUR,
32
+ keywordShares: {
33
+ RewardDistributor: 0n,
34
+ Reserve: 1n,
35
+ },
36
+ },
37
+ },
38
+ EMERYNET: {
39
+ params: {
40
+ collectionInterval: 1n * SECONDS_PER_HOUR,
41
+ keywordShares: {
42
+ RewardDistributor: 0n,
43
+ Reserve: 1n,
44
+ },
45
+ },
46
+ },
47
+ };
48
+
49
+ const { keys } = Object;
50
+ const knownVariants = keys(configurations);
51
+
52
+ /** @type {CoreEvalBuilder} */
53
+ export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
54
+ const config = opts.config || configurations[opts.variant];
55
+ console.log('feeDist OPTS', opts, config);
56
+ if (!config) {
57
+ const error = `Unknown variant "${opts.variant}". Expected one of ${knownVariants.join(', ')}`;
58
+ console.error(error);
59
+ throw Error(error);
60
+ }
61
+ const { params } = config;
62
+
63
+ return harden({
64
+ sourceSpec:
65
+ '@agoric/inter-protocol/src/proposals/replace-fee-distributor.js',
66
+ getManifestCall: [
67
+ getManifestForReplaceFeeDistributor.name,
68
+ {
69
+ feeDistributorRef: publishRef(
70
+ install('@agoric/inter-protocol/src/feeDistributor.js'),
71
+ ),
72
+ ...params,
73
+ },
74
+ ],
75
+ });
76
+ };
77
+
78
+ /** @type {DeployScriptFunction} */
79
+ export default async (homeP, endowments) => {
80
+ const name = 'replace-feeDistributor-combo';
81
+ const opts = parseScriptArgs(endowments, name, knownVariants);
82
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
83
+
84
+ await writeCoreEval('replace-feeDistributor', utils =>
85
+ defaultProposalBuilder(utils, opts),
86
+ );
87
+ };
@@ -2,21 +2,34 @@ import { makeHelpers } from '@agoric/deploy-script-support';
2
2
  import { getManifestForReplaceFeeDistributor } from '@agoric/inter-protocol/src/proposals/replace-fee-distributor.js';
3
3
  import { SECONDS_PER_HOUR } from '@agoric/inter-protocol/src/proposals/econ-behaviors.js';
4
4
 
5
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
6
- export const defaultProposalBuilder = async (_, opts) => {
7
- console.log('OPTS', opts);
5
+ /**
6
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
7
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
8
+ */
9
+
10
+ /** @type {CoreEvalBuilder} */
11
+ export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
12
+ console.log('feeDist OPTS', opts);
8
13
  return harden({
9
14
  sourceSpec:
10
15
  '@agoric/inter-protocol/src/proposals/replace-fee-distributor.js',
11
- getManifestCall: [getManifestForReplaceFeeDistributor.name, { ...opts }],
16
+ getManifestCall: [
17
+ getManifestForReplaceFeeDistributor.name,
18
+ {
19
+ feeDistributorRef: publishRef(
20
+ install('@agoric/inter-protocol/src/feeDistributor.js'),
21
+ ),
22
+ ...opts,
23
+ },
24
+ ],
12
25
  });
13
26
  };
14
27
 
15
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
28
+ /** @type {DeployScriptFunction} */
16
29
  export default async (homeP, endowments) => {
17
30
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
18
31
 
19
- await writeCoreEval('replace-feeDistributor-testing', utils =>
32
+ await writeCoreEval('replace-feeDistributor', utils =>
20
33
  defaultProposalBuilder(utils, {
21
34
  collectionInterval: 1n * SECONDS_PER_HOUR,
22
35
  keywordShares: {
@@ -1,7 +1,11 @@
1
1
  import { makeHelpers } from '@agoric/deploy-script-support';
2
2
  import { getManifestForPriceFeeds } from '@agoric/inter-protocol/src/proposals/deploy-price-feeds.js';
3
3
 
4
- /** @import {PriceFeedConfig} from '@agoric/inter-protocol/src/proposals/deploy-price-feeds.js'; */
4
+ /**
5
+ * @import {PriceFeedConfig} from '@agoric/inter-protocol/src/proposals/deploy-price-feeds.js';
6
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
7
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
8
+ */
5
9
 
6
10
  /** @type {Record<string, PriceFeedConfig>} */
7
11
  const configurations = {
@@ -32,7 +36,7 @@ const configurations = {
32
36
  'agoric1qj07c7vfk3knqdral0sej7fa6eavkdn8vd8etf', // Simply Staking
33
37
  'agoric10vjkvkmpp9e356xeh6qqlhrny2htyzp8hf88fk', // P2P
34
38
  ],
35
- inBrandNames: ['ATOM', 'stTIA', 'stkATOM'],
39
+ inBrandNames: ['ATOM', 'stTIA', 'stkATOM', 'dATOM'],
36
40
  },
37
41
  EMERYNET: {
38
42
  oracleAddresses: [
@@ -41,12 +45,22 @@ const configurations = {
41
45
  ],
42
46
  inBrandNames: ['ATOM', 'stATOM', 'stOSMO', 'stTIA', 'stkATOM'],
43
47
  },
48
+ BOOT_TEST: {
49
+ oracleAddresses: [
50
+ 'agoric144rrhh4m09mh7aaffhm6xy223ym76gve2x7y78', // DSRV
51
+ 'agoric19d6gnr9fyp6hev4tlrg87zjrzsd5gzr5qlfq2p', // Stakin
52
+ 'agoric19uscwxdac6cf6z7d5e26e0jm0lgwstc47cpll8', // 01node
53
+ 'agoric1krunjcqfrf7la48zrvdfeeqtls5r00ep68mzkr', // Simply Staking
54
+ 'agoric1n4fcxsnkxe4gj6e24naec99hzmc4pjfdccy5nj', // P2P
55
+ ],
56
+ inBrandNames: ['ATOM'],
57
+ },
44
58
  };
45
59
 
46
60
  const { keys } = Object;
47
61
  const knownVariants = keys(configurations);
48
62
 
49
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
63
+ /** @type {CoreEvalBuilder} */
50
64
  export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
51
65
  const config = opts.config || configurations[opts.variant];
52
66
  if (!config) {
@@ -86,7 +100,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
86
100
 
87
101
  const Usage = `agoric run updatePriceFeeds.js ${[...knownVariants, '<json-config>'].join(' | ')}`;
88
102
 
89
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
103
+ /** @type {DeployScriptFunction} */
90
104
  export default async (homeP, endowments) => {
91
105
  const { scriptArgs } = endowments;
92
106
  const variantOrConfig = scriptArgs?.[0];
@@ -0,0 +1,73 @@
1
+ /* eslint-env node */
2
+ import { parseArgs } from 'node:util';
3
+ import { isNat } from '@endo/nat';
4
+ import { makeHelpers } from '@agoric/deploy-script-support';
5
+ import { getManifestForInviteWithdrawer } from '@agoric/inter-protocol/src/proposals/withdraw-reserve-proposal.js';
6
+
7
+ /**
8
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
9
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
10
+ */
11
+
12
+ /**
13
+ * @template {{ type: string }} T
14
+ * @typedef { T['type'] extends 'string' ? string : T['type'] extends 'boolean' ? boolean : (string | boolean) } TypeFromParseArgsOptionDescriptor
15
+ */
16
+
17
+ /**
18
+ * @template {Record<string, { type: string, multiple?: boolean }>} T
19
+ * @typedef {{
20
+ * [K in keyof T]: (
21
+ * T[K]['multiple'] extends true
22
+ * ? TypeFromParseArgsOptionDescriptor<T[K]>[]
23
+ * : T[K]['multiple'] extends (false | unknown)
24
+ * ? TypeFromParseArgsOptionDescriptor<T[K]>
25
+ * : (TypeFromParseArgsOptionDescriptor<T[K]>[] | TypeFromParseArgsOptionDescriptor<T[K]>)
26
+ * )
27
+ * }} CliOptions
28
+ */
29
+
30
+ const { Fail } = assert;
31
+
32
+ const cliOptions = /** @type {const} */ ({
33
+ address: { type: 'string', multiple: false },
34
+ count: { type: 'string', multiple: false },
35
+ });
36
+
37
+ /** @type {CoreEvalBuilder} */
38
+ export const defaultProposalBuilder = async (
39
+ { publishRef: _publishRef, install: _install },
40
+ namedArgs = {},
41
+ ) => {
42
+ const { address, count } = namedArgs;
43
+
44
+ typeof address === 'string' || Fail`string address is required`;
45
+ if (count !== undefined) {
46
+ isNat(count) || Fail`count must be a safe natural number`;
47
+ }
48
+
49
+ return harden({
50
+ sourceSpec:
51
+ '@agoric/inter-protocol/src/proposals/withdraw-reserve-proposal.js',
52
+ getManifestCall: [getManifestForInviteWithdrawer.name, { address, count }],
53
+ });
54
+ };
55
+
56
+ /** @type {DeployScriptFunction} */
57
+ export default async (homeP, endowments) => {
58
+ const { scriptArgs: argv } = endowments;
59
+ /** @type {{ values: Partial<CliOptions<typeof cliOptions>> }} */
60
+ const { values: rawArgs } = parseArgs({ args: argv, options: cliOptions });
61
+ const { address, count: rawCount } = rawArgs;
62
+ const count = (() => {
63
+ if (rawCount === undefined) return undefined;
64
+ /[0-9]/.test(rawCount) || Fail`--count value must be numeric`;
65
+ return +rawCount;
66
+ })();
67
+ const namedArgs = { address, count };
68
+
69
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
70
+ await writeCoreEval('withdraw-reserve', utils =>
71
+ defaultProposalBuilder(utils, namedArgs),
72
+ );
73
+ };
@@ -0,0 +1,6 @@
1
+ {
2
+ "consume": {
3
+ "agoricNames": "lookupBrands",
4
+ "bankManager": "getBankForAddress"
5
+ }
6
+ }
@@ -0,0 +1,67 @@
1
+ /* global E */
2
+ /// <reference types="@agoric/vats/src/core/core-eval-env.js" />
3
+ // @ts-check
4
+
5
+ // FIXME: we need to hardcode these values because the vbank reserve purse
6
+ // balance is not synced.
7
+ const DEFAULT_BLD_VALUE = 1_998n;
8
+ const DEFAULT_IST_VALUE = 202_020n;
9
+
10
+ const vbankReserveAddress = 'agoric1ae0lmtzlgrcnla9xjkpaarq5d5dfez63h3nucl';
11
+ const beneficiaryAddress = 'agoric18lfz3w97u72p4jq58gdn05ftdcv9rwz0ft5l2m';
12
+
13
+ /** @param {ChainBootstrapSpace & BootstrapPowers} powers */
14
+ const coreEval = async powers => {
15
+ console.warn('Core eval to transfer vbank/reserve to a beneficiary');
16
+ const {
17
+ consume: { agoricNames, bankManager },
18
+ } = powers;
19
+
20
+ console.warn('Looking up brands');
21
+ const BLD = await E(agoricNames).lookup('brand', 'BLD');
22
+ const IST = await E(agoricNames).lookup('brand', 'IST');
23
+
24
+ console.warn('Getting banks');
25
+ const reserveBank =
26
+ await E(bankManager).getBankForAddress(vbankReserveAddress);
27
+ const beneficiaryBank =
28
+ await E(bankManager).getBankForAddress(beneficiaryAddress);
29
+
30
+ console.warn('Getting reserve purses');
31
+ const reserveBLDPurse = await E(reserveBank).getPurse(BLD);
32
+ const reserveISTPurse = await E(reserveBank).getPurse(IST);
33
+
34
+ console.warn('Getting reserve balances');
35
+ const BLDAmount = await E(reserveBLDPurse).getCurrentAmount();
36
+ const reserveBLDBalance = harden({
37
+ ...BLDAmount,
38
+ value: BLDAmount.value || DEFAULT_BLD_VALUE,
39
+ });
40
+ const ISTAmount = await E(reserveISTPurse).getCurrentAmount();
41
+ const reserveISTBalance = harden({
42
+ ...ISTAmount,
43
+ value: ISTAmount.value || DEFAULT_IST_VALUE,
44
+ });
45
+ console.warn('reserve BLD balance', reserveBLDBalance);
46
+ console.warn('reserve IST balance', reserveISTBalance);
47
+
48
+ console.warn('Getting beneficiary purses');
49
+ const beneficiaryBLDPurse = await E(beneficiaryBank).getPurse(BLD);
50
+ const beneficiaryISTPurse = await E(beneficiaryBank).getPurse(IST);
51
+
52
+ console.warn('Withdrawing from reserve purses');
53
+ const BLDPayment = await E(reserveBLDPurse).withdraw(reserveBLDBalance);
54
+ const ISTPayment = await E(reserveISTPurse).withdraw(reserveISTBalance);
55
+
56
+ console.warn('Depositing into beneficiary purses');
57
+ const BLDTransferAmount = await E(beneficiaryBLDPurse).deposit(BLDPayment);
58
+ const ISTTransferAmount = await E(beneficiaryISTPurse).deposit(ISTPayment);
59
+
60
+ console.warn(
61
+ 'Done withdrawing reserve!',
62
+ BLDTransferAmount,
63
+ ISTTransferAmount,
64
+ );
65
+ };
66
+
67
+ coreEval;