Compiling Contracts
Build artifacts.
Why Compile
Solidity source code cannot run on the EVM directly. The compiler turns .sol files into bytecode and an ABI that tools and clients use.
- Bytecode — the low-level instructions deployed on-chain.
- ABI — a JSON interface describing functions and events.
The Compile Task
Hardhat compiles every contract under contracts/ with a single command:
npx hardhat compileHardhat downloads the right solc version automatically, so you do not need to install the compiler manually.
npx hardhat compileAll lessons in this course
- Hardhat Setup
- Compiling Contracts
- Scripts and Tasks
- Local Network and Forking