DEV Community

Shlok Kumar
Shlok Kumar

Posted on

An Introduction to solc-js

solc-js is available as a npm package with the name solc. You may install the solc-js npm package locally or globally just like any other npm package. If this package is installed globally, then solc-js, a command-line utility, will be accessible.

So, to install the command-line utility, perform this command in the command prompt:

npm install -g solc

Now go ahead and run this command to see how to compile solidity files using the command-line compiler:

solcjs —help

To compile a solidity file and get the byte code, go to the directory where you have stored the .sol file and type the following command:

solcjs —bin <filename>.sol

To get the ABI for the file, type the following command in the directory where you have stored the .sol file:

solcjs —abi <filename>.sol

For more content, follow me on - https://linktr.ee/shlokkumar2303

Top comments (0)