A Collection of Code Snippets in as Many Programming Languages as Possible
This project is maintained by TheRenegadeCoder
Welcome to the Hello World in Solidity page! Here, you'll find the source code for this program as well as a description of how the program works.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8;
contract HelloWorld {
function main (string memory) public pure returns (string memory) {
return 'Hello, World!\n';
}
}
Hello World in Solidity was written by:
This article was written by:
If you see anything you'd like to change or update, please consider contributing.
While the format of Solidity looks a bit different from the more popular programming languages today, what's happening behind is fairly straightforward.
First we import the version of Solidity we'd like to use. Then we create a function and specify we'd only like to return a string. And, voila!
If you want to run the solution, remix provides an IDE you can visit to write and execute the smart contract. Every piece of code written in Solidity, or any blockchain programming language, is considered a smart contract.