etheno

Simplify Ethereum security analysis and testing

https://github.com/crytic/etheno

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.7%) to scientific vocabulary

Keywords

differential-testing ethereum ganache solidity symbolic-execution truffle

Keywords from Contributors

vulnerability-detection static-analysis vyper shellcodes emulation interactive binary-analysis program-analysis smt z3
Last synced: 6 months ago · JSON representation

Repository

Simplify Ethereum security analysis and testing

Basic Info
  • Host: GitHub
  • Owner: crytic
  • License: agpl-3.0
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 738 KB
Statistics
  • Stars: 339
  • Watchers: 19
  • Forks: 33
  • Open Issues: 37
  • Releases: 9
Archived
Topics
differential-testing ethereum ganache solidity symbolic-execution truffle
Created over 7 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog License

README.md

The repo is now archived. Use medusa for fuzzing. To learn more: https://secure-contracts.com/

Etheno

Slack Status PyPI version


Etheno is the Ethereum testing Swiss Army knife. It’s a JSON RPC multiplexer, analysis tool wrapper, and test integration tool. It eliminates the complexity of setting up analysis tools like Echidna on large, multi-contract projects.

If you are a smart contract developer, you should use Etheno to test your contracts. If you are an Ethereum client developer, you should use Etheno to perform differential testing on your implementation.

Etheno is named after the Greek goddess Stheno, sister of Medusa, and mother of Echidna—which also happens to be the name of our EVM property-based fuzz tester.

Features

  • JSON RPC Multiplexing: Etheno runs a JSON RPC server that can multiplex calls to one or more clients
    • API for filtering and modifying JSON RPC calls
    • Enables differential testing by sending JSON RPC sequences to multiple Ethereum clients
    • Deploy to and interact with multiple networks at the same time
  • Integration with Test Frameworks like Ganache and Truffle
    • Run a local test network with a single command

Quickstart

Use our prebuilt Docker container to quickly install and try Etheno:

docker pull trailofbits/etheno docker run -it trailofbits/etheno

NOTE: Many of Etheno's capabilities will require publishing one or more ports and persisting data using volumes as part of the docker run command. - To learn about publishing ports, click here - To learn more about persisting data using volumes, click here

Alternatively, natively install Etheno in a few shell commands:

```

Install system dependencies

sudo apt-get update && sudo apt-get install python3 python3-pip -y

Install Etheno

pip3 install --user etheno

Use the Etheno CLI

cd /path/to/a/truffle/project etheno --ganache --truffle ```

Usage

Etheno can be used in many different ways and therefore has numerous command-line argument combinations.

Ganache Integration

A Ganache instance can automatically be run within Etheno: etheno --ganache

  • --ganache-port will set the port on which Ganache is run; if omitted, Etheno will choose the lowest port higher than the port on which Etheno’s JSON RPC server is running
  • --ganache-args lets you pass additional arguments to Ganache
  • --accounts or -a sets the number of accounts to create in Ganache (default is 10)
  • --balance or -b sets the default balance (in Ether) to seed to each Ganache account (default is 1000.0)
  • --gas-price or -c sets the default gas price in wei for Ganache (default is 20000000_000)

Running a Ganache instance via Etheno can be used to deploy large, multi-contract projects in tandem with Echidna. To learn more on how to use Echidna and Ganache together, click here.

NOTE: We recommend using the latest version of Ganache (v7.3.2) and Node 16.x. After the upstream bug (see below) is fixed, the Ganache package should be upgraded.

NOTE: Currently, there is an upstream bug in the latest version of Ganache (v7.3.2) that prevents the Etheno integration from working if the contract size that is being tested is very large (https://github.com/trufflesuite/ganache/issues/3332).

JSON RPC Server and Multiplexing

This command starts a JSON RPC server and forwards all messages to the given clients:

etheno https://client1.url.com:1234/ https://client2.url.com:8545/ http://client3.url.com:8888/

  • --port or -p allows you to specify a port on which to run Etheno’s JSON RPC server (default is 8545)
  • --run-publicly allows incoming JSON RPC connections from external computers on the network
  • --debug will run a web-based interactive debugger in the event that an internal Etheno client throws an exception while processing a JSON RPC call; this should never be used in conjunction with --run-publicly
  • --master or -s will set the “master” client, which will be used for synchronizing with Etheno clients. If a master is not explicitly provided, it defaults to the first client listed.
  • --raw, when prefixed before a client URL, will cause Etheno to auto-sign all transactions and submit them to the client as raw transactions

Geth and Parity Integration

A Geth and/or Parity instance can be run as a private chain with * --geth or -go for Geth * --parity or -pa for Parity

Each will be instantiated with an autogenerated genesis block. You may provide a custom genesis.json file in Geth format using the --genesis or -j argument. The genesis used for each run will automatically be saved to the log directory (if one is provided using the --log-dir option), or it can be manually saved to a location provided with the --save-genesis option.

The network ID of each client will default to 0x657468656E6F (equal to the string etheno in ASCII). This can be overridden with the --network-id or -i option.

EIP and hard fork block numbers can be set within a custom genesis.json as usual, or they may be specified as command-line options such as --constantinople.

Differential Testing

Whenever two or more clients are run within Etheno, the differential testing plugin will automatically be loaded. This plugin checks for a variety of different discrepancies between the clients, such as gas usage differences. A report is printed when Etheno exits.

This plugin can be disabled with the --no-differential-testing option.

Truffle Integration

Truffle migrations can automatically be run within a Truffle project: etheno --truffle

Additional arguments can be passed to Truffle using --truffle-args.

Logging

By default, Etheno only prints log messages to the console with a log level defaulting to INFO. An alternative log level can be specified with --log-level or -l. You can specify a log file with the --log-file option. In addition, you can provide the path to a logging directory with --log-dir in which the following will be saved: * a complete log file including log messages at all log levels; * separate log files for each Etheno client and plugin; * the genesis file used to instantiate clients; * a subdirectory in which each client and plugin can store additional files such as test results; * a script to re-run Geth and/or Parity using the same genesis and chain data that Etheno used.

Requirements

  • Python 3.7 or newer

Optional Requirements

  • Node 16.x or newer to install various integrations
  • Ganache 7.3.2 or newer for its associated integrations
  • Truffle for its associated integrations
  • Geth and/or Parity, if you would like to have Etheno run them

Getting Help

Feel free to stop by our Slack channel for help on using or extending Etheno.

License

Etheno is licensed and distributed under the AGPLv3 license. Contact us if you’re looking for an exception to the terms.

Owner

  • Name: Crytic
  • Login: crytic
  • Kind: organization
  • Email: opensource@trailofbits.com
  • Location: New York, NY

Blockchain Security, by @trailofbits

GitHub Events

Total
  • Watch event: 9
  • Push event: 1
  • Fork event: 2
Last Year
  • Watch event: 9
  • Push event: 1
  • Fork event: 2

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 382
  • Total Committers: 14
  • Avg Commits per committer: 27.286
  • Development Distribution Score (DDS): 0.275
Past Year
  • Commits: 1
  • Committers: 1
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Evan Sultanik e****k@t****m 277
Anish Naik a****k@t****m 45
Emilio López e****z@t****m 33
Alexander Remie a****e@t****m 7
ggrieco-tob g****o@t****m 4
Dan Guido d****n@t****m 3
William Woodruff w****m@y****t 3
Rappie j****r@r****m 2
dependabot[bot] 4****] 2
Josselin j****n@t****m 2
Illia Bobyr i****r@g****m 1
James Olds j****s@t****m 1
Mike Myers 3****b 1
disconnect3d d****a@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 49
  • Total pull requests: 57
  • Average time to close issues: 21 days
  • Average time to close pull requests: 24 days
  • Total issue authors: 25
  • Total pull request authors: 14
  • Average comments per issue: 1.55
  • Average comments per pull request: 0.51
  • Merged pull requests: 40
  • Bot issues: 0
  • Bot pull requests: 12
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 1.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • ESultanik (18)
  • anishnaik (4)
  • ggrieco-tob (4)
  • rappie (2)
  • n00b21337 (1)
  • mike-myers-tob (1)
  • jackson-clerkenwell-labs (1)
  • 77ph (1)
  • htadashi (1)
  • BarrySauce (1)
  • fang19911030 (1)
  • chenrui333 (1)
  • naszam (1)
  • elenadimitrova (1)
  • cberman (1)
Pull Request Authors
  • ESultanik (18)
  • dependabot[bot] (12)
  • anishnaik (7)
  • elopez (5)
  • ggrieco-tob (4)
  • woodruffw (2)
  • rmi7 (2)
  • rappie (1)
  • ilya-bobyr (1)
  • disconnect3d (1)
  • oldsj (1)
  • nettrino (1)
  • adarshsrivastava11 (1)
  • cruzdanilo (1)
Top Labels
Issue Labels
enhancement (15) bug (5) question (1)
Pull Request Labels
dependencies (12) enhancement (10) github_actions (9) bug (6)

Dependencies

.github/workflows/docker.yml actions
  • docker/build-push-action v3 composite
  • docker/login-action v2 composite
  • docker/setup-buildx-action v2 composite
  • docker/setup-qemu-action v2 composite
.github/workflows/pip-audit.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • pypa/gh-action-pip-audit v1.0.0 composite
.github/workflows/pythonpublish.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
Dockerfile docker
  • ubuntu focal build
tests/drizzle/package.json npm
  • @nomiclabs/hardhat-ethers ^2.0.5 development
  • @nomiclabs/hardhat-waffle ^2.0.3 development
  • chai ^4.3.6 development
  • ethereum-waffle ^3.4.4 development
  • ethers ^5.6.2 development
  • ganache ^7.3.2 development
  • hardhat ^2.9.2 development
  • @openzeppelin/contracts ^2.4.0
setup.py pypi
  • Contextual *
  • Pinning *
  • TODO *
  • This *
  • eth-hash >=0.3.1,<0.4.0
  • eth-rlp <0.3.0
  • eth-utils ==1.10.0
  • flask *
  • ptyprocess *
  • pysha3 >=1.0.2
  • setuptools *
  • web3 >=3.16.4