-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontract work remmaing
139 lines (99 loc) · 6.04 KB
/
contract work remmaing
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
one - 681c13066f27a55812dc47dde3ddac7fd70f7f783013d577759621c2f911b50b
two - db534987ef647a27528e824cbf3bf85a63533910699c0c88ad617daa3689586c
three = 728c6aa16193bb077a5d4d6cbdb44d7f53b0af5a63c831e16486177b31ae7b72
Member storage member = members[msg.sender];
address payable _refAddr1 = member.refFrom;
address payable _refAddr2 = members[_refAddr1].refFrom;
address payable _refAddr3 = members[_refAddr2].refFrom;
address payable _refAddr4 = members[_refAddr3].refFrom;
address payable _refAddr5 = members[_refAddr4].refFrom;
address payable _refAddr6 = members[_refAddr5].refFrom;
address payable _refAddr7 = members[_refAddr6].refFrom;
address payable _refAddr8 = members[_refAddr7].refFrom;
address payable _refAddr9 = members[_refAddr8].refFrom;
address payable _refAddr10 = members[_refAddr9].refFrom;
uint256 _allref = (members[msg.sender].avlBalance.mul(40)).div(100);
owner.transfer(_allref);
uint256 _totalReffRewards = 0;
uint _compInterest = 4;
if (_refAddr1 != address(0) && members[_refAddr1].isActive == 1) {
_totalReffRewards = (_allref.mul(_compInterest)).div(100);
_allref = _allref.sub(_totalReffRewards);
members[_refAddr1].avlBalance = _totalReffRewards.add(members[_refAddr1].avlBalance);
members[_refAddr1].totalRewards = _totalReffRewards.add(members[_refAddr1].totalRewards);
checkActive(_refAddr1);
}
if (_refAddr2 != address(0) && members[_refAddr2].isActive == 1) {
_totalReffRewards = (_allref.mul(_compInterest)).div(100);
_allref = _allref.sub(_totalReffRewards);
members[_refAddr2].avlBalance = _totalReffRewards.add(members[_refAddr2].avlBalance);
members[_refAddr2].totalRewards = _totalReffRewards.add(members[_refAddr2].totalRewards);
checkActive(_refAddr2);
}
if (_refAddr3 != address(0) && members[_refAddr3].isActive == 1) {
_totalReffRewards = (_allref.mul(_compInterest)).div(100);
_allref = _allref.sub(_totalReffRewards);
members[_refAddr3].avlBalance = _totalReffRewards.add(members[_refAddr3].avlBalance);
members[_refAddr3].totalRewards = _totalReffRewards.add(members[_refAddr3].totalRewards);
checkActive(_refAddr3);
}
if (_refAddr4 != address(0) && members[_refAddr4].isActive == 1) {
_totalReffRewards = (_allref.mul(_compInterest)).div(100);
_allref = _allref.sub(_totalReffRewards);
members[_refAddr4].avlBalance = _totalReffRewards.add(members[_refAddr4].avlBalance);
members[_refAddr4].totalRewards = _totalReffRewards.add(members[_refAddr4].totalRewards);
checkActive(_refAddr4);
}
if (_refAddr5 != address(0) && members[_refAddr5].isActive == 1) {
_totalReffRewards = (_allref.mul(_compInterest)).div(100);
_allref = _allref.sub(_totalReffRewards);
members[_refAddr5].avlBalance = _totalReffRewards.add(members[_refAddr5].avlBalance);
members[_refAddr5].totalRewards = _totalReffRewards.add(members[_refAddr5].totalRewards);
checkActive(_refAddr5);
}
if (_refAddr6 != address(0) && members[_refAddr6].isActive == 1) {
_totalReffRewards = (_allref.mul(_compInterest)).div(100);
_allref = _allref.sub(_totalReffRewards);
members[_refAddr6].avlBalance = _totalReffRewards.add(members[_refAddr6].avlBalance);
members[_refAddr6].totalRewards = _totalReffRewards.add(members[_refAddr6].totalRewards);
checkActive(_refAddr6);
}
if (_refAddr7 != address(0) && members[_refAddr7].isActive == 1) {
_totalReffRewards = (_allref.mul(_compInterest)).div(100);
_allref = _allref.sub(_totalReffRewards);
members[_refAddr7].avlBalance = _totalReffRewards.add(members[_refAddr7].avlBalance);
members[_refAddr7].totalRewards = _totalReffRewards.add(members[_refAddr7].totalRewards);
checkActive(_refAddr7);
}
if (_refAddr8 != address(0) && members[_refAddr8].isActive == 1) {
_totalReffRewards = (_allref.mul(_compInterest)).div(100);
_allref = _allref.sub(_totalReffRewards);
members[_refAddr8].avlBalance = _totalReffRewards.add(members[_refAddr8].avlBalance);
members[_refAddr8].totalRewards = _totalReffRewards.add(members[_refAddr8].totalRewards);
checkActive(_refAddr8);
}
if (_refAddr9 != address(0) && members[_refAddr9].isActive == 1) {
_totalReffRewards = (_allref.mul(_compInterest)).div(100);
_allref = _allref.sub(_totalReffRewards);
if(members[_refAddr9].level1Count >= 10){
checkActive(_refAddr9);
members[_refAddr9].avlBalance = _totalReffRewards.add(members[_refAddr9].avlBalance);
members[_refAddr9].totalRewards = _totalReffRewards.add(members[_refAddr9].totalRewards);
} else {
owner.transfer(_totalReffRewards);
}
}
if (_refAddr10 != address(0) && members[_refAddr10].isActive == 1) {
_totalReffRewards = (_allref.mul(_compInterest)).div(100);
_allref = _allref.sub(_totalReffRewards);
if(members[_refAddr10].level1Count >= 10){
members[_refAddr10].avlBalance = _totalReffRewards.add(members[_refAddr10].avlBalance);
members[_refAddr10].totalRewards = _totalReffRewards.add(members[_refAddr10].totalRewards);
checkActive(_refAddr10);
} else {
owner.transfer(_totalReffRewards);
}
}
if(_allref > 0 ){
owner.transfer(_allref);
}