# Verify with Chiliz Block Explorer

[Chiliz Block Explorer](https://scan.chiliz.com/) is a service built by Blockscout. You can therefore rely on [their documentation](https://docs.blockscout.com/) for your everyday use.

Blockscout provides several ways to verify your smart contract on Chiliz Chain:

* For most contracts: using their verification feature.
* For more complex contracts: using command-line tools, such as Hardhat.
* For easy contracts: using their API.

See Blockscout's [documentation on contract verification](https://docs.blockscout.com/devs/verification).

## Using the Chiliz Block Explorer verification feature

Chiliz Block Explorer provides a contract verification interface for Chiliz Mainnet at \
<https://scan.chiliz.com/contract-verification>.\
It is also documented here: <https://docs.blockscout.com/devs/verification/blockscout-ui>

{% hint style="info" %}
You can also verify contract on Spicy Testnet with this interface:\
<https://spicy-explorer.chiliz.com/>
{% endhint %}

{% hint style="info" %}
For multi-file contracts, ensure your code has been flattened before uploading.

For instance, if you use Remix IDE, you can right click on your compiled `contract-XYZ.sol` contract file in the File Explorer, and choose the "Flatten" option. \
Then, download the resulting file (named  `contract-XYZ_flattened.sol` in order to upload it to the verification form.
{% endhint %}

Steps:

1. In the "Contract address to verify" field, insert the address of the smart contract.
2. Select the license that you want to apply to your contract. Because it is not obvious what this means, [here is a quick explainer](https://choosealicense.com/) on open-source licenses.

<figure><img src="https://3400301555-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4L7rBH2rmyoBTn93MSdx%2Fuploads%2Fjpgqz1VIRBFCXBhesBHn%2Fimage.png?alt=media&#x26;token=7762fc9d-f13f-4dd1-9050-282ff9878d63" alt=""><figcaption></figcaption></figure>

3. Choose the verification method.\
   The most simple method will be to provide a flattened version of your Solidity contract, or "Solidity (Single file)".
4. Choose the compiler version (Chiliz Chain supports versions up to v0.8.24) and EVM version (Chiliz Chain supports versions up to the Shangai version).

<figure><img src="https://3400301555-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4L7rBH2rmyoBTn93MSdx%2Fuploads%2FTg0pnnRcwbIyOiNmcp0g%2Fimage.png?alt=media&#x26;token=1a0db09f-fb32-409a-8b92-79d0bc28364c" alt=""><figcaption></figcaption></figure>

5. Finally, in "Contract Code" field, paste the smart contract code that you used to originally compile the smart contract, and click "Verify & publish".

<figure><img src="https://3400301555-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4L7rBH2rmyoBTn93MSdx%2Fuploads%2FoGPEoc72MxBm3yu3wfpv%2Fimage.png?alt=media&#x26;token=36773b3e-2dbe-4ffb-b3df-4421aa355358" alt=""><figcaption></figcaption></figure>

If successful, your contract will be clearly labeled as verified, notably with a green check. The block explorer will make its source code visible and enable all interactive features.

<figure><img src="https://3400301555-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4L7rBH2rmyoBTn93MSdx%2Fuploads%2FlhUloeLUzzjA88YOzJKk%2Fimage.png?alt=media&#x26;token=2971fc65-be9e-4235-b87b-6378289fe0d1" alt="" width="563"><figcaption></figcaption></figure>

## Using command-line tools

Blockscout's own documentation features [detailed guides](https://docs.blockscout.com/devs/verification) on how to use command-line tools for verification. This is particularly useful if you're already want to automate contract verification in your development environment.

You can read their guides on deploying & verifying with:

* [Hardhat](https://docs.blockscout.com/devs/verification/hardhat-verification-plugin)
* [Foundry](https://docs.blockscout.com/devs/verification/foundry-verification)
* [Sourcify](https://docs.blockscout.com/devs/verification/contracts-verification-via-sourcify)
* [Remix](https://docs.blockscout.com/devs/verification/remix-verification)
* ... and more!

## Using Blockscout's API

Blockscout has a dedicated contract verification API:

{% embed url="<https://docs.blockscout.com/devs/verification/blockscout-smart-contract-verification-api>" %}

The API endpoints are:

* Chiliz Mainnet: [`https://scan-api.chiliz.com/`](https://scan-api.chiliz.com/)
* Spicy Testnet: [`https://spicy-explorer-api.chiliz.com/`](https://spicy-explorer-api.chiliz.com/)
