https://github.com/shanefontaine/4byte
💻 Look up an Ethereum function signature by the 4 bytes of its hash
https://github.com/shanefontaine/4byte
4byte blockchain eth ethereum function-signature hash keccack sha3
Last synced: 10 months ago
JSON representation
💻 Look up an Ethereum function signature by the 4 bytes of its hash
- Host: GitHub
- URL: https://github.com/shanefontaine/4byte
- Owner: shanefontaine
- License: mit
- Created: 2021-03-27T05:44:28.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2022-03-24T10:47:21.000Z (about 4 years ago)
- Last Synced: 2025-02-28T02:11:05.747Z (over 1 year ago)
- Topics: 4byte, blockchain, eth, ethereum, function-signature, hash, keccack, sha3
- Language: JavaScript
- Homepage:
- Size: 79.1 KB
- Stars: 20
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 4byte
> Look up an Ethereum function signature by the 4 bytes of its hash
[](https://raw.githubusercontent.com/shanefontaine/4byte/master/LICENSE)
[](http://badge.fury.io/js/4byte)
## Install
```bash
npm install 4byte
```
## Getting started
```javascript
const fourByte = require('4byte')
const signatures = fourByte('0x51c6590a')
console.log(signatures) // ['addLiquidity(uint256)']
```
## CLI
Install:
```bash
npm install -g 4byte
```
Look up a function signature:
```bash
$ 4byte 0xa9059cbb
transfer(bytes4[9],bytes5[6],int48[11])
many_msg_babbage(bytes1)
transfer(address,uint256)
```
```bash
$ 4byte 0xa9059cbb --format=json
[
"transfer(bytes4[9],bytes5[6],int48[11])",
"many_msg_babbage(bytes1)",
"transfer(address,uint256)"
]
```
## Test
```bash
npm test
```
## License
[MIT](LICENSE)