Solidity
First appeared | August 2014 |
---|---|
Stable release | 0.8.25[3]
/ 14 March 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.
History
Solidity was proposed in August 2014 by Gavin Wood[12][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.[13][14]
Description
Solidity is a
Solidity uses
Example of a Solidity program:[19][20]
// 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 existing 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);
}
}
Development IDEs
Editor extensions
Blockchain platforms
Solidity is available on:
- Avalanche C-Chain
- Binance Smart Chain[25]
- Ethereum
- Ethereum Classic
- Tron
- Hedera Hashgraph
- Polygon
- Metis
- Arbitrum
- Optimism
Criticism
Many security properties of smart contracts are inherently difficult to reason about directly, and the
In 2016, a
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
- ^ "Contributors to ethereum/solidity". GitHub. Retrieved 30 March 2023.
- ^ "Contributors to ethereum/solidity". GitHub. Retrieved 30 March 2023.
- ^ "Release 0.8.25". 14 March 2024. Retrieved 25 March 2024.
- ^ "Build software better, together". GitHub. Retrieved 30 March 2023.
- ^ The Solidity Contract-Oriented Programming Language, ethereum, 30 March 2023, retrieved 30 March 2023
- ^ Afshar, Vala (17 July 2017). "Ethereum Is The Second Most Valuable Digital Currency, Behind Bitcoin". HuffPost. Retrieved 10 April 2019.
- ^ "SOFE Berlin: Swift unveils blockchain proof-of-concept". Finextra (News). 24 November 2016. Retrieved 24 November 2016.
- ^ Finley, Klint. "Someone Just Stole $50 Million from the Biggest Crowdfunded Project Ever. (Humans Can't Be Trusted)". Wired.
- ^ The Solidity Contract-Oriented Programming Language, ethereum, 30 March 2023, retrieved 30 March 2023
- ^ Wood, Gavin (13 January 2015). "Created Solidity". Ethereum Wiki (Archived). Retrieved 23 March 2024.
{{cite web}}
: Check|archive-url=
value (help)CS1 maint: url-status (link) - ^ "List of contributors". GitHub.
- ^ "Gavin Wood". gavwood.com. Retrieved 30 March 2023.
- arXiv:1802.06038 [cs.CR].
Different source languages compile to the EVM semantics, the predominant of them being Solidity
- ^ "Westpac joins SWIFT's blockchain proof of concept". ZDNet. Retrieved 13 July 2022.
- ^ "Hyperledger Fabric Tutorial - Create a blockchain app for loyalty points". IBM Developer. Retrieved 10 April 2019.
- ^ "Language Influences — Solidity 0.8.17 documentation". docs.soliditylang.org. Retrieved 30 March 2023.
- ^ Kapetanios-2008-06-27, p. 309.
- ^ ethereum. "Ethereum Natural Specification Format". GitHub.
- ^ "Introduction to Smart Contracts — Solidity 0.8.19 documentation". docs.soliditylang.org. Retrieved 30 March 2023.
- ^
Schneier, Karthikeyan; Schneier, Antoine; Bhargavan, Cedric; Delignat-Lavaud, Anitha; Fournet, Gollamudi; Schneier, Bruce; Rastogi, Nadim; Sibut-Pinote, Aseem; Rastogi1, Thomas; Swamy, Nikhil; Zanella-Beguelin, Santiago (27 August 2016). "Short Paper: Formal Verification of Smart Contracts" (PDF). Microsoft Research, French Institute for Research in Computer Science and Automation, Harvard University. Archived (PDF) from the original on 27 August 2016.
{{cite journal}}
: CS1 maint: numeric names: authors list (link) - ^ "Remix - Ethereum IDE". remix.ethereum.org. Retrieved 30 March 2023.
- ^ "EthFiddle - Solidity in the Browser. Powered By Loom Network". ethfiddle.com. Retrieved 30 March 2023.
- ^ "solidity - Visual Studio Marketplace". marketplace.visualstudio.com. Retrieved 30 March 2023.
- ^ "Solidity - IntelliJ IDEs Plugin | Marketplace". JetBrains Marketplace. Retrieved 30 March 2023.
- ^ "Binance Smart Chain". GitHub. 26 October 2021.
- ISSN 0099-9660. Retrieved 16 April 2021.
- )
- S2CID 46936025.
- S2CID 15494854.
- ^ Finley, Klint (18 June 2016). "A $50 Million Hack Just Showed That the DAO Was All Too Human". Wired (News). Retrieved 18 February 2017.