@agoric/inter-protocol 0.13.2-dev-e61a41e.0 → 0.13.2-dev-d092592.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.
- package/bundles/bundle-amm-meta.js +123 -123
- package/bundles/bundle-econCommitteeCharter-meta.js +418 -0
- package/bundles/bundle-econCommitteeCharter.js +1 -0
- package/bundles/bundle-feeDistributor-meta.js +53 -53
- package/bundles/bundle-interchainPool-meta.js +106 -106
- package/bundles/bundle-liquidateIncrementally-meta.js +65 -65
- package/bundles/bundle-liquidateMinimum-meta.js +70 -70
- package/bundles/bundle-psm-meta.js +104 -104
- package/bundles/bundle-reserve-meta.js +113 -113
- package/bundles/bundle-scaledPriceAuthority-meta.js +65 -65
- package/bundles/bundle-stakeFactory-meta.js +112 -112
- package/bundles/bundle-vaultFactory-meta.js +134 -134
- package/package.json +15 -15
- package/scripts/build-bundles.js +4 -1
- package/scripts/start-local-chain-config.json +2 -2
- package/src/econCommitteeCharter.js +109 -77
- package/src/proposals/committee-proposal.js +29 -8
- package/src/proposals/econ-behaviors.js +9 -2
- package/src/proposals/startPSM.js +23 -21
- package/bundles/bundle-psmCharter-meta.js +0 -418
- package/bundles/bundle-psmCharter.js +0 -1
- package/src/psm/psmCharter.js +0 -135
package/src/psm/psmCharter.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import '@agoric/governance/exported.js';
|
|
2
|
-
import { makeScalarMapStore, M, makeHeapFarInstance, fit } from '@agoric/store';
|
|
3
|
-
import '@agoric/zoe/exported.js';
|
|
4
|
-
import '@agoric/zoe/src/contracts/exported.js';
|
|
5
|
-
import { InstanceHandleShape } from '@agoric/zoe/src/typeGuards.js';
|
|
6
|
-
import { BrandShape } from '@agoric/ertp';
|
|
7
|
-
import { TimestampShape } from '@agoric/swingset-vat/src/vats/timer/typeGuards.js';
|
|
8
|
-
import { E } from '@endo/far';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @file
|
|
12
|
-
*
|
|
13
|
-
* This contract makes it possible for those who govern the PSM to call for
|
|
14
|
-
* votes on changes. A more complete implementation would validate parameters,
|
|
15
|
-
* constrain deadlines and possibly split the ability to call for votes into
|
|
16
|
-
* separate capabilities for finer grain encapsulation.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @typedef {object} ParamChangesOfferArgs
|
|
21
|
-
* @property {bigint} deadline
|
|
22
|
-
* @property {Instance} instance
|
|
23
|
-
* @property {Record<string, unknown>} params
|
|
24
|
-
* @property {{paramPath: { key: string }}} [path]
|
|
25
|
-
*/
|
|
26
|
-
const ParamChangesOfferArgsShape = M.splitRecord(
|
|
27
|
-
{
|
|
28
|
-
deadline: TimestampShape,
|
|
29
|
-
instance: InstanceHandleShape,
|
|
30
|
-
params: M.recordOf(M.string(), M.any()),
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
path: { paramPath: { key: M.string() } },
|
|
34
|
-
},
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* @param {ZCF<{binaryVoteCounterInstallation:Installation}>} zcf
|
|
39
|
-
*/
|
|
40
|
-
export const start = async zcf => {
|
|
41
|
-
const { binaryVoteCounterInstallation: counter } = zcf.getTerms();
|
|
42
|
-
/** @type {MapStore<Instance,GovernedContractFacetAccess<{},{}>>} */
|
|
43
|
-
const instanceToGovernor = makeScalarMapStore();
|
|
44
|
-
|
|
45
|
-
const makeParamInvitation = () => {
|
|
46
|
-
/**
|
|
47
|
-
* @param {ZCFSeat} seat
|
|
48
|
-
* @param {ParamChangesOfferArgs} args
|
|
49
|
-
*/
|
|
50
|
-
const voteOnParamChanges = (seat, args) => {
|
|
51
|
-
fit(args, ParamChangesOfferArgsShape);
|
|
52
|
-
seat.exit();
|
|
53
|
-
|
|
54
|
-
const {
|
|
55
|
-
params,
|
|
56
|
-
instance,
|
|
57
|
-
deadline,
|
|
58
|
-
path = { paramPath: { key: 'governedApi' } },
|
|
59
|
-
} = args;
|
|
60
|
-
const psmGovernor = instanceToGovernor.get(instance);
|
|
61
|
-
return E(psmGovernor).voteOnParamChanges(counter, deadline, {
|
|
62
|
-
...path,
|
|
63
|
-
changes: params,
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
return zcf.makeInvitation(voteOnParamChanges, 'vote on param changes');
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const makeOfferFilterInvitation = (instance, strings, deadline) => {
|
|
71
|
-
const voteOnOfferFilterHandler = seat => {
|
|
72
|
-
seat.exit();
|
|
73
|
-
|
|
74
|
-
const psmGovernor = instanceToGovernor.get(instance);
|
|
75
|
-
return E(psmGovernor).voteOnOfferFilter(counter, deadline, strings);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
return zcf.makeInvitation(voteOnOfferFilterHandler, 'vote on offer filter');
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const MakerShape = M.interface('PSM Charter InvitationMakers', {
|
|
82
|
-
VoteOnParamChange: M.call().returns(M.promise()),
|
|
83
|
-
VoteOnPauseOffers: M.call(
|
|
84
|
-
InstanceHandleShape,
|
|
85
|
-
M.arrayOf(M.string()),
|
|
86
|
-
TimestampShape,
|
|
87
|
-
).returns(M.promise()),
|
|
88
|
-
});
|
|
89
|
-
const invitationMakers = makeHeapFarInstance(
|
|
90
|
-
'PSM Invitation Makers',
|
|
91
|
-
MakerShape,
|
|
92
|
-
{
|
|
93
|
-
VoteOnParamChange: makeParamInvitation,
|
|
94
|
-
VoteOnPauseOffers: makeOfferFilterInvitation,
|
|
95
|
-
},
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
const charterMemberHandler = seat => {
|
|
99
|
-
seat.exit();
|
|
100
|
-
return harden({ invitationMakers });
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
const psmCharterCreatorI = M.interface('PSM Charter creatorFacet', {
|
|
104
|
-
addInstance: M.call(InstanceHandleShape, M.any())
|
|
105
|
-
.optional(BrandShape, BrandShape)
|
|
106
|
-
.returns(),
|
|
107
|
-
makeCharterMemberInvitation: M.call().returns(M.promise()),
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
const creatorFacet = makeHeapFarInstance(
|
|
111
|
-
'PSM Charter creatorFacet',
|
|
112
|
-
psmCharterCreatorI,
|
|
113
|
-
{
|
|
114
|
-
/**
|
|
115
|
-
* @param {Instance} psmInstance
|
|
116
|
-
* @param {GovernedContractFacetAccess<{},{}>} psmGovernorFacet
|
|
117
|
-
* @param {Brand} [anchor] for diagnostic use only
|
|
118
|
-
* @param {Brand} [minted] for diagnostic use only
|
|
119
|
-
*/
|
|
120
|
-
addInstance: (psmInstance, psmGovernorFacet, anchor, minted) => {
|
|
121
|
-
console.log('psmCharter: adding instance', { minted, anchor });
|
|
122
|
-
instanceToGovernor.init(psmInstance, psmGovernorFacet);
|
|
123
|
-
},
|
|
124
|
-
makeCharterMemberInvitation: () =>
|
|
125
|
-
zcf.makeInvitation(
|
|
126
|
-
charterMemberHandler,
|
|
127
|
-
'PSM charter member invitation',
|
|
128
|
-
),
|
|
129
|
-
},
|
|
130
|
-
);
|
|
131
|
-
|
|
132
|
-
return harden({ creatorFacet });
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
export const INVITATION_MAKERS_DESC = 'PSM charter member invitation';
|