Share
Buy $MOVE
Anime (ANI)

0xac47...d36f

Overall Score

93/100

Decentralization

99/100

Security

92/100

Code Quality

87/100

1// Beginning of StandardBEP20.sol
2// SPDX-License-Identifier: MIT
3
4// File: @openzeppelin/contracts/GSN/Context.sol
5
6pragma solidity ^0.7.0;
7
8/*
9 * @dev Provides information about the current execution context, including the
10 * sender of the transaction and its data. While these are generally available
11 * via msg.sender and msg.data, they should not be accessed in such a direct
12 * manner, since when dealing with GSN meta-transactions the account sending and
13 * paying for execution may not be the actual sender (as far as an application
14 * is concerned).
15 *
16 * This contract is only required for intermediate, library-like contracts.
17 */
18abstract contract Context {
19 function _msgSender() internal view virtual returns (address payable) {
20 return msg.sender;
21 }
22
23 function _msgData() internal view virtual returns (bytes memory) {
24 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
25 return msg.data;
26 }
27}
28
29// File: @openzeppelin/contracts/access/Ownable.sol
30
31
32
33pragma solidity ^0.7.0;
34
35/**
36 * @dev Contract module which provides a basic access control mechanism, where
37 * there is an account (an owner) that can be granted exclusive access to
38 * specific functions.
39 *
40 * By default, the owner account will be the one that deploys the contract. This
41 * can later be changed with {transferOwnership}.
42 *
43 * This module is used through inheritance. It will make available the modifier
44 * `onlyOwner`, which can be applied to your functions to restrict their use to
45 * the owner.
46 */
47abstract contract Ownable is Context {
48 address private _owner;
49
50 event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
51
52 /**
53 * @dev Initializes the contract setting the deployer as the initial owner.
54 */
55 constructor () {
56 address msgSender = _msgSender();
57 _owner = msgSender;
58 emit OwnershipTransferred(address(0), msgSender);
59 }
60
61 /**
62 * @dev Returns the address of the current owner.
63 */
64 function owner() public view returns (address) {
65 return _owner;
66 }
67
68 /**
69 * @dev Throws if called by any account other than the owner.
70 */
71 modifier onlyOwner() {
72 require(_owner == _msgSender(), "Ownable: caller is not the owner");
73 _;
74 }
75
76 /**
77 * @dev Leaves the contract without owner. It will not be possible to call
78 * `onlyOwner` functions anymore. Can only be called by the current owner.
79 *
80 * NOTE: Renouncing ownership will leave the contract without an owner,
81 * thereby removing any functionality that is only available to the owner.
82 */
83 function renounceOwnership() public virtual onlyOwner {
84 emit OwnershipTransferred(_owner, address(0));
85 _owner = address(0);
86 }
87
88 /**
89 * @dev Transfers ownership of the contract to a new account (`newOwner`).
90 * Can only be called by the current owner.
91 */
92 function transferOwnership(address newOwner) public virtual onlyOwner {
93 require(newOwner != address(0), "Ownable: new owner is the zero address");
94 emit OwnershipTransferred(_owner, newOwner);
95 _owner = newOwner;
96 }
97}
98
99// File: @openzeppelin/contracts/math/SafeMath.sol
100
101
102
103pragma solidity ^0.7.0;
104
105/**
106 * @dev Wrappers over Solidity's arithmetic operations with added overflow
107 * checks.
108 *
109 * Arithmetic operations in Solidity wrap on overflow. This can easily result
110 * in bugs, because programmers usually assume that an overflow raises an
111 * error, which is the standard behavior in high level programming languages.
112 * `SafeMath` restores this intuition by reverting the transaction when an
113 * operation overflows.
114 *
115 * Using this library instead of the unchecked operations eliminates an entire
116 * class of bugs, so it's recommended to use it always.
117 */
118library SafeMath {
119 /**
120 * @dev Returns the addition of two unsigned integers, reverting on
121 * overflow.
122 *
123 * Counterpart to Solidity's `+` operator.
124 *
125 * Requirements:
126 *
127 * - Addition cannot overflow.
128 */
129 function add(uint256 a, uint256 b) internal pure returns (uint256) {
130 uint256 c = a + b;
131 require(c >= a, "SafeMath: addition overflow");
132
133 return c;
134 }
135
136 /**
137 * @dev Returns the subtraction of two unsigned integers, reverting on
138 * overflow (when the result is negative).
139 *
140 * Counterpart to Solidity's `-` operator.
141 *
142 * Requirements:
143 *
144 * - Subtraction cannot overflow.
145 */
146 function sub(uint256 a, uint256 b) internal pure returns (uint256) {
147 return sub(a, b, "SafeMath: subtraction overflow");
148 }
149
150 /**
151 * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
152 * overflow (when the result is negative).
153 *
154 * Counterpart to Solidity's `-` operator.
155 *
156 * Requirements:
157 *
158 * - Subtraction cannot overflow.
159 */
160 function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
161 require(b <= a, errorMessage);
162 uint256 c = a - b;
163
164 return c;
165 }
166
167 /**
168 * @dev Returns the multiplication of two unsigned integers, reverting on
169 * overflow.
170 *
171 * Counterpart to Solidity's `*` operator.
172 *
173 * Requirements:
174 *
175 * - Multiplication cannot overflow.
176 */
177 function mul(uint256 a, uint256 b) internal pure returns (uint256) {
178 // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
179 // benefit is lost if 'b' is also tested.
180 // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
181 if (a == 0) {
182 return 0;
183 }
184
185 uint256 c = a * b;
186 require(c / a == b, "SafeMath: multiplication overflow");
187
188 return c;
189 }
190
191 /**
192 * @dev Returns the integer division of two unsigned integers. Reverts on
193 * division by zero. The result is rounded towards zero.
194 *
195 * Counterpart to Solidity's `/` operator. Note: this function uses a
196 * `revert` opcode (which leaves remaining gas untouched) while Solidity
197 * uses an invalid opcode to revert (consuming all remaining gas).
198 *
199 * Requirements:
200 *
201 * - The divisor cannot be zero.
202 */
203 function div(uint256 a, uint256 b) internal pure returns (uint256) {
204 return div(a, b, "SafeMath: division by zero");
205 }
206
207 /**
208 * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
209 * division by zero. The result is rounded towards zero.
210 *
211 * Counterpart to Solidity's `/` operator. Note: this function uses a
212 * `revert` opcode (which leaves remaining gas untouched) while Solidity
213 * uses an invalid opcode to revert (consuming all remaining gas).
214 *
215 * Requirements:
216 *
217 * - The divisor cannot be zero.
218 */
219 function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
220 require(b > 0, errorMessage);
221 uint256 c = a / b;
222 // assert(a == b * c + a % b); // There is no case in which this doesn't hold
223
224 return c;
225 }
226
227 /**
228 * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
229 * Reverts when dividing by zero.
230 *
231 * Counterpart to Solidity's `%` operator. This function uses a `revert`
232 * opcode (which leaves remaining gas untouched) while Solidity uses an
233 * invalid opcode to revert (consuming all remaining gas).
234 *
235 * Requirements:
236 *
237 * - The divisor cannot be zero.
238 */
239 function mod(uint256 a, uint256 b) internal pure returns (uint256) {
240 return mod(a, b, "SafeMath: modulo by zero");
241 }
242
243 /**
244 * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
245 * Reverts with custom message when dividing by zero.
246 *
247 * Counterpart to Solidity's `%` operator. This function uses a `revert`
248 * opcode (which leaves remaining gas untouched) while Solidity uses an
249 * invalid opcode to revert (consuming all remaining gas).
250 *
251 * Requirements:
252 *
253 * - The divisor cannot be zero.
254 */
255 function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
256 require(b != 0, errorMessage);
257 return a % b;
258 }
259}
260
261// File: contracts/token/BEP20/lib/IBEP20.sol
262
263
264
265pragma solidity ^0.7.0;
266
267/**
268 * @dev Interface of the BEP standard.
269 */
270interface IBEP20 {
271
272 /**
273 * @dev Returns the token name.
274 */
275 function name() external view returns (string memory);
276
277 /**
278 * @dev Returns the token symbol.
279 */
280 function symbol() external view returns (string memory);
281
282 /**
283 * @dev Returns the token decimals.
284 */
285 function decimals() external view returns (uint8);
286
287 /**
288 * @dev Returns the amount of tokens in existence.
289 */
290 function totalSupply() external view returns (uint256);
291
292 /**
293 * @dev Returns the amount of tokens owned by `account`.
294 */
295 function balanceOf(address account) external view returns (uint256);
296
297 /**
298 * @dev Returns the token owner.
299 */
300 function getOwner() external view returns (address);
301
302 /**
303 * @dev Moves `amount` tokens from the caller's account to `recipient`.
304 *
305 * Returns a boolean value indicating whether the operation succeeded.
306 *
307 * Emits a {Transfer} event.
308 */
309 function transfer(address recipient, uint256 amount) external returns (bool);
310
311 /**
312 * @dev Moves `amount` tokens from `sender` to `recipient` using the
313 * allowance mechanism. `amount` is then deducted from the caller's
314 * allowance.
315 *
316 * Returns a boolean value indicating whether the operation succeeded.
317 *
318 * Emits a {Transfer} event.
319 */
320 function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
321
322 /**
323 * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
324 *
325 * Returns a boolean value indicating whether the operation succeeded.
326 *
327 * IMPORTANT: Beware that changing an allowance with this method brings the risk
328 * that someone may use both the old and the new allowance by unfortunate
329 * transaction ordering. One possible solution to mitigate this race
330 * condition is to first reduce the spender's allowance to 0 and set the
331 * desired value afterwards:
332 * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
333 *
334 * Emits an {Approval} event.
335 */
336 function approve(address spender, uint256 amount) external returns (bool);
337
338 /**
339 * @dev Returns the remaining number of tokens that `spender` will be
340 * allowed to spend on behalf of `owner` through {transferFrom}. This is
341 * zero by default.
342 *
343 * This value changes when {approve} or {transferFrom} are called.
344 */
345 function allowance(address _owner, address spender) external view returns (uint256);
346
347 /**
348 * @dev Emitted when `value` tokens are moved from one account (`from`) to
349 * another (`to`).
350 *
351 * Note that `value` may be zero.
352 */
353 event Transfer(address indexed from, address indexed to, uint256 value);
354
355 /**
356 * @dev Emitted when the allowance of a `spender` for an `owner` is set by
357 * a call to {approve}. `value` is the new allowance.
358 */
359 event Approval(address indexed owner, address indexed spender, uint256 value);
360}
361
362// File: contracts/token/BEP20/lib/BEP20.sol
363
364
365
366pragma solidity ^0.7.0;
367
368
369
370
371/**
372 * @dev Implementation of the {IBEP20} interface.
373 *
374 * This implementation is agnostic to the way tokens are created. This means
375 * that a supply mechanism has to be added in a derived contract using {_mint}.
376 *
377 * We have followed general OpenZeppelin guidelines: functions revert instead
378 * of returning `false` on failure. This behavior is nonetheless conventional
379 * and does not conflict with the expectations of BEP20 applications.
380 *
381 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
382 * This allows applications to reconstruct the allowance for all accounts just
383 * by listening to said events. Other implementations of the EIP may not emit
384 * these events, as it isn't required by the specification.
385 *
386 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
387 * functions have been added to mitigate the well-known issues around setting
388 * allowances. See {IBEP20-approve}.
389 */
390contract BEP20 is Ownable, IBEP20 {
391 using SafeMath for uint256;
392
393 mapping (address => uint256) private _balances;
394
395 mapping (address => mapping (address => uint256)) private _allowances;
396
397 uint256 private _totalSupply;
398
399 string private _name;
400 string private _symbol;
401 uint8 private _decimals;
402
403 /**
404 * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
405 * a default value of 18.
406 *
407 * To select a different value for {decimals}, use {_setupDecimals}.
408 *
409 * All three of these values are immutable: they can only be set once during
410 * construction.
411 */
412 constructor (string memory name_, string memory symbol_) {
413 _name = name_;
414 _symbol = symbol_;
415 _decimals = 18;
416 }
417
418 /**
419 * @dev Returns the name of the token.
420 */
421 function name() public view override returns (string memory) {
422 return _name;
423 }
424
425 /**
426 * @dev Returns the symbol of the token, usually a shorter version of the
427 * name.
428 */
429 function symbol() public view override returns (string memory) {
430 return _symbol;
431 }
432
433 /**
434 * @dev Returns the number of decimals used to get its user representation.
435 * For example, if `decimals` equals `2`, a balance of `505` tokens should
436 * be displayed to a user as `5,05` (`505 / 10 ** 2`).
437 *
438 * Tokens usually opt for a value of 18, imitating the relationship between
439 * Ether and Wei. This is the value {BEP20} uses, unless {_setupDecimals} is
440 * called.
441 *
442 * NOTE: This information is only used for _display_ purposes: it in
443 * no way affects any of the arithmetic of the contract, including
444 * {IBEP20-balanceOf} and {IBEP20-transfer}.
445 */
446 function decimals() public view override returns (uint8) {
447 return _decimals;
448 }
449
450 /**
451 * @dev See {IBEP20-totalSupply}.
452 */
453 function totalSupply() public view override returns (uint256) {
454 return _totalSupply;
455 }
456
457 /**
458 * @dev See {IBEP20-balanceOf}.
459 */
460 function balanceOf(address account) public view override returns (uint256) {
461 return _balances[account];
462 }
463
464 /**
465 * @dev See {IBEP20-getOwner}.
466 */
467 function getOwner() public view override returns (address) {
468 return owner();
469 }
470
471 /**
472 * @dev See {IBEP20-transfer}.
473 *
474 * Requirements:
475 *
476 * - `recipient` cannot be the zero address.
477 * - the caller must have a balance of at least `amount`.
478 */
479 function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
480 _transfer(_msgSender(), recipient, amount);
481 return true;
482 }
483
484 /**
485 * @dev See {IBEP20-transferFrom}.
486 *
487 * Emits an {Approval} event indicating the updated allowance. This is not
488 * required by the EIP. See the note at the beginning of {BEP20}.
489 *
490 * Requirements:
491 *
492 * - `sender` and `recipient` cannot be the zero address.
493 * - `sender` must have a balance of at least `amount`.
494 * - the caller must have allowance for ``sender``'s tokens of at least
495 * `amount`.
496 */
497 function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
498 _transfer(sender, recipient, amount);
499 _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "BEP20: transfer amount exceeds allowance"));
500 return true;
501 }
502
503 /**
504 * @dev See {IBEP20-approve}.
505 *
506 * Requirements:
507 *
508 * - `spender` cannot be the zero address.
509 */
510 function approve(address spender, uint256 amount) public virtual override returns (bool) {
511 _approve(_msgSender(), spender, amount);
512 return true;
513 }
514
515 /**
516 * @dev See {IBEP20-allowance}.
517 */
518 function allowance(address owner, address spender) public view virtual override returns (uint256) {
519 return _allowances[owner][spender];
520 }
521
522 /**
523 * @dev Atomically increases the allowance granted to `spender` by the caller.
524 *
525 * This is an alternative to {approve} that can be used as a mitigation for
526 * problems described in {IBEP20-approve}.
527 *
528 * Emits an {Approval} event indicating the updated allowance.
529 *
530 * Requirements:
531 *
532 * - `spender` cannot be the zero address.
533 */
534 function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
535 _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
536 return true;
537 }
538
539 /**
540 * @dev Atomically decreases the allowance granted to `spender` by the caller.
541 *
542 * This is an alternative to {approve} that can be used as a mitigation for
543 * problems described in {IBEP20-approve}.
544 *
545 * Emits an {Approval} event indicating the updated allowance.
546 *
547 * Requirements:
548 *
549 * - `spender` cannot be the zero address.
550 * - `spender` must have allowance for the caller of at least
551 * `subtractedValue`.
552 */
553 function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
554 _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "BEP20: decreased allowance below zero"));
555 return true;
556 }
557
558 /**
559 * @dev Moves tokens `amount` from `sender` to `recipient`.
560 *
561 * This is internal function is equivalent to {transfer}, and can be used to
562 * e.g. implement automatic token fees, slashing mechanisms, etc.
563 *
564 * Emits a {Transfer} event.
565 *
566 * Requirements:
567 *
568 * - `sender` cannot be the zero address.
569 * - `recipient` cannot be the zero address.
570 * - `sender` must have a balance of at least `amount`.
571 */
572 function _transfer(address sender, address recipient, uint256 amount) internal virtual {
573 require(sender != address(0), "BEP20: transfer from the zero address");
574 require(recipient != address(0), "BEP20: transfer to the zero address");
575
576 _beforeTokenTransfer(sender, recipient, amount);
577
578 _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
579 _balances[recipient] = _balances[recipient].add(amount);
580 emit Transfer(sender, recipient, amount);
581 }
582
583 /** @dev Creates `amount` tokens and assigns them to `account`, increasing
584 * the total supply.
585 *
586 * Emits a {Transfer} event with `from` set to the zero address.
587 *
588 * Requirements:
589 *
590 * - `to` cannot be the zero address.
591 */
592 function _mint(address account, uint256 amount) internal virtual {
593 require(account != address(0), "BEP20: mint to the zero address");
594
595 _beforeTokenTransfer(address(0), account, amount);
596
597 _totalSupply = _totalSupply.add(amount);
598 _balances[account] = _balances[account].add(amount);
599 emit Transfer(address(0), account, amount);
600 }
601
602 /**
603 * @dev Destroys `amount` tokens from `account`, reducing the
604 * total supply.
605 *
606 * Emits a {Transfer} event with `to` set to the zero address.
607 *
608 * Requirements:
609 *
610 * - `account` cannot be the zero address.
611 * - `account` must have at least `amount` tokens.
612 */
613 function _burn(address account, uint256 amount) internal virtual {
614 require(account != address(0), "BEP20: burn from the zero address");
615
616 _beforeTokenTransfer(account, address(0), amount);
617
618 _balances[account] = _balances[account].sub(amount, "BEP20: burn amount exceeds balance");
619 _totalSupply = _totalSupply.sub(amount);
620 emit Transfer(account, address(0), amount);
621 }
622
623 /**
624 * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
625 *
626 * This internal function is equivalent to `approve`, and can be used to
627 * e.g. set automatic allowances for certain subsystems, etc.
628 *
629 * Emits an {Approval} event.
630 *
631 * Requirements:
632 *
633 * - `owner` cannot be the zero address.
634 * - `spender` cannot be the zero address.
635 */
636 function _approve(address owner, address spender, uint256 amount) internal virtual {
637 require(owner != address(0), "BEP20: approve from the zero address");
638 require(spender != address(0), "BEP20: approve to the zero address");
639
640 _allowances[owner][spender] = amount;
641 emit Approval(owner, spender, amount);
642 }
643
644 /**
645 * @dev Sets {decimals} to a value other than the default one of 18.
646 *
647 * WARNING: This function should only be called from the constructor. Most
648 * applications that interact with token contracts will not expect
649 * {decimals} to ever change, and may work incorrectly if it does.
650 */
651 function _setupDecimals(uint8 decimals_) internal {
652 _decimals = decimals_;
653 }
654
655 /**
656 * @dev Hook that is called before any transfer of tokens. This includes
657 * minting and burning.
658 *
659 * Calling conditions:
660 *
661 * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
662 * will be to transferred to `to`.
663 * - when `from` is zero, `amount` tokens will be minted for `to`.
664 * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
665 * - `from` and `to` are never both zero.
666 *
667 * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
668 */
669 function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
670}
671
672// File: contracts/service/ServiceReceiver.sol
673
674
675
676pragma solidity ^0.7.0;
677
678
679/**
680 * @title ServiceReceiver
681 * @dev Implementation of the ServiceReceiver
682 */
683contract ServiceReceiver is Ownable {
684
685 mapping (bytes32 => uint256) private _prices;
686
687 event Created(string serviceName, address indexed serviceAddress);
688
689 function pay(string memory serviceName) public payable {
690 require(msg.value == _prices[_toBytes32(serviceName)], "ServiceReceiver: incorrect price");
691
692 emit Created(serviceName, _msgSender());
693 }
694
695 function getPrice(string memory serviceName) public view returns (uint256) {
696 return _prices[_toBytes32(serviceName)];
697 }
698
699 function setPrice(string memory serviceName, uint256 amount) public onlyOwner {
700 _prices[_toBytes32(serviceName)] = amount;
701 }
702
703 function withdraw(uint256 amount) public onlyOwner {
704 payable(owner()).transfer(amount);
705 }
706
707 function _toBytes32(string memory serviceName) private pure returns (bytes32) {
708 return keccak256(abi.encode(serviceName));
709 }
710}
711
712// File: contracts/service/ServicePayer.sol
713
714
715
716pragma solidity ^0.7.0;
717
718
719/**
720 * @title ServicePayer
721 * @dev Implementation of the ServicePayer
722 */
723abstract contract ServicePayer {
724
725 constructor (address payable receiver, string memory serviceName) payable {
726 ServiceReceiver(receiver).pay{value: msg.value}(serviceName);
727 }
728}
729
730// File: contracts/token/BEP20/StandardBEP20.sol
731
732
733
734pragma solidity ^0.7.0;
735
736
737
738/**
739 * @title StandardBEP20
740 * @dev Implementation of the StandardBEP20
741 */
742contract StandardBEP20 is BEP20, ServicePayer {
743
744 constructor (
745 string memory name,
746 string memory symbol,
747 uint8 decimals,
748 uint256 initialBalance,
749 address payable feeReceiver
750 )
751 BEP20(name, symbol)
752 ServicePayer(feeReceiver, "StandardBEP20")
753 payable
754 {
755 require(initialBalance > 0, "StandardBEP20: supply cannot be zero");
756
757 _setupDecimals(decimals);
758 _mint(_msgSender(), initialBalance);
759 }
760}
761// End of StandardBEP20.sol
762