ether-abi

command module
v0.0.0-...-a14333a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2019 License: MIT Imports: 7 Imported by: 0

README

ether-abi

A cli tool for decode & encode Ethereum ABI

Installation

go get github.com/outprog/ether-abi

Examples

ABI must json file.

  • abi.json
[
    {
        "constant": false,
        "inputs": [
            {
                "name": "wad",
                "type": "uint256"
            }
        ],
        "name": "withdraw",
        "outputs": [],
        "payable": false,
        "stateMutability": "nonpayable",
        "type": "function"
    }
]
encode
ether-abi --file abi.json --type encode --method setAllowance --args \[0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.0x0f5d2fb29fb7d3cfee444a200298f468908cc942\],0x2240dab907db71e64d3e0dba4800c83b5c502d4e 

notice:

  • \ before [,]
  • splite . in []
decode

TODO

Development

go get -d github.com/outprog/ether-abi
cd $GOPATH/src/github.com/outprog/ether-abi
sh dep.sh

Run example:

go run ./cli.go --file abi.example.json --type encode --method setAllowance --args \[0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.0x0f5d2fb29fb7d3cfee444a200298f468908cc942\],0x2240dab907db71e64d3e0dba4800c83b5c502d4e
#0x46920bad00000000000000000000000000000000000000000000000000000000000000400000000000000000000000002240dab907db71e64d3e0dba4800c83b5c502d4e0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000f5d2fb29fb7d3cfee444a200298f468908cc942

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
dep
crypto/bn256
Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
crypto/bn256/cloudflare
Package bn256 implements a particular bilinear group at the 128-bit security level.
Package bn256 implements a particular bilinear group at the 128-bit security level.
crypto/bn256/google
Package bn256 implements a particular bilinear group.
Package bn256 implements a particular bilinear group.
crypto/secp256k1
Package secp256k1 wraps the bitcoin secp256k1 C library.
Package secp256k1 wraps the bitcoin secp256k1 C library.
crypto/sha3
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL