Solidity

Solidity
Paradigm object-oriented
Website github.com/ethereum/solidity
Influenced by
JavaScript, C++

Solidity is an object oriented domain-specific language[1] for the Ethereum public blockchain and programmable transaction platform.[2][3][4]

History

Solidity was initially proposed in August 2014 by Gavin Wood;[5] the language was later developed by the Ethereum project's Solidity team, led by Christian Reitwiessner. It is one of four languages (the others being Serpent, LLL and Mutan (deprecated)[6]) designed to target the Ethereum Virtual Machine. Since the rise of blockchain technology and in particular Ethereum-derived architectures, it has found substantial usage[7][8][9] for authoring on-chain software programs known as "smart contracts".

Description

Solidity is a JavaScript-like statically-typed programming language designed for developing smart contracts that run on the Ethereum Virtual Machine (EVM).[10][11] Solidity is compiled to bytecode that is executable on the EVM. With Solidity, developers are able to write applications that implement self-enforcing business logic embodied in smart contracts, leaving a non-repudiable and authoritative record of transactions."[12]

As specified by Wood it is designed around the ECMAScript syntax to make it familiar for existing web developers; unlike ECMAScript it has static typing and variadic return types. Compared to other EVM-targeting languages of the time such as Serpent and Mutan, Solidity contained a number of important differences. Complex member variables for contracts including arbitrarily hierarchical mappings and structs were supported. Contracts support inheritance, including multiple inheritance with C3 linearization. An Application Binary Interface (ABI) facilitating multiple type-safe functions within a single contract was also introduced (and later supported by Serpent). A documentation system for specifying a user-centric description of the ramifications of a method-call was also included in the proposal, and later became known as "Natural Language Specification".[13]

Example of a Solidity program:[14]

contract GavCoin
{
  mapping(address=>uint) balances;
  uint constant totalCoins = 100000000000;

  /// Endows creator of contract with 1m GAV.
  function GavCoin(){
      balances[msg.sender] = totalCoins;
  }

  /// Send $((valueInmGAV / 1000).fixed(0,3)) GAV from the account of $(message.caller.address()), to an account accessible only by $(to.address()).
  function send(address to, uint256 valueInmGAV) {
    if (balances[msg.sender] >= valueInmGAV) {
      balances[to] += valueInmGAV;
      balances[msg.sender] -= valueInmGAV;
    }
  }

  /// getter function for the balance
  function balance(address who) constant returns (uint256 balanceInmGAV) {
    balanceInmGAV = balances[who];
  }

};

Development platform availability

References

  1. "Solidity — Solidity 0.2.0 documentation". readthedocs.io.
  2. Popper, Nathaniel (2016-03-27). "Ethereum, a Virtual Currency, Enables Transactions That Rival Bitcoin's". New York Times. Retrieved 2016-05-01.
  3. Gray, Jeff (7 April 2014). "Bitcoin believers: Why digital currency backers are keeping the faith". The Globe and Mail. Phillip Crawley. Retrieved 17 February 2016.
  4. Vigna, Paul (28 October 2015). "BitBeat: Microsoft to Offer Ethereum-Based Services on Azure". The Wall Street Journal (Blog). News Corp. Retrieved 17 February 2016.
  5. Benoit Schweblin. "StackEdit Viewer". stackedit.io.
  6. "Ethereum High Level Languages". Ethdocs.org. Retrieved 12 September 2016.
  7. "Blockchain Technology and Applications from a Financial Perspective". Scribd.
  8. slockit. "GitHub - slockit/DAO: The Standard DAO Framework, inc. Whitepaper". GitHub.
  9. "Augur documentation". augur.net.
  10. Mougayar, William (2016-04-26). The Business Blockchain: Promise, Practice, and Application of the Next Internet Technology. Wiley Publishing. ISBN 978-1119300311.
  11. Allison, Ian (2016-03-30). "Microsoft adds Ethereum language Solidity to Visual Studio". International Business Times. Retrieved 2016-05-11.
  12. Bradley, Joseph (2016-05-04). "Ethereum's Solidity Now Available in Microsoft Visual Studio". Cryptocoinnews. Retrieved 2016-05-11.
  13. ethereum. "Ethereum Natural Specification Format". GitHub.
  14. RJ Catalano, one of the core developers, see VoR0220 on github
  15. "Ethereum's Solidity Now Available in Microsoft Visual Studio". CCN: Financial Bitcoin & Cryptocurrency News. Retrieved 1 May 2016.
  16. http://rethink-iot.com/2016/04/01/hyperledger-blockchain-code-almost-comes-together-for-iot/, accessed 23 April 2016.
  17. "Microsoft Adds Ethereum to Windows Platform For Over 3 Million Developers". CoinDesk. Retrieved 1 May 2016.
  18. Allison, Ian (2016-03-30). "Microsoft adds Ethereum language Solidity to Visual Studio". International Business Times. Retrieved 2016-05-11.

External links

This article is issued from Wikipedia - version of the 12/1/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.