Cli tool to get smart contract code + ABI on BSC chain for ease of piping and viewing at terminal (e.g. with vim or others)
cargo install tracpls
Users are required to define environment variable of TRACPLS_BSCSCAN_APIKEY
to
be bscscan's apikey. Check bscscan.com website to sign up an account, then
create an apikey.
The following options are available
``` tracpls Wasin Thonkaew (wasin@wasin.io) cli tool to get smart contract code and its ABI for ease of viewing on terminal
USAGE: tracpls [OPTIONS] --address
OPTIONS: -a, --address
Target contract address to get its smart contract code or ABI from --abi-only Get only contract ABI -h, --help Print help information --no-abi-pretty-print Pretty print output for contract ABI. It can only be used if --abi- only exists --no-clean-crlf Make sure to clean CR/LF character codes to make it suitable to view the content on the platform running the application ```
$ tracpls -a 0x0000000000000000000000000000000000001004 | vim -c "set syntax=solidity" -
You might not need -c "set syntax=solidity"
if you already configured your
~/.vimrc
to support solidity syntax highlighting.
$ tracpls -a 0x0000000000000000000000000000000000001004 --abi-only > abi.json
$ tracpls -a 0x0000000000000000000000000000000000001004 --abi-only --no-abi-pretty-print > abi.json
Error message will always be outputted to stderr
. So normal correct and proper
output won't be interfere with the error message. But you are free to combine
them into one.
MIT, Wasin Thonkaew