Files
tokenizer/tokenizerRendu/code/README.md
2026-10-20 15:09:41 +02:00

86 lines
2.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Code — FGC42Forge (Hardhat 3)
Sources du token **FGC42Forge** (symbole **FG42**), standard **BEP-20**, déployé sur **BNB Smart Chain Testnet** (chainId **97**).
Stack : **Solidity 0.8.34**, **Hardhat 3**, **OpenZeppelin 5**, tests **Mocha + ethers**.
Adresse déployée et vérif BscScan : [`../deployment/addresses.json`](../deployment/addresses.json) · [`../deployment/BSCSCAN_VERIFICATION.md`](../deployment/BSCSCAN_VERIFICATION.md)
---
## Guide relecture (correcteur / code review)
| Fichier | Contenu commenté |
|---------|------------------|
| **`contracts/FGC42Forge.sol`** | **Contrat principal** — NatSpec, contraintes sujet, supply fixe, sécurité, fonctions héritées |
| `test/FGC42Forge.ts` | Tests du token (métadonnées, transfer, supply) |
| `ignition/modules/FGC42Forge.ts` | Module de déploiement Ignition |
| `hardhat.config.ts` | Compilateur, réseau `bscTestnet`, variables d’environnement |
Fichiers **hors livrable token** (template Hardhat) : `contracts/Counter.sol`, `Counter.t.sol`, `test/Counter.ts` — le jeton évalué est **FGC42Forge** uniquement.
---
### BEP-20 vs `ERC20` dans le code
- **Soutenance :** jeton **BEP-20** sur BSC Testnet.
- **Code :** héritage **OpenZeppelin `ERC20`** (interface EVM identique ; pas de module `BEP20` séparé).
- **BscScan :** affiche BEP-20 après déploiement ; vérification du **code source** via `deployment/FGC42Forge_flat.sol`.
---
## Prérequis
- Node.js ≥ 18 (Hardhat 3 recommande v22+)
- Compte testnet avec **tBNB** pour deploy / gas
## Installation
```shell
cd code
npm install
cp .env.example .env
# Éditer .env : PRIVATE_KEY = clé privée (pas l'adresse wallet)
```
| Variable | Description |
|----------|-------------|
| `BSC_TESTNET_RPC` | URL RPC BSC Testnet |
| `PRIVATE_KEY` | Signataire des transactions Hardhat (deploy) |
## Commandes utiles
```shell
npx hardhat build
npx hardhat test mocha --grep FGC42Forge
```
Tous les tests (inclut l’exemple Counter du template) :
```shell
npx hardhat test
```
## Déploiement (déjà effectué — reproduction)
```shell
npx hardhat ignition deploy --network bscTestnet ignition/modules/FGC42Forge.ts
```
Détails : [`../deployment/README.md`](../deployment/README.md)
## Arborescence
```
contracts/
FGC42Forge.sol ← token BEP-20 (commenté pour la soutenance)
Counter.* ← exemple Hardhat (optionnel)
test/
FGC42Forge.ts ← tests du token
ignition/modules/
FGC42Forge.ts ← deploy Ignition
hardhat.config.ts ← réseau bscTestnet + Solidity 0.8.34
```
Documentation utilisateur (wallet, transfers) : [`../documentation/README.md`](../documentation/README.md)