Bytecode
EVMDéfinition
Code compilé au format hexadécimal exécuté par l'EVM. Quand vous déployez un smart contract, le compilateur Solidity transforme votre code en bytecode. Il existe deux types : creation bytecode (déployé une fois) et runtime bytecode (stocké on-chain après déploiement). Inspecter le bytecode permet de vérifier qu'un contrat correspond à son code source.
Version anglaise
Compiled code in hexadecimal format executed by the EVM. When deploying a smart contract, the Solidity compiler transforms your code into bytecode. Two types exist: creation bytecode (deployed once) and runtime bytecode (stored on-chain after deployment). Inspecting bytecode allows verifying a contract matches its source code.
Exemple de Code
// Bytecode runtime stocké on-chain (extrait)
0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063...
// Récupérer le bytecode d'un contrat
bytes memory code = address(target).code;
// Vérifier si une adresse est un contrat
bool isContract = address(target).code.length > 0;Termes Liés
Pages Liées
Pratique ce concept sur Solingo
Maîtrise Bytecode avec des exercices interactifs et un IDE intégré.
Commencer gratuitement