Skip to content

Commit

Permalink
feat(vats): share Invitation issuer/brand in agoricNames
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Jan 23, 2023
1 parent bc4e1aa commit fcc5027
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
10 changes: 10 additions & 0 deletions packages/vats/src/core/basic-behaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,23 @@ harden(makeVatsFromBundles);
export const buildZoe = async ({
consume: { vatAdminSvc, loadCriticalVat, client },
produce: { zoe, feeMintAccess },
brand: {
produce: { Invitation: invitationBrand },
},
issuer: {
produce: { Invitation: invitationIssuer },
},
}) => {
const zcfBundleName = 'zcf'; // should match config.bundles.zcf=
const { zoeService, feeMintAccess: fma } = await E(
E(loadCriticalVat)('zoe'),
).buildZoe(vatAdminSvc, feeIssuerConfig, zcfBundleName);

zoe.resolve(zoeService);
const issuer = E(zoeService).getInvitationIssuer();
const brand = E(issuer).getBrand();
invitationIssuer.resolve(issuer);
invitationBrand.resolve(brand);

feeMintAccess.resolve(fma);
return Promise.all([
Expand Down
2 changes: 2 additions & 0 deletions packages/vats/src/core/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ const SHARED_CHAIN_BOOTSTRAP_MANIFEST = harden({
zoe: 'zoe',
feeMintAccess: 'zoe',
},
issuer: { produce: { Invitation: 'zoe' } },
brand: { produce: { Invitation: 'zoe' } },
},
[makeBoard.name]: {
consume: {
Expand Down
2 changes: 1 addition & 1 deletion packages/vats/src/core/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
*
* @typedef {{
* issuer: |
* TokenKeyword | 'Attestation' | 'AUSD',
* TokenKeyword | 'Invitation' | 'Attestation' | 'AUSD',
* installation: |
* 'centralSupply' | 'mintHolder' |
* 'walletFactory' | 'provisionPool' |
Expand Down
2 changes: 2 additions & 0 deletions packages/vats/src/core/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ export const agoricNamesReserved = harden({
[Stake.symbol]: Stake.proposedName,
[Stable.symbol]: Stable.proposedName,
Attestation: 'Agoric lien attestation',
Invitation: 'Zoe invitation',
AUSD: 'Agoric bridged USDC',
},
brand: {
[Stake.symbol]: Stake.proposedName,
[Stable.symbol]: Stable.proposedName,
Attestation: 'Agoric lien attestation',
AUSD: 'Agoric bridged USDC',
Invitation: 'Zoe invitation',
},
vbankAsset: {
[Stake.denom]: Stake.proposedName,
Expand Down

0 comments on commit fcc5027

Please sign in to comment.