From 53ead64451ab7f299f99a5a2552368031104950d Mon Sep 17 00:00:00 2001 From: Chris Hibbert Date: Tue, 12 Sep 2023 09:38:48 -0700 Subject: [PATCH 01/39] refactor: bootstrap and context hold publicFacet vs instance --- agoric/contract/test/bootstrap.js | 8 +-- agoric/contract/test/setup.js | 14 +---- agoric/contract/test/test-inventory.js | 22 +++---- agoric/contract/test/test-market-metrics.js | 18 +++--- agoric/contract/test/test-market.js | 26 ++++----- agoric/contract/test/test-minting.js | 63 ++++++++------------- agoric/contract/test/types.js | 12 ++-- 7 files changed, 70 insertions(+), 93 deletions(-) diff --git a/agoric/contract/test/bootstrap.js b/agoric/contract/test/bootstrap.js index 505e8e244..3964a9a2c 100644 --- a/agoric/contract/test/bootstrap.js +++ b/agoric/contract/test/bootstrap.js @@ -77,14 +77,13 @@ export const bootstrapContext = async (conf) => { }; // Start contract instance - const instance = await E(zoe).startInstance( + const { creatorFacet, instance, publicFacet } = await E(zoe).startInstance( installation, { Money: issuerMockIST }, harden(kreadTerms), harden(privateArgs), ); - const { creatorFacet } = instance; - const terms = await E(zoe).getTerms(instance.instance); + const terms = await E(zoe).getTerms(instance); await E(creatorFacet).initializeBaseAssets(defaultCharacters, defaultItems); await E(creatorFacet).initializeCharacterNamesEntries(); await E(creatorFacet).initializeMetrics(); @@ -108,7 +107,8 @@ export const bootstrapContext = async (conf) => { const result = { contractAssets, assets, - instance, + creatorFacet, + publicFacet, purses, zoe, paymentAsset: { diff --git a/agoric/contract/test/setup.js b/agoric/contract/test/setup.js index 200bd015b..bf36860a1 100644 --- a/agoric/contract/test/setup.js +++ b/agoric/contract/test/setup.js @@ -26,12 +26,7 @@ harden(setupZoe); */ export const addCharacterToBootstrap = async (bootstrap) => { /** @type {Bootstrap} */ - const { - instance: { publicFacet }, - paymentAsset, - purses, - zoe, - } = bootstrap; + const { publicFacet, paymentAsset, purses, zoe } = bootstrap; const { offerArgs, give } = flow.mintCharacter.expected; @@ -67,12 +62,7 @@ harden(addCharacterToBootstrap); */ export const addItemToBootstrap = async (bootstrap, item) => { /** @type {Bootstrap} */ - const { - instance: { creatorFacet }, - contractAssets, - purses, - zoe, - } = bootstrap; + const { creatorFacet, contractAssets, purses, zoe } = bootstrap; const mintItemInvitation = await E(creatorFacet).makeMintItemInvitation(); const itemAmount = AmountMath.make( diff --git a/agoric/contract/test/test-inventory.js b/agoric/contract/test/test-inventory.js index 295bc8cb3..05efeaf83 100644 --- a/agoric/contract/test/test-inventory.js +++ b/agoric/contract/test/test-inventory.js @@ -17,7 +17,7 @@ test.before(async (t) => { const unequipOffer = async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, contractAssets, purses, zoe, @@ -82,7 +82,7 @@ const unequipOffer = async (t) => { test.serial('| INVENTORY - Unequip Item', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, purses, } = t.context; const { @@ -115,7 +115,7 @@ test.serial('| INVENTORY - Unequip Item', async (t) => { test.serial('| INVENTORY - Unequip already unequipped item', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, contractAssets, purses, zoe, @@ -182,7 +182,7 @@ test.serial('| INVENTORY - Unequip already unequipped item', async (t) => { test.serial('| INVENTORY - Unequip - wrong character', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, contractAssets, purses, zoe, @@ -265,7 +265,7 @@ test.serial('| INVENTORY - Unequip - wrong character', async (t) => { test.serial('| INVENTORY - Equip Item', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, contractAssets, purses, zoe, @@ -360,7 +360,7 @@ test.serial('| INVENTORY - Equip Item', async (t) => { test.serial('| INVENTORY - Equip Item duplicate category', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, contractAssets, purses, zoe, @@ -466,7 +466,7 @@ test.serial('| INVENTORY - Equip Item duplicate category', async (t) => { test.serial('| INVENTORY - Swap Items', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, contractAssets, purses, zoe, @@ -569,7 +569,7 @@ test.serial('| INVENTORY - Swap Items', async (t) => { test.serial('| INVENTORY - Swap Items - Initially empty', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, contractAssets, purses, zoe, @@ -663,7 +663,7 @@ test.serial('| INVENTORY - Swap Items - Initially empty', async (t) => { test.serial('| INVENTORY - Swap Items - Different categories', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, contractAssets, purses, zoe, @@ -773,7 +773,7 @@ test.serial('| INVENTORY - Swap Items - Different categories', async (t) => { test.serial('| INVENTORY - Unequip all', async (t) => { const { - instance: { publicFacet }, + publicFacet, contractAssets, purses, zoe, @@ -847,7 +847,7 @@ test.serial('| INVENTORY - Unequip all', async (t) => { test.serial('| INVENTORY - UnequipAll empty inventory', async (t) => { const { - instance: { publicFacet }, + publicFacet, contractAssets, purses, zoe, diff --git a/agoric/contract/test/test-market-metrics.js b/agoric/contract/test/test-market-metrics.js index e10b372ef..2b949a277 100644 --- a/agoric/contract/test/test-market-metrics.js +++ b/agoric/contract/test/test-market-metrics.js @@ -9,7 +9,7 @@ import { makeKreadUser } from './make-user.js'; async function sellCharacter(context, user, characterName, askingPrice) { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, contractAssets, zoe, paymentAsset, @@ -48,7 +48,7 @@ async function sellCharacter(context, user, characterName, askingPrice) { async function buyCharacter(context, user, characterName, seller) { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, contractAssets, zoe, } = context; @@ -93,7 +93,7 @@ async function buyCharacter(context, user, characterName, seller) { test.before(async (t) => { const bootstrap = await bootstrapContext(); - const { zoe, contractAssets, assets, purses, instance, paymentAsset } = + const { zoe, contractAssets, assets, purses, publicFacet, paymentAsset } = bootstrap; const bob = makeKreadUser('bob', purses); @@ -104,7 +104,7 @@ test.before(async (t) => { bob.depositPayment(payout); t.context = { - instance, + publicFacet, contractAssets, assets, purses, @@ -117,7 +117,7 @@ test.before(async (t) => { test.serial('---| METRICS - Initialization', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, } = t.context; const metrics = await E(publicFacet).getMarketMetrics(); @@ -132,7 +132,7 @@ test.serial('---| METRICS - Initialization', async (t) => { test.serial('---| METRICS - Collection size', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, paymentAsset, zoe, users: { bob }, @@ -172,7 +172,7 @@ test.serial('---| METRICS - Collection size', async (t) => { test.serial('---| METRICS - Average levels character', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, users: { bob }, } = t.context; @@ -203,7 +203,7 @@ test.serial('---| METRICS - Average levels character', async (t) => { test.serial('---| METRICS - Amount sold character', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, users: { bob }, } = t.context; @@ -232,7 +232,7 @@ test.serial('---| METRICS - Amount sold character', async (t) => { test.serial('---| METRICS - Latest sale price character', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, users: { bob }, } = t.context; diff --git a/agoric/contract/test/test-market.js b/agoric/contract/test/test-market.js index 8eb6b1553..b3be24ddf 100644 --- a/agoric/contract/test/test-market.js +++ b/agoric/contract/test/test-market.js @@ -40,7 +40,7 @@ test.before(async (t) => { contractAssets, assets, purses, - instance, + publicFacet, paymentAsset, royaltyPurse, platformFeePurse, @@ -57,7 +57,7 @@ test.before(async (t) => { character: contractAssets.character.issuer.makeEmptyPurse(), item: contractAssets.item.issuer.makeEmptyPurse(), payment: paymentAsset.issuerMockIST.makeEmptyPurse(), - }); +j }); const payout = paymentAsset.mintMockIST.mintPayment( AmountMath.make(paymentAsset.brandMockIST, harden(100n)), @@ -70,7 +70,7 @@ test.before(async (t) => { // bob.depositPayment(payoutBob); t.context = { - instance, + publicFacet, contractAssets, assets, purses, @@ -87,7 +87,7 @@ test.before(async (t) => { test.serial('---| MARKET - Sell character', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, contractAssets, zoe, users: { bob }, @@ -150,7 +150,7 @@ test.serial( async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, contractAssets, zoe, users: { bob, alice }, @@ -212,7 +212,7 @@ test.serial( test.serial('---| MARKET - Buy character', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, contractAssets, zoe, users: { bob, alice }, @@ -304,7 +304,7 @@ test.serial('---| MARKET - Buy character', async (t) => { test.serial('---| MARKET - Buy character not on market', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, contractAssets, zoe, users: { alice }, @@ -358,7 +358,7 @@ test.serial('---| MARKET - Buy character not on market', async (t) => { test.serial('---| MARKET - Sell Item', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, contractAssets, zoe, users: { bob }, @@ -400,7 +400,7 @@ test.serial( async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, contractAssets, zoe, users: { bob, alice }, @@ -454,7 +454,7 @@ test.serial( test.serial('---| MARKET - Buy item', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, contractAssets, zoe, users: { bob, alice }, @@ -507,7 +507,7 @@ test.serial('---| MARKET - Buy item', async (t) => { test.serial('---| MARKET - Buy item not on market', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, contractAssets, zoe, users: { alice }, @@ -553,7 +553,7 @@ test.serial( async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, contractAssets, zoe, users: { bob, alice }, @@ -671,7 +671,7 @@ test.serial( async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, contractAssets, zoe, users: { bob, alice }, diff --git a/agoric/contract/test/test-minting.js b/agoric/contract/test/test-minting.js index a4e213ef6..b59cf776c 100644 --- a/agoric/contract/test/test-minting.js +++ b/agoric/contract/test/test-minting.js @@ -8,8 +8,15 @@ import { makeKreadUser } from './make-user.js'; import { makeCopyBag } from '@agoric/store'; test.before(async (t) => { - const { zoe, contractAssets, assets, purses, instance, paymentAsset } = - await bootstrapContext(); + const { + zoe, + contractAssets, + assets, + purses, + publicFacet, + paymentAsset, + creatorFacet, + } = await bootstrapContext(); const alice = makeKreadUser('alice', { character: contractAssets.character.issuer.makeEmptyPurse(), @@ -22,7 +29,7 @@ test.before(async (t) => { alice.depositPayment(payout); t.context = { - instance, + publicFacet, contractAssets, assets, purses, @@ -35,7 +42,7 @@ test.before(async (t) => { test.serial('--| MINT - Too Long Name', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, paymentAsset, users: { alice }, zoe, @@ -75,7 +82,7 @@ test.serial('--| MINT - Too Long Name', async (t) => { test.serial('--| MINT - Invalid Chars in Name', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, users: { alice }, paymentAsset, zoe, @@ -115,7 +122,7 @@ test.serial('--| MINT - Invalid Chars in Name', async (t) => { test.serial('--| MINT - Forbidden name: "names"', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, users: { alice }, paymentAsset, zoe, @@ -155,7 +162,7 @@ test.serial('--| MINT - Forbidden name: "names"', async (t) => { test.serial('--| MINT - Expected flow', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, purses, paymentAsset, users: { alice }, @@ -203,7 +210,7 @@ test.serial('--| MINT - Expected flow', async (t) => { test.serial('--| MINT - Fee too low', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, paymentAsset, users: { alice }, zoe, @@ -241,7 +248,7 @@ test.serial('--| MINT - Fee too low', async (t) => { test.serial('--| MINT - No offerArgs', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, paymentAsset, users: { alice }, zoe, @@ -279,7 +286,7 @@ test.serial('--| MINT - No offerArgs', async (t) => { test.serial('--| MINT - Duplicate Name', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, paymentAsset, users: { alice }, zoe, @@ -317,7 +324,7 @@ test.serial('--| MINT - Duplicate Name', async (t) => { test.serial('--| MINT - No name', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, paymentAsset, users: { alice }, zoe, @@ -355,7 +362,7 @@ test.serial('--| MINT - No name', async (t) => { test.serial('--| MINT - No characters available', async (t) => { /** @type {Bootstrap} */ const { - instance: { publicFacet }, + publicFacet, paymentAsset, users: { alice }, zoe, @@ -392,9 +399,7 @@ test.serial('--| MINT - No characters available', async (t) => { test.serial('--| MINT - Inventory check', async (t) => { /** @type {Bootstrap} */ - const { - instance: { publicFacet }, - } = t.context; + const { publicFacet } = t.context; const { offerArgs } = flow.mintCharacter.expected; const characterInventory = await E(publicFacet).getCharacterInventory( @@ -430,12 +435,7 @@ test.serial('--| MINT - Inventory check', async (t) => { test.serial('--| MINT - Item - Expected flow', async (t) => { /** @type {Bootstrap} */ - const { - instance: { creatorFacet }, - contractAssets, - purses, - zoe, - } = t.context; + const { creatorFacet, contractAssets, purses, zoe } = t.context; const { want, message } = flow.mintItem.expected; const mintItemInvitation = await E(creatorFacet).makeMintItemInvitation(); @@ -464,12 +464,7 @@ test.serial('--| MINT - Item - Expected flow', async (t) => { test.serial('--| MINT - Item - Mint same item (SFT)', async (t) => { /** @type {Bootstrap} */ - const { - instance: { creatorFacet }, - contractAssets, - purses, - zoe, - } = t.context; + const { creatorFacet, contractAssets, purses, zoe } = t.context; const { want, message } = flow.mintItem.expected; const mintItemInvitation = await E(creatorFacet).makeMintItemInvitation(); @@ -505,12 +500,7 @@ test.serial('--| MINT - Item - Mint same item (SFT)', async (t) => { test.serial('--| MINT - Item - Multiple flow', async (t) => { /** @type {Bootstrap} */ - const { - instance: { creatorFacet }, - contractAssets, - purses, - zoe, - } = t.context; + const { creatorFacet, contractAssets, purses, zoe } = t.context; const { want, message } = flow.mintItem.multiple; const mintItemInvitation = await E(creatorFacet).makeMintItemInvitation(); @@ -543,12 +533,7 @@ test.serial('--| MINT - Item - Multiple flow', async (t) => { test.serial('--| MINT - Item - Multiple different items flow', async (t) => { /** @type {Bootstrap} */ - const { - instance: { creatorFacet }, - contractAssets, - purses, - zoe, - } = t.context; + const { creatorFacet, contractAssets, purses, zoe } = t.context; const { want, message } = flow.mintItem.multipleUnique; const mintItemInvitation = await E(creatorFacet).makeMintItemInvitation(); diff --git a/agoric/contract/test/types.js b/agoric/contract/test/types.js index 17e99d0c9..3df5e19bf 100644 --- a/agoric/contract/test/types.js +++ b/agoric/contract/test/types.js @@ -40,19 +40,21 @@ * }} ContractAssets */ +// XXX approximate /** * Return value from bootstrap.js * * @typedef {{ - * assets: Assets - * contractAssets: ContractAssets - * zoe: ZoeService + * assets: Assets; + * creatorFacet: unknown; + * contractAssets: ContractAssets; + * publicFacet: unknown; + * zoe: ZoeService; * purses: { * character: any * item: any * payment: any - * } - * instance: StartInstanceResult + * }; * }} Bootstrap */ From 34f2c3c0cd8d09bcece328e690f3e6ca9166b4a5 Mon Sep 17 00:00:00 2001 From: Chris Hibbert Date: Thu, 21 Sep 2023 10:32:56 -0700 Subject: [PATCH 02/39] feat: add contract governance --- agoric/Makefile | 32 +- agoric/Makefile.paths | 3 +- agoric/contract/package.json | 4 + agoric/contract/scripts/parseProposals.js | 41 ++ agoric/contract/src/index.js | 22 +- agoric/contract/src/kreadCommitteeCharter.js | 111 +++++ agoric/contract/src/kreadKit.js | 4 +- .../src/proposal/chain-storage-proposal.js | 8 +- .../src/proposal/kread-committee-proposal.js | 267 +++++++++++ .../src/proposal/kread-committee-script.js | 45 ++ agoric/contract/src/proposal/powers.json | 6 +- .../src/proposal/start-kread-proposal.js | 416 ++++++++++++++++++ .../src/proposal/start-kread-script.js | 30 ++ agoric/contract/test/bootstrap.js | 20 +- agoric/contract/test/test-governance.js | 60 +++ agoric/contract/test/test-market.js | 10 +- agoric/yarn.lock | 2 +- 17 files changed, 1053 insertions(+), 28 deletions(-) create mode 100755 agoric/contract/scripts/parseProposals.js create mode 100644 agoric/contract/src/kreadCommitteeCharter.js create mode 100644 agoric/contract/src/proposal/kread-committee-proposal.js create mode 100644 agoric/contract/src/proposal/kread-committee-script.js create mode 100644 agoric/contract/src/proposal/start-kread-proposal.js create mode 100644 agoric/contract/src/proposal/start-kread-script.js create mode 100644 agoric/contract/test/test-governance.js diff --git a/agoric/Makefile b/agoric/Makefile index 1a3313e94..04d4af4ed 100644 --- a/agoric/Makefile +++ b/agoric/Makefile @@ -8,6 +8,8 @@ KREAD_REPO = EVAL_PERMIT = EVAL_CODE = EVAL_CLEAN = +KR_AG_DIR = +PROP_DIR = $(KR_AG_DIR)/contract/src/proposal include Makefile.paths.local @@ -38,6 +40,26 @@ wallet1: deploy: agoric deploy contract/kread-deploy-contract.js api/kread-deploy-api.js +kread-committee: + agoric run contract/src/proposal/kread-committee-script.js | tee kread-committee.out + node contract/scripts/parseProposals.js < kread-committee.out | jq -r '.bundles[]' | sort -u > kread-committee-bundles.out + for b in `cat kread-committee-bundles.out` ; do \ + agoric publish --node 127.0.0.1:26657 $$b --chain-id agoriclocal --home $(COSMIC_SWINGSET_PATH)/t1/8000 ; \ + done + cd $(COSMIC_SWINGSET_PATH); \ + make scenario2-core-eval EVAL_PERMIT=$(KR_AG_DIR)/kread-invite-committee-permit.json \ + EVAL_CODE=$(KR_AG_DIR)/kread-invite-committee.js EVAL_CLEAN=$(KR_AG_DIR)/kread-invite-committee.js.t scenario2-vote VOTE_PROPOSAL=3 \ + +start-kread: + agoric run contract/src/proposal/start-kread-script.js | tee start-kread.out + node contract/scripts/parseProposals.js < start-kread.out | jq -r '.bundles[]' | sort -u > start-kread-bundles.out + for b in `cat start-kread-bundles.out` ; do \ + agoric publish --node 127.0.0.1:26657 $$b --chain-id agoriclocal --home $(COSMIC_SWINGSET_PATH)/t1/8000 ; \ + done + cd $(COSMIC_SWINGSET_PATH); \ + make scenario2-core-eval EVAL_PERMIT=$(KR_AG_DIR)/start-kread-permit.json \ + EVAL_CODE=$(KR_AG_DIR)/start-kread.js EVAL_CLEAN=$(KR_AG_DIR)/start-kread.js.t scenario2-vote VOTE_PROPOSAL=4 \ + kread-bundle: cd $(VATS_PATH); \ yarn bundle-source --cache-json bundles/ ${KREAD_REPO} kread; \ @@ -63,12 +85,16 @@ provision-fee-collector: fund-account: cd $(COSMIC_SWINGSET_PATH); \ make fund-acct ACCT_ADDR=$(KEPLR_ADDRESS) FUNDS=1000000000000uist; \ - make fund-acct ACCT_ADDR=$(KEPLR_ADDRESS) FUNDS=1000000000000ubld; \ + make fund-acct ACCT_ADDR=$(KEPLR_ADDRESS) FUNDS=1000000000000ubld; \ fund-pool: cd $(COSMIC_SWINGSET_PATH); \ make fund-provision-pool \ +fund-large-contract: + cd $(COSMIC_SWINGSET_PATH); \ + make fund-acct ACCT_ADDR=$(KEPLR_ADDRESS) FUNDS=10000000000000000uist; \ + fund-account-atom: cd $(COSMIC_SWINGSET_PATH); \ make fund-acct ACCT_ADDR=$(KEPLR_ADDRESS) FUNDS=100000000ibc/toyatom; \ @@ -86,10 +112,10 @@ proposal-2: # before running make proposal bootstrap: make provision-account; \ - make fund-account; \ + make fund-account; \ make kread-bundle; \ make proposal; \ fund+provision: make provision-account; \ - make fund-account; \ + make fund-account; \ diff --git a/agoric/Makefile.paths b/agoric/Makefile.paths index 5969f0ea9..4aa240724 100644 --- a/agoric/Makefile.paths +++ b/agoric/Makefile.paths @@ -6,4 +6,5 @@ KEPLR_ADDRESS2 = agoric1tq3v943uaycqp90qvuyaqzwdc3eh52xzrcl4p6 KREAD_REPO = /Users/carlostrigo/kryha/agoric/code/Agoric/agoric/contract/src/index.js EVAL_PERMIT = /Users/carlostrigo/kryha/agoric/code/Agoric/agoric/contract/src/proposal/powers.json EVAL_CODE = /Users/carlostrigo/kryha/agoric/code/Agoric/agoric/contract/src/proposal/chain-storage-proposal.js -EVAL_CLEAN = $(EVAL_CODE)-clean.js \ No newline at end of file +EVAL_CLEAN = $(EVAL_CODE)-clean.js +KR_AG_DIR = /Users/carlostrigo/agoric-kread/agoric diff --git a/agoric/contract/package.json b/agoric/contract/package.json index 857990539..f825266a0 100644 --- a/agoric/contract/package.json +++ b/agoric/contract/package.json @@ -34,14 +34,18 @@ "@agoric/babel-parser": "^7.6.4", "@agoric/deploy-script-support": "beta", "@agoric/ertp": "beta", + "@agoric/governance": "beta", + "@agoric/inter-protocol": "beta", "@agoric/nat": "dev", "@agoric/notifier": "beta", "@agoric/store": "beta", + "@agoric/time": "beta", "@agoric/vat-data": "^0.5.2", "@agoric/zoe": "beta", "@agoric/vats": "beta", "@endo/bundle-source": "^2.1.1", "@endo/eventual-send": "^0.14.8", + "@endo/far": "^0.2.18", "@endo/init": "^0.5.37", "@endo/marshal": "^0.6.9", "@endo/ses-ava": "^0.2.40", diff --git a/agoric/contract/scripts/parseProposals.js b/agoric/contract/scripts/parseProposals.js new file mode 100755 index 000000000..daab1be36 --- /dev/null +++ b/agoric/contract/scripts/parseProposals.js @@ -0,0 +1,41 @@ +#!/usr/bin/env node + +import fs from 'fs'; + +const Fail = (template, ...args) => { + throw Error(String.raw(template, ...args.map(val => String(val)))); +}; + +/** + * Parse output of `agoric run proposal-builder.js` + * + * @param {string} txt + * + * adapted from packages/boot/test/bootstrapTests/supports.js + */ +const parseProposalParts = txt => { + const evals = [ + ...txt.matchAll(/swingset-core-eval (?\S+) (?