How to compile a Solidity Smart Contract with solc-js

Penetration Testing Wiki

How to compile a Solidity Smart Contract with solc-js

You can easily install solc-js from npm official package repository:



npm install -g solc

It will install solc-js under /usr/local/bin/solcjs -> ../lib/node_modules/solc/solc.js

Basic syntax to compile a smart contract written in Solidity:

solcjs --bin contract.sol

If you use external contracts, imports or OpenZeppelin:

solcjs --bin --include-path node_modules/ --base-path . MainContract.sol

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.