Smart Contract Development with Solidity
Language fundamentals
Solidity is statically typed and compiled to EVM bytecode. Master data locations: storage (persistent, expensive), memory (temporary, per call), and calldata (read-only input). Know value types versus reference types, and that assigning storage to memory copies while assigning memory to storage writes back. Understand visibility (public, external, internal, private), function mutability (view, pure, payable), and constructors.
Contracts, inheritance, and interfaces
Solidity supports single inheritance with multiple interfaces, using virtual and override. Abstract contracts cannot be deployed. Interfaces declare external functions only. Libraries can be internal (inlined) or external (deployed with delegatecall semantics). Understand that delegatecall runs another contract's code in the caller's storage context, which is powerful and dangerous.
Patterns and traps
Examiners test integer division truncation, unchecked versus checked arithmetic (Solidity 0.8+ reverts on overflow), and the difference between transfer, send, and call. transfer and send forward a fixed 2300 gas stipend and can break with complex receivers; call is preferred with reentrancy guards. Watch for shadowing, missing visibility defaults, and confusing block.timestamp with secure randomness. Also know that selfdestruct behavior changed and should not be relied on for cleanup.
Rule of thumb
Prefer checks-effects-interactions and pull-over-push payments. Worked example: to send Ether safely, update balances before calling payable recipient with call, and require success.