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

https://github.com/wmitsuda/truffle-plugin-register-methods

Truffle plugin for registering contract functions in Parity Method Registry
https://github.com/wmitsuda/truffle-plugin-register-methods

ethereum solidity truffle truffle-framework web3

Last synced: about 1 year ago
JSON representation

Truffle plugin for registering contract functions in Parity Method Registry

Awesome Lists containing this project

README

          

# Overview

> 🏆 1st Place Winner of TruffleCon 2019 Hackathon!!! 🎉🎉🎉

This plugin allows truffle to scan your contract build artifacts for non-constant methods and register them in the Parity Signature Registry smart contract.

By doing this, web3 browsers can use this information to show some user friendly info to the user when calling contract methods, like saying it is calling the function **HELLO** instead of doing an enigmatic **CONTRACT INTERACTION**.

![metamask](docs/overview.png)

Currently Metamask uses this registry as explained in https://metamask.github.io/metamask-docs/Best_Practices/Registering_Function_Names, but there is too much friction. This plugin aims to incentivize people to start registering their contract functions.

# TLDR

Add:

```
plugins: ["truffle-plugin-register-methods"]
```

to `truffle-config.js`, then run:

```sh
$ npm i -D truffle-plugin-register-methods
$ export TRUFFLE_PLUGIN_MNEMONIC=""
$ npx truffle run register-methods
```

# Usage

For a more detailed explanation, see [usage](USAGE.md).