Skip to content

Compilation

To compile a smart contract

sh
solc --bin --abi <sol-file-path> -o <output-path>

For example,

sh
solc --bin --abi contracts/test.sol -o build

To generate go code

sh
abigen --bin=<bin-file-path> --abi=<abi-file-path> --pkg=<go-file-package> --out=<output-file-path>

For example,

sh
abigen --bin=build/Test.bin --abi=Test.abi --pkg=test --out=gen/test.go