Earn While Learning Web3 Programming>> Start Here FREE!!!
What does Smart Contract in Solidity looks like?
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).