Dec 19, 2023
Tutorials
ZxStim
// SPDX-License-Identifier: MIT
comment in your solidity file. Without the license identifier, the Solidity Compiler will produce a warning but not error.pragma
specifies the compiler version of Solidity.contract
to declare a contract in Solidity followed by the contract name HelloWorld
and curly brackets.public
variable that is a string
with name as greet
and assigned value as Hello World!
. Make sure you end with semicolon ;
.Compile and deploy the code block below:
solidityHelloWorld.sol// SPDX-License-Identifier: MIT // compiler version must be greater than or equal to 0.8.20 and less than 0.9.0 pragma solidity ^0.8.20; contract HelloWorld { string public greet = "Hello World!"; }