@agoric/builders 0.1.1-calypso-dev-84eb287.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/LICENSE +201 -0
  3. package/index.js +0 -0
  4. package/package.json +84 -0
  5. package/scripts/inter-protocol/add-STARS.js +43 -0
  6. package/scripts/inter-protocol/add-collateral-core.js +118 -0
  7. package/scripts/inter-protocol/deploy-contracts.js +111 -0
  8. package/scripts/inter-protocol/init-core.js +204 -0
  9. package/scripts/inter-protocol/invite-committee-core.js +42 -0
  10. package/scripts/inter-protocol/manual-price-feed.js +123 -0
  11. package/scripts/inter-protocol/price-feed-core.js +104 -0
  12. package/scripts/orchestration/init-stakeAtom.js +23 -0
  13. package/scripts/orchestration/init-stakeBld.js +23 -0
  14. package/scripts/orchestration/init-stakeOsmo.js +23 -0
  15. package/scripts/pegasus/init-core.js +23 -0
  16. package/scripts/smart-wallet/build-game1-start.js +33 -0
  17. package/scripts/smart-wallet/build-wallet-factory2-upgrade.js +28 -0
  18. package/scripts/smart-wallet/build-walletFactory-upgrade.js +34 -0
  19. package/scripts/testing/add-LEMONS.js +23 -0
  20. package/scripts/testing/add-OLIVES.js +22 -0
  21. package/scripts/testing/append-chain-info.js +50 -0
  22. package/scripts/testing/tweak-chain-info.js +53 -0
  23. package/scripts/vats/add-auction.js +14 -0
  24. package/scripts/vats/init-core.js +31 -0
  25. package/scripts/vats/init-localchain.js +20 -0
  26. package/scripts/vats/init-network.js +19 -0
  27. package/scripts/vats/init-orchestration.js +20 -0
  28. package/scripts/vats/init-transfer.js +18 -0
  29. package/scripts/vats/priceFeedSupport.js +90 -0
  30. package/scripts/vats/probe-zcf-bundle.js +22 -0
  31. package/scripts/vats/replace-provisioning.js +23 -0
  32. package/scripts/vats/replace-zoe.js +19 -0
  33. package/scripts/vats/restart-vats.js +25 -0
  34. package/scripts/vats/revive-kread.js +13 -0
  35. package/scripts/vats/set-core-proposal-env.js +35 -0
  36. package/scripts/vats/test-localchain.js +18 -0
  37. package/scripts/vats/test-vtransfer.js +18 -0
  38. package/scripts/vats/updateAtomPriceFeed.js +21 -0
  39. package/scripts/vats/updateStAtomPriceFeed.js +21 -0
  40. package/scripts/vats/updateStOsmoPriceFeed.js +21 -0
  41. package/scripts/vats/updateStTiaPriceFeed.js +21 -0
  42. package/scripts/vats/updateStkAtomPriceFeed.js +21 -0
  43. package/scripts/vats/upgrade-bank.js +18 -0
  44. package/scripts/vats/upgrade-provisionPool.js +20 -0
  45. package/scripts/vats/upgrade-zcf.js +18 -0
  46. package/scripts/vats/upgrade-zoe.js +18 -0
  47. package/scripts/vats/upgradeScaledPriceAuthorities.js +22 -0
  48. package/scripts/vats/upgradeVaults.js +23 -0
  49. package/tsconfig.build.json +11 -0
  50. package/tsconfig.json +13 -0
@@ -0,0 +1,204 @@
1
+ /* global process */
2
+ /**
3
+ * @file can be run with `agoric deploy` after a chain is running (depends on
4
+ * chain state) Only works with "local" chain and not sim-chain b/c it needs
5
+ * governance votes (n/a on sim-chain).
6
+ */
7
+ import { makeHelpers } from '@agoric/deploy-script-support';
8
+ import { objectMap } from '@agoric/internal';
9
+
10
+ import {
11
+ getManifestForInterProtocol,
12
+ getManifestForEconCommittee,
13
+ getManifestForMain,
14
+ } from '@agoric/inter-protocol/src/proposals/core-proposal.js';
15
+ import { makeInstallCache } from '@agoric/inter-protocol/src/proposals/utils.js';
16
+
17
+ // TODO end inter-package filesystem references https://github.com/Agoric/agoric-sdk/issues/8178
18
+
19
+ /** @type {Record<string, Record<string, [string, string]>>} */
20
+ const installKeyGroups = {
21
+ econCommittee: {
22
+ contractGovernor: [
23
+ '@agoric/governance/src/contractGovernor.js',
24
+ '../../governance/bundles/bundle-contractGovernor.js',
25
+ ],
26
+ committee: [
27
+ '@agoric/governance/src/committee.js',
28
+ '../../governance/bundles/bundle-committee.js',
29
+ ],
30
+ binaryVoteCounter: [
31
+ '@agoric/governance/src/binaryVoteCounter.js',
32
+ '../../governance/bundles/bundle-binaryVoteCounter.js',
33
+ ],
34
+ },
35
+ main: {
36
+ auctioneer: [
37
+ '@agoric/inter-protocol/src/auction/auctioneer.js',
38
+ '../../inter-protocol/bundles/bundle-auctioneer.js',
39
+ ],
40
+ vaultFactory: [
41
+ '@agoric/inter-protocol/src/vaultFactory/vaultFactory.js',
42
+ '../../inter-protocol/bundles/bundle-vaultFactory.js',
43
+ ],
44
+ feeDistributor: [
45
+ '@agoric/inter-protocol/src/feeDistributor.js',
46
+ '../../inter-protocol/bundles/bundle-feeDistributor.js',
47
+ ],
48
+ reserve: [
49
+ '@agoric/inter-protocol/src/reserve/assetReserve.js',
50
+ '../../inter-protocol/bundles/bundle-reserve.js',
51
+ ],
52
+ },
53
+ };
54
+
55
+ /**
56
+ * @template I
57
+ * @template R
58
+ * @param {object} opts
59
+ * @param {(i: I) => R} opts.publishRef
60
+ * @param {(m: string, b: string, opts?: any) => I} opts.install
61
+ * @param {<T>(f: T) => T} [opts.wrapInstall]
62
+ * @param {object} [options]
63
+ * @param {{ committeeName?: string; committeeSize?: number }} [options.econCommitteeOptions]
64
+ */
65
+ export const committeeProposalBuilder = async (
66
+ { publishRef, install: install0, wrapInstall },
67
+ { econCommitteeOptions } = {},
68
+ ) => {
69
+ const install = wrapInstall ? wrapInstall(install0) : install0;
70
+
71
+ /** @param {Record<string, [string, string]>} group */
72
+ const publishGroup = group =>
73
+ objectMap(group, ([mod, bundle]) =>
74
+ publishRef(install(mod, bundle, { persist: true })),
75
+ );
76
+ return harden({
77
+ sourceSpec: '@agoric/inter-protocol/src/proposals/core-proposal.js',
78
+ getManifestCall: [
79
+ getManifestForEconCommittee.name,
80
+ {
81
+ econCommitteeOptions,
82
+ installKeys: {
83
+ ...publishGroup(installKeyGroups.econCommittee),
84
+ },
85
+ },
86
+ ],
87
+ });
88
+ };
89
+
90
+ /**
91
+ * @template I
92
+ * @template R
93
+ * @param {object} opts
94
+ * @param {(i: I) => R} opts.publishRef
95
+ * @param {(m: string, b: string, opts?: any) => I} opts.install
96
+ * @param {<T>(f: T) => T} [opts.wrapInstall]
97
+ */
98
+ export const mainProposalBuilder = async ({
99
+ publishRef,
100
+ install: install0,
101
+ wrapInstall,
102
+ }) => {
103
+ const { VAULT_FACTORY_CONTROLLER_ADDR } = process.env;
104
+
105
+ const install = wrapInstall ? wrapInstall(install0) : install0;
106
+
107
+ const persist = true;
108
+ /** @param {Record<string, [string, string]>} group */
109
+ const publishGroup = group =>
110
+ objectMap(group, ([mod, bundle]) =>
111
+ publishRef(install(mod, bundle, { persist })),
112
+ );
113
+ return harden({
114
+ sourceSpec: '@agoric/inter-protocol/src/proposals/core-proposal.js',
115
+ getManifestCall: [
116
+ getManifestForMain.name,
117
+ {
118
+ vaultFactoryControllerAddress: VAULT_FACTORY_CONTROLLER_ADDR,
119
+ installKeys: {
120
+ ...publishGroup(installKeyGroups.main),
121
+ },
122
+ },
123
+ ],
124
+ });
125
+ };
126
+
127
+ // Build proposal for sim-chain etc.
128
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
129
+ export const defaultProposalBuilder = async (
130
+ { publishRef, install },
131
+ options = {},
132
+ { env = process.env } = {},
133
+ ) => {
134
+ /** @param {string | undefined} s */
135
+ const optBigInt = s => s && BigInt(s);
136
+ const {
137
+ vaultFactoryControllerAddress = env.VAULT_FACTORY_CONTROLLER_ADDR,
138
+ minInitialPoolLiquidity = env.MIN_INITIAL_POOL_LIQUIDITY,
139
+ referencedUi,
140
+ anchorOptions: {
141
+ anchorDenom = env.ANCHOR_DENOM,
142
+ anchorDecimalPlaces = '6',
143
+ anchorKeyword = 'AUSD',
144
+ anchorProposedName = anchorKeyword,
145
+ initialPrice = undefined,
146
+ } = {},
147
+ econCommitteeOptions: {
148
+ committeeSize: econCommitteeSize = env.ECON_COMMITTEE_SIZE || '3',
149
+ } = {},
150
+ } = options;
151
+
152
+ /** @param {Record<string, [string, string]>} group */
153
+ const publishGroup = group =>
154
+ objectMap(group, ([mod, bundle]) => publishRef(install(mod, bundle)));
155
+
156
+ const anchorOptions = anchorDenom && {
157
+ denom: anchorDenom,
158
+ decimalPlaces: parseInt(anchorDecimalPlaces, 10),
159
+ initialPrice,
160
+ keyword: anchorKeyword,
161
+ proposedName: anchorProposedName,
162
+ };
163
+
164
+ const econCommitteeOptions = {
165
+ committeeSize: parseInt(econCommitteeSize, 10),
166
+ };
167
+
168
+ return harden({
169
+ sourceSpec: '@agoric/inter-protocol/src/proposals/core-proposal.js',
170
+ getManifestCall: [
171
+ getManifestForInterProtocol.name,
172
+ {
173
+ vaultFactoryControllerAddress,
174
+ minInitialPoolLiquidity: optBigInt(minInitialPoolLiquidity),
175
+ referencedUi,
176
+ anchorOptions,
177
+ econCommitteeOptions,
178
+ installKeys: {
179
+ ...publishGroup(installKeyGroups.econCommittee),
180
+ ...publishGroup(installKeyGroups.main),
181
+ },
182
+ },
183
+ ],
184
+ });
185
+ };
186
+
187
+ export default async (homeP, endowments) => {
188
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
189
+
190
+ const tool = await makeInstallCache(homeP, {
191
+ loadBundle: spec => import(spec),
192
+ });
193
+ await Promise.all([
194
+ writeCoreEval('gov-econ-committee', opts =>
195
+ // @ts-expect-error XXX makeInstallCache types
196
+ committeeProposalBuilder({ ...opts, wrapInstall: tool.wrapInstall }),
197
+ ),
198
+ writeCoreEval('gov-amm-vaults-etc', opts =>
199
+ // @ts-expect-error XXX makeInstallCache types
200
+ mainProposalBuilder({ ...opts, wrapInstall: tool.wrapInstall }),
201
+ ),
202
+ ]);
203
+ await tool.saveCache();
204
+ };
@@ -0,0 +1,42 @@
1
+ /* global process */
2
+ import { makeHelpers } from '@agoric/deploy-script-support';
3
+
4
+ import { getManifestForInviteCommittee } from '@agoric/inter-protocol/src/proposals/committee-proposal.js';
5
+
6
+ // Build proposal for sim-chain etc.
7
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
8
+ export const defaultProposalBuilder = async (
9
+ { publishRef, install },
10
+ options = {},
11
+ ) => {
12
+ const {
13
+ ECON_COMMITTEE_ADDRESSES = process.env.ECON_COMMITTEE_ADDRESSES,
14
+ voterAddresses = JSON.parse(ECON_COMMITTEE_ADDRESSES),
15
+ } = options;
16
+
17
+ assert(voterAddresses, 'ECON_COMMITTEE_ADDRESSES is required');
18
+
19
+ return harden({
20
+ sourceSpec: '@agoric/inter-protocol/src/proposals/committee-proposal.js',
21
+ getManifestCall: [
22
+ getManifestForInviteCommittee.name,
23
+ {
24
+ voterAddresses,
25
+ econCommitteeCharterRef: publishRef(
26
+ install(
27
+ '@agoric/inter-protocol/src/econCommitteeCharter.js',
28
+ '../bundles/bundle-econCommitteeCharter.js',
29
+ {
30
+ persist: true,
31
+ },
32
+ ),
33
+ ),
34
+ },
35
+ ],
36
+ });
37
+ };
38
+
39
+ export default async (homeP, endowments) => {
40
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
41
+ await writeCoreEval('gov-invite-committee', defaultProposalBuilder);
42
+ };
@@ -0,0 +1,123 @@
1
+ import { E } from '@endo/far';
2
+ import { deeplyFulfilled } from '@endo/marshal';
3
+ import { makeNotifierFromAsyncIterable } from '@agoric/notifier';
4
+
5
+ import process from 'process';
6
+
7
+ /**
8
+ * After extracting the oracleAdmins to entries in home.scratch, you can use one
9
+ * from the REPL like:
10
+ *
11
+ * lookup('agoricNames', 'oracleBrand', 'ATOM').then(brand => atom = brand)
12
+ * -> [Object Alleged: ATOM brand]{}
13
+ * lookup('agoricNames', 'oracleBrand', 'USD').then(brand => usd = brand)
14
+ * -> [Object Alleged: USD brand]{}
15
+ * pa = home.priceAuthority
16
+ * -> [Object Alleged: PriceAuthority]{}
17
+ * qn = E(pa).makeQuoteNotifier({ value: 1n * 10n ** 6n, brand: atom }, usd)
18
+ * -> [Object Alleged: QuoteNotifier]{}
19
+ * oa = E(home.scratch).get("offerResult unknown#1652669688625")
20
+ * -> [Object Alleged: OracleAdmin]{}
21
+ * E(oa).pushResult('19.37')
22
+ * E(qn).getUpdateSince()
23
+ *
24
+ * @typedef {{
25
+ * board: import('@agoric/vats').Board;
26
+ * chainTimerService;
27
+ * scratch;
28
+ * zoe;
29
+ * }} Home
30
+ * @param {Promise<Home>} homePromise
31
+ * @param {object} root0
32
+ * @param {(...path: string[]) => Promise<any>} root0.lookup A promise for the
33
+ * references available from REPL home
34
+ */
35
+ export default async function priceAuthorityFromNotifier(
36
+ homePromise,
37
+ { lookup },
38
+ ) {
39
+ const { AGGREGATOR_INSTANCE_LOOKUP } = process.env;
40
+
41
+ // Let's wait for the promise to resolve.
42
+ const home = await deeplyFulfilled(homePromise);
43
+
44
+ let aggregatorInstance;
45
+ if (AGGREGATOR_INSTANCE_LOOKUP) {
46
+ aggregatorInstance = await lookup(JSON.parse(AGGREGATOR_INSTANCE_LOOKUP));
47
+ }
48
+
49
+ if (!aggregatorInstance) {
50
+ console.log('Autodetecting aggregator instance...');
51
+ const purse = E(home.wallet).getPurse('Default Zoe invite purse');
52
+ const { value } = await E(purse).getCurrentAmount();
53
+ const invitations = value.filter(
54
+ ({ description }) => description === 'oracle invitation',
55
+ );
56
+ if (invitations.length > 1) {
57
+ console.error('Multiple oracle invitations found', invitations);
58
+ throw Error('You need an AGGREGATOR_INSTANCE_LOOKUP to disambiguate');
59
+ }
60
+ if (invitations.length === 0) {
61
+ console.error(
62
+ 'No oracle invitations found; you may need an AGGREGATOR_INSTANCE_LOOKUP',
63
+ );
64
+ } else {
65
+ console.log('Found oracle invitation', invitations);
66
+ aggregatorInstance = invitations[0].instance;
67
+ }
68
+ }
69
+
70
+ if (!aggregatorInstance) {
71
+ return;
72
+ }
73
+
74
+ const offer = {
75
+ id: Date.now(),
76
+ proposalTemplate: {},
77
+ invitationQuery: {
78
+ description: 'oracle invitation',
79
+ instance: aggregatorInstance,
80
+ },
81
+ };
82
+
83
+ console.log('Getting wallet bridge...');
84
+ const bridge = await E(home.wallet).getBridge();
85
+
86
+ // Consume an aggregator invitation for this instance.
87
+ await E(bridge)
88
+ .addOffer(offer)
89
+ .then(
90
+ () =>
91
+ console.log(
92
+ `Please approve your wallet's proposal to connect the aggregator ${aggregatorInstance}...`,
93
+ ),
94
+ () => {},
95
+ );
96
+
97
+ const walletAdmin = E(home.wallet).getAdminFacet();
98
+
99
+ console.log('=====================================================');
100
+ console.log('=== Extracting oracleAdmins from price feed offers...');
101
+ console.log('=== Control-C to cancel');
102
+ const offerIt = E(walletAdmin).getOffersNotifier();
103
+ for await (const offers of makeNotifierFromAsyncIterable(offerIt)) {
104
+ // console.log(offers);
105
+ const completed = offers
106
+ .filter(
107
+ ({ status, invitationQuery: { instance } }) =>
108
+ status === 'complete' && instance === aggregatorInstance,
109
+ )
110
+ .map(async ({ id }) => {
111
+ const orKey = `offerResult ${id}`;
112
+ await E(home.scratch).set(
113
+ orKey,
114
+ E(home.wallet).lookup('offerResult', id),
115
+ );
116
+ console.log(
117
+ 'Use this oracleAdmin:',
118
+ `E(home.scratch).get(${JSON.stringify(orKey)})`,
119
+ );
120
+ });
121
+ await Promise.all(completed);
122
+ }
123
+ }
@@ -0,0 +1,104 @@
1
+ /* global process */
2
+ import { makeHelpers } from '@agoric/deploy-script-support';
3
+
4
+ export const DEFAULT_CONTRACT_TERMS = {
5
+ POLL_INTERVAL: 30n,
6
+ maxSubmissionCount: 1000,
7
+ minSubmissionCount: 2,
8
+ restartDelay: 1, // the number of rounds an Oracle has to wait before they can initiate another round
9
+ timeout: 10, // in seconds according to chainTimerService
10
+ minSubmissionValue: 1n,
11
+ maxSubmissionValue: 2n ** 256n,
12
+ };
13
+
14
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
15
+ export const defaultProposalBuilder = async (
16
+ { publishRef, install },
17
+ options = {},
18
+ ) => {
19
+ const {
20
+ brandIn,
21
+ brandOut,
22
+ contractTerms = DEFAULT_CONTRACT_TERMS,
23
+ AGORIC_INSTANCE_NAME,
24
+ IN_BRAND_LOOKUP,
25
+ OUT_BRAND_LOOKUP,
26
+ IN_BRAND_NAME = IN_BRAND_LOOKUP[IN_BRAND_LOOKUP.length - 1],
27
+ OUT_BRAND_NAME = OUT_BRAND_LOOKUP[OUT_BRAND_LOOKUP.length - 1],
28
+ oracleAddresses,
29
+ ...optionsRest
30
+ } = options;
31
+
32
+ assert(AGORIC_INSTANCE_NAME, 'AGORIC_INSTANCE_NAME is required');
33
+ assert(Array.isArray(oracleAddresses), 'oracleAddresses array is required');
34
+
35
+ if (!brandIn) {
36
+ assert.equal(IN_BRAND_LOOKUP[0], 'agoricNames');
37
+ assert(IN_BRAND_NAME);
38
+ }
39
+ if (!brandOut) {
40
+ assert.equal(OUT_BRAND_LOOKUP[0], 'agoricNames');
41
+ assert(OUT_BRAND_NAME);
42
+ }
43
+
44
+ return harden({
45
+ sourceSpec: '@agoric/inter-protocol/src/proposals/price-feed-proposal.js',
46
+ getManifestCall: [
47
+ 'getManifestForPriceFeed',
48
+ {
49
+ ...optionsRest,
50
+ AGORIC_INSTANCE_NAME,
51
+ contractTerms,
52
+ oracleAddresses,
53
+ IN_BRAND_LOOKUP,
54
+ OUT_BRAND_LOOKUP,
55
+ IN_BRAND_NAME,
56
+ OUT_BRAND_NAME,
57
+ brandInRef: brandIn && publishRef(brandIn),
58
+ brandOutRef: brandOut && publishRef(brandOut),
59
+ priceAggregatorRef: publishRef(
60
+ install(
61
+ '@agoric/inter-protocol/src/price/fluxAggregatorContract.js',
62
+ '../bundles/bundle-fluxAggregatorKit.js',
63
+ ),
64
+ ),
65
+ },
66
+ ],
67
+ });
68
+ };
69
+
70
+ export const createGov = async (homeP, endowments) => {
71
+ const { lookup } = endowments;
72
+
73
+ const {
74
+ AGORIC_INSTANCE_NAME,
75
+ IN_BRAND_DECIMALS = '6',
76
+ IN_BRAND_LOOKUP = JSON.stringify(['wallet', 'brand', 'BLD']),
77
+ OUT_BRAND_DECIMALS = '6',
78
+ OUT_BRAND_LOOKUP = JSON.stringify(['agoricNames', 'oracleBrand', 'USD']),
79
+ ORACLE_ADDRESSES,
80
+ } = process.env;
81
+
82
+ assert(AGORIC_INSTANCE_NAME, 'AGORIC_INSTANCE_NAME is required');
83
+ assert(ORACLE_ADDRESSES, 'ORACLE_ADDRESSES is required');
84
+
85
+ const oracleAddresses = ORACLE_ADDRESSES.split(',');
86
+
87
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
88
+
89
+ const inLookup = JSON.parse(IN_BRAND_LOOKUP);
90
+ const outLookup = JSON.parse(OUT_BRAND_LOOKUP);
91
+
92
+ const proposalBuilder = powers =>
93
+ defaultProposalBuilder(powers, {
94
+ AGORIC_INSTANCE_NAME,
95
+ IN_BRAND_DECIMALS: parseInt(IN_BRAND_DECIMALS, 10),
96
+ OUT_BRAND_DECIMALS: parseInt(OUT_BRAND_DECIMALS, 10),
97
+ oracleAddresses,
98
+ brandIn: lookup(inLookup).catch(() => undefined),
99
+ brandOut: lookup(outLookup).catch(() => undefined),
100
+ });
101
+ await writeCoreEval('gov-price-feed', proposalBuilder); // gov-price-feed.js gov-price-feed-permit.json
102
+ };
103
+
104
+ export default createGov;
@@ -0,0 +1,23 @@
1
+ import { makeHelpers } from '@agoric/deploy-script-support';
2
+
3
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
4
+ export const defaultProposalBuilder = async ({ publishRef, install }) => {
5
+ return harden({
6
+ sourceSpec: '@agoric/orchestration/src/proposals/start-stakeAtom.js',
7
+ getManifestCall: [
8
+ 'getManifestForStakeAtom',
9
+ {
10
+ installKeys: {
11
+ stakeIca: publishRef(
12
+ install('@agoric/orchestration/src/examples/stakeIca.contract.js'),
13
+ ),
14
+ },
15
+ },
16
+ ],
17
+ });
18
+ };
19
+
20
+ export default async (homeP, endowments) => {
21
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
22
+ await writeCoreEval('start-stakeAtom', defaultProposalBuilder);
23
+ };
@@ -0,0 +1,23 @@
1
+ // @ts-check
2
+ import { makeHelpers } from '@agoric/deploy-script-support';
3
+
4
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
5
+ export const defaultProposalBuilder = async ({ publishRef, install }) =>
6
+ harden({
7
+ sourceSpec: '@agoric/orchestration/src/proposals/start-stakeBld.js',
8
+ getManifestCall: [
9
+ 'getManifestForStakeBld',
10
+ {
11
+ installKeys: {
12
+ stakeBld: publishRef(
13
+ install('@agoric/orchestration/src/examples/stakeBld.contract.js'),
14
+ ),
15
+ },
16
+ },
17
+ ],
18
+ });
19
+
20
+ export default async (homeP, endowments) => {
21
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
22
+ await writeCoreEval('start-stakeBld', defaultProposalBuilder);
23
+ };
@@ -0,0 +1,23 @@
1
+ import { makeHelpers } from '@agoric/deploy-script-support';
2
+
3
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
4
+ export const defaultProposalBuilder = async ({ publishRef, install }) => {
5
+ return harden({
6
+ sourceSpec: '@agoric/orchestration/src/proposals/start-stakeOsmo.js',
7
+ getManifestCall: [
8
+ 'getManifestForStakeOsmo',
9
+ {
10
+ installKeys: {
11
+ stakeIca: publishRef(
12
+ install('@agoric/orchestration/src/examples/stakeIca.contract.js'),
13
+ ),
14
+ },
15
+ },
16
+ ],
17
+ });
18
+ };
19
+
20
+ export default async (homeP, endowments) => {
21
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
22
+ await writeCoreEval('start-stakeOsmo', defaultProposalBuilder);
23
+ };
@@ -0,0 +1,23 @@
1
+ import { makeHelpers } from '@agoric/deploy-script-support';
2
+
3
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
4
+ export const defaultProposalBuilder = async ({ publishRef, install }) =>
5
+ harden({
6
+ sourceSpec: '@agoric/pegasus/src/proposals/core-proposal.js',
7
+ getManifestCall: [
8
+ 'getManifestForPegasus',
9
+ {
10
+ pegasusRef: publishRef(
11
+ install(
12
+ '@agoric/pegasus/src/contract.js',
13
+ '../bundles/bundle-pegasus.js',
14
+ ),
15
+ ),
16
+ },
17
+ ],
18
+ });
19
+
20
+ export default async (homeP, endowments) => {
21
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
22
+ await writeCoreEval('gov-pegasus', defaultProposalBuilder);
23
+ };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @file Proposal Builder: Start Game with non-vbank Place NFT asset
3
+ *
4
+ * Usage:
5
+ * agoric run build-game1-start.js
6
+ */
7
+
8
+ import { makeHelpers } from '@agoric/deploy-script-support';
9
+ import { getManifestForGame1 } from '@agoric/smart-wallet/test/start-game1-proposal.js';
10
+
11
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
12
+ const game1ProposalBuilder = async ({ publishRef, install }) => {
13
+ return harden({
14
+ sourceSpec: '@agoric/smart-wallet/test/start-game1-proposal.js',
15
+ getManifestCall: [
16
+ getManifestForGame1.name,
17
+ {
18
+ game1Ref: publishRef(
19
+ install(
20
+ '@agoric/smart-wallet/test/gameAssetContract.js',
21
+ '../bundles/bundle-game1.js',
22
+ { persist: true },
23
+ ),
24
+ ),
25
+ },
26
+ ],
27
+ });
28
+ };
29
+
30
+ export default async (homeP, endowments) => {
31
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
32
+ await writeCoreEval('start-game1', game1ProposalBuilder);
33
+ };
@@ -0,0 +1,28 @@
1
+ import { makeHelpers } from '@agoric/deploy-script-support';
2
+
3
+ /**
4
+ * @file
5
+ * `agoric run scripts/smart-wallet/build-wallet-factory2-upgrade.js`
6
+ * produces a proposal and permit file, as well as the necessary bundles. It
7
+ * also prints helpful instructions for copying the files and installing them.
8
+ */
9
+
10
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
11
+ export const defaultProposalBuilder = async ({ publishRef, install }) =>
12
+ harden({
13
+ sourceSpec:
14
+ '@agoric/smart-wallet/src/proposals/upgrade-wallet-factory2-proposal.js',
15
+ getManifestCall: [
16
+ 'getManifestForUpgradeWallet',
17
+ {
18
+ walletRef: publishRef(
19
+ install('@agoric/smart-wallet/src/walletFactory.js'),
20
+ ),
21
+ },
22
+ ],
23
+ });
24
+
25
+ export default async (homeP, endowments) => {
26
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
27
+ await writeCoreEval('upgrade-wallet-factory', defaultProposalBuilder);
28
+ };
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @file Proposal Builder: Upgrade walletFactory
3
+ *
4
+ * Usage:
5
+ * agoric run build-walletFactory-upgrade.js
6
+ */
7
+
8
+ import { makeHelpers } from '@agoric/deploy-script-support';
9
+ import { getManifestForUpgrade } from '@agoric/smart-wallet/src/proposals/upgrade-walletFactory-proposal.js';
10
+
11
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
12
+ export const defaultProposalBuilder = async ({ publishRef, install }) => {
13
+ return harden({
14
+ sourceSpec:
15
+ '@agoric/smart-wallet/src/proposals/upgrade-walletFactory-proposal.js',
16
+ getManifestCall: [
17
+ getManifestForUpgrade.name,
18
+ {
19
+ walletFactoryRef: publishRef(
20
+ install(
21
+ '@agoric/smart-wallet/src/walletFactory.js',
22
+ '../bundles/bundle-walletFactory.js',
23
+ { persist: true },
24
+ ),
25
+ ),
26
+ },
27
+ ],
28
+ });
29
+ };
30
+
31
+ export default async (homeP, endowments) => {
32
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
33
+ await writeCoreEval('upgrade-walletFactory', defaultProposalBuilder);
34
+ };
@@ -0,0 +1,23 @@
1
+ import { makeHelpers } from '@agoric/deploy-script-support';
2
+ import { defaultProposalBuilder as vaultProposalBuilder } from '../inter-protocol/add-collateral-core.js';
3
+
4
+ /** @file This is for use in tests in a3p-integration */
5
+
6
+ /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
7
+ const starsVaultProposalBuilder = async powers => {
8
+ return vaultProposalBuilder(powers, {
9
+ interchainAssetOptions: {
10
+ denom: 'ibc/000C0FFEECAFE000',
11
+ decimalPlaces: 6,
12
+ keyword: 'LEMONS',
13
+
14
+ oracleBrand: 'LEMONS',
15
+ proposedName: 'LEMONS',
16
+ },
17
+ });
18
+ };
19
+
20
+ export default async (homeP, endowments) => {
21
+ const { writeCoreEval } = await makeHelpers(homeP, endowments);
22
+ await writeCoreEval('add-STARS-collateral', starsVaultProposalBuilder);
23
+ };