"jsonPermits":"{
"consume": {
"board": true,
"chainStorage": true,
"diagnostics": true,
"zoe": "makeCoreProposalBehavior",
"namesByAddressAdmin": true,
"kreadCommitteeCreatorFacet": true,
"highPrioritySendersManager": true,
"kreadCharterKit": true,
"agoricNames": true,
"kreadKit": true,
"agoricNamesAdmin": "makeCoreProposalBehavior",
"vatAdminSvc": "makeCoreProposalBehavior"
},
"produce": {
"kreadCommitteeKit": true,
"kreadCommitteeCreatorFacet": "kreadCommittee",
"kreadCharterKit": true
},
"installation": {
"consume": {
"committee": "zoe",
"binaryVoteCounter": true,
"kreadCommitteeCharter": true
},
"produce": "makeCoreProposalBehavior"
},
"instance": {
"produce": {
"kreadCommittee": "kreadCommittee",
"kreadCommitteeCharter": true
},
"consume": {
"kread": true
}
},
"evaluateBundleCap": "makeCoreProposalBehavior",
"modules": {
"utils": {
"runModuleBehaviors": "makeCoreProposalBehavior"
}
}
}"
"jsCode":"// This is generated by writeCoreProposal; please edit!
/* eslint-disable */
const manifestBundleRef = {bundleID:"b1-a724453e7bfcaae1843be4532e18c1236c3d6d33bf6c44011f2966e155bc7149b904573014e583fdcde2b9cf2913cb8b337fc9daf79c59a38a37c99030fcf7dc"};
const getManifestCall = harden([
"getManifestForInviteCommittee",
{
committeeName: "kread-gov",
kreadCommitteeCharterRef: {
bundleID: "b1-51085a4ad4ac3448ccf039c0b54b41bd11e9367dfbd641deda38e614a7f647d7f1c0d34e55ba354d0331b1bf54c999fca911e6a796c90c30869f7fb8887b3024",
},
voterAddresses: {
kgov1: "agoric1hlm7w6pyyqnwz35jdknly8mp0ehvyrl04xjez7",
kgov2: "agoric19rtq0t8rm5ej5eyumgl0qwepzr7t4x50whx9ae",
},
},
]);
const overrideManifest = {
addGovernorToKreadCharter: {
consume: {
agoricNames: true,
kreadCharterKit: true,
kreadCommitteeCreatorFacet: true,
kreadKit: true,
namesByAddressAdmin: true,
zoe: true,
},
installation: {
consume: {
binaryVoteCounter: true,
},
},
instance: {
consume: {
kread: true,
},
},
},
inviteCommitteeMembers: {
consume: {
highPrioritySendersManager: true,
kreadCommitteeCreatorFacet: true,
namesByAddressAdmin: true,
},
},
inviteToKreadCharter: {
consume: {
kreadCharterKit: true,
namesByAddressAdmin: true,
},
},
startKreadCharter: {
consume: {
zoe: true,
},
installation: {
consume: {
binaryVoteCounter: true,
kreadCommitteeCharter: true,
},
},
instance: {
produce: {
kreadCommitteeCharter: true,
},
},
produce: {
kreadCharterKit: true,
},
},
startKreadCommittee: {
consume: {
board: true,
chainStorage: true,
diagnostics: true,
zoe: true,
},
installation: {
consume: {
committee: "zoe",
},
},
instance: {
produce: {
kreadCommittee: "kreadCommittee",
},
},
produce: {
kreadCommitteeCreatorFacet: "kreadCommittee",
kreadCommitteeKit: true,
},
},
};
// Make the behavior the completion value.
(({
manifestBundleRef,
getManifestCall,
overrideManifest,
E,
log = console.info,
restoreRef: overrideRestoreRef,
}) => {
const { entries, fromEntries } = Object;
// deeplyFulfilled is a bit overkill for what we need.
const shallowlyFulfilled = async obj => {
if (!obj) {
return obj;
}
const ents = await Promise.all(
entries(obj).map(async ([key, valueP]) => {
const value = await valueP;
return [key, value];
}),
);
return fromEntries(ents);
};
/** @param {ChainBootstrapSpace & BootstrapPowers & { evaluateBundleCap: any }} allPowers */
const behavior = async allPowers => {
// NOTE: If updating any of these names extracted from `allPowers`, you must
// change `permits` above to reflect their accessibility.
const {
consume: { vatAdminSvc, zoe, agoricNamesAdmin },
evaluateBundleCap,
installation: { produce: produceInstallations },
modules: {
utils: { runModuleBehaviors },
},
} = allPowers;
const [exportedGetManifest, ...manifestArgs] = getManifestCall;
const defaultRestoreRef = async ref => {
// extract-proposal.js creates these records, and bundleName is
// the name under which the bundle was installed into
// config.bundles
const p = ref.bundleName
? E(vatAdminSvc).getBundleIDByName(ref.bundleName)
: ref.bundleID;
const bundleID = await p;
const label = bundleID.slice(0, 8);
return E(zoe).installBundleID(bundleID, label);
};
const restoreRef = overrideRestoreRef || defaultRestoreRef;
// Get the on-chain installation containing the manifest and behaviors.
console.info('evaluateBundleCap', {
manifestBundleRef,
exportedGetManifest,
vatAdminSvc,
});
let bcapP;
if ('bundleName' in manifestBundleRef) {
bcapP = E(vatAdminSvc).getNamedBundleCap(manifestBundleRef.bundleName);
} else {
bcapP = E(vatAdminSvc).getBundleCap(manifestBundleRef.bundleID);
}
const bundleCap = await bcapP;
const manifestNS = await evaluateBundleCap(bundleCap);
console.error('execute', {
exportedGetManifest,
behaviors: Object.keys(manifestNS),
});
const {
manifest,
options: rawOptions,
installations: rawInstallations,
} = await manifestNS[exportedGetManifest](
harden({ restoreRef }),
...manifestArgs,
);
// Await references in the options or installations.
const [options, installations] = await Promise.all(
[rawOptions, rawInstallations].map(shallowlyFulfilled),
);
// Publish the installations for behavior dependencies.
const installAdmin = E(agoricNamesAdmin).lookupAdmin('installation');
await Promise.all(
entries(installations || {}).map(([key, value]) => {
produceInstallations[key].resolve(value);
return E(installAdmin).update(key, value);
}),
);
// Evaluate the manifest for our behaviors.
return runModuleBehaviors({
allPowers,
behaviors: manifestNS,
manifest: overrideManifest || manifest,
makeConfig: (name, _permit) => {
log('coreProposal:', name);
return { options };
},
});
};
// Make the behavior the completion value.
return behavior;
})({ manifestBundleRef, getManifestCall, overrideManifest, E });
"