near-explorer icon indicating copy to clipboard operation
near-explorer copied to clipboard

Display more information about the deployed contract on Account Details page

Open frol opened this issue 2 years ago • 0 comments

Story

As a developer who inspects an account with a contract, I want to understand what are the interfaces the contract has so I can have some ideas about the purpose of the contract and its APIs.

We have been talking about defining metadata API for contracts, but it is just a convention and it is not ready yet. We can inspect the method names from Wasm file, and that would be already a good starting point: https://github.com/near/near-cli/issues/849

Acceptance Criteria

  • [ ] Extract the method names from the Wasm binary downloaded from RPC on the backend side and cache the result based on the contract hash in memory (we have 18k unique contracts on testnet and 1k unique contracts on mainnet, so that should not consume any noticeable amount of RAM, and even if that is the case, we can introduce some cache invalidation)
  • [ ] Make sure that the extraction of method names does not incur a security threat
  • [ ] Expose the method names on the Account Details page
  • [ ] Mobile ok
  • [ ] Tested

frol avatar Oct 07 '21 15:10 frol