# Sourcify Verification

Along with contract verification through a flattened source file (the default option in Blockscout), a [Sourcify](https://sourcify.dev/) API verification option is also available. Projects who want to use this feature need to set the following [ENV variables](https://github.com/dominant-strategies/quaiscan-docs/blob/main/setup-and-run-blockscout/env-variables/README.md#sourcify).

```
SOURCIFY_INTEGRATION_ENABLED=true
SOURCIFY_SERVER_URL=https://sourcify.dev/server
SOURCIFY_REPO_URL=https://repo.sourcify.dev/select-contract/
```

## Usage Example

Verify your contract using Sourcify:

1\) Go to the Verify contract page *(Other -> Verify contract)*

<figure><img src="/files/DjOlrYHeqmS5niWJLzQQ" alt=""><figcaption><p>Go to Other -> verify contract</p></figcaption></figure>

2\) Enter the deployed contract address, select Solidity (Sourcify) from the Verification method dropdown.

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

3\) Drag and drop (or click the button to add files from your computer) all *.sol* files used by the target contract you want to verify and the *.json* file containing the contract's metadata. For example, hardhat stores the outputs of the compilations under the `artifacts/build-info/` folder inside the project. [More info is available here](https://docs.sourcify.dev/docs/metadata/).

If your contract has linked libraries you should also drag & drop *.json* files *\_for those libraries. Once all files are added, start verification by clicking the \_Verify & Publish* button.

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

5\) After several seconds your contract should be verified through Sourcify's API (If verification fails, you will see the reason in the dropzone). Verification metadata will be saved in the Quaiscan DB and you will see the verified contract page with the link to the same metadata in the [Sourcify contract repository](https://repo.sourcify.dev/contracts/full_match/100/).

### Example Contract:

* Contract [verified in Blockscout](https://gnosis.blockscout.com/address/0x4f15a6e74CFC2F80D5967a8aB75F3c83D8043cF4?tab=contract)
* The same contract in the [Sourcify contract repository](https://repo.sourcify.dev/contracts/full_match/100/0x4f15a6e74CFC2F80D5967a8aB75F3c83D8043cF4/).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.quaiscan.io/developer-support/smart-contract-verification/contracts-verification-via-sourcify.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
