Welcome to Solidity!

Photo by Nenad Novaković on Unsplash

What is a Blockchain?

How is web2 different from web3?

Why web3, and what are its use cases?

Programming in web3.

Solidity Syntax

“Hello, World!” in Solidity.

//SPDX-Licenses-Identifier: MIT
pragma solidity ^0.8.16;
contract HelloWorld {
address public owner;
string greeting;
constructor(){
owner = msg.sender;
}
function setGreeting() public {
greeting = "Hello, World!";
}
function getGreeting() public view returns(string memory) {
return greeting;
}
}
//SPDX-Licenses-Identifier: MIT
pragma solidity ^0.8.16;
Contract HelloWorld {
}
address public owner;
string greeting;
constructor(){
owner = msg.sender;
}
function setGreeting() public {
greeting = "Hello, World!";
}
function getGreeting() public view returns(string memory) {
return greeting;
}
function setGreeting(string memory _greeting) public {
string memory s = "Hello ";
greeting = string.concat(s, _greeting);
}

Conclusion.

Resources.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Emmanuel Odianosen

Software Developer living in Lagos, Nigeria. A Technical Writer proficient in JavaScript and Solidity.