We’re going to use Solidity to write a simple HelloWorld smart contract. This is our starting point to create more complex logic and functions.

The HelloWorld contract

This contract aims to store a string variable called message on the blockchain. The initial value is set to a "Hello, World!" string, but the contract also provides a public function called setMessage to allow changing the value of the message variable. The basic structure of the contract is:

Get hands-on with 1400+ tech skills courses.