Skip to content

Commit

Permalink
rm obsolete penaltyPoolSeat
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed May 13, 2022
1 parent 248fd9e commit 788c61b
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const start = async zcf => {
const asFloat = (numerator, denominator) =>
Number(numerator) / Number(denominator);

// TODO distribute penalties to the reserve
// TODO(before merge) distribute penalties to the reserve
assert(reservePublicFacet, 'Missing reservePublicFacet');
const { zcfSeat: penaltyPoolSeat } = zcf.makeEmptySeatKit();

Expand Down
2 changes: 0 additions & 2 deletions packages/run-protocol/src/vaultFactory/liquidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const trace = makeTracer('LIQ');
* ) => void} burnLosses
* @param {Liquidator} liquidator
* @param {Brand} collateralBrand
* @param {ZCFSeat} penaltyPoolSeat
* @param {Ratio} penaltyRate
* @returns {Promise<Vault>}
*/
Expand All @@ -33,7 +32,6 @@ const liquidate = async (
burnLosses,
liquidator,
collateralBrand,
penaltyPoolSeat,
penaltyRate,
) => {
trace('liquidate start', vault);
Expand Down
1 change: 0 additions & 1 deletion packages/run-protocol/src/vaultFactory/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
* @property {AddVaultType} addVaultType
* @property {() => Promise<Array<Collateral>>} getCollaterals
* @property {() => Allocation} getRewardAllocation
* @property {() => Allocation} getPenaltyAllocation
* @property {() => Instance} getContractGovernor
* @property {() => Promise<Invitation>} makeCollectFeesInvitation
*/
Expand Down
8 changes: 0 additions & 8 deletions packages/run-protocol/src/vaultFactory/vaultDirector.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const { details: X } = assert;
* electionManager: Instance,
* directorParamManager: import('@agoric/governance/src/contractGovernance/typedParamManager').TypedParamManager<import('./params.js').VaultDirectorParams>,
* mintSeat: ZCFSeat,
* penaltyPoolSeat: ZCFSeat,
* rewardPoolSeat: ZCFSeat,
* vaultParamManagers: Store<Brand, import('./params.js').VaultParamManager>,
* zcf: import('./vaultFactory.js').VaultFactoryZCF,
Expand All @@ -64,7 +63,6 @@ const initState = (zcf, directorParamManager, debtMint) => {
/** For temporary staging of newly minted tokens */
const { zcfSeat: mintSeat } = zcf.makeEmptySeatKit();
const { zcfSeat: rewardPoolSeat } = zcf.makeEmptySeatKit();
const { zcfSeat: penaltyPoolSeat } = zcf.makeEmptySeatKit();

const collateralTypes = makeScalarMap('brand');

Expand All @@ -76,7 +74,6 @@ const initState = (zcf, directorParamManager, debtMint) => {
directorParamManager,
mintSeat,
rewardPoolSeat,
penaltyPoolSeat,
vaultParamManagers,
zcf,
};
Expand Down Expand Up @@ -204,7 +201,6 @@ const machineBehavior = {
debtMint,
collateralTypes,
mintSeat,
penaltyPoolSeat,
rewardPoolSeat,
vaultParamManagers,
directorParamManager,
Expand Down Expand Up @@ -289,7 +285,6 @@ const machineBehavior = {
zcf.getTerms().priceAuthority,
factoryPowers,
timerService,
penaltyPoolSeat,
startTimeStamp,
);
collateralTypes.init(collateralBrand, vm);
Expand All @@ -316,9 +311,6 @@ const machineBehavior = {
/** @param {MethodContext} context */
getRewardAllocation: ({ state }) =>
state.rewardPoolSeat.getCurrentAllocation(),
/** @param {MethodContext} context */
getPenaltyAllocation: ({ state }) =>
state.penaltyPoolSeat.getCurrentAllocation(),
};

const creatorBehavior = {
Expand Down
8 changes: 1 addition & 7 deletions packages/run-protocol/src/vaultFactory/vaultManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ const trace = makeTracer('VM', false);
* debtBrand: Brand<'nat'>,
* debtMint: ZCFMint<'nat'>,
* factoryPowers: import('./vaultDirector.js').FactoryPowersFacet,
* penaltyPoolSeat: ZCFSeat,
* periodNotifier: ERef<Notifier<bigint>>,
* poolIncrementSeat: ZCFSeat,
* priceAuthority: ERef<PriceAuthority>,
Expand Down Expand Up @@ -103,7 +102,6 @@ let outstandingQuote = null;
* @param {ERef<PriceAuthority>} priceAuthority
* @param {import('./vaultDirector.js').FactoryPowersFacet} factoryPowers
* @param {ERef<TimerService>} timerService
* @param {ZCFSeat} penaltyPoolSeat
* @param {Timestamp} startTimeStamp
*/
const initState = (
Expand All @@ -113,7 +111,6 @@ const initState = (
priceAuthority,
factoryPowers,
timerService,
penaltyPoolSeat,
startTimeStamp,
) => {
const periodNotifier = E(timerService).makeNotifier(
Expand All @@ -127,7 +124,6 @@ const initState = (
debtBrand: debtMint.getIssuerRecord().brand,
debtMint,
factoryPowers,
penaltyPoolSeat,
periodNotifier,
poolIncrementSeat: zcf.makeEmptySeatKit().zcfSeat,
priceAuthority,
Expand Down Expand Up @@ -354,7 +350,7 @@ const helperBehavior = {
* @param {[key: string, vaultKit: Vault]} record
*/
liquidateAndRemove: ({ state, facets }, [key, vault]) => {
const { factoryPowers, penaltyPoolSeat, prioritizedVaults, zcf } = state;
const { factoryPowers, prioritizedVaults, zcf } = state;
trace('liquidating', vault.getVaultSeat().getProposal());

// Start liquidation (vaultState: LIQUIDATING)
Expand All @@ -367,7 +363,6 @@ const helperBehavior = {
(amount, seat) => facets.manager.burnAndRecord(amount, seat),
liquidator,
state.collateralBrand,
penaltyPoolSeat,
factoryPowers.getGovernedParams().getLiquidationPenalty(),
)
.then(() => {
Expand Down Expand Up @@ -633,7 +628,6 @@ const makeVaultManagerKit = defineKindMulti(
* @param {ERef<PriceAuthority>} priceAuthority
* @param {import('./vaultDirector.js').FactoryPowersFacet} factoryPowers
* @param {ERef<TimerService>} timerService
* @param {ZCFSeat} penaltyPoolSeat
* @param {Timestamp} startTimeStamp
*/
export const makeVaultManager = pickFacet(makeVaultManagerKit, 'self');
Expand Down

0 comments on commit 788c61b

Please sign in to comment.