Pages

Simple example of Smart Contract with Remix


Online IDE
https://remix.ethereum.org/


pragma solidity ^0.4.0; // like import library

contract unlvcontract{ // class name
    string str="unlv contract";


   //getting string
    function getter() constant returns(string){
         return str;
    }



   //setting test using
    function setter(string newStr){
        str=newStr;
    }

}

The right side of online IDE




Click "Run" tap and "Create" Button.

Using setter button, you can input data.

Getter button is to get the string in the contract.
Share:

No comments:

Post a Comment

Powered by Blogger.

Popular Posts