Glossary index › S

Solidity (Programming Language)

Solidity is an object-oriented, statically typed programming language used to write smart contracts - self-executing code - that run on Ethereum and other blockchains compatible with the Ethereum Virtual Machine (EVM), including many layer-2 networks and EVM-compatible sidechains. Its syntax was deliberately designed to feel familiar to developers coming from JavaScript, C++, and Python, which helped it become the dominant language for building decentralized applications since it was first proposed in 2014, with Christian Reitwiessner leading much of its early development alongside contributions from Gavin Wood and others on the Ethereum team.

A Solidity contract defines the rules for how a token, exchange, lending pool, or any other on-chain application behaves - who can call which functions, how balances update, what conditions must be met before funds move. A simple contract creating a basic fungible token (following the widely used ERC-20 standard) can be written in well under 50 lines of code, while deploying it to the Ethereum mainnet costs "gas" fees paid in ETH; depending on network congestion, deploying even a modest contract can cost anywhere from roughly $20 to several hundred dollars worth of ETH.

For traders and investors, Solidity matters because it's the layer where DeFi risk actually lives: a coding mistake in a Solidity contract - not a market move - can drain a protocol instantly and irreversibly, since the code executes exactly as written, bugs and all. The infamous 2016 "The DAO" hack exploited a reentrancy vulnerability in Solidity code, and similar bug classes have caused hundreds of millions of dollars in losses across DeFi protocols since. This is why independent smart-contract audits, and whether a protocol's code has been publicly reviewed, are practical due-diligence checks before committing meaningful capital to any Solidity-based platform.

There is a layer below the one described here that the usual due-diligence checklist misses. An audit reads the source code, but the network runs the bytecode, and the compiler that turns one into the other is software with bugs of its own. In July 2023 several Ethereum liquidity pools were drained not because their source code was wrong but because specific versions of Vyper, the main alternative language to Solidity, produced reentrancy locks that did not actually lock. Versions 0.2.15, 0.2.16 and 0.3.0 were affected. A Curve pool lost more than 18.5 million dollars, a JPEG'd pool about 11.5 million, with Alchemix and Metronome also hit; initial losses were put near 70 million dollars, cut to roughly 52 million after whitehats who exploited the same flaw returned about 18 million. The contracts involved had been audited, and the audits were not wrong about the code they read.

The practical consequence is a second question to ask alongside whether a protocol has been audited: which compiler version was it built with, and has anything been found in that version since it was deployed. This is answerable, because Solidity itself publishes a list of known compiler bugs indexed by release, in a machine-readable form precisely so that tools can check a deployed contract against it. It also explains a habit that looks like superstition from the outside, namely why serious protocols pin an exact compiler version rather than accepting any recent one, and why a redeployment after a compiler upgrade is treated as a change worth re-auditing rather than a formality.

Where do Solidity contracts run? On Ethereum and other blockchains compatible with the Ethereum Virtual Machine, including many layer-2 networks and compatible sidechains.
Why does Solidity syntax feel familiar? It was deliberately designed to resemble JavaScript, C++ and Python, which helped it become dominant for building decentralised applications.
When did Solidity appear? The language was proposed in 2014; Christian Reitwiessner led much of its early work, with Gavin Wood among the other contributors.
What does a Solidity contract define? The rules for how a token, exchange, lending pool or other on-chain application behaves: who can call which functions, how balances update, what must be true before funds move.
How long is a simple token contract in Solidity? A basic fungible token following the common standard can be written in well under 50 lines.
What does deploying a contract cost? Gas fees paid in the network's own currency, ranging from roughly 20 dollars to several hundred depending on congestion.
Why does Solidity matter to an investor? Because this is the layer where decentralised finance risk actually lives. A coding mistake can drain a protocol instantly and irreversibly.
Is there a famous Solidity bug case? The 2016 attack on The DAO exploited a reentrancy vulnerability, and similar bug classes have caused hundreds of millions in losses since.
Does a code audit make a contract safe? It does not, and the record of audited protocols that were drained afterwards is long enough to be worth knowing about.

By InsiderTicker Editorial Team · Last updated

All news on Crypto →