Use Remix to deploy and interact with a contract.
Storage
ContractStorage
contract.
0xd8b934580fcE35a11B58C6D73aDeE468a2833fa8
.
The address is what you will use to find your contract with tools such as Etherscan, or to connect to it with a front end.
However, when you deploy using the Remix VM simulation, it will only exist in your browser.
public
function in the Storage
contract. Notice how the Store button also has a field to pass a uint256, matching the parameter for uint256 num
.
number
variable was instantiated without a value, what do you think the return will be?
Go ahead and click – the result will appear below the button as:
uint256
of 0. Were you expecting undefined
or an error?
Unlike many languages, variables in Solidity have a default value if not assigned. For uint
and int
, that value is 0.
You can also review the results of your transaction in the console.