Brianspha / harmony-contract-code-verification-tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Harmonyone Contract Verfication CLI Tool

This is a WIP forked from the original repo Work in progress

Installing Dependencies

yarn

Usage

To use the tool locally simply run the following comands any would work

  1. For help - node bin.js -h
  2. For testing the tool with all the options (example) - node bin.js --contract-address one1rcs4yy4kln53ux60qdeuhhvpygn2sutn500dhw --repo-url https://github.com/rachit2501/Lottery-System/blob/master/contracts/Lottery.sol --chain testnet --solc-version 0.4.17

The above is just an example where each of the options prefixed with -- are defined as follows

Usage: hcli command <options> 

Options:
  -V, --version                               output the version number
  -ca <address>,--contract-address <address>  Specify contract address on HarmonyOne
  -sv <version>,--solc-version <version>      Specify Solidity Version
  -ru <url>,--repo-url <url>                  Specify Github url link
  -c <chain-id>,--chain <chain-id>            Specify Chain i.e. Testnet etc
  -h, --help                                  display help for command

Commands:
  verify|v                                    verifies if the given contract address byte code matches that generated by the tool
  help,                                       outputs all commands

Executable

To build an executable for the current OS simply run the following command

yarn build:prod

This will output a file called hcli which can then be used to verify any contract deployed on harmonyone blockchain
Example.

./hcli  -ca one1rcs4yy4kln53ux60qdeuhhvpygn2sutn500dhw -ru https://github.com/rachit2501/Lottery-System/blob/master/contracts/Lottery.sol -c testnet -sv 0.4.17 

About


Languages

Language:JavaScript 100.0%