Skip to content

Commit

Permalink
Use 4byte
Browse files Browse the repository at this point in the history
  • Loading branch information
shanefontaine committed Mar 27, 2021
1 parent 9b67c93 commit 5985aa1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# four-byte
# 4byte

> Look up an Ethereum function signature by the 4 bytes of its hash
[![License](http://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/shanefontaine/four-byte/master/LICENSE)
[![NPM version](https://badge.fury.io/js/four-byte.svg)](http://badge.fury.io/js/four-byte)
[![License](http://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/shanefontaine/4byte/master/LICENSE)
[![NPM version](https://badge.fury.io/js/4byte.svg)](http://badge.fury.io/js/4byte)

## Install

```bash
npm install four-byte
npm install 4byte
```

## Getting started

```javascript
const fourByte = require('four-byte')
const fourByte = require('4byte')

const signatures = fourByte('0x51c6590a')
console.log(signatures) // ['addLiquidity(uint256)']
Expand All @@ -25,20 +25,20 @@ console.log(signatures) // ['addLiquidity(uint256)']
Install:

```bash
npm install -g four-byte
npm install -g 4byte
```

Look up a function signature:

```bash
$ four-byte 0xa9059cbb
$ 4byte 0xa9059cbb
transfer(bytes4[9],bytes5[6],int48[11])
many_msg_babbage(bytes1)
transfer(address,uint256)
```

```bash
$ four-byte 0xa9059cbb --format=json
$ 4byte 0xa9059cbb --format=json
[
"transfer(bytes4[9],bytes5[6],int48[11])",
"many_msg_babbage(bytes1)",
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ const fourByte = require('.')

const cli = meow(`
Usage
$ four-byte <hash-of-function-sig>
$ 4byte <hash-of-function-sig>
Examples
$ four-byte 0x51c6590a
$ 4byte 0x51c6590a
addLiquidity(uint256)
`, {
flags: {
Expand Down
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
{
"name": "four-byte",
"name": "4byte",
"version": "0.0.1",
"description": "Look up an Ethereum function signature by the 4 bytes of its hash",
"main": "index.js",
"bin": {
"four-byte": "bin/four-byte",
"four_byte": "bin/four-byte"
"4byte": "bin/4byte"
},
"scripts": {
"test": "tape test/*.js",
"lint": "standard --fix *.js test/*.js"
},
"repository": {
"type": "git",
"url": "https://github.com/shanefontaine/four-byte"
"url": "https://github.com/shanefontaine/4byte"
},
"bugs": {
"url": "https://github.com/shanefontaine/four-byte/issues"
"url": "https://github.com/shanefontaine/4byte/issues"
},
"homepage": "https://github.com/shanefontaine/four-byte",
"homepage": "https://github.com/shanefontaine/4byte",
"author": {
"name": "Shane Fontaine",
"email": "[email protected]",
"url": "https://shane.dev/"
},
"license": "MIT",
"url": "https://github.com/shanefontaine/four-byte/blob/master/LICENSE",
"url": "https://github.com/shanefontaine/4byte/blob/master/LICENSE",
"dependencies": {
"meow": "^5.0.0",
"node-fetch": "2.6.1"
Expand Down

0 comments on commit 5985aa1

Please sign in to comment.