# Registering Your Contract's Method Names
MetaMask uses the Parity on-chain registry of function signatures to display method names on the confirm screen.
For many common method names, like token methods, this allows MetaMask to successfully look up the method names by their method signature (opens new window).
However, sometimes you're using a method that is not in that on-chain registry, and MetaMask will simply display Contract Interaction
to the user.
To add your contract's function names to this registry so it shows in the MetaMask interface, follow the below steps.
Go to the Mainnet Parity signature registration contract on etherscan (opens new window)
Connect MetaMask
Use etherscan's write contract feature to input the string value (without quotes or spaces) to the register function
For example:
getOwners()
execTransaction(address,uint256,bytes,uint8,uint256,uint256,uint256,address,address,bytes)
Click "write"
Approve the transaction in MetaMask (you only pay gas)
# Verify
ethers.utils.keccak256('getOwners()') => 0xa0e67e2bdc0a6d8a09ccd6c353c9df590807ad66ff5e6630c4f31a86dfa84821
- Take the first 10 characters:
0xa0e67e2b
- Input them into this demo app (opens new window) that checks the on-chain registry
- Mainnet or Rinkeby only
# Using remix.ethereum.org
- Paste the contract code from bokky's blog post (opens new window) into remix (opens new window).
- Set the correct compiler version based on the contract.
- Use remix's write functionality to add to the registry.
- You can look at the FUNCTIONHASHES section on remix (opens new window) by loading the signature registry contract, press the "details" button on the compile tab.
# Using eth-method-registry
- You can also use the signature registry (opens new window) deployed on Rinkeby
eth-method-registry
(opens new window) is used to lookup methods in MetaMask.- Note that MetaMask reads from the Mainnet
eth-method-registry
endpoint, regardless of user's network. - For more details, see this StackExchange answer (opens new window).