Ethereum. Smart Contract

Ethereum. Smart Contract

Ethereum platform

Ethereum has established itself as a most versatile platform catering to multiple applications. This is as of now. Only time will tell whether it will proceed to an enormously powerful globally shared software platform built with Blockchain technology. One of the most prominent development in the IT space is developing Smart Contracts in Ethereum Platform. An year back itself this Techcrunch article states this with the following words:

Ethereum is the platform of choice because it offers a Blockchain platform with a built-in abstraction layer, which serves to unify the ecosystem. Ethereum offers the tantalizing promise of one chain to rule them all, or at least one chain to act as the foundation.

Ethereum Smart contract

Ethereum Smart Contract is every where now. A contract is an agreement usually enforceable or legally binding. Even an order or purchase order can be taken as a contract. A contract may have its own and general terms and conditions. A smart contract is a computer protocol intended to facilitate, verify, or enforce the negotiation or performance of a contract.

How to develop Smart Contracts

Smart contracts being executable software programs are usually created by software programmers. Any programming language can be used to build Smart contracts; One of the most recommended and used programming language is Solidity. Solidity is a contract-oriented, high-level language whose syntax is similar to that of JavaScript and it is designed to target the EVM -Ethereum Virtual Machine. A contract in the sense of Solidity is a collection of code (its functions) and data (its state) that resides at a specific address on the Ethereum Blockchain.

A Smart Contract example

The following is one of the simple examples of a Smart contract code:


The following is an extremely basic example of a solidity contract.

It takes a string upon creation and then repeats it when greet() is called.


contract Greeter         // The contract definition. A constructor of the same name will be automatically called on contract creation.


address creator;     // At first, an empty “address”-type variable of the name “creator”. Will be set in the constructor.

string greeting;     // At first, an empty “string”-type variable of the name “greeting”. Will be set in constructor and can be changed.

function Greeter(string _greeting) public   // The constructor. It accepts a string input and saves it to the contract’s “greeting” variable.


creator = msg.sender;

greeting = _greeting;


function greet() constant returns (string)


return greeting;


function getBlockNumber() constant returns (uint) // this doesn’t have anything to do with the act of greeting

// just demonstrating return of some global variable

return block.number;


function setGreeting(string _newgreeting)


greeting = _newgreeting;



Standard kill() function to recover funds


function kill()


if (msg.sender == creator)  // only allow this action if the account sending the signal is the creator

suicide(creator);       // kills this contract and sends remaining funds back to creator


We will continue to see more about Smart Contracts.

/Malick, Chain Scripts, Chennai, India.

‘I have no special talent. I am only passionately curious’. -Albert Einstein


Leave a Reply

Your email address will not be published. Required fields are marked *