To install solc on macOS, execute the following commands:
$ brew tap ethereum/ethereum $ brew install solidity $ brew linkapps solidity
solc supports a variety of functions. A few examples are shown as follows:
- Display contract in a binary format:
$ solc --bin Addition.sol
This command will produce an output similar to the following. This shows the binary translation of the Addition.sol contract code:
- Estimate gas:
$ solc --gas Addition.sol
This will give the following output: