From 9505588587f952028cd88e4bcd4c5aefad47ea1e Mon Sep 17 00:00:00 2001 From: Dan Connolly Date: Tue, 18 Apr 2023 16:42:37 -0500 Subject: [PATCH 1/2] fix: missing zoe arg in setDestinations() --- packages/inter-protocol/src/feeDistributor.js | 2 +- .../src/proposals/econ-behaviors.js | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/packages/inter-protocol/src/feeDistributor.js b/packages/inter-protocol/src/feeDistributor.js index 3f7808df478..fc16eea1d22 100644 --- a/packages/inter-protocol/src/feeDistributor.js +++ b/packages/inter-protocol/src/feeDistributor.js @@ -316,7 +316,7 @@ export const makeFeeDistributor = (feeIssuer, terms) => { }, /** - * @param {Record} newDestinations + * @param {Record>} newDestinations */ setDestinations: async newDestinations => { destinations = newDestinations; diff --git a/packages/inter-protocol/src/proposals/econ-behaviors.js b/packages/inter-protocol/src/proposals/econ-behaviors.js index aa9f404d3e7..ce6209e88cb 100644 --- a/packages/inter-protocol/src/proposals/econ-behaviors.js +++ b/packages/inter-protocol/src/proposals/econ-behaviors.js @@ -417,6 +417,12 @@ export const startRewardDistributor = async ({ return undefined; }); + /** + * @type {Awaited< + * ReturnType> + * & { adminFacet: AdminFacet, instance: Instance } + * } + */ const instanceKit = await E(zoe).startInstance( feeDistributor, { Fee: centralIssuer }, @@ -424,13 +430,15 @@ export const startRewardDistributor = async ({ undefined, 'feeDistributor', ); + /** @type {ERef} */ await E(instanceKit.creatorFacet).setDestinations({ - RewardDistributor: - rewardDistributorDepositFacet && - E(instanceKit.creatorFacet).makeDepositFacetDestination( - rewardDistributorDepositFacet, - ), + ...(rewardDistributorDepositFacet && { + RewardDistributor: E( + instanceKit.creatorFacet, + ).makeDepositFacetDestination(rewardDistributorDepositFacet), + }), Reserve: E(instanceKit.creatorFacet).makeOfferDestination( + zoe, 'Collateral', E.get(reserveKit).publicFacet, 'makeAddCollateralInvitation', From 7d0dd558e5654aa36094b32d2f30c768479cd3b8 Mon Sep 17 00:00:00 2001 From: Dan Connolly Date: Tue, 18 Apr 2023 16:46:41 -0500 Subject: [PATCH 2/2] fix: initially all rewards go to the reserve --- packages/inter-protocol/src/proposals/econ-behaviors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/inter-protocol/src/proposals/econ-behaviors.js b/packages/inter-protocol/src/proposals/econ-behaviors.js index ce6209e88cb..cd2fea2c72e 100644 --- a/packages/inter-protocol/src/proposals/econ-behaviors.js +++ b/packages/inter-protocol/src/proposals/econ-behaviors.js @@ -396,7 +396,7 @@ export const startRewardDistributor = async ({ timerService, collectionInterval: 60n * 60n, // 1 hour keywordShares: { - RewardDistributor: 1n, + RewardDistributor: 0n, Reserve: 1n, }, }),