"jsonPermits":"{
"produce": {
"ymax0Kit": true
},
"consume": {
"localchain": true,
"cosmosInterchainService": true,
"chainStorage": true,
"chainTimerService": true,
"agoricNames": true,
"board": true,
"startUpgradable": true,
"zoe": "makeCoreProposalBehavior",
"chainInfoPublished": true,
"ymax0Kit": true,
"agoricNamesAdmin": "makeCoreProposalBehavior",
"vatAdminSvc": "makeCoreProposalBehavior"
},
"instance": {
"produce": {
"ymax0": true
}
},
"installation": {
"consume": {
"ymax0": true
},
"produce": "makeCoreProposalBehavior"
},
"brand": {},
"issuer": {
"consume": {
"BLD": true,
"USDC": true,
"PoC26": true
}
},
"evaluateBundleCap": "makeCoreProposalBehavior",
"modules": {
"utils": {
"runModuleBehaviors": "makeCoreProposalBehavior"
}
}
}"
"jsCode":"// This is generated by writeCoreEval; please edit!
/* eslint-disable */
const manifestBundleRef = {bundleID:"b1-357d9fcf22d18b17b6bb4134d8deccee56ded1904aa2cdc7b511b7e4406ddccbefceb3fd1e4cd146b1b387c2ee6e0a8192aa933ed9c4bb5fa5a53fecf6521d95"};
const getManifestCall = harden([
"getManifestForPortfolio",
{
installKeys: {
ymax0: {
bundleID: "b1-867596e047f55dcf08bafe36e4a6719adb36421ee4718f4c94f4747771fd0e89b3bd5db4dadaff29a837181d669b61332ef2a5c67e7feb28e5377d19ee2f16fc",
},
},
options: {
slots: [],
structure: {
axelarConfig: {
Arbitrum: {
axelarId: "arbitrum-sepolia",
chainInfo: {
cctpDestinationDomain: 3,
namespace: "eip155",
reference: "421614",
},
contracts: {
aavePool: "0xBfC91D59fdAA134A4ED45f7B584cAf96D7792Eff",
aaveRewardsController: "0x",
aaveUSDC: "#undefined",
compound: "0x",
compoundRewardsController: "0x",
factory: "0x",
tokenMessenger: "0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",
usdc: "0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d",
},
},
Avalanche: {
axelarId: "Avalanche",
chainInfo: {
cctpDestinationDomain: 1,
namespace: "eip155",
reference: "43113",
},
contracts: {
aavePool: "0x8B9b2AF4afB389b4a70A474dfD4AdCD4a302bb40",
aaveRewardsController: "0x03aFC1Dfb53eae8eB7BE0E8CB6524aa79C3F8578",
aaveUSDC: "0xb1c85310a1b809C70fA6806d27Da425C1261F801",
compound: "0x",
compoundRewardsController: "0x",
factory: "0xe4Bf676E956AF5f30876b9af9E93D3CCC4D2ECfF",
tokenMessenger: "0xeb08f243E5d3FCFF26A9E38Ae5520A669f4019d0",
usdc: "0x5425890298aed601595a70AB815c96711a31Bc65",
},
},
Optimism: {
axelarId: "optimism-sepolia",
chainInfo: {
cctpDestinationDomain: 2,
namespace: "eip155",
reference: "11155420",
},
contracts: {
aavePool: "0xb50201558B00496A145fE76f7424749556E326D8",
aaveRewardsController: "0x",
aaveUSDC: "#undefined",
compound: "0x",
compoundRewardsController: "0x",
factory: "0x",
tokenMessenger: "0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",
usdc: "0x5fd84259d66Cd46123540766Be93DFE6D43130D7",
},
},
Polygon: {
axelarId: "polygon-sepolia",
chainInfo: {
cctpDestinationDomain: 7,
namespace: "eip155",
reference: "80002",
},
contracts: {
aavePool: "0x",
aaveRewardsController: "0x",
aaveUSDC: "0x",
compound: "0x",
compoundRewardsController: "0x",
factory: "0x",
tokenMessenger: "0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5",
usdc: "0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",
},
},
},
oldBoardId: "board013515",
},
},
},
]);
const customManifest = {
startPortfolio: {
brand: {},
consume: {
agoricNames: true,
board: true,
chainInfoPublished: true,
chainStorage: true,
chainTimerService: true,
cosmosInterchainService: true,
localchain: true,
startUpgradable: true,
ymax0Kit: true,
zoe: true,
},
installation: {
consume: {
ymax0: true,
},
},
instance: {
produce: {
ymax0: true,
},
},
issuer: {
consume: {
BLD: true,
PoC26: true,
USDC: true,
},
},
produce: {
ymax0Kit: true,
},
},
};
// Make a behavior function and "export" it by way of script completion value.
// It is constructed by an anonymous invocation to ensure the absence of a global binding
// for makeCoreProposalBehavior, which may not be necessary but preserves behavior pre-dating
// https://github.com/Agoric/agoric-sdk/pull/8712 .
const behavior = (({
manifestBundleRef,
getManifestCall: [manifestGetterName, ...manifestGetterArgs],
customManifest,
E,
log = console.info,
customRestoreRef,
}) => {
const { entries, fromEntries } = Object;
/**
* Given an object whose properties may be promise-valued, return a promise
* for an analogous object in which each such value has been replaced with its
* fulfillment.
* This is a non-recursive form of endo `deeplyFulfilled`.
*
* @template T
* @param {{[K in keyof T]: (T[K] | Promise<T[K]>)}} obj
* @returns {Promise<T>}
*/
const shallowlyFulfilled = async obj => {
if (!obj) {
return obj;
}
const awaitedEntries = await Promise.all(
entries(obj).map(async ([key, valueP]) => {
const value = await valueP;
return [key, value];
}),
);
return fromEntries(awaitedEntries);
};
const makeRestoreRef = (vatAdminSvc, zoe) => {
/** @type {(ref: import\('./externalTypes.js').ManifestBundleRef) => Promise<Installation<unknown>>} */
const defaultRestoreRef = async bundleRef => {
// extract-proposal.js creates these records, and bundleName is
// the optional name under which the bundle was installed into
// config.bundles
const bundleIdP =
'bundleName' in bundleRef
? E(vatAdminSvc).getBundleIDByName(bundleRef.bundleName)
: bundleRef.bundleID;
const bundleID = await bundleIdP;
const label = bundleID.slice(0, 8);
return E(zoe).installBundleID(bundleID, label);
};
return defaultRestoreRef;
};
/** @param {ChainBootstrapSpace & BootstrapPowers & { evaluateBundleCap: any }} powers */
const coreProposalBehavior = async powers => {
// NOTE: `powers` is expected to match or be a superset of the above `permits` export,
// which should therefore be kept in sync with this deconstruction code.
// HOWEVER, do note that this function is invoked with at least the *union* of powers
// required by individual moduleBehaviors declared by the manifest getter, which is
// necessary so it can use `runModuleBehaviors` to provide the appropriate subset to
// each one (see ./writeCoreEvalParts.js).
// Handle `powers` with the requisite care.
const {
consume: { vatAdminSvc, zoe, agoricNamesAdmin },
evaluateBundleCap,
installation: { produce: produceInstallations },
modules: {
utils: { runModuleBehaviors },
},
} = powers;
// Get the on-chain installation containing the manifest and behaviors.
log('evaluateBundleCap', {
manifestBundleRef,
manifestGetterName,
vatAdminSvc,
});
let bcapP;
if ('bundleName' in manifestBundleRef) {
bcapP = E(vatAdminSvc).getNamedBundleCap(manifestBundleRef.bundleName);
} else if ('bundleID' in manifestBundleRef) {
bcapP = E(vatAdminSvc).getBundleCap(manifestBundleRef.bundleID);
} else {
const keys = Reflect.ownKeys(manifestBundleRef).map(key =>
typeof key === 'string' ? JSON.stringify(key) : String(key),
);
const keysStr = `[${keys.join(', ')}]`;
throw Error(
`bundleRef must have own bundleName or bundleID, missing in ${keysStr}`,
);
}
const bundleCap = await bcapP;
const proposalNS = await evaluateBundleCap(bundleCap);
// Get the manifest and its metadata.
log('execute', {
manifestGetterName,
bundleExports: Object.keys(proposalNS),
});
const restoreRef = customRestoreRef || makeRestoreRef(vatAdminSvc, zoe);
const {
manifest,
options: rawOptions,
installations: rawInstallations,
} = await proposalNS[manifestGetterName](
harden({ restoreRef }),
...manifestGetterArgs,
);
// Await promises in the returned options and installations records.
const [options, installations] = await Promise.all(
[rawOptions, rawInstallations].map(shallowlyFulfilled),
);
// Publish the installations for our dependencies.
const installationEntries = entries(installations || {});
if (installationEntries.length > 0) {
const installAdmin = E(agoricNamesAdmin).lookupAdmin('installation');
await Promise.all(
installationEntries.map(([key, value]) => {
produceInstallations[key].reset();
produceInstallations[key].resolve(value);
return E(installAdmin).update(key, value);
}),
);
}
// Evaluate the manifest.
return runModuleBehaviors({
// Remember that `powers` may be arbitrarily broad.
allPowers: powers,
behaviors: proposalNS,
manifest: customManifest || manifest,
makeConfig: (name, _permit) => {
log('coreProposal:', name);
return { options };
},
});
};
return coreProposalBehavior;
})({ manifestBundleRef, getManifestCall, customManifest, E });
behavior;
"