stylus-toolkit 0.1.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/.claude/settings.local.json +20 -0
- package/CHANGELOG.md +30 -0
- package/CONTRIBUTING.md +50 -0
- package/LICENSE +21 -0
- package/README.md +132 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +62 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/benchmark.d.ts +3 -0
- package/dist/commands/benchmark.d.ts.map +1 -0
- package/dist/commands/benchmark.js +18 -0
- package/dist/commands/benchmark.js.map +1 -0
- package/dist/commands/config.d.ts +9 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +63 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +115 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/profile.d.ts +3 -0
- package/dist/commands/profile.d.ts.map +1 -0
- package/dist/commands/profile.js +160 -0
- package/dist/commands/profile.js.map +1 -0
- package/dist/compiler/rust-compiler.d.ts +12 -0
- package/dist/compiler/rust-compiler.d.ts.map +1 -0
- package/dist/compiler/rust-compiler.js +141 -0
- package/dist/compiler/rust-compiler.js.map +1 -0
- package/dist/compiler/solidity-compiler.d.ts +10 -0
- package/dist/compiler/solidity-compiler.d.ts.map +1 -0
- package/dist/compiler/solidity-compiler.js +160 -0
- package/dist/compiler/solidity-compiler.js.map +1 -0
- package/dist/exporter/exporter.d.ts +13 -0
- package/dist/exporter/exporter.d.ts.map +1 -0
- package/dist/exporter/exporter.js +322 -0
- package/dist/exporter/exporter.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/profiler/comparator.d.ts +10 -0
- package/dist/profiler/comparator.d.ts.map +1 -0
- package/dist/profiler/comparator.js +96 -0
- package/dist/profiler/comparator.js.map +1 -0
- package/dist/profiler/gas-profiler.d.ts +11 -0
- package/dist/profiler/gas-profiler.d.ts.map +1 -0
- package/dist/profiler/gas-profiler.js +143 -0
- package/dist/profiler/gas-profiler.js.map +1 -0
- package/dist/storage/results-store.d.ts +16 -0
- package/dist/storage/results-store.d.ts.map +1 -0
- package/dist/storage/results-store.js +107 -0
- package/dist/storage/results-store.js.map +1 -0
- package/dist/templates/generator.d.ts +11 -0
- package/dist/templates/generator.d.ts.map +1 -0
- package/dist/templates/generator.js +135 -0
- package/dist/templates/generator.js.map +1 -0
- package/dist/templates/templates.d.ts +2 -0
- package/dist/templates/templates.d.ts.map +1 -0
- package/dist/templates/templates.js +324 -0
- package/dist/templates/templates.js.map +1 -0
- package/dist/types/index.d.ts +115 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/config.d.ts +15 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +77 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/file-system.d.ts +14 -0
- package/dist/utils/file-system.d.ts.map +1 -0
- package/dist/utils/file-system.js +84 -0
- package/dist/utils/file-system.js.map +1 -0
- package/dist/utils/logger.d.ts +20 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +76 -0
- package/dist/utils/logger.js.map +1 -0
- package/package.json +75 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GasProfiler = void 0;
|
|
4
|
+
const ethers_1 = require("ethers");
|
|
5
|
+
const logger_1 = require("../utils/logger");
|
|
6
|
+
class GasProfiler {
|
|
7
|
+
constructor(rpcUrl, privateKey) {
|
|
8
|
+
this.provider = new ethers_1.ethers.JsonRpcProvider(rpcUrl);
|
|
9
|
+
if (privateKey) {
|
|
10
|
+
this.signer = new ethers_1.ethers.Wallet(privateKey, this.provider);
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
this.signer = ethers_1.ethers.Wallet.createRandom().connect(this.provider);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
async profileContract(compilation, testCases) {
|
|
17
|
+
logger_1.logger.startSpinner(`Profiling ${compilation.language} contract...`);
|
|
18
|
+
try {
|
|
19
|
+
const deploymentGas = await this.measureDeploymentGas(compilation);
|
|
20
|
+
logger_1.logger.updateSpinner('Measuring function gas usage...');
|
|
21
|
+
const functionGas = await this.measureFunctionGas(compilation, testCases);
|
|
22
|
+
const network = await this.provider.getNetwork();
|
|
23
|
+
const blockNumber = await this.provider.getBlockNumber();
|
|
24
|
+
logger_1.logger.succeedSpinner(`${compilation.language} profiling complete (Deployment: ${deploymentGas} gas)`);
|
|
25
|
+
return {
|
|
26
|
+
contractName: compilation.contractName,
|
|
27
|
+
language: compilation.language,
|
|
28
|
+
deploymentGas,
|
|
29
|
+
functionGas,
|
|
30
|
+
timestamp: new Date().toISOString(),
|
|
31
|
+
network: network.name || 'unknown',
|
|
32
|
+
blockNumber,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
logger_1.logger.failSpinner(`Failed to profile ${compilation.language} contract`);
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async measureDeploymentGas(compilation) {
|
|
41
|
+
try {
|
|
42
|
+
let factory;
|
|
43
|
+
if (compilation.language === 'solidity') {
|
|
44
|
+
factory = new ethers_1.ethers.ContractFactory(compilation.abi || [], compilation.bytecode, this.signer);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
const bytecode = '0x' + compilation.bytecode;
|
|
48
|
+
const tx = await this.signer.sendTransaction({
|
|
49
|
+
data: bytecode,
|
|
50
|
+
});
|
|
51
|
+
const receipt = await tx.wait();
|
|
52
|
+
if (!receipt) {
|
|
53
|
+
throw new Error('Transaction receipt not available');
|
|
54
|
+
}
|
|
55
|
+
return Number(receipt.gasUsed);
|
|
56
|
+
}
|
|
57
|
+
const contract = await factory.deploy();
|
|
58
|
+
await contract.waitForDeployment();
|
|
59
|
+
const deployTx = contract.deploymentTransaction();
|
|
60
|
+
if (!deployTx) {
|
|
61
|
+
throw new Error('Deployment transaction not found');
|
|
62
|
+
}
|
|
63
|
+
const receipt = await deployTx.wait();
|
|
64
|
+
if (!receipt) {
|
|
65
|
+
throw new Error('Transaction receipt not available');
|
|
66
|
+
}
|
|
67
|
+
return Number(receipt.gasUsed);
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
logger_1.logger.warn(`Deployment gas measurement failed: ${error.message}`);
|
|
71
|
+
return 0;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
async measureFunctionGas(compilation, testCases) {
|
|
75
|
+
const functionGasMap = new Map();
|
|
76
|
+
if (!compilation.abi || !testCases) {
|
|
77
|
+
return functionGasMap;
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
let contract;
|
|
81
|
+
if (compilation.language === 'solidity') {
|
|
82
|
+
const factory = new ethers_1.ethers.ContractFactory(compilation.abi, compilation.bytecode, this.signer);
|
|
83
|
+
contract = await factory.deploy();
|
|
84
|
+
await contract.waitForDeployment();
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
return functionGasMap;
|
|
88
|
+
}
|
|
89
|
+
for (const [functionName, inputs] of testCases) {
|
|
90
|
+
const testResults = [];
|
|
91
|
+
const gasUsages = [];
|
|
92
|
+
for (let i = 0; i < inputs.length; i++) {
|
|
93
|
+
try {
|
|
94
|
+
const tx = await contract[functionName](...inputs[i]);
|
|
95
|
+
const receipt = await tx.wait();
|
|
96
|
+
const gasUsed = Number(receipt.gasUsed);
|
|
97
|
+
gasUsages.push(gasUsed);
|
|
98
|
+
testResults.push({
|
|
99
|
+
name: `Test ${i + 1}`,
|
|
100
|
+
inputs: inputs[i],
|
|
101
|
+
gasUsed,
|
|
102
|
+
success: true,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
testResults.push({
|
|
107
|
+
name: `Test ${i + 1}`,
|
|
108
|
+
inputs: inputs[i],
|
|
109
|
+
gasUsed: 0,
|
|
110
|
+
success: false,
|
|
111
|
+
error: error.message,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (gasUsages.length > 0) {
|
|
116
|
+
const avgGas = gasUsages.reduce((a, b) => a + b, 0) / gasUsages.length;
|
|
117
|
+
const minGas = Math.min(...gasUsages);
|
|
118
|
+
const maxGas = Math.max(...gasUsages);
|
|
119
|
+
functionGasMap.set(functionName, {
|
|
120
|
+
functionName,
|
|
121
|
+
gasUsed: avgGas,
|
|
122
|
+
executions: gasUsages.length,
|
|
123
|
+
avgGas,
|
|
124
|
+
minGas,
|
|
125
|
+
maxGas,
|
|
126
|
+
testCases: testResults,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
logger_1.logger.warn(`Function gas measurement failed: ${error.message}`);
|
|
133
|
+
}
|
|
134
|
+
return functionGasMap;
|
|
135
|
+
}
|
|
136
|
+
async estimateGas(contractAddress, abi, functionName, args) {
|
|
137
|
+
const contract = new ethers_1.ethers.Contract(contractAddress, abi, this.signer);
|
|
138
|
+
const gasEstimate = await contract[functionName].estimateGas(...args);
|
|
139
|
+
return Number(gasEstimate);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
exports.GasProfiler = GasProfiler;
|
|
143
|
+
//# sourceMappingURL=gas-profiler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gas-profiler.js","sourceRoot":"","sources":["../../src/profiler/gas-profiler.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAChC,4CAAyC;AAGzC,MAAa,WAAW;IAItB,YAAY,MAAc,EAAE,UAAmB;QAC7C,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CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,eAAM,CAAC,IAAI,CAAC,oCAAqC,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9E,CAAC;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,WAAW,CACf,eAAuB,EACvB,GAAU,EACV,YAAoB,EACpB,IAAW;QAEX,MAAM,QAAQ,GAAG,IAAI,eAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAExE,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,YAAY,CAAC,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,CAAC;QAEtE,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC;IAC7B,CAAC;CACF;AA3LD,kCA2LC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComparisonResult } from '../types';
|
|
2
|
+
export declare class ResultsStore {
|
|
3
|
+
private resultsDir;
|
|
4
|
+
constructor(customDir?: string);
|
|
5
|
+
initialize(): Promise<void>;
|
|
6
|
+
save(comparison: ComparisonResult): Promise<string>;
|
|
7
|
+
load(filename: string): Promise<ComparisonResult>;
|
|
8
|
+
list(): Promise<string[]>;
|
|
9
|
+
getLatest(contractName?: string): Promise<ComparisonResult | null>;
|
|
10
|
+
delete(filename: string): Promise<void>;
|
|
11
|
+
clear(): Promise<void>;
|
|
12
|
+
private serializeComparison;
|
|
13
|
+
private deserializeComparison;
|
|
14
|
+
getResultsDirectory(): string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=results-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"results-store.d.ts","sourceRoot":"","sources":["../../src/storage/results-store.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5C,qBAAa,YAAY;IACvB,OAAO,CAAC,UAAU,CAAS;gBAEf,SAAS,CAAC,EAAE,MAAM;IAKxB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,IAAI,CAAC,UAAU,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC;IAcnD,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAWjD,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAWzB,SAAS,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAclE,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASvC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAM5B,OAAO,CAAC,mBAAmB;IAkB3B,OAAO,CAAC,qBAAqB;IAkB7B,mBAAmB,IAAI,MAAM;CAG9B"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ResultsStore = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
|
+
const file_system_1 = require("../utils/file-system");
|
|
10
|
+
const logger_1 = require("../utils/logger");
|
|
11
|
+
class ResultsStore {
|
|
12
|
+
constructor(customDir) {
|
|
13
|
+
this.resultsDir =
|
|
14
|
+
customDir || path_1.default.join(file_system_1.FileSystem.getProjectRoot(), '.stylus-toolkit', 'results');
|
|
15
|
+
}
|
|
16
|
+
async initialize() {
|
|
17
|
+
await file_system_1.FileSystem.ensureDir(this.resultsDir);
|
|
18
|
+
}
|
|
19
|
+
async save(comparison) {
|
|
20
|
+
await this.initialize();
|
|
21
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
22
|
+
const filename = `${comparison.contractName}_${timestamp}.json`;
|
|
23
|
+
const filepath = path_1.default.join(this.resultsDir, filename);
|
|
24
|
+
await file_system_1.FileSystem.writeJson(filepath, this.serializeComparison(comparison));
|
|
25
|
+
logger_1.logger.success(`Results saved to ${filepath}`);
|
|
26
|
+
return filepath;
|
|
27
|
+
}
|
|
28
|
+
async load(filename) {
|
|
29
|
+
const filepath = path_1.default.join(this.resultsDir, filename);
|
|
30
|
+
if (!(await file_system_1.FileSystem.fileExists(filepath))) {
|
|
31
|
+
throw new Error(`Result file not found: ${filename}`);
|
|
32
|
+
}
|
|
33
|
+
const data = await file_system_1.FileSystem.readJson(filepath);
|
|
34
|
+
return this.deserializeComparison(data);
|
|
35
|
+
}
|
|
36
|
+
async list() {
|
|
37
|
+
await this.initialize();
|
|
38
|
+
try {
|
|
39
|
+
const files = await fs_extra_1.default.readdir(this.resultsDir);
|
|
40
|
+
return files.filter((f) => f.endsWith('.json')).sort().reverse();
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
async getLatest(contractName) {
|
|
47
|
+
const files = await this.list();
|
|
48
|
+
const filteredFiles = contractName
|
|
49
|
+
? files.filter((f) => f.startsWith(contractName))
|
|
50
|
+
: files;
|
|
51
|
+
if (filteredFiles.length === 0) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
return await this.load(filteredFiles[0]);
|
|
55
|
+
}
|
|
56
|
+
async delete(filename) {
|
|
57
|
+
const filepath = path_1.default.join(this.resultsDir, filename);
|
|
58
|
+
if (await file_system_1.FileSystem.fileExists(filepath)) {
|
|
59
|
+
await fs_extra_1.default.remove(filepath);
|
|
60
|
+
logger_1.logger.success(`Deleted result: ${filename}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async clear() {
|
|
64
|
+
await fs_extra_1.default.remove(this.resultsDir);
|
|
65
|
+
await this.initialize();
|
|
66
|
+
logger_1.logger.success('All results cleared');
|
|
67
|
+
}
|
|
68
|
+
serializeComparison(comparison) {
|
|
69
|
+
return {
|
|
70
|
+
...comparison,
|
|
71
|
+
rustProfile: {
|
|
72
|
+
...comparison.rustProfile,
|
|
73
|
+
functionGas: Array.from(comparison.rustProfile.functionGas.entries()),
|
|
74
|
+
},
|
|
75
|
+
solidityProfile: {
|
|
76
|
+
...comparison.solidityProfile,
|
|
77
|
+
functionGas: Array.from(comparison.solidityProfile.functionGas.entries()),
|
|
78
|
+
},
|
|
79
|
+
savings: {
|
|
80
|
+
...comparison.savings,
|
|
81
|
+
functionSavings: Array.from(comparison.savings.functionSavings.entries()),
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
deserializeComparison(data) {
|
|
86
|
+
return {
|
|
87
|
+
...data,
|
|
88
|
+
rustProfile: {
|
|
89
|
+
...data.rustProfile,
|
|
90
|
+
functionGas: new Map(data.rustProfile.functionGas),
|
|
91
|
+
},
|
|
92
|
+
solidityProfile: {
|
|
93
|
+
...data.solidityProfile,
|
|
94
|
+
functionGas: new Map(data.solidityProfile.functionGas),
|
|
95
|
+
},
|
|
96
|
+
savings: {
|
|
97
|
+
...data.savings,
|
|
98
|
+
functionSavings: new Map(data.savings.functionSavings),
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
getResultsDirectory() {
|
|
103
|
+
return this.resultsDir;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.ResultsStore = ResultsStore;
|
|
107
|
+
//# sourceMappingURL=results-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"results-store.js","sourceRoot":"","sources":["../../src/storage/results-store.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,wDAA0B;AAC1B,sDAAkD;AAElD,4CAAyC;AAEzC,MAAa,YAAY;IAGvB,YAAY,SAAkB;QAC5B,IAAI,CAAC,UAAU;YAC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
|
|
1
|
+
export declare class TemplateGenerator {
|
|
2
|
+
generate(projectPath: string, templateName: string, hasRust: boolean, hasSolidity: boolean): Promise<void>;
|
|
3
|
+
private generateRustFiles;
|
|
4
|
+
private generateSolidityFiles;
|
|
5
|
+
private generateCommonFiles;
|
|
6
|
+
private generateCargoToml;
|
|
7
|
+
private generateReadme;
|
|
8
|
+
private generateGitignore;
|
|
9
|
+
private generateEnvExample;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/templates/generator.ts"],"names":[],"mappings":"AAIA,qBAAa,iBAAiB;IACtB,QAAQ,CACZ,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,OAAO,GACnB,OAAO,CAAC,IAAI,CAAC;YAcF,iBAAiB;YAQjB,qBAAqB;YASrB,mBAAmB;IAgBjC,OAAO,CAAC,iBAAiB;IA0BzB,OAAO,CAAC,cAAc;IAwCtB,OAAO,CAAC,iBAAiB;IAwBzB,OAAO,CAAC,kBAAkB;CAW3B"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TemplateGenerator = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const file_system_1 = require("../utils/file-system");
|
|
9
|
+
const templates_1 = require("./templates");
|
|
10
|
+
class TemplateGenerator {
|
|
11
|
+
async generate(projectPath, templateName, hasRust, hasSolidity) {
|
|
12
|
+
const template = templates_1.TEMPLATES[templateName] || templates_1.TEMPLATES.basic;
|
|
13
|
+
if (hasRust) {
|
|
14
|
+
await this.generateRustFiles(projectPath, template);
|
|
15
|
+
}
|
|
16
|
+
if (hasSolidity) {
|
|
17
|
+
await this.generateSolidityFiles(projectPath, template);
|
|
18
|
+
}
|
|
19
|
+
await this.generateCommonFiles(projectPath, templateName, hasRust, hasSolidity);
|
|
20
|
+
}
|
|
21
|
+
async generateRustFiles(projectPath, template) {
|
|
22
|
+
const rustContractPath = path_1.default.join(projectPath, 'contracts-rust', 'src', 'lib.rs');
|
|
23
|
+
await file_system_1.FileSystem.writeFile(rustContractPath, template.rust);
|
|
24
|
+
const cargoToml = path_1.default.join(projectPath, 'contracts-rust', 'Cargo.toml');
|
|
25
|
+
await file_system_1.FileSystem.writeFile(cargoToml, this.generateCargoToml(template.name));
|
|
26
|
+
}
|
|
27
|
+
async generateSolidityFiles(projectPath, template) {
|
|
28
|
+
const solidityContractPath = path_1.default.join(projectPath, 'contracts-solidity', `${template.name}.sol`);
|
|
29
|
+
await file_system_1.FileSystem.writeFile(solidityContractPath, template.solidity);
|
|
30
|
+
}
|
|
31
|
+
async generateCommonFiles(projectPath, templateName, hasRust, hasSolidity) {
|
|
32
|
+
const readme = this.generateReadme(templateName, hasRust, hasSolidity);
|
|
33
|
+
await file_system_1.FileSystem.writeFile(path_1.default.join(projectPath, 'README.md'), readme);
|
|
34
|
+
const gitignore = this.generateGitignore();
|
|
35
|
+
await file_system_1.FileSystem.writeFile(path_1.default.join(projectPath, '.gitignore'), gitignore);
|
|
36
|
+
const envExample = this.generateEnvExample();
|
|
37
|
+
await file_system_1.FileSystem.writeFile(path_1.default.join(projectPath, '.env.example'), envExample);
|
|
38
|
+
}
|
|
39
|
+
generateCargoToml(contractName) {
|
|
40
|
+
return `[package]
|
|
41
|
+
name = "${contractName.toLowerCase()}"
|
|
42
|
+
version = "0.1.0"
|
|
43
|
+
edition = "2021"
|
|
44
|
+
|
|
45
|
+
[dependencies]
|
|
46
|
+
stylus-sdk = "0.10.0"
|
|
47
|
+
alloy-primitives = "0.8.19"
|
|
48
|
+
alloy-sol-types = "0.8.19"
|
|
49
|
+
|
|
50
|
+
[dev-dependencies]
|
|
51
|
+
tokio = { version = "1.12.0", features = ["full"] }
|
|
52
|
+
|
|
53
|
+
[lib]
|
|
54
|
+
crate-type = ["lib", "cdylib"]
|
|
55
|
+
|
|
56
|
+
[profile.release]
|
|
57
|
+
codegen-units = 1
|
|
58
|
+
strip = true
|
|
59
|
+
lto = true
|
|
60
|
+
panic = "abort"
|
|
61
|
+
opt-level = "z"
|
|
62
|
+
`;
|
|
63
|
+
}
|
|
64
|
+
generateReadme(templateName, hasRust, hasSolidity) {
|
|
65
|
+
return `# Stylus Project - ${templateName}
|
|
66
|
+
|
|
67
|
+
## Overview
|
|
68
|
+
|
|
69
|
+
This project was generated using the Stylus Toolkit CLI.
|
|
70
|
+
|
|
71
|
+
${hasRust ? '### Rust (Stylus)\n\nLocation: \`contracts-rust/src/lib.rs\`\n' : ''}
|
|
72
|
+
${hasSolidity ? '### Solidity\n\nLocation: \`contracts-solidity/\`\n' : ''}
|
|
73
|
+
|
|
74
|
+
## Quick Start
|
|
75
|
+
|
|
76
|
+
### Profile Gas Usage
|
|
77
|
+
|
|
78
|
+
Compare gas usage between Rust and Solidity implementations:
|
|
79
|
+
|
|
80
|
+
\`\`\`bash
|
|
81
|
+
stylus-toolkit profile
|
|
82
|
+
\`\`\`
|
|
83
|
+
|
|
84
|
+
### Compile Contracts
|
|
85
|
+
|
|
86
|
+
${hasRust ? '#### Rust (Stylus)\n\`\`\`bash\ncd contracts-rust\ncargo build --release --target wasm32-unknown-unknown\n\`\`\`\n' : ''}
|
|
87
|
+
${hasSolidity ? '#### Solidity\n\`\`\`bash\ncd contracts-solidity\nforge build\n\`\`\`\n' : ''}
|
|
88
|
+
|
|
89
|
+
## Documentation
|
|
90
|
+
|
|
91
|
+
- [Stylus Documentation](https://docs.arbitrum.io/stylus/stylus-gentle-introduction)
|
|
92
|
+
- [Stylus SDK](https://github.com/OffchainLabs/stylus-sdk-rs)
|
|
93
|
+
|
|
94
|
+
## License
|
|
95
|
+
|
|
96
|
+
MIT
|
|
97
|
+
`;
|
|
98
|
+
}
|
|
99
|
+
generateGitignore() {
|
|
100
|
+
return `# Rust
|
|
101
|
+
target/
|
|
102
|
+
Cargo.lock
|
|
103
|
+
|
|
104
|
+
# Solidity
|
|
105
|
+
out/
|
|
106
|
+
cache/
|
|
107
|
+
|
|
108
|
+
# Environment
|
|
109
|
+
.env
|
|
110
|
+
|
|
111
|
+
# Results
|
|
112
|
+
.stylus-toolkit/results/
|
|
113
|
+
|
|
114
|
+
# Node
|
|
115
|
+
node_modules/
|
|
116
|
+
|
|
117
|
+
# IDE
|
|
118
|
+
.vscode/
|
|
119
|
+
.idea/
|
|
120
|
+
`;
|
|
121
|
+
}
|
|
122
|
+
generateEnvExample() {
|
|
123
|
+
return `# RPC Configuration
|
|
124
|
+
RPC_URL=http://localhost:8547
|
|
125
|
+
|
|
126
|
+
# Private key for deployment (DO NOT commit actual private key)
|
|
127
|
+
PRIVATE_KEY=
|
|
128
|
+
|
|
129
|
+
# Network
|
|
130
|
+
NETWORK=local
|
|
131
|
+
`;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.TemplateGenerator = TemplateGenerator;
|
|
135
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../src/templates/generator.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,sDAAkD;AAClD,2CAAwC;AAExC,MAAa,iBAAiB;IAC5B,KAAK,CAAC,QAAQ,CACZ,WAAmB,EACnB,YAAoB,EACpB,OAAgB,EAChB,WAAoB;QAEpB,MAAM,QAAQ,GAAG,qBAAS,CAAC,YAAY,CAAC,IAAI,qBAAS,CAAC,KAAK,CAAC;QAE5D,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;QACtD,CAA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