Ethereum. Smart Contract
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
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)
function getBlockNumber() constant returns (uint) // this doesn’t have anything to do with the act of greeting
// just demonstrating return of some global variable
function setGreeting(string _newgreeting)
greeting = _newgreeting;
Standard kill() function to recover funds
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