Created
July 14, 2023 16:04
-
-
Save arturmartins/02abf10a5dd87dde36ad7c15c72d6e0f to your computer and use it in GitHub Desktop.
Ethereum Smart Contract - HelloWorld example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity 0.8.20; | |
// This defines a contract named “HelloWorld”. | |
// | |
// A contract is a collection of functions and data (its state). | |
// Once deployed, a contract will exist at an address on the Ethereum blockchain. | |
contract HelloWorld { | |
// This is a public function that returns the string “Hello World”. | |
// It is declared pure because it doesn’t read or modify the blockchain state. | |
function sayHelloWorld() public pure returns (string memory) { | |
return "Hello World"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment