Share:
Notifications
Clear all

Earn While Learning Web3 Programming>> Start Here FREE!!!

[Solved] Solidity Smart Contract Example - Web3 Programming

1 Posts
1 Users
2 Reactions
645 Views
1
Topic starter

What does Smart Contract in Solidity looks like?

1 Answer
1
Topic starter

Here is a quick and simplified solidity smart contract examples with an output of "Hello World":

 

 

pragma solidity 0.8.7; //version of solidity compiler to use

contract HelloWorld {

          //you need a function to output the HelloWorld

           function helloWorld() public pure returns(string memory) {

                   return "Hello World";

           }

 

}

 

You just learnt how to write and Hello World in Solidity Smart Contract.

If you want to run this code, copy and paste it inside this free online Solidity REMIX IDE

 

NOTE:

This Is An Extract From Our FREE Smart Contract Development With Solidity For Beginners Course (If you have not enrolled yet, you can join the course totally for FREE).

Share: