-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexercise.sol
More file actions
44 lines (26 loc) · 999 Bytes
/
exercise.sol
File metadata and controls
44 lines (26 loc) · 999 Bytes
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
44
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract tech4dev{
// CLASS WORK 1 Create a function that will return the address of the person interacting with the contract.
//address sender = msg.sender;
function Victoria() public view returns(address) {
address sender = msg.sender;
return(sender);
}
// CLASSWORK 2 Create a function that will return timestamp in solidity.
function Tonia() public view returns(uint) {
uint timestamp = block.timestamp;
return(timestamp);
}
/*CLASSWORK 3 Create a variable called Michael which is a state variable that is equal to 100.
Then create a function called add where we increase Michael by 5 and immediately increase Michael by 2.
Moreso, create a function that will decrease Michael by 3*/
uint public Michael = 100;
function add() public{
Michael +=5;
Michael +=2;
}
function decrease() public{
Michael -=3;
}
}