Ethereum, tokens & smart contracts.

Notes on getting started Part 3. Solidity.

Keno Leon

--

The next step in this little trek towards making smart contracts and tokens in the Ethereum ecosystem will be to actually start coding contracts and tokens and release them and test them in the wild ( a test net not the real blockchain for now).

Enter Solidity.

In a nutshell, Solidity ( check for the correct docs version !) is the language in which you write contracts, it’s syntax is similar to javascript (importantly it is statically typed and supports libraries and other cool features). So the plan is to write a contract, then compile it and then release/interact with it through web3.js which we briefly covered in the last part of this series. So let’s start with a very very simple contract.

pragma solidity ^0.4.0;contract HelloWorldContract {
function sayHi() constant returns (string){
return 'Hello World';
}
}

While it might look simple, there is a lot going on here, so let’s comment this example:

// You will also need a solidity linter for ATOM ! like linter-solidity// FILE : HelloWorldContract.sol
// Notice the .sol (for solidity) extension.
pragma solidity ^0.4.0;

--

--