Search code examples
solanasolana-web3js

How can I see the contract code in Solana?


On Ethereum, I can go to the Etherscan link for a contract address and view the code and Read/Write ABIs. I can't seem to find this on Solana Explorer, Solscan, or anything. What's the best way for me to see IDL signatures and/or the Rust code in the functions?

Thanks


Solution

  • Like on Ethereum, some programs are submitted and verified. This is done using the Anchor verification process.

    An example can be found with the Serum V3 program.

    The Anchor Verified badge links to the actual source code of the program, where you can get the IDL, Anchor's version of ABI.

    Note: Also like Ethereum, not all programs are verified. This feature is rather new, and still being adopted. I hope to see more programs use this feature in the future.