Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions packages/builders/scripts/fast-usdc/init-fast-usdc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// @ts-check
import { makeHelpers } from '@agoric/deploy-script-support';
import { AmountMath } from '@agoric/ertp';
import {
FastUSDCConfigShape,
getManifestForFastUSDC,
} from '@agoric/fast-usdc/src/fast-usdc.start.js';
import { getManifestForFastUSDC } from '@agoric/fast-usdc/src/fast-usdc.start.js';
import { FastUSDCConfigShape } from '@agoric/fast-usdc/src/fast-usdc.contract.meta.js';
import { toExternalConfig } from '@agoric/fast-usdc/src/utils/config-marshal.js';
import { configurations } from '@agoric/fast-usdc/src/utils/deploy-config.js';
import {
Expand Down
22 changes: 2 additions & 20 deletions packages/fast-usdc/src/fast-usdc.contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ import { AssetKind } from '@agoric/ertp';
import { makeTracer } from '@agoric/internal';
import { observeIteration, subscribeEach } from '@agoric/notifier';
import {
CosmosChainInfoShape,
DenomDetailShape,
DenomShape,
OrchestrationPowersShape,
registerChainsAndAssets,
withOrchestration,
} from '@agoric/orchestration';
Expand All @@ -14,14 +10,13 @@ import { provideSingleton } from '@agoric/zoe/src/contractSupport/durability.js'
import { prepareRecorderKitMakers } from '@agoric/zoe/src/contractSupport/recorder.js';
import { Fail } from '@endo/errors';
import { E } from '@endo/far';
import { M } from '@endo/patterns';
import { prepareAdvancer } from './exos/advancer.js';
import { prepareLiquidityPoolKit } from './exos/liquidity-pool.js';
import { prepareSettler } from './exos/settler.js';
import { prepareStatusManager } from './exos/status-manager.js';
import { prepareTransactionFeedKit } from './exos/transaction-feed.js';
import { meta } from './fast-usdc.contract.meta.js';
import * as flows from './fast-usdc.flows.js';
import { FastUSDCTermsShape, FeeConfigShape } from './type-guards.js';
import { defineInertInvitation } from './utils/zoe.js';

const trace = makeTracer('FastUsdc');
Expand All @@ -48,20 +43,7 @@ const ADDRESSES_BAGGAGE_KEY = 'addresses';
* }} FastUsdcTerms
*/

/** @type {ContractMeta<typeof start>} */
export const meta = {
// @ts-expect-error TypedPattern not recognized as record
customTermsShape: FastUSDCTermsShape,
privateArgsShape: {
// @ts-expect-error TypedPattern not recognized as record
...OrchestrationPowersShape,
assetInfo: M.arrayOf([DenomShape, DenomDetailShape]),
chainInfo: M.recordOf(M.string(), CosmosChainInfoShape),
feeConfig: FeeConfigShape,
marshaller: M.remotable(),
poolMetricsNode: M.remotable(),
},
};
export { meta };
harden(meta);

/**
Expand Down
74 changes: 74 additions & 0 deletions packages/fast-usdc/src/fast-usdc.contract.meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/** ContractMeta, Permit for Fast USDC */
import {
CosmosChainInfoShape,
DenomDetailShape,
DenomShape,
OrchestrationPowersShape,
} from '@agoric/orchestration';
import { M } from '@endo/patterns';
import {
FastUSDCTermsShape,
FeeConfigShape,
FeedPolicyShape,
} from './type-guards.js';
import { adminPermit, orchPermit } from './orch.start.js';

/**
* @import {StartParams} from '@agoric/zoe/src/zoeService/utils'
* @import {BootstrapManifest, BootstrapManifestPermit} from '@agoric/vats/src/core/lib-boot.js';
* @import {ManifestBundleRef} from '@agoric/deploy-script-support/src/externalTypes.js'
* @import {TypedPattern, Remote} from '@agoric/internal'
* @import {Marshaller} from '@agoric/internal/src/lib-chainStorage.js'
* @import {OrchestrationPowers} from '@agoric/orchestration';
* @import {FastUsdcSF} from './fast-usdc.contract.js';
* @import {FeedPolicy, FastUSDCConfig} from './types.js'
*/

/**
* @import {LegibleCapData} from './utils/config-marshal.js'
* @import {CorePowersG} from './orch.start.js';
*/

/** @type {TypedPattern<FastUSDCConfig>} */
export const FastUSDCConfigShape = M.splitRecord({
terms: FastUSDCTermsShape,
oracles: M.recordOf(M.string(), M.string()),
feeConfig: FeeConfigShape,
feedPolicy: FeedPolicyShape,
chainInfo: M.recordOf(M.string(), CosmosChainInfoShape),
assetInfo: M.arrayOf([DenomShape, DenomDetailShape]),
});

/** @satisfies {ContractMeta<FastUsdcSF>} */
export const meta = /** @type {const} */ ({
name: 'fastUsdc',
abbr: 'FUSD', // for tracer(s)
// @ts-expect-error TypedPattern not recognized as record
customTermsShape: FastUSDCTermsShape,
privateArgsShape: {
// @ts-expect-error TypedPattern not recognized as record
...OrchestrationPowersShape,
assetInfo: M.arrayOf([DenomShape, DenomDetailShape]),
chainInfo: M.recordOf(M.string(), CosmosChainInfoShape),
feeConfig: FeeConfigShape,
marshaller: M.remotable(),
poolMetricsNode: M.remotable(),
},
deployConfigShape: FastUSDCConfigShape,
/** @type {Record<keyof FastUSDCConfig, keyof StartedInstanceKit<FastUsdcSF>['creatorFacet']>} */
adminRoles: {
oracles: 'makeOperatorInvitation',
},
});
harden(meta);

/** @satisfies {BootstrapManifestPermit} */
export const permit = /** @type {const} */ ({
produce: { [`${meta.name}Kit`]: true },
consume: { ...orchPermit, ...adminPermit },
instance: { produce: { [meta.name]: true } },
installation: { consume: { [meta.name]: true } },
issuer: { produce: { FastLP: 'PoolShares' }, consume: { USDC: true } },
brand: { produce: { FastLP: 'PoolShares' } },
});
harden(permit);
Loading