An open API service indexing awesome lists of open source software.

https://github.com/0xdaebak/solselector

⚓ Get The 4 byte Selector/Method Signature of any function
https://github.com/0xdaebak/solselector

0xdaebak assembly hash javascript keccak256 methodsig selector solidity yul

Last synced: about 2 months ago
JSON representation

⚓ Get The 4 byte Selector/Method Signature of any function

Awesome Lists containing this project

README

          

# solselector

![](https://img.shields.io/npm/v/solselector?color=red&style=for-the-badge) ![](https://img.shields.io/github/package-json/v/0xdaebak/solselector?color=green&style=for-the-badge) ![](https://img.shields.io/badge/0xdaebak-alphaLeaks-red?style=for-the-badge)

⚓ Get The 4 byte Selector/Method Signature of any function

## Installation

Install dependencies

```bash
npm install solselector
```

## Key Functions

```javascript
let selector = require("solselector");

//full keccak256 hash
selector.keccak256("balanceOf()");

//get 4byte selector
selector.getSelector("balanceOf()");

//get 4byte selector - multi arguments
selector.getMultiSelector("balanceOf()", "transferFrom(address,uint256)");

//get 4byte selector - multi array arguments
selector.getMultiSelector(["balanceOf()", "transferFrom(address,uint256)", "deposit()"]);

```

## Authors

- [@0xdaebak](https://www.github.com/0xdaebak)

## License

![MIT License](https://img.shields.io/github/license/0xdaebak/solselector?style=for-the-badge)