Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 22 additions & 0 deletions website/route-lockfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
/ar/subgraphs/developing/subgraphs/
/ar/subgraphs/explorer/
/ar/subgraphs/guides/arweave/
/ar/subgraphs/guides/contract-analyzer/
/ar/subgraphs/guides/enums/
/ar/subgraphs/guides/grafting/
/ar/subgraphs/guides/near/
Expand Down Expand Up @@ -141,6 +142,7 @@
/cs/subgraphs/developing/subgraphs/
/cs/subgraphs/explorer/
/cs/subgraphs/guides/arweave/
/cs/subgraphs/guides/contract-analyzer/
/cs/subgraphs/guides/enums/
/cs/subgraphs/guides/grafting/
/cs/subgraphs/guides/near/
Expand Down Expand Up @@ -226,6 +228,7 @@
/de/subgraphs/developing/subgraphs/
/de/subgraphs/explorer/
/de/subgraphs/guides/arweave/
/de/subgraphs/guides/contract-analyzer/
/de/subgraphs/guides/enums/
/de/subgraphs/guides/grafting/
/de/subgraphs/guides/near/
Expand Down Expand Up @@ -311,6 +314,7 @@
/en/subgraphs/developing/subgraphs/
/en/subgraphs/explorer/
/en/subgraphs/guides/arweave/
/en/subgraphs/guides/contract-analyzer/
/en/subgraphs/guides/enums/
/en/subgraphs/guides/grafting/
/en/subgraphs/guides/near/
Expand Down Expand Up @@ -396,6 +400,7 @@
/es/subgraphs/developing/subgraphs/
/es/subgraphs/explorer/
/es/subgraphs/guides/arweave/
/es/subgraphs/guides/contract-analyzer/
/es/subgraphs/guides/enums/
/es/subgraphs/guides/grafting/
/es/subgraphs/guides/near/
Expand Down Expand Up @@ -481,6 +486,7 @@
/fr/subgraphs/developing/subgraphs/
/fr/subgraphs/explorer/
/fr/subgraphs/guides/arweave/
/fr/subgraphs/guides/contract-analyzer/
/fr/subgraphs/guides/enums/
/fr/subgraphs/guides/grafting/
/fr/subgraphs/guides/near/
Expand Down Expand Up @@ -566,6 +572,7 @@
/hi/subgraphs/developing/subgraphs/
/hi/subgraphs/explorer/
/hi/subgraphs/guides/arweave/
/hi/subgraphs/guides/contract-analyzer/
/hi/subgraphs/guides/enums/
/hi/subgraphs/guides/grafting/
/hi/subgraphs/guides/near/
Expand Down Expand Up @@ -651,6 +658,7 @@
/it/subgraphs/developing/subgraphs/
/it/subgraphs/explorer/
/it/subgraphs/guides/arweave/
/it/subgraphs/guides/contract-analyzer/
/it/subgraphs/guides/enums/
/it/subgraphs/guides/grafting/
/it/subgraphs/guides/near/
Expand Down Expand Up @@ -736,6 +744,7 @@
/ja/subgraphs/developing/subgraphs/
/ja/subgraphs/explorer/
/ja/subgraphs/guides/arweave/
/ja/subgraphs/guides/contract-analyzer/
/ja/subgraphs/guides/enums/
/ja/subgraphs/guides/grafting/
/ja/subgraphs/guides/near/
Expand Down Expand Up @@ -819,6 +828,7 @@
/ko/subgraphs/developing/subgraphs/
/ko/subgraphs/explorer/
/ko/subgraphs/guides/arweave/
/ko/subgraphs/guides/contract-analyzer/
/ko/subgraphs/guides/enums/
/ko/subgraphs/guides/grafting/
/ko/subgraphs/guides/near/
Expand Down Expand Up @@ -904,6 +914,7 @@
/mr/subgraphs/developing/subgraphs/
/mr/subgraphs/explorer/
/mr/subgraphs/guides/arweave/
/mr/subgraphs/guides/contract-analyzer/
/mr/subgraphs/guides/enums/
/mr/subgraphs/guides/grafting/
/mr/subgraphs/guides/near/
Expand Down Expand Up @@ -987,6 +998,7 @@
/nl/subgraphs/developing/subgraphs/
/nl/subgraphs/explorer/
/nl/subgraphs/guides/arweave/
/nl/subgraphs/guides/contract-analyzer/
/nl/subgraphs/guides/enums/
/nl/subgraphs/guides/grafting/
/nl/subgraphs/guides/near/
Expand Down Expand Up @@ -1070,6 +1082,7 @@
/pl/subgraphs/developing/subgraphs/
/pl/subgraphs/explorer/
/pl/subgraphs/guides/arweave/
/pl/subgraphs/guides/contract-analyzer/
/pl/subgraphs/guides/enums/
/pl/subgraphs/guides/grafting/
/pl/subgraphs/guides/near/
Expand Down Expand Up @@ -1155,6 +1168,7 @@
/pt/subgraphs/developing/subgraphs/
/pt/subgraphs/explorer/
/pt/subgraphs/guides/arweave/
/pt/subgraphs/guides/contract-analyzer/
/pt/subgraphs/guides/enums/
/pt/subgraphs/guides/grafting/
/pt/subgraphs/guides/near/
Expand Down Expand Up @@ -1238,6 +1252,7 @@
/ro/subgraphs/developing/subgraphs/
/ro/subgraphs/explorer/
/ro/subgraphs/guides/arweave/
/ro/subgraphs/guides/contract-analyzer/
/ro/subgraphs/guides/enums/
/ro/subgraphs/guides/grafting/
/ro/subgraphs/guides/near/
Expand Down Expand Up @@ -1323,6 +1338,7 @@
/ru/subgraphs/developing/subgraphs/
/ru/subgraphs/explorer/
/ru/subgraphs/guides/arweave/
/ru/subgraphs/guides/contract-analyzer/
/ru/subgraphs/guides/enums/
/ru/subgraphs/guides/grafting/
/ru/subgraphs/guides/near/
Expand Down Expand Up @@ -1408,6 +1424,7 @@
/sv/subgraphs/developing/subgraphs/
/sv/subgraphs/explorer/
/sv/subgraphs/guides/arweave/
/sv/subgraphs/guides/contract-analyzer/
/sv/subgraphs/guides/enums/
/sv/subgraphs/guides/grafting/
/sv/subgraphs/guides/near/
Expand Down Expand Up @@ -1493,6 +1510,7 @@
/tr/subgraphs/developing/subgraphs/
/tr/subgraphs/explorer/
/tr/subgraphs/guides/arweave/
/tr/subgraphs/guides/contract-analyzer/
/tr/subgraphs/guides/enums/
/tr/subgraphs/guides/grafting/
/tr/subgraphs/guides/near/
Expand Down Expand Up @@ -1576,6 +1594,7 @@
/uk/subgraphs/developing/subgraphs/
/uk/subgraphs/explorer/
/uk/subgraphs/guides/arweave/
/uk/subgraphs/guides/contract-analyzer/
/uk/subgraphs/guides/enums/
/uk/subgraphs/guides/grafting/
/uk/subgraphs/guides/near/
Expand Down Expand Up @@ -1661,6 +1680,7 @@
/ur/subgraphs/developing/subgraphs/
/ur/subgraphs/explorer/
/ur/subgraphs/guides/arweave/
/ur/subgraphs/guides/contract-analyzer/
/ur/subgraphs/guides/enums/
/ur/subgraphs/guides/grafting/
/ur/subgraphs/guides/near/
Expand Down Expand Up @@ -1744,6 +1764,7 @@
/vi/subgraphs/developing/subgraphs/
/vi/subgraphs/explorer/
/vi/subgraphs/guides/arweave/
/vi/subgraphs/guides/contract-analyzer/
/vi/subgraphs/guides/enums/
/vi/subgraphs/guides/grafting/
/vi/subgraphs/guides/near/
Expand Down Expand Up @@ -1829,6 +1850,7 @@
/zh/subgraphs/developing/subgraphs/
/zh/subgraphs/explorer/
/zh/subgraphs/guides/arweave/
/zh/subgraphs/guides/contract-analyzer/
/zh/subgraphs/guides/enums/
/zh/subgraphs/guides/grafting/
/zh/subgraphs/guides/near/
Expand Down
1 change: 1 addition & 0 deletions website/src/pages/ar/subgraphs/guides/_meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export default {
enums: '',
'secure-api-keys-nextjs': '',
polymarket: '',
'contract-analyzer': '',
}
103 changes: 103 additions & 0 deletions website/src/pages/ar/subgraphs/guides/contract-analyzer.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
title: Smart Contract Analysis with Cana CLI
---

# Cana CLI: Quick & Efficient Contract Analysis

**Cana CLI** is a command-line tool that streamlines helpful smart contract metadata analysis specific to subgraph development across multiple EVM-compatible chains.

## 📌 Key Features

- Detect deployment blocks
- Verify source code
- Extract ABIs & event signatures
- Identify proxy and implementation contracts
- Support multiple chains

## 🚀 Installation & Setup

Install Cana globally using npm:

```bash
npm install -g contract-analyzer
```

Set up a blockchain for analysis:

```bash
cana setup
```

Provide the required block explorer API and block explorer endpoint URL details when prompted.

Running `cana setup` creates a configuration file at `~/.contract-analyzer/config.json`. This file stores your block explorer API credentials, endpoint URLs, and chain selection preferences for future use.

## 🍳 Usage

### 🔹 Chain Selection

Cana supports multiple EVM-compatible chains.

List chains added with:

```bash
cana chains
```

Then select a chain with:

```bash
cana chains --switch <chain>
```

Once a chain is selected, all subsequent contract analases will continue on that chain.

### 🔹 Basic Contract Analysis

Analyze a contract with:

```bash
cana analyze 0xContractAddress
```

or

```bash
cana -a 0xContractAddress
```

This command displays essential contract information in the terminal using a clear, organized format.

### 🔹 Understanding Output

Cana organizes results into the terminal as well as into a structured directory when detailed contract data is successfully retrieved:

```
contracts-analyzed/
└── ContractName_chainName_YYYY-MM-DD/
├── contract/ # Folder for individual contract files
├── abi.json # Contract ABI
└── event-information.json # Event signatures and examples
```

### 🔹 Chain Management

Add and manage chains:

```bash
cana setup # Add a new chain
cana chains # List configured chains
cana chains -s <chain> # Swich chains.
```

## ⚠️ Troubleshooting

- **Missing Data**: Ensure the contract address is correct, verified on the block explorer, and that your API key has the required permissions.

## ✅ Requirements

- Node.js v16+
- npm v6+
- Block explorer API keys

Keep your contract analyses efficient and well-organized. 🚀
1 change: 1 addition & 0 deletions website/src/pages/cs/subgraphs/guides/_meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export default {
enums: '',
'secure-api-keys-nextjs': '',
polymarket: '',
'contract-analyzer': '',
}
103 changes: 103 additions & 0 deletions website/src/pages/cs/subgraphs/guides/contract-analyzer.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
title: Smart Contract Analysis with Cana CLI
---

# Cana CLI: Quick & Efficient Contract Analysis

**Cana CLI** is a command-line tool that streamlines helpful smart contract metadata analysis specific to subgraph development across multiple EVM-compatible chains.

## 📌 Key Features

- Detect deployment blocks
- Verify source code
- Extract ABIs & event signatures
- Identify proxy and implementation contracts
- Support multiple chains

## 🚀 Installation & Setup

Install Cana globally using npm:

```bash
npm install -g contract-analyzer
```

Set up a blockchain for analysis:

```bash
cana setup
```

Provide the required block explorer API and block explorer endpoint URL details when prompted.

Running `cana setup` creates a configuration file at `~/.contract-analyzer/config.json`. This file stores your block explorer API credentials, endpoint URLs, and chain selection preferences for future use.

## 🍳 Usage

### 🔹 Chain Selection

Cana supports multiple EVM-compatible chains.

List chains added with:

```bash
cana chains
```

Then select a chain with:

```bash
cana chains --switch <chain>
```

Once a chain is selected, all subsequent contract analases will continue on that chain.

### 🔹 Basic Contract Analysis

Analyze a contract with:

```bash
cana analyze 0xContractAddress
```

or

```bash
cana -a 0xContractAddress
```

This command displays essential contract information in the terminal using a clear, organized format.

### 🔹 Understanding Output

Cana organizes results into the terminal as well as into a structured directory when detailed contract data is successfully retrieved:

```
contracts-analyzed/
└── ContractName_chainName_YYYY-MM-DD/
├── contract/ # Folder for individual contract files
├── abi.json # Contract ABI
└── event-information.json # Event signatures and examples
```

### 🔹 Chain Management

Add and manage chains:

```bash
cana setup # Add a new chain
cana chains # List configured chains
cana chains -s <chain> # Swich chains.
```

## ⚠️ Troubleshooting

- **Missing Data**: Ensure the contract address is correct, verified on the block explorer, and that your API key has the required permissions.

## ✅ Requirements

- Node.js v16+
- npm v6+
- Block explorer API keys

Keep your contract analyses efficient and well-organized. 🚀
Loading