Search code examples
nearprotocol

How to find out how to interract with a smart contract on NEAR? Where to see its source or byte code?


Having checked 2 main NEAR explorers, the official one and nearscan, I haven't found neither any way to see the byte code and source code of smart contracts on them, nor ability to interract with a smart contract, nor check what functions a smart contract has. On any Ethereum Explorer, and on a few others, all of this is possible.

Or perhaps I've missed something?

Is it correct that on NEAR explorers neither of the abovementioned features exist?


Solution

  • very good question.

    You can use "Stats Gallery", this tool let you see Stats from an account (Or contract - which is an account with a contract deployed).

    But let you interact with the Contract too.

    https://stats.gallery/mainnet/nit.globaledu.near/contract?t=week

    This is an example, you can see the functions of my "Feedback Contract". Instead of this you can add a Testnet contract and try to call some functions, maybe the next one:

    https://stats.gallery/testnet/alpha.neatar.testnet/contract?t=week

    And the source code of the tool is here, just in case you want to know exactly how is does:

    https://github.com/NEARFoundation/stats.gallery/blob/90c76d452bdb8ce12a7b1a4675df453f437494cc/src/composables/contract/useContract.ts

    Saludos