⛓️Solidity
Also known as Solidity Language, Solidity Programming
The main code language for smart contracts. It runs on Ethereum.
Think of it like
It is the words you use to tell a snack machine what to do.
Example
Lucy writes a counter contract in Solidity. She compiles it and puts it on the chain. Now anyone can press add.
Why it matters
Most smart contracts are written in it, so it is the first thing to learn if you want to read one.
Definition
Example code
solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract Counter {
uint256 public count;
function add() public {
count += 1;
}
}Common mistake
Key takeaways
- 1Typed. Each value has a set type.
- 2Compiled. It turns into bytecode.
- 3Runs on the EVM. Every Ethereum computer runs it.