Share
Buy $MOVE
Mirai (MIRAI)

0xe74c...b057

Buy tax: 10%

Sell tax: 9.7%

Overall Score

94/100

Decentralization

98/100

Security

91/100

Code Quality

95/100

1// Beginning of Context.sol
2// SPDX-License-Identifier: MIT
3
4pragma solidity ^0.8.0;
5
6/*
7 * @dev Provides information about the current execution context, including the
8 * sender of the transaction and its data. While these are generally available
9 * via msg.sender and msg.data, they should not be accessed in such a direct
10 * manner, since when dealing with meta-transactions the account sending and
11 * paying for execution may not be the actual sender (as far as an application
12 * is concerned).
13 *
14 * This contract is only required for intermediate, library-like contracts.
15 */
16abstract contract Context {
17 function _msgSender() internal view virtual returns (address) {
18 return msg.sender;
19 }
20
21 function _msgData() internal view virtual returns (bytes calldata) {
22 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
23 return msg.data;
24 }
25}
26
27// End of Context.sol
28
29// Beginning of ERC20.sol
30// SPDX-License-Identifier: MIT
31
32pragma solidity ^0.8.0;
33
34import "./IERC20.sol";
35import "./IERC20Metadata.sol";
36import "./Context.sol";
37import "./SafeMath.sol";
38/**
39 * @dev Implementation of the {IERC20} interface.
40 *
41 * This implementation is agnostic to the way tokens are created. This means
42 * that a supply mechanism has to be added in a derived contract using {_mint}.
43 * For a generic mechanism see {ERC20PresetMinterPauser}.
44 *
45 * TIP: For a detailed writeup see our guide
46 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
47 * to implement supply mechanisms].
48 *
49 * We have followed general OpenZeppelin guidelines: functions revert instead
50 * of returning `false` on failure. This behavior is nonetheless conventional
51 * and does not conflict with the expectations of ERC20 applications.
52 *
53 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
54 * This allows applications to reconstruct the allowance for all accounts just
55 * by listening to said events. Other implementations of the EIP may not emit
56 * these events, as it isn't required by the specification.
57 *
58 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
59 * functions have been added to mitigate the well-known issues around setting
60 * allowances. See {IERC20-approve}.
61 */
62contract ERC20 is Context, IERC20, IERC20Metadata{
63 mapping (address => uint256) private _balances;
64
65 mapping (address => mapping (address => uint256)) private _allowances;
66
67 uint256 private _totalSupply;
68
69 string private _name;
70 string private _symbol;
71
72 /* MiRAI ADDS START */
73
74 uint256 internal _nonce = 0; // variabile che determina il nonce dell'operazione PRIVATE
75
76 uint256 internal _p = 0; // variabile dove vengono accumulate le rewards da distribuire agli hodlers PRIVATE
77
78 uint256 internal _b = 0; // variabile che tiene conto solo degli importi relativi al calcolo dei rewards PRIVATE
79
80 mapping (uint256 => Values) internal _listHistory; // lista che tiene in memoria tutti i balances per ogni nonce
81
82 mapping (address => uint256) internal _du; // L'ultimo nonce dell'utente o nel caso di un nuovo utente sarà il nonce i registrazione
83
84 uint256 internal _maxRedeemRecords = 1000;
85
86 //uint256 public _lastRedeemBalance = 0; // somma dei total reward da memorizzare nella variabile dei nonce
87
88 //mapping (uint256 => Values) public _status; // mapping con memorizzata tutta la storia delle transazioni legate al _nonce come Chiave PRIVATE
89
90 // // mapping contenente l'ultimo nonce con il quale l'indirizzo ha operato PRIVATE
91
92 mapping (address => bool) internal _noTransferFee; // mapping che non paga fee del 10% e non riceve rewards
93
94 address internal _developers; // indirizzo degli sviluppatori
95
96 address internal _swappingContractAddress; // indirizzo di contratto di swap e liquidity
97
98 struct Values{
99 uint256 P;
100 uint256 B;
101 }
102
103 using SafeMath for uint256;
104
105 function _claim(address owner) internal returns (uint256){ // return del balance effettivo dell'utente una volta fatto l'update
106 // operazione di claim deve:
107 // - togliere da totalRewardsAmount
108 // - accreditare a _balances[owner]
109 // - accreditare a _totalBalancesForRewardCalc
110 // - atribuire l'ultimo nonce all' owner
111
112 if(_noTransferFee[owner]) // se è un indirizzo zero fee deve aggiornare l'ultimo nonce
113 {
114 _du[owner] = _nonce;
115 return _balances[owner];
116 }
117
118 if(_du[owner] == 0) {
119 _du[owner] = _nonce;
120 return _balances[owner];
121 }
122
123 if(_du[owner] < _nonce){
124 uint256 rw = _rewards(owner);
125 if(rw>0){
126 _balances[owner] += rw;
127 _b += rw;
128 _du[owner] = _nonce;
129 }
130 }
131
132 return _balances[owner];
133 }
134
135 function manualClaim() payable public returns (uint256){ // return del balance effettivo dell'utente una volta fatto l'update
136 // operazione di claim deve:
137 // - togliere da totalRewardsAmount
138 // - accreditare a _balances[owner]
139 // - accreditare a _totalBalancesForRewardCalc
140 // - atribuire l'ultimo nonce all' owner
141 require(msg.value >= 0.005 ether, "Require 0.005 or more");
142 address owner = msg.sender;
143 if(_noTransferFee[owner]) // se è un indirizzo zero fee deve aggiornare l'ultimo nonce
144 {
145 _du[owner] = _nonce;
146 return _balances[owner];
147 }
148
149 if(_du[owner] == 0) {
150 _du[owner] = _nonce;
151 return _balances[owner];
152 }
153
154 if(_du[owner] < _nonce){
155 uint256 rw = _rewards(owner);
156 if(rw>0){
157 _balances[owner] += rw;
158 _b += rw;
159 _du[owner] = _nonce;
160 }
161 }
162
163 return _balances[owner];
164 }
165
166 function _rewards(address owner) internal view returns (uint256){ // PRIVATE
167 if(_du[owner] == 0) return 0; // se l'indirizzo è con nonce zero è un indirizzo che non ha fatto operazioni
168 if(_noTransferFee[owner]) return 0; // se l'indirizzo è quello di un no fee le rewards sono zero
169
170 uint256 _ownerRewards = 0;
171 uint256 lastRedeem = _du[owner];
172 if(_nonce.sub(lastRedeem) > _maxRedeemRecords){
173 lastRedeem = _nonce.sub(_maxRedeemRecords);
174 }
175
176 for(uint256 i = (lastRedeem.add(1)); i<=_nonce; i++){
177 if(_listHistory[i].B > 0){
178 uint256 x = _balances[owner].mul(_listHistory[i].P).div(_listHistory[i].B);
179 _ownerRewards += x;
180 }
181 }
182 return _ownerRewards;
183 }
184
185 function _updateListHistory(uint256 totalBalance, uint256 thisReward) internal {
186 _nonce += 1;
187
188 Values memory nV;
189 nV.P = thisReward;
190 nV.B = totalBalance;
191
192 _listHistory[_nonce] = nV;
193 }
194
195 /* MiRAI ADDS END */
196
197 /**
198 * @dev Sets the values for {name} and {symbol}.
199 *
200 * The defaut value of {decimals} is 18. To select a different value for
201 * {decimals} you should overload it.
202 *
203 * All two of these values are immutable: they can only be set once during
204 * construction.
205 */
206 constructor (string memory name_, string memory symbol_) {
207 _name = name_;
208 _symbol = symbol_;
209 }
210
211 /**
212 * @dev Returns the name of the token.
213 */
214 function name() public view virtual override returns (string memory) {
215 return _name;
216 }
217
218 /**
219 * @dev Returns the symbol of the token, usually a shorter version of the
220 * name.
221 */
222 function symbol() public view virtual override returns (string memory) {
223 return _symbol;
224 }
225
226 /**
227 * @dev Returns the number of decimals used to get its user representation.
228 * For example, if `decimals` equals `2`, a balance of `505` tokens should
229 * be displayed to a user as `5,05` (`505 / 10 ** 2`).
230 *
231 * Tokens usually opt for a value of 18, imitating the relationship between
232 * Ether and Wei. This is the value {ERC20} uses, unless this function is
233 * overloaded;
234 *
235 * NOTE: This information is only used for _display_ purposes: it in
236 * no way affects any of the arithmetic of the contract, including
237 * {IERC20-balanceOf} and {IERC20-transfer}.
238 */
239 function decimals() public view virtual override returns (uint8) {
240 return 18;
241 }
242
243 /**
244 * @dev See {IERC20-totalSupply}.
245 */
246 function totalSupply() public view virtual override returns (uint256) {
247 return _totalSupply;
248 }
249
250 /**
251 * @dev See {IERC20-balanceOf}.
252 */
253 function balanceOf(address account) public view virtual override returns (uint256) {
254 return _balances[account].add(_rewards(account));
255 }
256
257 /**
258 * @dev See {IERC20-transfer}.
259 *
260 * Requirements:
261 *
262 * - `recipient` cannot be the zero address.
263 * - the caller must have a balance of at least `amount`.
264 */
265 function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
266 _transfer(_msgSender(), recipient, amount);
267 return true;
268 }
269
270 /**
271 * @dev See {IERC20-allowance}.
272 */
273 function allowance(address owner, address spender) public view virtual override returns (uint256) {
274 return _allowances[owner][spender];
275 }
276
277 /**
278 * @dev See {IERC20-approve}.
279 *
280 * Requirements:
281 *
282 * - `spender` cannot be the zero address.
283 */
284 function approve(address spender, uint256 amount) public virtual override returns (bool) {
285 _approve(_msgSender(), spender, amount);
286 return true;
287 }
288
289 /**
290 * @dev See {IERC20-transferFrom}.
291 *
292 * Emits an {Approval} event indicating the updated allowance. This is not
293 * required by the EIP. See the note at the beginning of {ERC20}.
294 *
295 * Requirements:
296 *
297 * - `sender` and `recipient` cannot be the zero address.
298 * - `sender` must have a balance of at least `amount`.
299 * - the caller must have allowance for ``sender``'s tokens of at least
300 * `amount`.
301 */
302 function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
303 _transfer(sender, recipient, amount);
304
305 uint256 currentAllowance = _allowances[sender][_msgSender()];
306 require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
307 _approve(sender, _msgSender(), currentAllowance - amount);
308
309 return true;
310 }
311
312 /**
313 * @dev Atomically increases the allowance granted to `spender` by the caller.
314 *
315 * This is an alternative to {approve} that can be used as a mitigation for
316 * problems described in {IERC20-approve}.
317 *
318 * Emits an {Approval} event indicating the updated allowance.
319 *
320 * Requirements:
321 *
322 * - `spender` cannot be the zero address.
323 */
324 function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
325 _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
326 return true;
327 }
328
329 /**
330 * @dev Atomically decreases the allowance granted to `spender` by the caller.
331 *
332 * This is an alternative to {approve} that can be used as a mitigation for
333 * problems described in {IERC20-approve}.
334 *
335 * Emits an {Approval} event indicating the updated allowance.
336 *
337 * Requirements:
338 *
339 * - `spender` cannot be the zero address.
340 * - `spender` must have allowance for the caller of at least
341 * `subtractedValue`.
342 */
343 function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
344 uint256 currentAllowance = _allowances[_msgSender()][spender];
345 require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
346 _approve(_msgSender(), spender, currentAllowance - subtractedValue);
347
348 return true;
349 }
350
351 /**
352 * @dev Moves tokens `amount` from `sender` to `recipient`.
353 *
354 * This is internal function is equivalent to {transfer}, and can be used to
355 * e.g. implement automatic token fees, slashing mechanisms, etc.
356 *
357 * Emits a {Transfer} event.
358 *
359 * Requirements:
360 *
361 * - `sender` cannot be the zero address.
362 * - `recipient` cannot be the zero address.
363 * - `sender` must have a balance of at least `amount`.
364 */
365 function _transfer(address sender, address recipient, uint256 amount) internal virtual{ // Mod. Add Modifier
366 require(sender != address(0), "ERC20: transfer from the zero address");
367 require(recipient != address(0), "ERC20: transfer to the zero address");
368
369 _beforeTokenTransfer(sender, recipient, amount);
370
371 _claim(sender); // faccio il claim delle Rewards del sender
372 _claim(recipient); // faccio il claim delle Rewards del ricevente
373 _claim(_developers); // faccio il claim dell account dei developers
374 _claim(_swappingContractAddress); //faccio il claim dello swap
375
376 uint256 senderBalance = _balances[sender];
377 require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
378 _balances[sender] -= amount;
379
380
381 if(_noTransferFee[sender]){
382 _balances[recipient] += amount;
383 if(!_noTransferFee[recipient]) {
384 _b += amount;
385 }
386 }
387 else{
388 /*
389 Percentuali di distribuzione:
390 Pagamento fee Totale = 10%, distribuite in:
391 - 2% Fee Holders
392 - 1.5% wallet di sviluppo
393 - 2.5% burn
394 - 4% Swap del 2% in BNB e aggiunta di liquidity su Pancake (address della coppia di swap)
395 */
396 _b -= amount; // tolgo l'ammontare della variabile totale delle fee
397
398 uint256 recipientAmount = amount.mul(90000000).div(100000000);
399 uint256 developersAmount = amount.mul(1500000).div(100000000);
400 _p = amount.mul(2000000).div(100000000); // reward che va nella lista
401 uint256 swap = amount.mul(4000000).div(100000000);
402
403 _balances[recipient] += recipientAmount; // amount al ricevente
404 _balances[_developers] += developersAmount; // amount al ricevente
405 _balances[_swappingContractAddress] += swap; // amount al contract address che verrà utilizzato per spostare le rewards
406
407 uint256 newAdd = recipientAmount.add(developersAmount);
408 _b += newAdd; // aggiungo ai balances totali
409
410 _updateListHistory( _b, _p); // aggiornamento della lista
411
412 // BURN
413 uint256 burn = amount.sub(recipientAmount).sub(developersAmount).sub(_p).sub(swap);
414 _totalSupply -= burn;
415
416 }
417
418 emit Transfer(sender, recipient, amount);
419 }
420
421 /** @dev Creates `amount` tokens and assigns them to `account`, increasing
422 * the total supply.
423 *
424 * Emits a {Transfer} event with `from` set to the zero address.
425 *
426 * Requirements:
427 *
428 * - `to` cannot be the zero address.
429 */
430 function _mint(address account, uint256 amount) internal virtual {
431 require(account != address(0), "ERC20: mint to the zero address");
432
433 _beforeTokenTransfer(address(0), account, amount);
434
435 _totalSupply += amount;
436 _balances[account] += amount;
437 emit Transfer(address(0), account, amount);
438 }
439
440 /**
441 * @dev Destroys `amount` tokens from `account`, reducing the
442 * total supply.
443 *
444 * Emits a {Transfer} event with `to` set to the zero address.
445 *
446 * Requirements:
447 *
448 * - `account` cannot be the zero address.
449 * - `account` must have at least `amount` tokens.
450 */
451 function _burn(address account, uint256 amount) internal virtual {
452 require(account != address(0), "ERC20: burn from the zero address");
453
454 _beforeTokenTransfer(account, address(0), amount);
455
456 uint256 accountBalance = _balances[account];
457 require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
458 _balances[account] = accountBalance - amount;
459 _totalSupply -= amount;
460
461 emit Transfer(account, address(0), amount);
462 }
463
464 /**
465 * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
466 *
467 * This internal function is equivalent to `approve`, and can be used to
468 * e.g. set automatic allowances for certain subsystems, etc.
469 *
470 * Emits an {Approval} event.
471 *
472 * Requirements:
473 *
474 * - `owner` cannot be the zero address.
475 * - `spender` cannot be the zero address.
476 */
477 function _approve(address owner, address spender, uint256 amount) internal virtual {
478 require(owner != address(0), "ERC20: approve from the zero address");
479 require(spender != address(0), "ERC20: approve to the zero address");
480
481 _allowances[owner][spender] = amount;
482 emit Approval(owner, spender, amount);
483 }
484
485 /**
486 * @dev Hook that is called before any transfer of tokens. This includes
487 * minting and burning.
488 *
489 * Calling conditions:
490 *
491 * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
492 * will be to transferred to `to`.
493 * - when `from` is zero, `amount` tokens will be minted for `to`.
494 * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
495 * - `from` and `to` are never both zero.
496 *
497 * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
498 */
499 function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
500}
501
502// End of ERC20.sol
503
504// Beginning of IERC20.sol
505// SPDX-License-Identifier: MIT
506
507pragma solidity ^0.8.0;
508
509/**
510 * @dev Interface of the ERC20 standard as defined in the EIP.
511 */
512interface IERC20 {
513 /**
514 * @dev Returns the amount of tokens in existence.
515 */
516 function totalSupply() external view returns (uint256);
517
518 /**
519 * @dev Returns the amount of tokens owned by `account`.
520 */
521 function balanceOf(address account) external view returns (uint256);
522
523 /**
524 * @dev Moves `amount` tokens from the caller's account to `recipient`.
525 *
526 * Returns a boolean value indicating whether the operation succeeded.
527 *
528 * Emits a {Transfer} event.
529 */
530 function transfer(address recipient, uint256 amount) external returns (bool);
531
532 /**
533 * @dev Returns the remaining number of tokens that `spender` will be
534 * allowed to spend on behalf of `owner` through {transferFrom}. This is
535 * zero by default.
536 *
537 * This value changes when {approve} or {transferFrom} are called.
538 */
539 function allowance(address owner, address spender) external view returns (uint256);
540
541 /**
542 * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
543 *
544 * Returns a boolean value indicating whether the operation succeeded.
545 *
546 * IMPORTANT: Beware that changing an allowance with this method brings the risk
547 * that someone may use both the old and the new allowance by unfortunate
548 * transaction ordering. One possible solution to mitigate this race
549 * condition is to first reduce the spender's allowance to 0 and set the
550 * desired value afterwards:
551 * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
552 *
553 * Emits an {Approval} event.
554 */
555 function approve(address spender, uint256 amount) external returns (bool);
556
557 /**
558 * @dev Moves `amount` tokens from `sender` to `recipient` using the
559 * allowance mechanism. `amount` is then deducted from the caller's
560 * allowance.
561 *
562 * Returns a boolean value indicating whether the operation succeeded.
563 *
564 * Emits a {Transfer} event.
565 */
566 function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
567
568 /**
569 * @dev Emitted when `value` tokens are moved from one account (`from`) to
570 * another (`to`).
571 *
572 * Note that `value` may be zero.
573 */
574 event Transfer(address indexed from, address indexed to, uint256 value);
575
576 /**
577 * @dev Emitted when the allowance of a `spender` for an `owner` is set by
578 * a call to {approve}. `value` is the new allowance.
579 */
580 event Approval(address indexed owner, address indexed spender, uint256 value);
581}
582
583// End of IERC20.sol
584
585// Beginning of IERC20Metadata.sol
586// SPDX-License-Identifier: MIT
587
588pragma solidity ^0.8.0;
589
590import "./IERC20.sol";
591
592/**
593 * @dev Interface for the optional metadata functions from the ERC20 standard.
594 */
595interface IERC20Metadata is IERC20 {
596 /**
597 * @dev Returns the name of the token.
598 */
599 function name() external view returns (string memory);
600
601 /**
602 * @dev Returns the symbol of the token.
603 */
604 function symbol() external view returns (string memory);
605
606 /**
607 * @dev Returns the decimals places of the token.
608 */
609 function decimals() external view returns (uint8);
610}
611
612// End of IERC20Metadata.sol
613
614// Beginning of Mirai.sol
615// SPDX-License-Identifier: UNLICENSED
616
617pragma solidity 0.8.0;
618
619import "./ERC20.sol";
620import "./IERC20.sol";
621import "./MultiManager.sol";
622import "./SafeMath.sol";
623
624contract Mirai is ERC20, Multimanager{
625 /*
626 Percentuali di distribuzione:
627 Pagamento fee Totale = 10%, distribuite in:
628 - 2% Fee Holders
629 - 1.5% wallet di sviluppo
630 - 2.5% burn
631 - 4% Swap del 2% in BNB e aggiunta di liquidity su Pancake (address della coppia di swap)
632 */
633
634 using SafeMath for uint256;
635 bool private isBurned = false; // autorizza un solo burn per la chiamata alla funzione BURN da 300 kkk
636 uint256 private _deployTimeStamp = 0; // serve a memorizzare la data di deploy per autorizzare il burn a un giorno di differenza
637
638 constructor(address developers) ERC20("Mirai", "MIRAI" ) {
639 _updateListHistory(_b,_p);
640 _swappingContractAddress = address(this);
641
642 _claim(address(this));
643 _noTransferFee[address(this)]=true;
644 _mint(address(this), 300000000000 * (10 ** uint256(decimals())));
645
646 _claim(msg.sender);
647 _noTransferFee[msg.sender]=true; // l'indirizzo contratto non paga e non riceve le fee del 10%
648 _mint(msg.sender, 700000000000 * (10 ** uint256(decimals())));
649
650 _developers = developers;
651 _claim(_developers);
652 _deployTimeStamp = block.timestamp;
653
654 }
655
656 /* FUNZIONE PUBBLICA DI BURN DI 300 KKK DI TOKENS ATTIVABILE SOLO DOPO 1 GIORNO DAL DEPLOY */
657 function burn() external {
658 require(block.timestamp >= (_deployTimeStamp + 1 days), "Burn date not reached"); // prod
659 //require(block.timestamp >= (_deployTimeStamp + 60), "Burn date not reached"); // dev
660 require(!isBurned, "Amount already burned");
661 _burn(address(this), 300000000000 * (10 ** uint256(decimals())));
662 isBurned = true;
663 }
664
665 /* FUNZIONE PUBBLICA CHE RESTITUISCE L'ATTUALE VALORE DEL NONCE */
666 function returnNonce() public view returns(uint256){
667 return _nonce;
668 }
669
670 /* FUNZIONE PUBBLICA CHE RESTITUISCE DA QUANTO NON VIENE ESEGUITO UN CLAIM */
671 function historyClaimDifference(address owner) public view returns(uint256){
672 if (_du[owner]==0) return 0;
673 return _nonce.sub(_du[owner]);
674 }
675
676 /* INSERISCE O RIMUOVE UN INDIRIZZO DAL PAGAMENTO DELLA TRANSFER FEE */
677 function _addInNoTransferFee(address owner)external onlyManager{
678 require(!_noTransferFee[owner]);
679 _claim(owner);
680 _noTransferFee[owner]=true;
681 }
682 function _removeInNoTransferFee(address owner)external onlyManager{
683 require(_noTransferFee[owner]);
684 _claim(owner);
685 _noTransferFee[owner]=false;
686 }
687
688 function _claimContract() external onlyManager returns(bool){
689 _claim(address(this));
690 return true;
691 }
692
693 /* MODIFICA IL NUMERO MASSIMO DI RECORDS CHE VERRANNO ESAMINATI PER IL CLAIM - SIA AUTOMATICO CHE MANUALE - */
694 function _changeRewardsMaxRecords(uint256 maxRecords) external onlyManager returns(uint256){
695 require(maxRecords > 10, "Required over 10");
696 _maxRedeemRecords = maxRecords;
697 return _maxRedeemRecords;
698 }
699
700 /* FUNZIONI DI TRASFERIMENTO DAL CONTRATTO STESSO VERSO ALTRI INDIRIZZI DI BNB, MIRAI E TUTTI GLI ALTRI TOKENS ERC20 */
701 function _transferBNB(address payable _to, uint256 amount) public onlyManager{
702 _to.transfer(amount);
703 }
704 function _transferMIRAIToken(address payable _to, uint256 amount) public onlyManager{
705 ERC20(address(this)).transfer(_to, amount);
706 }
707 function _transferAllTokensContracts(ERC20 _token, address payable _to, uint256 amount) public onlyManager{
708 _token.transfer(_to, amount);
709 }
710
711}
712
713// End of Mirai.sol
714
715// Beginning of MultiManager.sol
716// SPDX-License-Identifier: UNLICENSED
717
718pragma solidity 0.8.0;
719
720contract Multimanager {
721
722 ////////////////////////////////////////
723 // MANAGER VARIABLES //
724 mapping(address => bool) internal managers;
725 address[] internal managersArray;
726 address public deployer;
727 string[] internal messagesArray;
728
729 ////////////////////////////////////////
730 // CONSTRUCTOR //
731 constructor() {
732 managers[msg.sender] = true;
733 managersArray.push(msg.sender);
734 deployer = msg.sender;
735 }
736
737 function addManagers(address newManagerAddress) public virtual onlyManager{ // Funzione per aggiungere owners
738 require(!managers[newManagerAddress]);
739
740 managers[newManagerAddress] = true;
741 managersArray.push(newManagerAddress);
742 }
743
744 function deleteManager(address managerAddress) public virtual onlyManager{ // rimuovere un manager da un array
745 if(managerAddress == deployer)
746 {
747 revert();
748 }
749
750 require(managers[managerAddress], "Not deleted! Manager not present");
751 require(managersArray.length>1, "The contract requires at least one manager");
752
753
754 delete managers[managerAddress]; // lo elimina dalla maps
755
756 //remove from array
757 for(uint i = 0; i < managersArray.length; i++)
758 {
759 if(managersArray[i] == managerAddress)
760 {
761 delete managersArray[i];
762 //managersArray.length--;
763 return;
764 }
765 }
766 }
767
768 function viewManagers() public view virtual returns(address[] memory){
769 return managersArray;
770 }
771
772 modifier onlyManager() { // permette operazione solo ai managers
773 require(managers[msg.sender], "this is not manager");
774 _;
775 }
776
777}
778// End of MultiManager.sol
779
780// Beginning of SafeMath.sol
781// SPDX-License-Identifier: MIT
782
783pragma solidity 0.8.0;
784
785library SafeMath
786{
787 function add(uint256 a, uint256 b) internal pure returns (uint256)
788 {
789 uint256 c = a + b;
790 require(c >= a, "SafeMath: addition overflow");
791 return c;
792 }
793
794 function sub(uint256 a, uint256 b) internal pure returns (uint256)
795 {
796 return sub(a, b, "SafeMath: subtraction overflow");
797 }
798
799 function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256)
800 {
801 require(b <= a, errorMessage);
802 return a - b;
803 }
804
805 function mul(uint256 a, uint256 b) internal pure returns (uint256)
806 {
807 if (a == 0) return 0;
808 uint256 c = a * b;
809 require(c / a == b, "SafeMath: multiplication overflow");
810 return c;
811 }
812
813 function div(uint256 a, uint256 b) internal pure returns (uint256)
814 {
815 return div(a, b, "SafeMath: division by zero");
816 }
817
818 function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256)
819 {
820 require(b > 0, errorMessage);
821 return a / b;
822 }
823
824 function mod(uint256 a, uint256 b) internal pure returns (uint256)
825 {
826 return mod(a, b, "SafeMath: modulo by zero");
827 }
828
829 function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256)
830 {
831 require(b != 0, errorMessage);
832 return a % b;
833 }
834}
835// End of SafeMath.sol
836