Solidity

Programming language


title: "Solidity" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["domain-specific-programming-languages", "statically-typed-programming-languages", "ethereum", "articles-with-example-javascript-code"] description: "Programming language" topic_path: "technology/programming-languages" source: "https://en.wikipedia.org/wiki/Solidity" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0

::summary Programming language ::

::data[format=table title="Infobox programming language"]

FieldValue
nameSolidity
logoSolidity logo.svg
logo captionThe Solidity language logo
logo size80px
paradigmimperative, object-oriented
familyECMAScript (original)
C++ (later)
designerGavin Wood
developerChristian Reitwiessner, Alex Beregszaszi, and several former Ethereum core contributors
programming languageC++
released
latest release version
latest release date
typingstatic
scopelexical
platformblockchain platforms
operating systemCross-platform: Windows, macOS, Linux
licenseGNU General Public License v3.0
file ext.sol
website
influenced byJavaScript, C++, Python
::

::callout[type=note] the programming language ::

| name = Solidity | logo = Solidity logo.svg | logo caption = The Solidity language logo | logo size = 80px | paradigm = imperative, object-oriented | family = ECMAScript (original) C++ (later) | designer = Gavin Wood | developer = Christian Reitwiessner, Alex Beregszaszi, and several former Ethereum core contributors | programming language = C++ | released = | latest release version = | latest release date = | typing = static | memory management = | scope = lexical | platform = blockchain platforms | operating system = Cross-platform: Windows, macOS, Linux | license = GNU General Public License v3.0 | file ext = .sol | website = | influenced by = JavaScript, C++, Python Solidity is a programming language for implementing smart contracts on various blockchain platforms, most notably, Ethereum. Solidity is licensed under GNU General Public License v3.0. Solidity was designed by Gavin Wood and developed by Christian Reitwiessner, Alex Beregszaszi, and several former Ethereum core contributors. Programs in Solidity run on Ethereum Virtual Machine or on compatible virtual machines.

History

Solidity was proposed in August 2014 by Gavin Wood The language was later developed by the Ethereum project's Solidity team, led by Christian Reitwiessner.

Solidity is the primary language used to develop smart contracts for Ethereum and other private blockchains, such as the enterprise-oriented Hyperledger Fabric blockchain. SWIFT deployed a proof of concept using Solidity running on Hyperledger Fabric.

Description

Solidity is a statically typed programming language designed for developing smart contracts that run on the Ethereum Virtual Machine (EVM) or compatible virtual machines.

Solidity uses ECMAScript-like syntax which makes it familiar for extant web developers; however unlike ECMAScript it has static typing and variadic return types. Solidity is different from other EVM-targeting languages such as Serpent and Mutan in some important ways. It supports complex member variables for smart contracts, including arbitrarily hierarchical mappings and structs. Solidity smart contract support inheritance, including multiple inheritance with C3 linearization. Solidity introduces an application binary interface (ABI) that facilitates multiple type-safe functions within one smart contract (this was also later supported by Serpent). The Solidity proposal also includes "Natural Language Specification", a documentation system for specifying user-centric descriptions of the ramifications of method-calls.

Example of a Solidity program: ::code[lang=solidity] // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.4;

contract Coin { // The keyword "public" makes variables // accessible from other contracts address public minter; mapping(address => uint) public balances;

// Events allow clients to react to specific
// contract changes you declare
event Sent(address from, address to, uint amount);

// Constructor code is only run when the contract
// is created
constructor() {
    minter = msg.sender;
}

// Sends an amount of newly created coins to an address
// Can only be called by the contract creator
function mint(address receiver, uint amount) public {
    require(msg.sender == minter);
    balances[receiver] += amount;
}

// Errors allow you to provide information about
// why an operation failed. They are returned
// to the caller of the function.
error InsufficientBalance(uint requested, uint available);

// Sends an amount of extant coins
// from any caller to an address
function send(address receiver, uint amount) public {
    if (amount > balances[msg.sender])
        revert InsufficientBalance({
            requested: amount,
            available: balances[msg.sender]
        });

    balances[msg.sender] -= amount;
    balances[receiver] += amount;
    emit Sent(msg.sender, receiver, amount);
}

} ::

Criticism

Many security properties of smart contracts are inherently difficult to reason about directly, and the Turing-completeness of Solidity means that verification of arbitrary properties cannot be decidably automated. Current automated solutions for smart contract security analysis can miss critical violations, produce false positives, and fail to achieve sufficient code coverage on realistic contracts. Solidity has been blamed for the error-prone implementation of Ethereum smart contracts due to its counterintuitive nature, its lack of constructs to deal with blockchain domain-specific aspects, and its lack of centralized documentation of known vulnerabilities.

In 2016, a Cornell University researcher stated that Solidity was partly to blame for The DAO hack that occurred that year. He stated: "this was actually not a flaw or exploit in the DAO contract itself: technically the Ethereum Virtual Machine (EVM) was operating as intended, but Solidity was introducing security flaws into contracts that were not only missed by the community, but missed by the designers of the language themselves."

The developers community often cites Solidity requiring much of third party interfaces and APIs, and its inability to create critical information intensive smart contracts.

References

References

  1. "Contributors to ethereum/solidity".
  2. "Contributors to ethereum/solidity".
  3. "Build software better, together".
  4. (2023-03-30). "The Solidity Contract-Oriented Programming Language". [[Ethereum]].
  5. (2017-07-17). "Ethereum Is The Second Most Valuable Digital Currency, Behind Bitcoin".
  6. (24 November 2016). "SOFE Berlin: Swift unveils blockchain proof-of-concept". Finextra.
  7. (June 2016). "Someone Just Stole $50 Million from the Biggest Crowdfunded Project Ever (Humans Can't Be Trusted)".
  8. (2023-03-30). "The Solidity Contract-Oriented Programming Language". ethereum.
  9. Wood, Gavin. (January 13, 2015). "Created Solidity".
  10. "List of contributors".
  11. College, A. M. C.. (2022-11-01). "Blockchain & Cryptocurrency Technology with Solidity Level 1". Advanced Micro Systems Sdn Bhd.
  12. "Gavin Wood".
  13. (14 March 2018). "Finding The Greedy, Prodigal, and Suicidal Contracts at Scale".
  14. "Westpac joins SWIFT's blockchain proof of concept".
  15. "Hyperledger Fabric Tutorial - Create a blockchain app for loyalty points".
  16. "Language Influences — Solidity 0.8.17 documentation".
  17. ethereum. "Ethereum Natural Specification Format". [[GitHub]].
  18. "Introduction to Smart Contracts — Solidity 0.8.19 documentation".
  19. (15 October 2018). "Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security". Association for Computing Machinery.
  20. (2017). "Principles of Security and Trust, 6th International Conference, 2017, Proceedings".
  21. (18 June 2016). "A $50 Million Hack Just Showed That the DAO Was All Too Human".

::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::

domain-specific-programming-languagesstatically-typed-programming-languagesethereumarticles-with-example-javascript-code