> For the complete documentation index, see [llms.txt](https://docs.chiliz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chiliz.com/fr/developper/notions-de-base/verifier-un-smart-contract/verifier-avec-chiliz-block-explorer.md).

# Vérifier avec Chiliz Block Explorer

Vérifiez des smart contracts sur Chiliz Chain via Chiliz Block Explorer (Blockscout) en utilisant le formulaire web, le plugin Hardhat, ou l'API Blockscout.

[Chiliz Block Explorer](https://scan.chiliz.com/) est un service créé par Blockscout. Vous pouvez donc vous appuyer sur [leur documentation](https://docs.blockscout.com/) pour votre utilisation quotidienne.

Blockscout propose plusieurs façons de vérifier votre smart contract sur Chiliz Chain :

* Pour la plupart des contrats : en utilisant leur fonctionnalité de vérification.
* Pour les contrats plus complexes : en utilisant des outils en ligne de commande, tels que Hardhat.
* Pour les contrats simples : en utilisant leur API.

Consultez la [documentation de Blockscout sur la vérification de contrats](https://docs.blockscout.com/devs/verification).

## Utiliser la fonctionnalité de vérification de Chiliz Block Explorer

Chiliz Block Explorer propose une interface de vérification de contrats pour le Mainnet de Chiliz à l'adresse\
<https://scan.chiliz.com/contract-verification>.\
Elle est également documentée ici : <https://docs.blockscout.com/devs/verification/blockscout-ui>

{% hint style="info" %}
Vous pouvez également vérifier un contrat sur le Spicy Testnet avec cette interface :\
<https://spicy-explorer.chiliz.com/>
{% endhint %}

{% hint style="info" %}
Pour les contrats multi-fichiers, assurez-vous que votre code a été aplati avant le téléversement.

Par exemple, si vous utilisez Remix IDE, vous pouvez faire un clic droit sur votre fichier de contrat compilé `contract-XYZ.sol` dans l'Explorateur de fichiers, et choisir l'option "Flatten".\
Téléchargez ensuite le fichier résultant (nommé `contract-XYZ_flattened.sol`) afin de le téléverser dans le formulaire de vérification.
{% endhint %}

Étapes :

1. Dans le champ "Contract address to verify", insérez l'adresse du smart contract.
2. Sélectionnez la licence que vous souhaitez appliquer à votre contrat. Parce qu'il n'est pas évident de savoir ce que cela signifie, [voici un bref explicatif](https://choosealicense.com/) sur les licences open-source.

<figure><img src="https://717588929-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWWfo5F0mDNuaj9Q0zciq%2Fuploads%2F91ZvOpKcWMN3BiEn8r00%2Fimage.png?alt=media&amp;token=67001739-a502-448e-aa90-9a6a5d2742a3" alt=""><figcaption></figcaption></figure>

3. Choisissez la méthode de vérification.\
   La méthode la plus simple consistera à fournir une version aplatie de votre contrat Solidity, ou "Solidity (Single file)".
4. Choisissez la version du compilateur (Chiliz Chain prend en charge les versions jusqu'à v0.8.30) et la version EVM (Chiliz Chain prend en charge les versions jusqu'à la version Prague).

<figure><img src="https://717588929-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWWfo5F0mDNuaj9Q0zciq%2Fuploads%2FdVS5A5ulvz3QoH2yXUji%2Fimage.png?alt=media&amp;token=916914a6-3c4f-4b05-a5f8-9f6900a9a50c" alt=""><figcaption></figcaption></figure>

5. Enfin, dans le champ "Contract Code", collez le code du smart contract que vous avez utilisé pour compiler originellement le smart contract, et cliquez sur "Verify & publish".

<figure><img src="https://717588929-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWWfo5F0mDNuaj9Q0zciq%2Fuploads%2FkAHvcf3JspPZM5EDG50N%2Fimage.png?alt=media&amp;token=fbd204d8-f20d-474c-be35-5eddac572eab" alt=""><figcaption></figcaption></figure>

En cas de succès, votre contrat sera clairement marqué comme vérifié, notamment avec une coche verte. L'explorateur de blocs rendra son code source visible et activera toutes les fonctionnalités interactives.

<figure><img src="https://717588929-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWWfo5F0mDNuaj9Q0zciq%2Fuploads%2F029Puwocp5D7pMVogB4N%2Fimage.png?alt=media&amp;token=491e1d24-e734-4343-9dcc-38ca6a131cbc" alt="" width="563"><figcaption></figcaption></figure>

Par exemple, le Fan Token $PSG est déployé en tant que contrat proxy, dont le contrat d'implémentation vérifié est visible ici sur le Chiliz Block Explorer (remarquez la coche verte) :

{% embed url="<https://scan.chiliz.com/address/0xeC991a3FA1bfB4835A1D22f3df05c2CED5B7bF6d?tab=contract>" %}

## Utiliser des outils en ligne de commande

La propre documentation de Blockscout contient [des guides détaillés](https://docs.blockscout.com/devs/verification) sur l'utilisation d'outils en ligne de commande pour la vérification. C'est particulièrement utile si vous souhaitez automatiser la vérification de contrats dans votre environnement de développement.

Vous pouvez lire leurs guides sur le déploiement et la vérification avec :

* [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)
* ... et plus encore !

## Utiliser l'API de Blockscout

Blockscout dispose d'une API de vérification de contrats dédiée :

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

Les endpoints de l'API sont :

* Chiliz Mainnet: <https://scan-api.chiliz.com/api/v2/>
* Spicy Testnet: <https://spicy-explorer-api.chiliz.com/api/v2/>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.chiliz.com/fr/developper/notions-de-base/verifier-un-smart-contract/verifier-avec-chiliz-block-explorer.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
