Solidity language for blockchain

Posted By : Himanshu sharma | 12-Dec-2016

Solidity Language for Blockchain

I will disscuss those point which is to be reminber before implementing solidity .

The syntax for this language is 

pragma solidity ^0.4.0;

contract SimpleStorage {
    uint storedData;

    function set(uint x) {
        storedData = x;
    }

    function get() constant returns (uint) {
        return storedData;
    }
}

There is a function 'set ' which is use for storeing data inside contract variable and it can be accessed by 'get'  function .

Constant -> define that in this function not updation of record will we done. Hence  for this function no transaction payment will be done.

You can compile this code by various Ethereum api tool (web3 , ethereumj).

Make sure you give proper gas for transaction otherwise the operation will we not successfull.

THANKS

About Author

Author Image
Himanshu sharma

Himanshu has marvelous coding skills. In Free time too he loves to do coding and sometimes play Cricket.

Request for Proposal

Name is required

Comment is required

Sending message..