Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
}
const outputPathInfo = path.parse(fileName);
const contractName = outputPathInfo.name;
const compilationOutput = JSON.parse(fs.readFileSync(fileName, 'utf8'));
if (compilationOutput.abi !== undefined) {
const abi = JSON.stringify(compilationOutput.abi);
const contractByteCode = compilationOutput.bytecode;
const projectFullPath = path.join(projectPath, projectName + extension);
if (!fs.existsSync(projectFullPath)) {
codegen.generateNetStandardClassLibrary(projectName, projectPath, lang);
}
codegen.generateAllClasses(abi,
contractByteCode,
contractName,
baseNamespace,
projectPath,
lang);
}
} catch (e) {
const outputChannel = vscode.window.createOutputChannel('solidity code generation');
outputChannel.clear();
outputChannel.appendLine('Error generating code:');
outputChannel.appendLine(e.message);
outputChannel.show();
}
}
if (settings.projectPath !== undefined) {
projectPath = path.join(projectPath, settings.projectPath);
}
}
const outputPathInfo = path.parse(fileName);
const contractName = outputPathInfo.name;
const compilationOutput = JSON.parse(fs.readFileSync(fileName, 'utf8'));
if (compilationOutput.abi !== undefined) {
const abi = JSON.stringify(compilationOutput.abi);
const contractByteCode = compilationOutput.bytecode;
const projectFullPath = path.join(projectPath, projectName + extension);
if (!fs.existsSync(projectFullPath)) {
codegen.generateNetStandardClassLibrary(projectName, projectPath, lang);
}
codegen.generateAllClasses(abi,
contractByteCode,
contractName,
baseNamespace,
projectPath,
lang);
}
} catch (e) {
const outputChannel = vscode.window.createOutputChannel('solidity code generation');
outputChannel.clear();
outputChannel.appendLine('Error generating code:');
outputChannel.appendLine(e.message);
outputChannel.show();
}