// SPDX-License-Identifier: MIT
// Specifies the license under which this contract is made available; MIT License in this case
pragma solidity ^0.8.9;
// Specifies the compiler version this contract is compatible with
// Define a contract named HelloWorld
contract HelloWorld {
// Declare a private state variable of type uint (unsigned integer)
// This variable is not accessible outside of this contract directly
uint private simpleInt;
// Constructor function that's called when the contract is deployed
// Sets the initial value of simpleInt to 5
constructor() {
simpleInt = 5;
}
// Public function that returns the current value of simpleInt
// Marked as view because it doesn't modify the contract's state
function GetValue() public view returns (uint) {
return simpleInt;
}
// Public function that allows updating the value of simpleInt
// Takes an unsigned integer _value as input
function SetValue(uint _value) public {
simpleInt = _value;
}
}
// Deploy: