hardhat-tracer
Version:
Hardhat Tracer plugin
142 lines • 3.83 kB
TypeScript
import { MinimalInterpreterStep } from "hardhat/internal/hardhat-network/provider/vm/types";
import { BigNumberish, PopulatedTransaction } from "ethers";
import { Artifacts } from "hardhat/types";
import { TracerCache } from "./cache";
import { Decoder } from "./decoder";
import { CALL } from "./opcodes/call";
import { TraceRecorder } from "./trace-recorder";
import { TransactionTrace } from "./transaction-trace";
import { Switch } from "./switch";
type PrintMode = "console" | "json";
export interface NameTags {
[address: string]: string;
}
export interface TracerEnvUser {
enabled?: boolean;
defaultVerbosity?: number;
showAddresses?: boolean;
gasCost?: boolean;
enableAllOpcodes?: boolean;
use4bytesDirectory?: boolean;
opcodes?: string[];
nameTags?: NameTags;
stateOverrides?: StateOverrides;
tasks?: string[];
}
export interface TracerEnv {
enabled: boolean;
ignoreNext: boolean;
printNext: boolean;
verbosity: number;
showAddresses: boolean;
gasCost: boolean;
enableAllOpcodes: boolean;
use4bytesDirectory: boolean;
opcodes: Map<string, boolean>;
nameTags: NameTags;
printMode: PrintMode;
_internal: {
cache: TracerCache;
printNameTagTip: undefined | "print it" | "already printed";
};
recorder?: TraceRecorder;
switch?: Switch;
lastTrace: () => TransactionTrace | undefined;
lastTraces: (count: number) => TransactionTrace[] | never;
allTraces: () => TransactionTrace[];
decoder?: Decoder;
stateOverrides?: StateOverrides;
}
export interface TracerDependencies {
artifacts: Artifacts;
tracerEnv: TracerEnv;
provider: ProviderLike;
}
export interface TracerDependenciesExtended extends TracerDependencies {
nameTags: NameTags;
}
export interface ProviderLike {
send(method: string, params?: any[] | undefined): Promise<any>;
}
export interface StructLog {
depth: number;
error: string;
gas: number;
gasCost: number;
memory: string[];
op: string;
pc: number;
stack: string[];
storage: {};
}
export interface StateOverrides {
[address: string]: {
storage?: {
[slot: string | number]: BigNumberish;
};
bytecode?: ContractInfo;
balance?: BigNumberish;
nonce?: BigNumberish;
};
}
export type ContractInfo = string | {
name: string;
libraries?: {
[libraryName: string]: ContractInfo;
};
};
export interface Item<Params> {
opcode: string;
params: Params;
parent?: Item<Params>;
children?: Array<Item<Params>>;
format?: () => string;
noFormat?: boolean;
}
export interface AwaitedItem<T> {
isAwaitedItem: true;
next: number;
parse: (step: MinimalInterpreterStep, currentAddress?: {
value: string;
}) => Item<T>;
}
export interface CallItem extends Item<CALL> {
opcode: CALL_OPCODES;
children: Array<Item<any>>;
}
export type CALL_OPCODES = "CALL" | "STATICCALL" | "DELEGATECALL" | "CALLCODE" | "CREATE" | "CREATE2";
export interface ChaiMessageCallOptions {
isStaticCall?: boolean;
isDelegateCall?: boolean;
isSuccess?: boolean;
returnData?: string;
from?: string;
}
export interface I4BytesEntry {
id: number;
created_at: string;
text_signature: string;
hex_signature: string;
bytes_signature: string;
}
export interface Obj<V> {
[key: string]: V;
}
export interface PrecompleResult {
name: string;
inputResult?: {
[key: string]: any;
};
returnResult?: {
[key: string]: any;
};
}
declare global {
export namespace Chai {
interface Assertion {
messageCall(tx: PopulatedTransaction, options?: ChaiMessageCallOptions): Assertion;
}
}
}
export {};
//# sourceMappingURL=types.d.ts.map