https://github.com/solidstate-network/hardhat-selector-uploader
🗂️ Upload local function selectors to the Ethereum Selector Database 🗃️
https://github.com/solidstate-network/hardhat-selector-uploader
eth ether ethereum function-selector hardhat plugin wow
Last synced: 8 days ago
JSON representation
🗂️ Upload local function selectors to the Ethereum Selector Database 🗃️
- Host: GitHub
- URL: https://github.com/solidstate-network/hardhat-selector-uploader
- Owner: solidstate-network
- License: mit
- Created: 2022-01-01T03:58:41.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2025-09-18T18:10:13.000Z (4 months ago)
- Last Synced: 2025-10-02T21:42:43.216Z (4 months ago)
- Topics: eth, ether, ethereum, function-selector, hardhat, plugin, wow
- Language: TypeScript
- Size: 497 KB
- Stars: 2
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Hardhat Selector Uploader
Calculate the function selectors found in all local contracts and upload them to the [4byte Directory](https://www.4byte.directory/) Ethereum Signature Database.
> Versions of this plugin prior to `2.0.0` were released as `@solidstate/hardhat-4byte-uploader`.
## Installation
```bash
npm install --save-dev @solidstate/hardhat-selector-uploader
# or
pnpm add -D @solidstate/hardhat-selector-uploader
```
## Usage
Load plugin in Hardhat config:
```javascript
import hardhatSelectorUploader from '@solidstate/hardhat-selector-uploader';
const config: HardhatUserConfig = {
plugins: [
hardhatSelectorUploader,
],
selectorUploader: {
... // see table for configuration options
},
};
```
Add configuration under the `selectorUploader` key:
| option | description | default |
| -------------- | ----------------------------------------------------------------------------------------------------------------- | ------- |
| `runOnCompile` | whether to automatically upload selectors during compilation (ignored if Hardhat detects a CI server environment) | `false` |
```javascript
selectorUploader: {
runOnCompile: true,
}
```
Run the included Hardhat task manually:
```bash
npx hardhat upload-selectors
# or
pnpm hardhat upload-selectors
```
## Development
Install dependencies via pnpm:
```bash
pnpm install
```
Setup Husky to format code on commit:
```bash
pnpm prepare
```