Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cleanunicorn/abi2signature
Use the ABI of a smart contract to find out the function signatures
https://github.com/cleanunicorn/abi2signature
ethereum ethereum-contract solidity
Last synced: 3 months ago
JSON representation
Use the ABI of a smart contract to find out the function signatures
- Host: GitHub
- URL: https://github.com/cleanunicorn/abi2signature
- Owner: cleanunicorn
- Created: 2017-12-11T07:45:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-07T20:29:56.000Z (over 5 years ago)
- Last Synced: 2024-03-27T02:45:22.048Z (3 months ago)
- Topics: ethereum, ethereum-contract, solidity
- Language: JavaScript
- Size: 64.5 KB
- Stars: 53
- Watchers: 4
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Lists
- awesome-solidity - cleanunicorn/abi2signature - Use the ABI of a smart contract to find out the function signatures. (Tools)
- awesome-solidity - cleanunicorn/abi2signature - Use the ABI of a smart contract to find out the function signatures. (Tools)
- awesome-solidity - cleanunicorn/abi2signature - Use the ABI of a smart contract to find out the function signatures. (Tools)
- awesome-solidity - cleanunicorn/abi2signature - Use the ABI of a smart contract to find out the function signatures. (Tools)
README
# abi2signature
Generates the Ethereum ABI 4 byte signatures if you provide the ABI or the function signature.
## Installation
```console
$ npm i -g abi2signature
```## Usage examples
#### From stdin
```console
$ 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
```console
$ abi2signature func2sig "receive(address)"
receive(address) -> 0x9d01174f
```#### From ABI string
```console
$ abi2signature string2sig '[{...your abi...}]'
```#### Vyper one liner
```console
$ vyper -f abi contracts/uniswap_exchange.vy | abi2signature
```#### Solidity one liner
Solidity outputs a header so I could not find a way to do this
```console
$ solc --abi --pretty-json contracts/ballot.sol | abi2signature
======= contracts/ballot.sol:Crowdfunding =======
...
```