dop-stick
Version:
Source control tooling for versionable-upgradeable smart contracts
145 lines • 4 kB
TypeScript
import { DopStickConfig } from './types/config';
import { DiamondConfig } from './utils/provider';
export interface BasicDiamondInfo {
owner: string;
totalFacets: number;
totalFunctions: number;
implementationVersion?: string;
}
export interface FacetInfo {
address: string;
functionSelectors: string[];
functionSignatures?: string[];
}
export interface DetailedFacetInfo extends FacetInfo {
functionCount: number;
facetName?: string;
deploymentBlock?: number;
}
export interface DiamondStructure {
facets: DetailedFacetInfo[];
totalSelectors: number;
uniqueAddresses: string[];
}
interface RawFacet {
facetAddress: string;
moduleAddress?: string;
functionSelectors?: string[];
selectors?: string[];
}
export interface FunctionMetadata {
name: string;
selector: string;
signature: string;
params: {
name: string;
type: string;
indexed?: boolean;
}[];
returns: {
type: string;
name?: string;
}[];
stateMutability: 'pure' | 'view' | 'nonpayable' | 'payable';
visibility: 'external' | 'public' | 'internal' | 'private';
facetAddress: string;
}
export interface DetailedFacetMetadata {
name: string;
address: string;
selectors: string[];
functions: Array<{
name: string;
selector: string;
signature: string;
params: Array<{
name: string;
type: string;
indexed?: boolean;
}>;
returns: Array<{
name: string;
type: string;
}>;
stateMutability: string;
facetAddress: string;
}>;
}
interface DetailedFacetsResult {
processedFacets: DetailedFacetMetadata[];
rawBlockchainData: {
facets: RawFacet[];
totalFacets: number;
totalSelectors: number;
selectorsPerFacet: Array<{
facetAddress: string;
selectorCount: number;
}>;
};
}
export declare class BaseDiamondInfo {
private isCliCall;
private provider;
private diamondAddress;
private loupe;
private functions;
private dopStickConfig?;
private typechainProcessor;
private networkName;
private facets;
private infoLogger;
constructor(config: DiamondConfig, dopStickConfig?: DopStickConfig, isCliCall?: boolean);
private initializeProcessor;
/**
* Get basic diamond information
*/
getBasicInfo(): Promise<BasicDiamondInfo>;
/**
* Get all facets with their selectors
*/
getFacets(): Promise<FacetInfo[]>;
/**
* Get detailed information about a specific facet
*/
getFacetInfo(facetAddress: string): Promise<DetailedFacetInfo>;
/**
* Get all function selectors
*/
getAllFunctionSelectors(): Promise<string[]>;
/**
* Get complete diamond structure
*/
getDiamondStructure(): Promise<DiamondStructure>;
/**
* Get all non-event based information in one call
*/
getAllStaticInfo(): Promise<{
basic: BasicDiamondInfo;
structure: DiamondStructure;
}>;
private calculateOptimalBatchSize;
getDetailedFacetsInfo(): Promise<DetailedFacetsResult>;
private chunk;
private updateDetailedFacets;
private convertToParams;
private convertToReturns;
private findDeploymentBlock;
private getFunctionFragment;
/**
* Get a human-readable report of the diamond structure
*/
getFacetsReport(): Promise<DiamondStructure>;
private getFacetName;
private getEventsByFacetName;
static decodeTimeHash(hash: string): Date;
generateDocumentation(): Promise<void>;
private logDocumentationResults;
private getInfoProcessingConfig;
private generateAnalysisData;
private generateUnknownSelectorsBreakdown;
private getFacetAddressForSelector;
private getFacetAddressForProcessedSelector;
private getVersion;
}
export {};
//# sourceMappingURL=info.d.ts.map