"jsonPermits":"{
"vatParameters": {
"chainStorageEntries": true
},
"consume": {
"agoricNamesAdmin": "makeCoreProposalBehavior",
"bankManager": "bank",
"startUpgradable": true,
"anchorBalancePayments": true,
"anchorKits": true,
"board": true,
"chainStorage": true,
"diagnostics": true,
"zoe": "zoe",
"feeMintAccess": "zoe",
"economicCommitteeCreatorFacet": "economicCommittee",
"provisionPoolStartResult": true,
"econCharterKit": "econCommitteeCharter",
"chainTimerService": "timer",
"psmKit": true,
"vatAdminSvc": "makeCoreProposalBehavior"
},
"installation": {
"consume": {
"mintHolder": "zoe",
"contractGovernor": "zoe",
"psm": "zoe"
},
"produce": "makeCoreProposalBehavior"
},
"produce": {
"testFirstAnchorKit": true,
"anchorBalancePayments": true,
"anchorKits": true,
"psmKit": "true"
},
"instance": {
"consume": {
"economicCommittee": "economicCommittee"
}
},
"brand": {
"consume": {
"IST": "zoe"
}
},
"evaluateBundleCap": "makeCoreProposalBehavior",
"modules": {
"utils": {
"runModuleBehaviors": "makeCoreProposalBehavior"
}
}
}
"
"jsCode":"// This is generated by writeCoreProposal; please edit!
/* eslint-disable */
const manifestBundleRef = {
bundleID:
"b1-4c34c89b707bc8ece5a41e97e6a354081f7ae8a40391f1462848348613dd1218dcce574b3e30901a9825a966cb85bda6a92ba9f9ce9ba325e4c475f9a678b930",
};
const getManifestCall = harden([
"getManifestForPsm",
{
anchorOptions: {
decimalPlaces: 6,
denom:
"ibc/079DAF1995A28BCD3B4E3D38948BB0FBC1CDE47939820CBAB7C02AFB88FF31A3",
keyword: "USDT",
proposedName: "USDT",
},
installKeys: {
mintHolder: {
bundleID:
"b1-b183edd918de93c0b009b0f662502ff851c8e95177c812f2eabc82cd65c2c53e1cb12c56719d6e7c474a0f3d58d3c3d2839dfbf0c2e62f6ee6758e16c16b38c2",
},
psm: {
bundleID:
"b1-c25fbc404ae239a8bf9f3d5f65f3f27d489fb4c8e48de0613b1c59c6fc00718243b2c84a3d7060350cbe4442d340d4826d4d1948b9e9938b31807e64c18adbc4",
},
},
},
]);
const overrideManifest = {
makeAnchorAsset: {
consume: {
agoricNamesAdmin: true,
anchorBalancePayments: true,
anchorKits: true,
bankManager: "bank",
startUpgradable: true,
},
installation: {
consume: {
mintHolder: "zoe",
},
},
produce: {
anchorBalancePayments: true,
anchorKits: true,
testFirstAnchorKit: true,
},
vatParameters: {
chainStorageEntries: true,
},
},
startPSM: {
brand: {
consume: {
IST: "zoe",
},
},
consume: {
agoricNamesAdmin: true,
anchorBalancePayments: true,
board: true,
chainStorage: true,
chainTimerService: "timer",
diagnostics: true,
econCharterKit: "econCommitteeCharter",
economicCommitteeCreatorFacet: "economicCommittee",
feeMintAccess: "zoe",
provisionPoolStartResult: true,
psmKit: true,
zoe: "zoe",
},
installation: {
consume: {
contractGovernor: "zoe",
psm: "zoe",
},
},
instance: {
consume: {
economicCommittee: "economicCommittee",
},
},
produce: {
psmKit: "true",
},
vatParameters: {
chainStorageEntries: 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 });
"