Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more RUN remnants #5913

Merged
merged 2 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/inter-protocol/docs/governance-params.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ In `packages/inter-protocol/src/reserve/collateralReserve.js`:
The Inter Protocol Whitepaper v0.8 does not describe the governance parameters
for this contract.

### RUNStake
### stakeFactory

In `packages/inter-protocol/src/stakeFactory/stakeFactory.js`:

Expand All @@ -60,7 +60,7 @@ In `packages/inter-protocol/src/stakeFactory/stakeFactory.js`:
| MintingRatio | ParamTypes.RATIO | Yes |

From Inter Protocol Whitepaper, v0.8:
>Governance through the BLDer DAO determines the parameters for RUNstake. These include the total debt limit, the minting limit per account, and minting fees and interest rates.
>Governance through the BLDer DAO determines the parameters for stakeFactory. These include the total debt limit, the minting limit per account, and minting fees and interest rates.

### Parity Stability Mechanism (PSM)

Expand Down
4 changes: 2 additions & 2 deletions packages/inter-protocol/scripts/init-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { makeHelpers } from '@agoric/deploy-script-support';
import { objectMap } from '@agoric/vat-data';

import {
getManifestForRunProtocol,
getManifestForInterProtocol,
getManifestForEconCommittee,
getManifestForMain,
} from '../src/proposals/core-proposal.js';
Expand Down Expand Up @@ -181,7 +181,7 @@ export const defaultProposalBuilder = async (
return harden({
sourceSpec: '../src/proposals/core-proposal.js',
getManifestCall: [
getManifestForRunProtocol.name,
getManifestForInterProtocol.name,
{
ROLE,
vaultFactoryControllerAddress,
Expand Down
6 changes: 3 additions & 3 deletions packages/inter-protocol/src/proposals/core-proposal.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ const REWARD_MANIFEST = harden({
},
});

const RUN_STAKE_MANIFEST = harden({
const STAKE_FACTORY_MANIFEST = harden({
[econBehaviors.startLienBridge.name]: {
consume: { bridgeManager: true },
produce: { lienBridge: true },
Expand Down Expand Up @@ -296,13 +296,13 @@ export const getManifestForMain = (
const roleToManifest = harden({
chain: {
...REWARD_MANIFEST,
...RUN_STAKE_MANIFEST,
...STAKE_FACTORY_MANIFEST,
},
'sim-chain': SIM_CHAIN_MANIFEST,
client: {},
});

export const getManifestForRunProtocol = (
export const getManifestForInterProtocol = (
{ restoreRef },
{
ROLE = 'chain',
Expand Down
18 changes: 11 additions & 7 deletions packages/inter-protocol/src/proposals/econ-behaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,10 +539,10 @@ harden(grantVaultFactoryControl);
export const configureVaultFactoryUI = async ({
consume: { board, zoe },
issuer: {
consume: { [Stable.symbol]: centralIssuerP },
consume: { [Stable.symbol]: stableIssuerP },
},
brand: {
consume: { [Stable.symbol]: centralBrandP },
consume: { [Stable.symbol]: stableBrandP },
},
installation: {
consume: {
Expand All @@ -569,9 +569,9 @@ export const configureVaultFactoryUI = async ({
amm: ammInstance,
vaultFactory: vaultInstance,
});
const [centralIssuer, centralBrand] = await Promise.all([
centralIssuerP,
centralBrandP,
const [stableIssuer, stableBrand] = await Promise.all([
stableIssuerP,
stableBrandP,
]);

const invitationIssuer = await E(zoe).getInvitationIssuer();
Expand All @@ -589,8 +589,12 @@ export const configureVaultFactoryUI = async ({
const boardIdValue = [
['INSTANCE_BOARD_ID', instances.vaultFactory],
['INSTALLATION_BOARD_ID', installs.vaultFactory],
['RUN_ISSUER_BOARD_ID', centralIssuer],
['RUN_BRAND_BOARD_ID', centralBrand],
// @deprecated
['RUN_ISSUER_BOARD_ID', stableIssuer],
// @deprecated
['RUN_BRAND_BOARD_ID', stableBrand],
['STABLE_ISSUER_BOARD_ID', stableIssuer],
['STABLE_BRAND_BOARD_ID', stableBrand],
Comment on lines +596 to +597
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

things like this really should be looked up from a namehub such as E(home).agoricNames (see also #4819), so adding features to configureVaultFactoryUI seems like the wrong direction. Not critical, I suppose.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Easy enough to remove when that work is done. Meanwhile I don't want to slow down the dapps moving off RUN_*

['AMM_INSTALLATION_BOARD_ID', installs.amm],
['LIQ_INSTALLATION_BOARD_ID', installs.liquidate],
['BINARY_COUNTER_INSTALLATION_BOARD_ID', installs.binaryVoteCounter],
Expand Down
2 changes: 1 addition & 1 deletion packages/inter-protocol/src/stakeFactory/stakeFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export const start = async (
const publicFacet = augmentPublicFacet(
Far('stakeFactory public', {
makeLoanInvitation: () =>
zcf.makeInvitation(offerHandler, 'make RUNstake'),
zcf.makeInvitation(offerHandler, 'make stakeFactory'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. This change is part of the visible contract API, so it's more important than many of the others. Please consider separating it out as a separate commit marked as a breaking change fix.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visible to end users but not read by machines, correct? I.e. I don't believe this change breaks any commitments of the API.
https://github.com/Agoric/agoric-sdk/blob/master/packages/zoe/src/contractFacet/types.js#L93-L97

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make sense for a machine to select among invitations from an installation based on description. This is discussed in #2230 for example:

Just knowing the instance and description should be enough to choose an invitation to use.

makeReturnAttInvitation: att.publicFacet.makeReturnAttInvitation,
}),
);
Expand Down
8 changes: 4 additions & 4 deletions packages/inter-protocol/src/stakeFactory/stakeFactoryKit.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const calculateFee = (feeCoeff, currentDebt, giveAmount, wantAmount) => {
*/

/**
* Make RUNstake kit state
* Make stakeFactory kit state
*
* @param {ZCF} zcf
* @param {ZCFSeat} startSeat
Expand Down Expand Up @@ -358,7 +358,7 @@ const helperBehavior = {
helper.assertVaultHoldsNoMinted();
seat.exit();

return 'Your RUNstake is closed; thank you for your business.';
return 'Your stakeFactory is closed; thank you for your business.';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Messages like this don't play a critical security role like invitation descriptions, but strictly speaking, this is also a breaking contract API change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API just says that it returns a string. Anything depending on parsing that string is making unwarranted assumptions about the API.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have quite a few tests that depend on the contents of these strings. That seemed like an unwarranted assumption to me too, but that seems to be the current design. I guess it doesn't matter that much...

},
};

Expand Down Expand Up @@ -418,15 +418,15 @@ const finish = ({ facets }) => {
};

/**
* Make RUNstake kit, subject to stakeFactory terms.
* Make stakeFactory kit, subject to stakeFactory terms.
*
* @param {ZCF} zcf
* @param {ZCFSeat} startSeat
* @param {import('./stakeFactoryManager.js').StakeFactoryManager} manager
* @throws {Error} if startSeat proposal is not consistent with governance parameters in manager
*/
export const makeStakeFactoryKit = defineKindMulti(
'RUNStakeKit',
'stakeFactoryKit',
initState,
behavior,
{ finish },
Expand Down