Simple Addition - Solidity Typing CST Test
Loading…
Simple Addition — Solidity Code
Adds two numbers and stores the result in a state variable.
pragma solidity ^0.8.0;
contract AddProgram {
uint public a = 5;
uint public b = 3;
uint public sum;
function calculate() public {
sum = a + b;
}
}Solidity Language Guide
Solidity is a statically typed, contract-oriented programming language designed for building smart contracts on the Ethereum blockchain. It enables developers to write decentralized applications (dApps), manage digital assets, and automate trustless logic using a syntax inspired by JavaScript, C++, and Python.
Primary Use Cases
- ▸Smart contract development
- ▸DeFi protocols (DEXs, lending, staking)
- ▸NFT standards (ERC-721, ERC-1155)
- ▸Token creation (ERC-20)
- ▸DAO governance mechanisms
- ▸Permissioned enterprise blockchain apps
Notable Features
- ▸Contract-oriented design
- ▸Strong static typing
- ▸Events for EVM logs
- ▸Function modifiers
- ▸Library & inheritance support
Origin & Creator
Solidity was created by Gavin Wood and the Ethereum Foundation in 2014 to serve as the primary language for writing smart contracts on the Ethereum blockchain.
Industrial Note
Solidity is heavily used in decentralized finance (DeFi), NFT marketplaces, blockchain gaming, DAOs, tokenization engines, supply chain tracking, on-chain governance, and enterprise blockchain automation.