web3-tools-mcp 1.0.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -230
- package/dist/package.json +63 -0
- package/dist/src/client.d.ts +1653 -0
- package/dist/src/client.d.ts.map +1 -0
- package/dist/src/client.js +142 -0
- package/dist/src/client.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +88 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/tools/advanced.d.ts +75 -0
- package/dist/src/tools/advanced.d.ts.map +1 -0
- package/dist/src/tools/advanced.js +234 -0
- package/dist/src/tools/advanced.js.map +1 -0
- package/dist/src/tools/balance.d.ts +55 -0
- package/dist/src/tools/balance.d.ts.map +1 -0
- package/dist/src/tools/balance.js +146 -0
- package/dist/src/tools/balance.js.map +1 -0
- package/dist/src/tools/contract-info.d.ts +79 -0
- package/dist/src/tools/contract-info.d.ts.map +1 -0
- package/dist/src/tools/contract-info.js +450 -0
- package/dist/src/tools/contract-info.js.map +1 -0
- package/dist/src/tools/contract.d.ts +79 -0
- package/dist/src/tools/contract.d.ts.map +1 -0
- package/dist/src/tools/contract.js +140 -0
- package/dist/src/tools/contract.js.map +1 -0
- package/dist/src/tools/ens.d.ts +119 -0
- package/dist/src/tools/ens.d.ts.map +1 -0
- package/dist/src/tools/ens.js +425 -0
- package/dist/src/tools/ens.js.map +1 -0
- package/dist/src/tools/index.d.ts +3 -0
- package/dist/src/tools/index.d.ts.map +1 -0
- package/dist/src/tools/index.js +29 -0
- package/dist/src/tools/index.js.map +1 -0
- package/dist/src/tools/logs.d.ts +39 -0
- package/dist/src/tools/logs.d.ts.map +1 -0
- package/dist/src/tools/logs.js +231 -0
- package/dist/src/tools/logs.js.map +1 -0
- package/dist/src/tools/signatures.d.ts +83 -0
- package/dist/src/tools/signatures.d.ts.map +1 -0
- package/dist/src/tools/signatures.js +93 -0
- package/dist/src/tools/signatures.js.map +1 -0
- package/dist/src/types.d.ts +22 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/utils.d.ts +22 -0
- package/dist/src/utils.d.ts.map +1 -0
- package/dist/src/utils.js +183 -0
- package/dist/src/utils.js.map +1 -0
- package/dist/test/tools/advanced.test.d.ts +2 -0
- package/dist/test/tools/advanced.test.d.ts.map +1 -0
- package/dist/test/tools/advanced.test.js +235 -0
- package/dist/test/tools/advanced.test.js.map +1 -0
- package/dist/test/tools/balance.test.d.ts +2 -0
- package/dist/test/tools/balance.test.d.ts.map +1 -0
- package/dist/test/tools/balance.test.js +167 -0
- package/dist/test/tools/balance.test.js.map +1 -0
- package/dist/test/tools/contract-info.test.d.ts +2 -0
- package/dist/test/tools/contract-info.test.d.ts.map +1 -0
- package/dist/test/tools/contract-info.test.js +286 -0
- package/dist/test/tools/contract-info.test.js.map +1 -0
- package/dist/test/tools/contract.test.d.ts +2 -0
- package/dist/test/tools/contract.test.d.ts.map +1 -0
- package/dist/test/tools/contract.test.js +234 -0
- package/dist/test/tools/contract.test.js.map +1 -0
- package/dist/test/tools/ens.test.d.ts +2 -0
- package/dist/test/tools/ens.test.d.ts.map +1 -0
- package/dist/test/tools/ens.test.js +236 -0
- package/dist/test/tools/ens.test.js.map +1 -0
- package/dist/test/tools/logs.test.d.ts +2 -0
- package/dist/test/tools/logs.test.d.ts.map +1 -0
- package/dist/test/tools/logs.test.js +196 -0
- package/dist/test/tools/logs.test.js.map +1 -0
- package/dist/test/tools/signatures.test.d.ts +2 -0
- package/dist/test/tools/signatures.test.d.ts.map +1 -0
- package/dist/test/tools/signatures.test.js +112 -0
- package/dist/test/tools/signatures.test.js.map +1 -0
- package/package.json +37 -22
- package/src/client.ts +160 -0
- package/src/index.ts +96 -0
- package/src/tools/advanced.ts +262 -0
- package/src/tools/balance.ts +176 -0
- package/src/tools/contract-info.ts +582 -0
- package/src/tools/contract.ts +180 -0
- package/src/tools/ens.ts +493 -0
- package/src/tools/index.ts +37 -0
- package/src/tools/logs.ts +291 -0
- package/src/tools/signatures.ts +126 -0
- package/src/types.ts +29 -0
- package/src/utils.ts +222 -0
- package/dist/hypersync-client.darwin-arm64-7fegfwn5.node +0 -0
- package/dist/index.js +0 -28282
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
import { isAddress } from 'viem';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { CHAINS, getClientManager, SUPPORTED_CHAINS } from '../client.js';
|
|
4
|
+
import { createTool, formatResponse } from '../utils.js';
|
|
5
|
+
const contractCache = new Map();
|
|
6
|
+
// No TTL - contracts are immutable, cache never expires
|
|
7
|
+
// Helper to generate cache key
|
|
8
|
+
function getCacheKey(chainId, address) {
|
|
9
|
+
return `${chainId}:${address.toLowerCase()}`;
|
|
10
|
+
}
|
|
11
|
+
// Shared helper to fetch contract info from Etherscan (with caching)
|
|
12
|
+
async function fetchContractInfo(chainId, address, etherscanApiKey) {
|
|
13
|
+
// Check cache first
|
|
14
|
+
const cacheKey = getCacheKey(chainId, address);
|
|
15
|
+
const cached = contractCache.get(cacheKey);
|
|
16
|
+
if (cached?.rawInfo) {
|
|
17
|
+
return cached.rawInfo;
|
|
18
|
+
}
|
|
19
|
+
// Fetch from Etherscan API
|
|
20
|
+
const sourceUrl = `https://api.etherscan.io/v2/api?chainid=${chainId}&module=contract&action=getsourcecode&address=${address}&apikey=${etherscanApiKey}`;
|
|
21
|
+
const sourceResponse = await fetch(sourceUrl);
|
|
22
|
+
const sourceData = (await sourceResponse.json());
|
|
23
|
+
if (sourceData.status !== '1' || !sourceData.result || sourceData.result.length === 0) {
|
|
24
|
+
throw new Error(`Etherscan API error: ${sourceData.message || 'No contract source found'}`);
|
|
25
|
+
}
|
|
26
|
+
const contractInfo = sourceData.result[0];
|
|
27
|
+
// Cache the raw info immediately
|
|
28
|
+
const isProxy = contractInfo.Proxy === '1';
|
|
29
|
+
contractCache.set(cacheKey, {
|
|
30
|
+
rawInfo: contractInfo,
|
|
31
|
+
sourceFiles: {},
|
|
32
|
+
metadata: {
|
|
33
|
+
contractName: contractInfo.ContractName,
|
|
34
|
+
compilerVersion: contractInfo.CompilerVersion,
|
|
35
|
+
isProxy,
|
|
36
|
+
implementationAddress: isProxy ? contractInfo.Implementation : undefined
|
|
37
|
+
},
|
|
38
|
+
timestamp: Date.now()
|
|
39
|
+
});
|
|
40
|
+
return contractInfo;
|
|
41
|
+
}
|
|
42
|
+
export default {
|
|
43
|
+
get_contract_abi: createTool('Get Contract ABI', 'Retrieve contract ABI, proxy info, and verification status from Etherscan. Use for contract analysis.', z.object({
|
|
44
|
+
chain: z.enum(SUPPORTED_CHAINS).describe('The blockchain network to use'),
|
|
45
|
+
address: z.string().describe('The contract address to get ABI for'),
|
|
46
|
+
include: z
|
|
47
|
+
.array(z.enum(['abi', 'implementationAbi', 'metadata', 'compilation', 'creation', 'stats']))
|
|
48
|
+
.optional()
|
|
49
|
+
.describe('Optional: specify which data to include. Options: "abi" (contract ABI), "implementationAbi" (proxy implementation ABI), "metadata" (name, verification), "compilation" (compiler, optimization), "creation" (creator, tx), "stats" (function/event counts). Defaults to ["abi", "metadata"] for minimal context usage.')
|
|
50
|
+
}), async (args) => {
|
|
51
|
+
const clientManager = getClientManager();
|
|
52
|
+
const config = clientManager.config;
|
|
53
|
+
if (!config.etherscanApiKey) {
|
|
54
|
+
throw new Error('Etherscan API key is required for contract information retrieval. Use --etherscan-api-key or set ETHERSCAN_API_KEY environment variable.');
|
|
55
|
+
}
|
|
56
|
+
if (!isAddress(args.address)) {
|
|
57
|
+
throw new Error('Invalid contract address');
|
|
58
|
+
}
|
|
59
|
+
// Default to minimal data if not specified
|
|
60
|
+
const include = args.include || ['abi', 'metadata'];
|
|
61
|
+
const includeSet = new Set(include);
|
|
62
|
+
const chains = CHAINS(config);
|
|
63
|
+
const chainId = chains[args.chain].chain.id;
|
|
64
|
+
// Use shared helper to fetch contract info
|
|
65
|
+
const contractInfo = await fetchContractInfo(chainId, args.address, config.etherscanApiKey);
|
|
66
|
+
// Parse ABI if requested
|
|
67
|
+
let abi = [];
|
|
68
|
+
if (includeSet.has('abi') || includeSet.has('stats')) {
|
|
69
|
+
if (contractInfo.ABI && contractInfo.ABI !== 'Contract source code not verified') {
|
|
70
|
+
try {
|
|
71
|
+
abi = JSON.parse(contractInfo.ABI);
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
// ABI parsing failed, continue without it
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
// Parse the source information
|
|
79
|
+
const isProxy = contractInfo.Proxy === '1';
|
|
80
|
+
const hasSourceCode = contractInfo.SourceCode !== '';
|
|
81
|
+
const isVerified = hasSourceCode;
|
|
82
|
+
// Build base result
|
|
83
|
+
const abiResult = {
|
|
84
|
+
success: true,
|
|
85
|
+
chain: args.chain,
|
|
86
|
+
chainId,
|
|
87
|
+
address: args.address,
|
|
88
|
+
etherscanUrl: `https://${clientManager.getEtherscanDomain(args.chain)}/address/${args.address}`
|
|
89
|
+
};
|
|
90
|
+
// Add metadata if requested
|
|
91
|
+
if (includeSet.has('metadata')) {
|
|
92
|
+
abiResult.isVerified = isVerified;
|
|
93
|
+
abiResult.contractName = contractInfo.ContractName;
|
|
94
|
+
abiResult.hasSourceCode = hasSourceCode;
|
|
95
|
+
abiResult.licenseType = contractInfo.LicenseType;
|
|
96
|
+
if (isProxy) {
|
|
97
|
+
abiResult.isProxy = isProxy;
|
|
98
|
+
if (contractInfo.Implementation) {
|
|
99
|
+
abiResult.implementationAddress = contractInfo.Implementation;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// Add compilation info if requested
|
|
104
|
+
if (includeSet.has('compilation')) {
|
|
105
|
+
abiResult.compilerVersion = contractInfo.CompilerVersion;
|
|
106
|
+
abiResult.optimizationUsed = contractInfo.OptimizationUsed === '1';
|
|
107
|
+
abiResult.optimizationRuns = contractInfo.Runs;
|
|
108
|
+
abiResult.evmVersion = contractInfo.EVMVersion;
|
|
109
|
+
abiResult.constructorArguments = contractInfo.ConstructorArguments;
|
|
110
|
+
}
|
|
111
|
+
// Add ABI if requested
|
|
112
|
+
if (includeSet.has('abi')) {
|
|
113
|
+
abiResult.abi = abi;
|
|
114
|
+
}
|
|
115
|
+
// Add stats if requested
|
|
116
|
+
if (includeSet.has('stats')) {
|
|
117
|
+
abiResult.abiSize = abi.length;
|
|
118
|
+
abiResult.functions = abi.filter((item) => item.type === 'function').length;
|
|
119
|
+
abiResult.events = abi.filter((item) => item.type === 'event').length;
|
|
120
|
+
abiResult.errors = abi.filter((item) => item.type === 'error').length;
|
|
121
|
+
abiResult.constructors = abi.filter((item) => item.type === 'constructor').length;
|
|
122
|
+
}
|
|
123
|
+
// Try to get creation info if requested
|
|
124
|
+
if (includeSet.has('creation')) {
|
|
125
|
+
try {
|
|
126
|
+
const creationUrl = `https://api.etherscan.io/v2/api?chainid=${chainId}&module=contract&action=getcontractcreation&contractaddresses=${args.address}&apikey=${config.etherscanApiKey}`;
|
|
127
|
+
const creationResponse = await fetch(creationUrl);
|
|
128
|
+
const creationData = (await creationResponse.json());
|
|
129
|
+
if (creationData.status === '1' && creationData.result && creationData.result.length > 0) {
|
|
130
|
+
const result = creationData.result[0];
|
|
131
|
+
if (result) {
|
|
132
|
+
abiResult.creationInfo = {
|
|
133
|
+
creator: result.contractCreator,
|
|
134
|
+
transactionHash: result.txHash
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
// Creation info is optional
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
// If it's a proxy and implementation ABI is requested, try to get it
|
|
144
|
+
if (includeSet.has('implementationAbi') &&
|
|
145
|
+
isProxy &&
|
|
146
|
+
contractInfo.Implementation &&
|
|
147
|
+
isAddress(contractInfo.Implementation)) {
|
|
148
|
+
try {
|
|
149
|
+
const implContractInfo = await fetchContractInfo(chainId, contractInfo.Implementation, config.etherscanApiKey);
|
|
150
|
+
if (implContractInfo?.ABI && implContractInfo.ABI !== 'Contract source code not verified') {
|
|
151
|
+
try {
|
|
152
|
+
const implementationAbi = JSON.parse(implContractInfo.ABI);
|
|
153
|
+
abiResult.implementationAbi = implementationAbi;
|
|
154
|
+
// Add implementation stats if stats are requested
|
|
155
|
+
if (includeSet.has('stats')) {
|
|
156
|
+
abiResult.implementationAbiSize = implementationAbi.length;
|
|
157
|
+
abiResult.implementationFunctions = implementationAbi.filter((item) => item.type === 'function').length;
|
|
158
|
+
abiResult.implementationEvents = implementationAbi.filter((item) => item.type === 'event').length;
|
|
159
|
+
abiResult.implementationErrors = implementationAbi.filter((item) => item.type === 'error').length;
|
|
160
|
+
abiResult.implementationConstructors = implementationAbi.filter((item) => item.type === 'constructor').length;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
// Implementation ABI parsing failed, continue without it
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
catch {
|
|
169
|
+
// Implementation ABI fetch failed, continue without it
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
// Update cache with ABI (rawInfo already cached by fetchContractInfo)
|
|
173
|
+
const cacheKey = getCacheKey(chainId, args.address);
|
|
174
|
+
const existing = contractCache.get(cacheKey);
|
|
175
|
+
contractCache.set(cacheKey, {
|
|
176
|
+
...existing,
|
|
177
|
+
abi
|
|
178
|
+
});
|
|
179
|
+
return formatResponse(abiResult);
|
|
180
|
+
}),
|
|
181
|
+
get_contract_source_code: createTool('Get Contract Source Code', 'Retrieve verified contract source code from Etherscan. PROXY AWARE - automatically fetches implementation source for proxies.', z.object({
|
|
182
|
+
chain: z.enum(SUPPORTED_CHAINS).describe('The blockchain network to use'),
|
|
183
|
+
address: z.string().describe('The contract address to get source code for'),
|
|
184
|
+
includeImplementation: z
|
|
185
|
+
.boolean()
|
|
186
|
+
.optional()
|
|
187
|
+
.default(true)
|
|
188
|
+
.describe('For proxy contracts, also fetch implementation source code (default: true)'),
|
|
189
|
+
includeSource: z
|
|
190
|
+
.enum(['full', 'summary', 'none'])
|
|
191
|
+
.optional()
|
|
192
|
+
.default('summary')
|
|
193
|
+
.describe('Source code inclusion level: "full" (complete source), "summary" (file list with stats only), "none" (metadata only). Default: summary')
|
|
194
|
+
}), async (args) => {
|
|
195
|
+
const clientManager = getClientManager();
|
|
196
|
+
const config = clientManager.config;
|
|
197
|
+
if (!config.etherscanApiKey) {
|
|
198
|
+
throw new Error('Etherscan API key is required. Use --etherscan-api-key or set ETHERSCAN_API_KEY environment variable.');
|
|
199
|
+
}
|
|
200
|
+
if (!isAddress(args.address)) {
|
|
201
|
+
throw new Error('Invalid contract address');
|
|
202
|
+
}
|
|
203
|
+
const chains = CHAINS(config);
|
|
204
|
+
const chainId = chains[args.chain].chain.id;
|
|
205
|
+
try {
|
|
206
|
+
// Fetch main contract source using shared helper
|
|
207
|
+
const contractInfo = await fetchContractInfo(chainId, args.address, config.etherscanApiKey);
|
|
208
|
+
if (!contractInfo) {
|
|
209
|
+
throw new Error('No contract information found');
|
|
210
|
+
}
|
|
211
|
+
const isVerified = contractInfo.SourceCode !== '';
|
|
212
|
+
const isProxy = contractInfo.Proxy === '1';
|
|
213
|
+
if (!isVerified) {
|
|
214
|
+
return formatResponse({
|
|
215
|
+
success: false,
|
|
216
|
+
chain: args.chain,
|
|
217
|
+
chainId,
|
|
218
|
+
address: args.address,
|
|
219
|
+
isVerified: false,
|
|
220
|
+
message: 'Contract source code is not verified on Etherscan',
|
|
221
|
+
etherscanUrl: `https://${clientManager.getEtherscanDomain(args.chain)}/address/${args.address}`
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
// Parse source code
|
|
225
|
+
let sourceFiles = {};
|
|
226
|
+
let sourceCodeString = contractInfo.SourceCode;
|
|
227
|
+
// Handle multi-file sources (wrapped in {{ }} or [ ])
|
|
228
|
+
if (sourceCodeString.startsWith('{{') || sourceCodeString.startsWith('[')) {
|
|
229
|
+
try {
|
|
230
|
+
// Remove outer braces/brackets if present
|
|
231
|
+
if (sourceCodeString.startsWith('{{')) {
|
|
232
|
+
sourceCodeString = sourceCodeString.slice(1, -1);
|
|
233
|
+
}
|
|
234
|
+
const parsed = JSON.parse(sourceCodeString);
|
|
235
|
+
if (parsed.sources) {
|
|
236
|
+
// Standard JSON format
|
|
237
|
+
sourceFiles = Object.fromEntries(Object.entries(parsed.sources).map(([path, data]) => [path, data.content || '']));
|
|
238
|
+
}
|
|
239
|
+
else if (typeof parsed === 'object') {
|
|
240
|
+
// Simple object format
|
|
241
|
+
sourceFiles = parsed;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
catch {
|
|
245
|
+
// If parsing fails, treat as single file
|
|
246
|
+
sourceFiles = { [contractInfo.ContractName + '.sol']: sourceCodeString };
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
// Single file source
|
|
251
|
+
sourceFiles = { [contractInfo.ContractName + '.sol']: sourceCodeString };
|
|
252
|
+
}
|
|
253
|
+
// Calculate file stats for summary mode
|
|
254
|
+
const fileStats = Object.entries(sourceFiles).map(([path, content]) => ({
|
|
255
|
+
path,
|
|
256
|
+
lines: content.split('\n').length,
|
|
257
|
+
size: content.length
|
|
258
|
+
}));
|
|
259
|
+
const result = {
|
|
260
|
+
success: true,
|
|
261
|
+
chain: args.chain,
|
|
262
|
+
chainId,
|
|
263
|
+
address: args.address,
|
|
264
|
+
isVerified: true,
|
|
265
|
+
isProxy,
|
|
266
|
+
contractName: contractInfo.ContractName,
|
|
267
|
+
compilerVersion: contractInfo.CompilerVersion,
|
|
268
|
+
optimizationUsed: contractInfo.OptimizationUsed === '1',
|
|
269
|
+
optimizationRuns: parseInt(contractInfo.Runs) || 0,
|
|
270
|
+
evmVersion: contractInfo.EVMVersion,
|
|
271
|
+
licenseType: contractInfo.LicenseType,
|
|
272
|
+
constructorArguments: contractInfo.ConstructorArguments,
|
|
273
|
+
fileCount: Object.keys(sourceFiles).length,
|
|
274
|
+
totalLines: fileStats.reduce((sum, stat) => sum + stat.lines, 0),
|
|
275
|
+
etherscanUrl: `https://${clientManager.getEtherscanDomain(args.chain)}/address/${args.address}#code`
|
|
276
|
+
};
|
|
277
|
+
// Add source based on includeSource parameter
|
|
278
|
+
if (args.includeSource === 'full') {
|
|
279
|
+
result.sourceFiles = sourceFiles;
|
|
280
|
+
}
|
|
281
|
+
else if (args.includeSource === 'summary') {
|
|
282
|
+
result.files = fileStats;
|
|
283
|
+
}
|
|
284
|
+
// 'none' mode: no source files added
|
|
285
|
+
// If proxy and implementation requested, fetch implementation source
|
|
286
|
+
if (isProxy &&
|
|
287
|
+
args.includeImplementation &&
|
|
288
|
+
contractInfo.Implementation &&
|
|
289
|
+
isAddress(contractInfo.Implementation)) {
|
|
290
|
+
try {
|
|
291
|
+
const implInfo = await fetchContractInfo(chainId, contractInfo.Implementation, config.etherscanApiKey);
|
|
292
|
+
if (implInfo && implInfo.SourceCode !== '') {
|
|
293
|
+
// Parse implementation source code
|
|
294
|
+
let implSourceFiles = {};
|
|
295
|
+
let implSourceCodeString = implInfo.SourceCode;
|
|
296
|
+
if (implSourceCodeString.startsWith('{{') || implSourceCodeString.startsWith('[')) {
|
|
297
|
+
try {
|
|
298
|
+
if (implSourceCodeString.startsWith('{{')) {
|
|
299
|
+
implSourceCodeString = implSourceCodeString.slice(1, -1);
|
|
300
|
+
}
|
|
301
|
+
const parsed = JSON.parse(implSourceCodeString);
|
|
302
|
+
if (parsed.sources) {
|
|
303
|
+
implSourceFiles = Object.fromEntries(Object.entries(parsed.sources).map(([path, data]) => [path, data.content || '']));
|
|
304
|
+
}
|
|
305
|
+
else if (typeof parsed === 'object') {
|
|
306
|
+
implSourceFiles = parsed;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
catch {
|
|
310
|
+
implSourceFiles = { [implInfo.ContractName + '.sol']: implSourceCodeString };
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
implSourceFiles = { [implInfo.ContractName + '.sol']: implSourceCodeString };
|
|
315
|
+
}
|
|
316
|
+
// Calculate implementation file stats
|
|
317
|
+
const implFileStats = Object.entries(implSourceFiles).map(([path, content]) => ({
|
|
318
|
+
path,
|
|
319
|
+
lines: content.split('\n').length,
|
|
320
|
+
size: content.length
|
|
321
|
+
}));
|
|
322
|
+
const implResult = {
|
|
323
|
+
address: contractInfo.Implementation,
|
|
324
|
+
contractName: implInfo.ContractName,
|
|
325
|
+
compilerVersion: implInfo.CompilerVersion,
|
|
326
|
+
optimizationUsed: implInfo.OptimizationUsed === '1',
|
|
327
|
+
optimizationRuns: parseInt(implInfo.Runs) || 0,
|
|
328
|
+
evmVersion: implInfo.EVMVersion,
|
|
329
|
+
licenseType: implInfo.LicenseType,
|
|
330
|
+
fileCount: Object.keys(implSourceFiles).length,
|
|
331
|
+
totalLines: implFileStats.reduce((sum, stat) => sum + stat.lines, 0),
|
|
332
|
+
etherscanUrl: `https://${clientManager.getEtherscanDomain(args.chain)}/address/${contractInfo.Implementation}#code`
|
|
333
|
+
};
|
|
334
|
+
// Add implementation source based on includeSource parameter
|
|
335
|
+
if (args.includeSource === 'full') {
|
|
336
|
+
implResult.sourceFiles = implSourceFiles;
|
|
337
|
+
}
|
|
338
|
+
else if (args.includeSource === 'summary') {
|
|
339
|
+
implResult.files = implFileStats;
|
|
340
|
+
}
|
|
341
|
+
result.implementation = implResult;
|
|
342
|
+
// Update cache with implementation source (rawInfo already cached by fetchContractInfo)
|
|
343
|
+
if (contractInfo.Implementation) {
|
|
344
|
+
const implCacheKey = getCacheKey(chainId, contractInfo.Implementation);
|
|
345
|
+
const existingImpl = contractCache.get(implCacheKey);
|
|
346
|
+
contractCache.set(implCacheKey, {
|
|
347
|
+
...existingImpl,
|
|
348
|
+
sourceFiles: implSourceFiles
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
catch (error) {
|
|
354
|
+
// Implementation fetch failed, continue without it
|
|
355
|
+
result.implementationError = error instanceof Error ? error.message : 'Failed to fetch implementation source';
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
else if (isProxy && contractInfo.Implementation) {
|
|
359
|
+
result.implementationAddress = contractInfo.Implementation;
|
|
360
|
+
}
|
|
361
|
+
// Update cache with main contract source (rawInfo already cached by fetchContractInfo)
|
|
362
|
+
const cacheKey = getCacheKey(chainId, args.address);
|
|
363
|
+
const existing = contractCache.get(cacheKey);
|
|
364
|
+
contractCache.set(cacheKey, {
|
|
365
|
+
...existing,
|
|
366
|
+
sourceFiles
|
|
367
|
+
});
|
|
368
|
+
return formatResponse(result);
|
|
369
|
+
}
|
|
370
|
+
catch (error) {
|
|
371
|
+
throw new Error(`Failed to fetch source code: ${error}`);
|
|
372
|
+
}
|
|
373
|
+
}),
|
|
374
|
+
get_contract_source_file: createTool('Get Specific Contract Source File', 'Retrieve a specific source file from a cached contract. Use get_contract_source_code first to cache the contract.', z.object({
|
|
375
|
+
chain: z.enum(SUPPORTED_CHAINS).describe('The blockchain network to use'),
|
|
376
|
+
address: z.string().describe('The contract address'),
|
|
377
|
+
filePath: z.string().optional().describe('Specific file path to retrieve. If omitted, returns list of available files.'),
|
|
378
|
+
useImplementation: z
|
|
379
|
+
.boolean()
|
|
380
|
+
.optional()
|
|
381
|
+
.default(false)
|
|
382
|
+
.describe('For proxy contracts, get file from implementation instead (default: false)')
|
|
383
|
+
}), async (args) => {
|
|
384
|
+
const clientManager = getClientManager();
|
|
385
|
+
const chains = CHAINS(clientManager.config);
|
|
386
|
+
const chainId = chains[args.chain].chain.id;
|
|
387
|
+
if (!isAddress(args.address)) {
|
|
388
|
+
throw new Error('Invalid contract address');
|
|
389
|
+
}
|
|
390
|
+
// Check cache
|
|
391
|
+
let cacheKey = getCacheKey(chainId, args.address);
|
|
392
|
+
let cached = contractCache.get(cacheKey);
|
|
393
|
+
// If useImplementation is true and we have implementation address, use that instead
|
|
394
|
+
if (args.useImplementation && cached?.metadata.implementationAddress) {
|
|
395
|
+
cacheKey = getCacheKey(chainId, cached.metadata.implementationAddress);
|
|
396
|
+
cached = contractCache.get(cacheKey);
|
|
397
|
+
}
|
|
398
|
+
if (!cached) {
|
|
399
|
+
return formatResponse({
|
|
400
|
+
success: false,
|
|
401
|
+
chain: args.chain,
|
|
402
|
+
chainId,
|
|
403
|
+
address: args.address,
|
|
404
|
+
message: 'Contract not in cache. Use get_contract_source_code with includeSource="full" first to cache the contract.'
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
// If no filePath specified, return list of available files
|
|
408
|
+
if (!args.filePath) {
|
|
409
|
+
const fileList = Object.keys(cached.sourceFiles).map((path) => ({
|
|
410
|
+
path,
|
|
411
|
+
lines: cached.sourceFiles[path].split('\n').length,
|
|
412
|
+
size: cached.sourceFiles[path].length
|
|
413
|
+
}));
|
|
414
|
+
return formatResponse({
|
|
415
|
+
success: true,
|
|
416
|
+
chain: args.chain,
|
|
417
|
+
chainId,
|
|
418
|
+
address: args.address,
|
|
419
|
+
contractName: cached.metadata.contractName,
|
|
420
|
+
fileCount: fileList.length,
|
|
421
|
+
files: fileList
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
// Return specific file
|
|
425
|
+
const fileContent = cached.sourceFiles[args.filePath];
|
|
426
|
+
if (!fileContent) {
|
|
427
|
+
const availableFiles = Object.keys(cached.sourceFiles);
|
|
428
|
+
return formatResponse({
|
|
429
|
+
success: false,
|
|
430
|
+
chain: args.chain,
|
|
431
|
+
chainId,
|
|
432
|
+
address: args.address,
|
|
433
|
+
message: `File "${args.filePath}" not found in cached source`,
|
|
434
|
+
availableFiles
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
return formatResponse({
|
|
438
|
+
success: true,
|
|
439
|
+
chain: args.chain,
|
|
440
|
+
chainId,
|
|
441
|
+
address: args.address,
|
|
442
|
+
contractName: cached.metadata.contractName,
|
|
443
|
+
filePath: args.filePath,
|
|
444
|
+
content: fileContent,
|
|
445
|
+
lines: fileContent.split('\n').length,
|
|
446
|
+
size: fileContent.length
|
|
447
|
+
});
|
|
448
|
+
})
|
|
449
|
+
};
|
|
450
|
+
//# sourceMappingURL=contract-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-info.js","sourceRoot":"","sources":["../../../src/tools/contract-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAChC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACzE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAiCxD,MAAM,aAAa,GAAG,IAAI,GAAG,EAA0B,CAAA;AACvD,wDAAwD;AAExD,+BAA+B;AAC/B,SAAS,WAAW,CAAC,OAAe,EAAE,OAAe;IACnD,OAAO,GAAG,OAAO,IAAI,OAAO,CAAC,WAAW,EAAE,EAAE,CAAA;AAC9C,CAAC;AAED,qEAAqE;AACrE,KAAK,UAAU,iBAAiB,CAC9B,OAAe,EACf,OAAe,EACf,eAAuB;IAEvB,oBAAoB;IACpB,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC9C,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IAE1C,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC,OAAO,CAAA;IACvB,CAAC;IAED,2BAA2B;IAC3B,MAAM,SAAS,GAAG,2CAA2C,OAAO,iDAAiD,OAAO,WAAW,eAAe,EAAE,CAAA;IAExJ,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC,CAAA;IAC7C,MAAM,UAAU,GAAG,CAAC,MAAM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b,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,OAAO;gBACP,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,YAAY;gBAC1C,SAAS,EAAE,QAAQ,CAAC,MAAM;gBAC1B,KAAK,EAAE,QAAQ;aAChB,CAAC,CAAA;QACJ,CAAC;QAED,uBAAuB;QACvB,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACrD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;YACtD,OAAO,cAAc,CAAC;gBACpB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,OAAO;gBACP,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,OAAO,EAAE,SAAS,IAAI,CAAC,QAAQ,8BAA8B;gBAC7D,cAAc;aACf,CAAC,CAAA;QACJ,CAAC;QAED,OAAO,cAAc,CAAC;YACpB,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO;YACP,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,YAAY;YAC1C,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,OAAO,EAAE,WAAW;YACpB,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM;YACrC,IAAI,EAAE,WAAW,CAAC,MAAM;SACzB,CAAC,CAAA;IACJ,CAAC,CACF;CACF,CAAA"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
call_contract_function: {
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
schema: z.ZodObject<{
|
|
7
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
8
|
+
chain: z.ZodEnum<["mainnet", "base", "arbitrum", "polygon", "optimism", "celo", "localhost"]>;
|
|
9
|
+
contractAddress: z.ZodString;
|
|
10
|
+
functionAbi: z.ZodString;
|
|
11
|
+
args: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">>;
|
|
12
|
+
blockNumber: z.ZodOptional<z.ZodString>;
|
|
13
|
+
label: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
chain: "mainnet" | "base" | "arbitrum" | "polygon" | "optimism" | "celo" | "localhost";
|
|
16
|
+
contractAddress: string;
|
|
17
|
+
functionAbi: string;
|
|
18
|
+
blockNumber?: string | undefined;
|
|
19
|
+
args?: (string | number | boolean | null)[] | undefined;
|
|
20
|
+
label?: string | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
chain: "mainnet" | "base" | "arbitrum" | "polygon" | "optimism" | "celo" | "localhost";
|
|
23
|
+
contractAddress: string;
|
|
24
|
+
functionAbi: string;
|
|
25
|
+
blockNumber?: string | undefined;
|
|
26
|
+
args?: (string | number | boolean | null)[] | undefined;
|
|
27
|
+
label?: string | undefined;
|
|
28
|
+
}>, "many">;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
calls: {
|
|
31
|
+
chain: "mainnet" | "base" | "arbitrum" | "polygon" | "optimism" | "celo" | "localhost";
|
|
32
|
+
contractAddress: string;
|
|
33
|
+
functionAbi: string;
|
|
34
|
+
blockNumber?: string | undefined;
|
|
35
|
+
args?: (string | number | boolean | null)[] | undefined;
|
|
36
|
+
label?: string | undefined;
|
|
37
|
+
}[];
|
|
38
|
+
}, {
|
|
39
|
+
calls: {
|
|
40
|
+
chain: "mainnet" | "base" | "arbitrum" | "polygon" | "optimism" | "celo" | "localhost";
|
|
41
|
+
contractAddress: string;
|
|
42
|
+
functionAbi: string;
|
|
43
|
+
blockNumber?: string | undefined;
|
|
44
|
+
args?: (string | number | boolean | null)[] | undefined;
|
|
45
|
+
label?: string | undefined;
|
|
46
|
+
}[];
|
|
47
|
+
}>;
|
|
48
|
+
handler: (args: {
|
|
49
|
+
calls: {
|
|
50
|
+
chain: "mainnet" | "base" | "arbitrum" | "polygon" | "optimism" | "celo" | "localhost";
|
|
51
|
+
contractAddress: string;
|
|
52
|
+
functionAbi: string;
|
|
53
|
+
blockNumber?: string | undefined;
|
|
54
|
+
args?: (string | number | boolean | null)[] | undefined;
|
|
55
|
+
label?: string | undefined;
|
|
56
|
+
}[];
|
|
57
|
+
}) => Promise<import("../types.js").ToolResult>;
|
|
58
|
+
};
|
|
59
|
+
is_contract: {
|
|
60
|
+
title: string;
|
|
61
|
+
description: string;
|
|
62
|
+
schema: z.ZodObject<{
|
|
63
|
+
chain: z.ZodEnum<["mainnet", "base", "arbitrum", "polygon", "optimism", "celo", "localhost"]>;
|
|
64
|
+
address: z.ZodString;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
chain: "mainnet" | "base" | "arbitrum" | "polygon" | "optimism" | "celo" | "localhost";
|
|
67
|
+
address: string;
|
|
68
|
+
}, {
|
|
69
|
+
chain: "mainnet" | "base" | "arbitrum" | "polygon" | "optimism" | "celo" | "localhost";
|
|
70
|
+
address: string;
|
|
71
|
+
}>;
|
|
72
|
+
handler: (args: {
|
|
73
|
+
chain: "mainnet" | "base" | "arbitrum" | "polygon" | "optimism" | "celo" | "localhost";
|
|
74
|
+
address: string;
|
|
75
|
+
}) => Promise<import("../types.js").ToolResult>;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export default _default;
|
|
79
|
+
//# sourceMappingURL=contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../src/tools/contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BxB,wBAoJE"}
|