GithubHelp home page GithubHelp logo

riccardoravaro / bytecode-verifier Goto Github PK

View Code? Open in Web Editor NEW

This project forked from consensys/bytecode-verifier

0.0 1.0 0.0 17.37 MB

Compile Solidity source code and verify its bytecode matches the blockchain

JavaScript 100.00%

bytecode-verifier's Introduction

Bytecode Verifier

Bytecode Verifier is a handy commandline tool for verifying locally compiled bytecode of a target Solidity contract against its actual bytecode stored in Etheruem Blockchain provided its contract address. This tool:

  • integrity/correctness of bytecode: what's actually being stored on chain is correctly compiled from particular contract, which might be helpful in case of non-trivial potential high-value holder contract deployment(e.g. MultiSig Wallet), especially the contract is deployed through a third party platform.
  • Minimimal effort, simple to use: solidity compiler envolves overtime with minor and some major changes, which complicates the verification of bytecode. (as recurring "bytecode doesn't match" questions being asked on Ethereum Stack Exchange). Bytecode Verifier has been tested against latest version all the way back to some of the oldest deployed contracts.
  • Testnet friendly: most projects launch on testnet before deploying the contract system to mainnet, this tool supports Rinkeby, Kovan and Ropsten Testnet, which constitute three active, well-maintained testnets that most ethereum developers use.

Installation

Prefer global install:

npm install eth-bytecode-verifier -g

If successfully installed, try the -h or --help to read a brief info about this tool.

ethv --help

ethv_help

Quick Usage

ethv verify <chainChoice>

! Currently this tool can verify contracts on: mainnet, kovan, ropsten and rinkeby (NOTE: for contracts on Rinkeby, only compiler version no earlier than 0.4.9)!

  1. Save the contract code into a file with name *YourContractName*.sol. If your contract imports other contract in a separate file or it consists of multiple contracts, please do name the file as the main contract since that's what's the bytecode we tend to verify.(e.g. contract StandardToken is Token {}, then StandardToken.sol should be the file name.)

  2. The ethv verifier will prompt 4 questions. Among which, be careful about the format of compiler version specification. If you are not sure, try run ethv compiler first, and copy the legitimate version string from the output.

  3. If bytecode of your local file checks out with what's actually on the blockchain address, then terminal will return positive feedback, otherwise red bold alert feedback will be returned.

Example1: Golem_MultiSigWallet (mainnet)

golem_multisig

Example2: Oraclize (kovan)

oraclize_kovan

For more example: please go to example subfolder

ethv --list

To quickly get a list of formal major release version of solidity compiler.

ethv_list

ethv compiler

To look up for an intermediate "nightly" version of solidity compiler

ethv_compiler

Contributing

This bytecode verifier is entirely open sourced, anyone in the community is free to use in any purpose. (see MIT License for details) More importantly, any issues or pull request are more than welcomed. According npm package can be found (here)[https://www.npmjs.com/package/eth-bytecode-verifier].

Acknowledgement

Big thanks and great gratitude to ConsenSys Diligence for making this project possible.

bytecode-verifier's People

Contributors

alxiong avatar ethers avatar maurelian avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.