Introduction to smart contracts

Let's begin with the most basic smart contract example,  HelloWorld.solshown as follows:

pragma solidity ^0.4.24;

contract HelloWorld {
string public greeting;

constructor() public {
greeting = 'Hello World';
}

function setNewGreeting (string _newGreeting) public {
greeting = _newGreeting;
}
}

Solidity's file extension is .sol.  It is similar to .js for JavaScript files, and .html for HTML templates.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.138.104