<100 subscribers


Share Dialog
Share Dialog
This is a series of my initial approach to Solidity language.
// SPDX-License-Identifier: MIT
// compiler version must be greater than or equal to 0.8.13 and less than 0.9.0
pragma solidity ^0.8.13;
contract HelloSolidityWorld {
string public greet = "Hello Solidity World!";
}
pragma specifies the compiler version of Solidity.
By convention the contract name is written in UpperCamelCase, for that reason here we see HelloSolidityWorld as the contract name.
The contract has a state variable named “greet” and its type is string and public visibility, and it’s initialized with a string.
In my opinion, some of solidity code is similar to Java or C/C++, here we see that a contract looks like a Java class, and the sentences should be closed with a semicolon.
The next posts we will see more resemblances.
See the next post:
https://mirror.xyz/cryptovincent.eth/T7uEWlj5TfP5GVMoxhVxU7bQoHhYRA2CBXU37zk1bug
This is a series of my initial approach to Solidity language.
// SPDX-License-Identifier: MIT
// compiler version must be greater than or equal to 0.8.13 and less than 0.9.0
pragma solidity ^0.8.13;
contract HelloSolidityWorld {
string public greet = "Hello Solidity World!";
}
pragma specifies the compiler version of Solidity.
By convention the contract name is written in UpperCamelCase, for that reason here we see HelloSolidityWorld as the contract name.
The contract has a state variable named “greet” and its type is string and public visibility, and it’s initialized with a string.
In my opinion, some of solidity code is similar to Java or C/C++, here we see that a contract looks like a Java class, and the sentences should be closed with a semicolon.
The next posts we will see more resemblances.
See the next post:
https://mirror.xyz/cryptovincent.eth/T7uEWlj5TfP5GVMoxhVxU7bQoHhYRA2CBXU37zk1bug
No comments yet