Paradigm | Imperative |
---|---|
Designed by | Gavin Wood |
Developer | Christian Reitwiessner, [1] Alex Beregszaszi, [2] and several former Ethereum core contributors. |
First appeared | August 2014 |
Stable release | 0.8.28 [3] / 9 October 2024 |
Implementation language | C++ [4] |
License | GNU General Public License v3.0 [5] |
Filename extensions | .sol |
Website | soliditylang |
Influenced by | |
JavaScript, C++, Python |
Solidity is a programming language for implementing smart contracts [6] [7] on various blockchain platforms, most notably, Ethereum. [8] Solidity is licensed under GNU General Public License v3.0. [9] Solidity was designed by Gavin Wood [10] [ non-primary source needed ] and developed by Christian Reitwiessner, Alex Beregszaszi, and several former Ethereum core contributors. [11] Programs in Solidity run on Ethereum Virtual Machine or on compatible virtual machines. [12]
Solidity was proposed in August 2014 by Gavin Wood [13] [ non-primary source needed ] 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 as well as other private blockchains, such as the enterprise-oriented Hyperledger Fabric blockchain. SWIFT deployed a proof of concept using Solidity running on Hyperledger Fabric. [14] [15]
Solidity is a statically typed programming language designed for developing smart contracts that run on the Ethereum Virtual Machine (EVM) or compatible virtual machines. [16]
Solidity uses ECMAScript-like syntax which makes it familiar for existing web developers; [17] 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 a single 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. [18] [19] [ non-primary source needed ]
Example of a Solidity program: [20] [21]
// SPDX-License-Identifier: GPL-3.0pragma solidity^0.8.4;contractCoin{// The keyword "public" makes variables// accessible from other contractsaddresspublic minter;mapping(address=>uint)publicbalances;// Events allow clients to react to specific// contract changes you declareeventSent(addressfrom,addressto,uintamount);// Constructor code is only run when the contract// is createdconstructor(){minter=msg.sender;}// Sends an amount of newly created coins to an address// Can only be called by the contract creatorfunctionmint(addressreceiver,uintamount)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.errorInsufficientBalance(uintrequested,uintavailable);// Sends an amount of existing coins// from any caller to an addressfunctionsend(addressreceiver,uintamount)public{if(amount>balances[msg.sender])revertInsufficientBalance({requested:amount,available:balances[msg.sender]});balances[msg.sender]-=amount;balances[receiver]+=amount;emitSent(msg.sender,receiver,amount);}}
Solidity is available on:
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. [29] 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. [30]
In 2016, a Cornell University researcher stated that Solidity was partially to blame for The DAO hack that took place 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." [31]
The developers community often cites Solidity requiring much of third party interfaces and APIs, and its inability to create critical information intensive smart contracts.
Solidity is the primary programming language for developing smart contracts on the Ethereum Virtual Machine (EVM). [32] However, Rust has emerged as a strong alternative in the blockchain ecosystem, especially for blockchains that support WebAssembly (Wasm), such as Polkadot, Klever and Solana.
Rust offers built-in memory safety features that prevent common programming errors, such as null pointer dereferencing and buffer overflows, which are not as rigorously enforced in Solidity. This makes Rust contracts potentially less prone to security vulnerabilities that could be exploited in smart contract environments.
Rust supports concurrent programming, which allows developers to write highly performant code that can handle multiple tasks simultaneously. This is particularly beneficial for high-performance blockchains like Solana, [33] which need to process thousands of transactions per second. Solidity, on the other hand, does not natively support concurrency, which can limit its performance in certain applications. [34]
While Solidity is deeply integrated with the Ethereum ecosystem and its numerous development tools, [35] Rust is versatile and can be used across various blockchain platforms that leverage Wasm. Rust’s growing popularity is reflected in its adoption by new blockchain projects that prioritize performance and security.
A smart contract is a computer program or a transaction protocol that is intended to automatically execute, control or document events and actions according to the terms of a contract or an agreement. The objectives of smart contracts are the reduction of need for trusted intermediators, arbitration costs, and fraud losses, as well as the reduction of malicious and accidental exceptions. Smart contracts are commonly associated with cryptocurrencies, and the smart contracts introduced by Ethereum are generally considered a fundamental building block for decentralized finance (DeFi) and non-fungible token (NFT) applications.
JEB is a disassembler and decompiler software for Android applications and native machine code. It decompiles Dalvik bytecode to Java source code, and x86, ARM, MIPS, RISC-V machine code to C source code. The assembly and source outputs are interactive and can be refactored. Users can also write their own scripts and plugins to extend JEB functionality.
Ethereum is a decentralized blockchain with smart contract functionality. Ether is the native cryptocurrency of the platform. Among cryptocurrencies, ether is second only to bitcoin in market capitalization. It is open-source software.
A decentralized autonomous organization (DAO), sometimes called a decentralized autonomous corporation (DAC), is an organization managed in whole or in part by decentralized computer program, with voting and finances handled through a blockchain. In general terms, DAOs are member-owned communities without centralized leadership. The precise legal status of this type of business organization is unclear.
Counterparty is a peer-to-peer financial platform and a distributed, open source protocol built on top of the Bitcoin blockchain and network. It was one of the most well-known "Bitcoin 2.0" platforms in 2014, along with Mastercoin, Ethereum, Colored Coins, Ripple and BitShares.
A blockchain is a distributed ledger with growing lists of records (blocks) that are securely linked together via cryptographic hashes. Each block contains a cryptographic hash of the previous block, a timestamp, and transaction data. Since each block contains information about the previous block, they effectively form a chain, with each additional block linking to the ones before it. Consequently, blockchain transactions are irreversible in that, once they are recorded, the data in any given block cannot be altered retroactively without altering all subsequent blocks.
Hyperledger is an umbrella project of open source blockchains and related tools that the Linux Foundation started in December 2015. IBM, Intel, and SAP Ariba have contributed to support the collaborative development of blockchain-based distributed ledgers. It was renamed the Hyperledger Foundation in October 2021.
The DAO was a digital decentralized autonomous organization and a form of investor-directed venture capital fund. After launching in April 2016 via a token sale, it became one of the largest crowdfunding campaigns in history, but it ceased activity after much of its funds were taken in a hack in June 2016.
A decentralised application is an application that can operate autonomously, typically through the use of smart contracts, that run on a decentralized computing, blockchain or other distributed ledger system. Like traditional applications, DApps provide some function or utility to its users. However, unlike traditional applications, DApps operate without human intervention and are not owned by any one entity, rather DApps distribute tokens that represent ownership. These tokens are distributed according to a programmed algorithm to the users of the system, diluting ownership and control of the DApp. Without any one entity controlling the system, the application is therefore decentralised.
Ethereum Classic is a blockchain-based distributed computing platform that offers smart contract (scripting) functionality. It is open source and supports a modified version of Nakamoto consensus via transaction-based state transitions executed on a public Ethereum Virtual Machine (EVM).
Firo, formerly known as Zcoin, is a cryptocurrency aimed at using cryptography to provide better privacy for its users compared to other cryptocurrencies such as Bitcoin.
Cardano is a public blockchain platform. It is open-source and decentralized, with consensus achieved using proof of stake. It can facilitate peer-to-peer transactions with its internal cryptocurrency, ADA.
Gavin James Wood is an English computer scientist, a co-founder of Ethereum, and creator of Polkadot and Kusama.
The Open Network is a decentralized computer network consisting of a layer-1 blockchain with various components. TON was originally developed by Nikolai Durov who is also known for his role in creating the messaging platform, Telegram. Telegram had planned to use TON to launch its own cryptocurrency (Gram), but was forced to abandon the project in 2020 following an injunction by US regulators. The network was then renamed and independent developers have created their own cryptocurrencies and applications using TON. Toncoin, the principal token of The Open Network is deeply integrated into the Telegram messaging app, used for paying rewards to creators and developers, buying Telegram ads, hosting giveaways or purchasing services such as Telegram Premium.
Tron is a decentralized, proof-of-stake blockchain with smart contract functionality. The cryptocurrency native to the blockchain is known as Tronix (TRX). It was founded in March 2014 by Justin Sun and since 2017 has been overseen and supervised by the TRON Foundation, a non-profit organization in Singapore, established in the same year. It is open-source software.
Decentralized finance provides financial instruments and services through smart contracts on a programmable, permissionless blockchain. This approach reduces the need for intermediaries such as brokerages, exchanges, or banks. DeFi platforms enable users to lend or borrow funds, speculate on asset price movements using derivatives, trade cryptocurrencies, insure against risks, and earn interest in savings-like accounts. The DeFi ecosystem is built on a layered architecture and highly composable building blocks. While some applications offer high interest rates, they carry high risks. Coding errors and hacks are a common challenge in DeFi.
Originally developed in 2019 by Microsoft under the name Coco and later rebranded to Confidential Consortium Framework (CCF), it is an open-source framework for developing of a new category of performant applications that focuses on the optimization of secure multi-party computation and data availability. Intended to accelerate the adoption of blockchain technology by enterprises, CCF can enable a variety of high-scale, confidential, permissioned distributed ledger networks that meet key enterprise requirements.
Uniswap is a Ethereum-based decentralized cryptocurrency exchange (DEX) that uses a set of blockchain-based smart contracts to create liquidity pools for the execution of trades. It is an open source project and falls into the category of a DeFi product because it uses smart contracts to facilitate trades instead of a centralized exchange. The protocol facilitates automated transactions between cryptocurrency tokens on the Ethereum blockchain through the use of smart contracts. As of December 2024, Uniswap is estimated to be the largest decentralized exchange and the seven-largest cryptocurrency exchange overall by daily trading volume.
Solana is a blockchain platform which uses a proof-of-stake mechanism to provide smart contract functionality. Its native cryptocurrency is SOL.
Tornado Cash is an open source, non-custodial, fully decentralized cryptocurrency tumbler that runs on Ethereum Virtual Machine-compatible networks. It offers a service that mixes potentially identifiable or "tainted" cryptocurrency funds with others, so as to obscure the trail back to the fund's original source. This is a privacy tool used in EVM networks where all transactions are public by default.
Different source languages compile to the EVM semantics, the predominant of them being Solidity
{{cite journal}}
: CS1 maint: numeric names: authors list (link){{cite book}}
: CS1 maint: location missing publisher (link)