> For the complete documentation index, see [llms.txt](https://docs.chainlens.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chainlens.com/features/source-code-verification.md).

# Source Code Verification

## Video Walkthrough

The below video demonstrates how to upload smart contract source code and interact with the smart contracts from within Chainlens.

{% embed url="<https://www.youtube.com/watch?v=52CUs7aQB8Q>" %}
Overview of source code verification in Chainlens
{% endembed %}

## Prerequisites

1. You should have a smart contract written in Solidity, compiled, and deployed to your preferred EVM-compatible network. You should be able to locate the contract in Chainlens using the contract's address.
2. You have the compiled source code and metadata. [Read more about contract metadata. ](https://docs.soliditylang.org/en/v0.8.17/metadata.html)

## Getting the Contract Metadata

1. Using `solc --metadata` command as explained in the [solidity documentation](https://docs.soliditylang.org/en/v0.8.17/metadata.html).&#x20;
2. The contracts metadata can be found in the `artifacts/build-info/` directory as a .json file for hardhat projects.
3. Truffle adds the contract's compiled files in the `build/contracts/` folder.

## Source Code Verification

On the view of the contract in Chainlens click on the sources tab.

\
From the sources tab, upload the contract's solidity source code and the generated metadata.

<figure><img src="/files/cXyRfEykqQyT6druJPNr" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/RlSWoHdIAzdaClZr0tCz" alt=""><figcaption></figcaption></figure>

The source code verification status will be changed, and the contract's source codes and ABI will be visible after successful verification.

<figure><img src="/files/fC7fhP7HmaIjW4VWEXAl" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/XjwdHYcF9vA96mQY7HCJ" alt=""><figcaption></figcaption></figure>

## Contract Interaction

You can now interact directly with the contract in Chainlens via the read and write tabs in the UI.

<br>

<figure><img src="/files/rCbSHSt8GR00qlvsIzhe" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/fFDdhBMUrOKHMj1cC1j1" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/NhrqXPyiC0jEAcErYtTw" alt=""><figcaption></figcaption></figure>
