{"library":"polysol-js-core","title":"PolySol-JS","description":"PolySol-JS is a modular transpiler that converts JavaScript/TypeScript source code into an intermediate JSON representation (IR) and then into Solidity smart contracts. Version 1.0.1 is the current stable release. The project is in early stages with no public npm release, only installation via git clone. Its key differentiators are a standardized IR decoupling parsing from code generation, enabling extensibility to other source languages and target blockchains, and an educational focus on transpiler internals. Alternatives like Sol2Ink compile Solidity to Rust, while PolySol-JS targets Solidity from JS/TS.","language":"javascript","status":"active","last_verified":"Fri May 01","install":{"commands":["npm install polysol-js-core"],"cli":null},"imports":["import { PolySol } from 'polysol-js-core'","import { IRSchema } from 'polysol-js-core/ir'","import { Parser } from 'polysol-js-core/parser'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { parseJavaScript } from 'polysol-js-core/parser';\nimport { generateSolidity } from 'polysol-js-core/generator';\nimport { readFileSync } from 'fs';\n\nconst sourceCode = readFileSync('contract.js', 'utf8');\nconst ir = parseJavaScript(sourceCode); // returns IR object\nconst solidityCode = generateSolidity(ir);\nconsole.log(solidityCode);\n","lang":"typescript","description":"Shows how to transpile a JS file to Solidity using the modular parser and generator.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}