Is it possible for a user to see the Solidity source code in a web browser?

Linxight 61 Reputation points
2020-08-18T23:19:17.137+00:00

I know that there is an API function for this, but is there an easy way for a user (who was added to a smart contract) to see the source code transparently?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,596 questions
0 comments No comments
{count} votes

Accepted answer
  1. Cale Teeter-MSFT 166 Reputation points Microsoft Employee
    2020-08-20T14:16:02.98+00:00

    In general, viewing the source code for the smart contract that would be used on the client side, can be done via contract registries. Essentially, you need to validate that at this specific address, this source matches the binary. I haven't seen a component that does this directly, but there are some that provide links for this.

    For example, here is a transaction that was done on public mainnet:

    https://etherscan.io/tx/0x4e3895eb7ba72df5727dc198e70fd88efcbc4971ad4f20e62e3be11e31c8d8a5

    If you click on the contract address in etherscan:

    19146-image.png

    Then you will see the contract and transactions done with it. You can then view the source (verified to match the binary) on the contract tab).

    19147-image.png

    We don't have a single component to do this currently, but the same thing can be created for private blockchains to allow users to verify the source that they are using it the one they assume it to be.

    2 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. SanaCMSFT-8922 301 Reputation points
    2020-08-19T11:14:34.397+00:00

    Hi @Linxight ,

    Viewing solidity code on the web browser/app through the workbench web app is not supported in Azure Blockchain Workbench.
    Let us know if you have any further queries.

    Thanks,
    Sana

    2 people found this answer helpful.