Skip to main content

An all-in-one Ethereum SDK and command-line tool written in python.

Project description

Peth

Peth is an all-in-one Ethereum SDK and command-line tool, written in Python. It is designed for developers, smart contract auditors, web3 security researchers, and anyone interested in interacting with EVM-compatible chains with ease.

➜ peth


     ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄  ▄         ▄ 
    ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌       ▐░▌
    ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀▀▀  ▀▀▀▀█░█▀▀▀▀ ▐░▌       ▐░▌
    ▐░▌       ▐░▌▐░▌               ▐░▌     ▐░▌       ▐░▌
    ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄▄▄      ▐░▌     ▐░█▄▄▄▄▄▄▄█░▌
    ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌     ▐░▌     ▐░░░░░░░░░░░▌
    ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀      ▐░▌     ▐░█▀▀▀▀▀▀▀█░▌
    ▐░▌          ▐░▌               ▐░▌     ▐░▌       ▐░▌
    ▐░▌          ▐░█▄▄▄▄▄▄▄▄▄      ▐░▌     ▐░▌       ▐░▌
    ▐░▌          ▐░░░░░░░░░░░▌     ▐░▌     ▐░▌       ▐░▌
     ▀            ▀▀▀▀▀▀▀▀▀▀▀       ▀       ▀         ▀ 
                                                        

                           -- https://github.com/lmy375

Welcome to the peth shell. Type `help` to list commands.

peth > 

Features include:

  • An Etherscan-compatible blockchain explorer interface
  • ABI encoding/decoding capabilities
  • An EVM Bytecode disassembler
  • Common DApp contract tools
  • And more...

Documentation

English

中文

Installation

From pypi

➜ pip install peth
➜ peth

From github

➜ pip install git+https://github.com/lmy375/peth
➜ peth

From source

➜ git clone https://github.com/lmy375/peth
➜ cd peth
➜ pip -r requirements.txt
➜ python main.py

Quick Usage

Command-line mode:

➜ peth -h

Console mode:

 peth
Welcome to the peth shell. Type `help` to list commands.

peth > help

Documented commands (type help <topic>):
========================================
4byte             contract         estimate_gas  name       safe      tx_replay
abi4byte          debank           eth_call      open       send_tx   txs      
abi_decode        debug            exit          oracle     sender    url      
abi_encode        decompile        factory       owner      sh        verify   
address           deth             graph         pair       signer    view     
aes               diff             help          price      status  
aml               diffasm          idm           proxy      storage 
call              disasm           int           proxy_all  time    
chain             download_json    ipython       py         timelock
common_addresses  download_source  keccak256     rpc_call   tx      
config            erc20            log           run        tx_raw  

peth >

SDK mode:

 ipython
Python 3.10.0 (default, Oct 29 2021, 11:06:42) [Clang 13.0.0 (clang-1300.0.29.3)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.28.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from peth import Peth

In [2]: p = Peth.get_or_create('eth')

In [3]: p.call_contract('0xdAC17F958D2ee523a2206206994597C13D831ec7', 'name')
Out[3]: 'Tether USD'

In [4]: p.call_contract('0xdAC17F958D2ee523a2206206994597C13D831ec7', 'name()->(string)')
Out[4]: 'Tether USD'

Contributing

Help is always appreciated! Feel free to open an issue if you find a problem, or a pull request if you've solved an issue.

Please check out the Contribution Guide prior to opening a pull request.

Buy me a coffee

Send any tokens to 0x2aa75a41805E47eCd94fbBaD84eeF6d1BF21a019

License

This project is licensed under the AGPL v3 license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

peth-1.0.10.tar.gz (117.4 kB view details)

Uploaded Source

Built Distribution

peth-1.0.10-py3-none-any.whl (143.6 kB view details)

Uploaded Python 3

File details

Details for the file peth-1.0.10.tar.gz.

File metadata

  • Download URL: peth-1.0.10.tar.gz
  • Upload date:
  • Size: 117.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for peth-1.0.10.tar.gz
Algorithm Hash digest
SHA256 15c1f2585084f93710877904b7c0a145c6f1c065c27cec5377acb1054a5a1d27
MD5 0b31ef72dcdf71f0daa64beb0ec81e07
BLAKE2b-256 bb6f9f87a16d92bb123b6baca023ec296f1dfa2b654dc537feb1f6f09823f0ad

See more details on using hashes here.

File details

Details for the file peth-1.0.10-py3-none-any.whl.

File metadata

  • Download URL: peth-1.0.10-py3-none-any.whl
  • Upload date:
  • Size: 143.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for peth-1.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 56f10428c6215f37df9412a29381b838e0cd354d4f0d6c41f0702fa88c7396fd
MD5 2577d538343af31ee142f63650ed2327
BLAKE2b-256 8debbbd9c339ce6ca7c14041f5e8d7ea7848c7acb03a0d132e95d58714102ed4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page