You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Solidity is the most widely used programming language for writing smart contracts on Ethereum and EVM-compatible blockchains. It is a statically typed, object-oriented language influenced by JavaScript, Python, and C++.
| Tool | Purpose |
|---|---|
| Remix IDE | Browser-based IDE for quick prototyping (remix.ethereum.org) |
| Hardhat | JavaScript/TypeScript development framework for testing and deployment |
| Foundry | Rust-based toolkit with fast compilation and testing (forge, cast, anvil) |
| OpenZeppelin | Library of audited, reusable smart contract components |
| Slither | Static analysis tool for finding vulnerabilities |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract SimpleStorage {
// State variable (stored on-chain)
uint256 private storedValue;
// Event emitted when value changes
event ValueChanged(uint256 newValue);
// Function to set the value
function set(uint256 _value) public {
storedValue = _value;
emit ValueChanged(_value);
}
// Function to get the value (view = no state modification)
function get() public view returns (uint256) {
return storedValue;
}
}
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.