// Specifies that the source code is for a version of Solidity of exactly 0.8.0
pragma solidity 0.8.0;
// A contract is a collection of functions and data (its state)
// that resides at a specific address on the Ethereum blockchain.
contract HelloWorld {
// The keyword "public" makes variables accessible from outside a contract
// and creates a function that other contracts or SDKs can call to access the value
string public message;
// A special function only run during the creation of the contract
constructor(string memory initMessage) public {
// Takes a string value and stores the value in the memory data storage area,
// setting `message` to that value
message = initMessage;
}
// A publicly accessible function that takes a string as a parameter
// and updates `message`
function update(string memory newMessage) public {
message = newMessage;
}
}
from ethereum.org