Socket
Socket
Sign inDemoInstall

abi2signature

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abi2signature

abi transform to function signature


Version published
Weekly downloads
12
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

abi2signature

Generates the Ethereum ABI 4 byte signatures if you provide the ABI or the function signature.

Installation

$ npm i -g abi2signature

Usage examples

From stdin
$ abi2signature < cryptokitties-abi.json
0x06fdde03 -> [ function ] name
0x095ea7b3 -> [ function ] approve
0x18160ddd -> [ function ] totalSupply
0x23b872dd -> [ function ] transferFrom
0x313ce567 -> [ function ] decimals
0x475a9fa9 -> [ function ] issueTokens
0x70a08231 -> [ function ] balanceOf
0x95d89b41 -> [ function ] symbol
0xa9059cbb -> [ function ] transfer
0xdd62ed3e -> [ function ] allowance
0xddf252ad -> [ event ] Transfer
0x8c5be1e5 -> [ event ] Approval
From function string
$ abi2signature func2sig "receive(address)"
receive(address) -> 0x9d01174f
From ABI string
$ abi2signature string2sig '[{...your abi...}]' 
Vyper one liner
$ vyper -f abi contracts/uniswap_exchange.vy | abi2sig
Solidity one liner

Solidity outputs a header so I could not find a way to do this

$ solc --abi --pretty-json contracts/ballot.sol | abi2signature
======= contracts/ballot.sol:Crowdfunding =======
...

Keywords

FAQs

Package last updated on 07 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc