0

I have deployed a smart contract on Ethereum. When I triggered it, function name and params were displayed on etherscan. How can I hidden these infomation? enter image description here

kasuki
  • 1
  • 1

1 Answers1

1

Etherscan uses a dictionary that translates the function signature to a function name (in your case 0x38ed1739 to swapExactTokensForTokens(uint256,uint256,address[],address,uint256)).

If you don't want them to translate the function name, you'll need to rename your contract functions (it's definition and all places that call them) to some gibberish such as kdjgklfdjiwefw(uint256,uint256,address[],address,uint256).

Be aware that external contracts might want to call your functions by their name that they expect (such as swapExactTokensForTokens) and they will not be able to if a function with this name doesn't exist.

If you want to prohibit Etherscan showing the translations but NOT rename your functions - there's currently no way to do that.

Petr Hejda
  • 40,554
  • 8
  • 72
  • 100
  • Is the dictionary public? – hliu Jun 04 '21 at 08:59
  • @hliu The specific dictionary that Etherscan uses - probably not. But you can make your own by scanning ABI (or source codes) of different contracts. – Petr Hejda Jun 04 '21 at 09:06
  • Thanks for reply. Scanning all the contracts' source code seems a lot of work:) Does that mean in that way sometimes there may be some newly-created contracts which Etherscan cannot do the mapping to function name because not scanning in time? – hliu Jun 04 '21 at 09:20
  • I don't have the data to verify this, but it seems like a possibility. – Petr Hejda Jun 04 '21 at 09:31