{"id":26538,"library":"tsol","title":"tSol","description":"A transpiler for Solidity that adds GCC-like macro and helper functions to make Solidity assembly programming more manageable. Version 1.0.6, with initial release 1.0.3. Key differentiators: provides custom assembly functions (pointer, pointer_attr, byte_offset, build, attr) to simplify storage pointer calculations and data packing in inline assembly. Requires gcc and node/npm. Focused on Ethereum smart contract optimization, particularly for struct packing.","status":"active","version":"1.0.6","language":"javascript","source_language":"en","source_url":"https://github.com/merklex/tsol","tags":["javascript"],"install":[{"cmd":"npm install tsol","lang":"bash","label":"npm"},{"cmd":"yarn add tsol","lang":"bash","label":"yarn"},{"cmd":"pnpm add tsol","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required runtime dependency for transpilation","package":"gcc","optional":false},{"reason":"Required runtime dependency for the npm package","package":"node","optional":false}],"imports":[],"quickstart":{"code":"npm i -g tsol\ntsol file.sol > output.sol","lang":"javascript","description":"Installs tSol globally and transpiles a Solidity file containing #define TRANSPILE and tSol macros into plain Solidity."},"warnings":[{"fix":"Install gcc (e.g., apt-get install gcc on Linux, xcode-select --install on macOS).","message":"tSol requires gcc to be installed on the system. Missing gcc will cause transpilation to fail.","severity":"gotcha","affected_versions":">=1.0.3"},{"fix":"Add #define TRANSPILE at the top of your Solidity file before using tSol macros.","message":"The source file must contain #define TRANSPILE for tSol to process it. Without this directive, tSol will output the file unchanged.","severity":"gotcha","affected_versions":">=1.0.3"},{"fix":"Ensure all tSol assembly functions are used inside assembly { ... } blocks.","message":"tSol macros (pointer, pointer_attr, etc.) are only valid inside assembly blocks. Using them outside assembly will cause compilation errors.","severity":"gotcha","affected_versions":">=1.0.3"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm i -g tsol' and ensure npm global bin directory is in your PATH.","cause":"tSol is not installed globally or not in PATH.","error":"tsol: command not found"},{"fix":"Install gcc (e.g., apt-get install gcc for Debian/Ubuntu, or download from https://gcc.gnu.org/).","cause":"gcc is not installed on the system.","error":"gcc: command not found"},{"fix":"Add '#define TRANSPILE' at the top of your Solidity file.","cause":"The Solidity source file does not contain the required directive.","error":"Error: Could not find #define TRANSPILE"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}