-
Notifications
You must be signed in to change notification settings - Fork 0
/
modIfier.sol
53 lines (36 loc) · 840 Bytes
/
modIfier.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
44
45
46
47
48
49
50
51
52
53
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.1;
contract modIfier{
uint a;
uint b;
uint c;
uint d;
address owner;
constructor(){
owner = msg.sender;
}
modifier onlyOwner{
require(owner == msg.sender, "only owner can access");
_;
}
function setter (uint _a, uint _b, uint _c, uint _d) public onlyOwner{
a = _a;
b = _b;
c = _c;
d = _d;
}
function getter() public view onlyOwner returns(uint){
if((a > b) && (a > c) && (a > d)){
return a;
}
if((b > a) && (b > c) && (b > d)){
return b;
}
if((c > a) && (c > b) && (c > d)){
return c;
}
if((d > a) && (d > b) && (d > c)){
return d;
}
}
}