-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVariables.sol
43 lines (30 loc) · 877 Bytes
/
Variables.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.4;
contract WorkingWithVariables {
uint256 public myUint;
function setMyUint(uint256 _myUint) public {
myUint = _myUint;
}
bool public myBool;
function setMyBool(bool _myBool) public {
myBool = _myBool;
}
uint8 public myUint8;
function incrementUint() public {
myUint8++;
}
function decrementUint() public {
myUint8--;
}
address public myAddress;
function setAddress(address _address) public {
myAddress = _address;
}
function getBalanceOfAddress() public view returns(uint) {
return myAddress.balance;
}
string public myString = 'Hello World!';
function setMyString(string memory _myString) public {
myString = _myString;
}
}