Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Warning

As of 2016-05-13, The Mist wallet is still a beta software and shall be used at your own risk. A bug can leave you with a broken wallet and a potential lost of your wallet content.

Solidity

...

Ethereum’s JavaScript-like programming language used to write smart contracts is called solidity StatuscolourRedtitleTO WRITE. Solidity is roughly speaking, an object-oriented language designed for writing contracts in Ethereum. This is a language designed specifically to help express agreements that must encode ideas and relationships relevant to Real Life, or some formal model thereof. As such we see notions such as ownership, identity, protections and restrictions forming a core part of the vocabulary and idiomatic grammar.

Contract

The contract is the basic structure of Solidity. It is a prototype of an object which lives on the blockchain. A contract may be instantiated into a contract-account (or 'object', or sometimes just 'account') at which point it gets a uniquely identifying address with which is may be called. The address here is similar to a reference or pointer in C-like languages, or just a plain old object in Javascript. Like plain objects in many object-oriented languages, contracts can never run themselves - they may only be called, or, put another way, they can only react to the receipt of a message; they can never be proactive.

To make it do something when it receives a message, we can introduce a function. The syntax of a function is similar to Javascript: it begins with the function keyword, then has a parenthesised parameter list, and finally has a braced expression block.

Example:

 

Code Block
languagexml
themeDJango
contract MyBasicAddition {
	    function() {
        var two = 1 + 1;
    }
 }

Smart contract

...

Panel
borderColor#348AC7
borderWidth5
borderStylesolid

From Vitalik Buterin in ethereum blog: a smart contract is a mechanism involving digital assets and two or more parties, where some or all of the parties put assets in and assets are automatically redistributed among those parties according to a formula based on certain data that is not known at the time the contract is initiated.

...