MCPcopy Create free account
hub / github.com/dethcrypto/dethcode / main

Function main

packages/ethereum-viewer/src/extension.ts:31–63  ·  view source on GitHub ↗
(context: vscode.ExtensionContext)

Source from the content-addressed store, hash-verified

29export function deactivate() {}
30
31async function main(context: vscode.ExtensionContext) {
32 registerContributedCommands(context, fs);
33
34 const apiName = await detectExplorerApiName();
35 const network = networkNames[apiName];
36
37 vscode.workspace.updateWorkspaceFolders(0, 0, {
38 uri: vscode.Uri.parse("memfs:/"),
39 name: network,
40 });
41
42 let address: string | undefined;
43
44 if (IN_DETH_HOST) address = await executeHostCommand("getContractAddress");
45
46 if (!address) {
47 return;
48 }
49
50 renderStatusBarItems({
51 contractAddress: address,
52 contractName: "contract",
53 apiName,
54 });
55
56 const contractName = await openContractSource(context, fs, apiName, address);
57
58 renderStatusBarItems({
59 contractAddress: address,
60 contractName,
61 apiName,
62 });
63}
64
65async function detectExplorerApiName(): Promise<explorer.ApiName> {
66 if (IN_DETH_HOST) {

Callers 1

activateFunction · 0.70

Calls 5

executeHostCommandFunction · 0.90
renderStatusBarItemsFunction · 0.90
openContractSourceFunction · 0.90
detectExplorerApiNameFunction · 0.85

Tested by

no test coverage detected