ethabi

ethabi is a Rust library designed for encoding and decoding Ethereum's ABI (Application Binary Interface) calls and their outputs. The ABI defines how functions are called and how data is passed in Ethereum smart contracts, ensuring that function calls return data in the expected format.

Note to Readers

This project is not actively maintained. Consider these alternatives:

Overview

An Ethereum smart contract is bytecode (EVM) on the Ethereum blockchain. A contract may contain several functions, and the ABI is necessary to specify which function to invoke and ensure the function returns data in the expected format. Read more

This library provides the functionality to encode function calls and decode their output.

Documentation

Installation

cargo install ethabi-cli

Usage

Ethereum ABI coder.
  Copyright 2016-2017 Parity Technologies (UK) Limited
 
Usage:
    ethabi encode function \<abi-path\> \<function-name-or-signature\> [-p \<param\>]... [-l | --lenient]
    ethabi encode params [-v \<type\> \<param\>]... [-l | --lenient]
    ethabi decode function \<abi-path\> \<function-name-or-signature\> \<data\>
    ethabi decode params [-t \<type\>]... \<data\>
    ethabi decode log \<abi-path\> \<event-name-or-signature\> [-l \<topic\>]... \<data\>
    ethabi -h | --help
 
Options:
    -h, --help         Display this message and exit.
    -l, --lenient      Allow short representation of input params.
 
Commands:
    encode             Encode ABI call.
    decode             Decode ABI call result.
    function           Load function from json ABI file.
    params             Specify types of input params inline.
    log                Decode event log.

Similar Projects