daily pastebin goal
61%
SHARE
TWEET

Untitled

a guest Sep 20th, 2018 56 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. pragma solidity ^0.4.24;
  2.  
  3. library SafeMath {
  4.    
  5.     function mul(uint256 a, uint256 b) internal pure returns (uint256) {
  6.         if (a == 0) {
  7.             return 0;
  8.         }
  9.         uint256 c = a * b;
  10.         assert(c / a == b);
  11.         return c;
  12.     }
  13.  
  14.     function div(uint256 a, uint256 b) internal pure returns (uint256) {
  15.         return a / b;
  16.     }
  17.  
  18.     function sub(uint256 a, uint256 b) internal pure returns (uint256) {
  19.         assert(b <= a);
  20.         return a - b;
  21.     }
  22.  
  23.     function add(uint256 a, uint256 b) internal pure returns (uint256) {
  24.         uint256 c = a + b;
  25.         assert(c >= a);
  26.         return c;
  27.     }
  28. }
  29.  
  30. contract ERC20Basic {
  31.     function totalSupply() public view returns (uint256);
  32.     function balanceOf(address who) public view returns (uint256);
  33.     function transfer(address to, uint256 value) public returns (bool);
  34.     event Transfer(address indexed from, address indexed to, uint256 value);
  35. }
  36.  
  37. contract ERC20 is ERC20Basic {
  38.     function allowance(address owner, address spender) public view returns (uint256);
  39.     function transferFrom(address from, address to, uint256 value) public returns (bool);
  40.     function approve(address spender, uint256 value) public returns (bool);
  41.     event Approval(address indexed owner, address indexed spender, uint256 value);
  42. }
  43.  
  44. contract BasicToken is ERC20Basic {
  45.     using SafeMath for uint256;
  46.  
  47.     mapping(address => uint256) balances;
  48.  
  49.     uint256 totalSupply_;
  50.  
  51.     function totalSupply() public view returns (uint256) {
  52.         return totalSupply_;
  53.     }
  54.  
  55.     function transfer(address _to, uint256 _value) public returns (bool) {
  56.         require(_to != address(0));
  57.         require(_value <= balances[msg.sender]);
  58.  
  59.         balances[msg.sender] = balances[msg.sender].sub(_value);
  60.         balances[_to] = balances[_to].add(_value);
  61.    
  62.         emit Transfer(msg.sender, _to, _value);
  63.         return true;
  64.     }
  65.  
  66.     function balanceOf(address _owner) public view returns (uint256) {
  67.         return balances[_owner];
  68.     }
  69. }
  70.  
  71. contract Ownable {
  72.    
  73.     address public owner;
  74.  
  75.     constructor() public {
  76.         owner    = msg.sender;
  77.     }
  78.  
  79.     modifier onlyOwner() { require(msg.sender == owner); _; }
  80. }
  81.  
  82. contract BlackList is Ownable {
  83.  
  84.     event Lock(address indexed LockedAddress);
  85.     event Unlock(address indexed UnLockedAddress);
  86.  
  87.     mapping( address => bool ) public blackList;
  88.  
  89.     modifier CheckBlackList { require(blackList[msg.sender] != true); _; }
  90.  
  91.     function SetLockAddress(address _lockAddress) external onlyOwner returns (bool) {
  92.         require(_lockAddress != address(0));
  93.         require(_lockAddress != owner);
  94.         require(blackList[_lockAddress] != true);
  95.        
  96.         blackList[_lockAddress] = true;
  97.        
  98.         emit Lock(_lockAddress);
  99.  
  100.         return true;
  101.     }
  102.  
  103.     function UnLockAddress(address _unlockAddress) external onlyOwner returns (bool) {
  104.         require(blackList[_unlockAddress] != false);
  105.        
  106.         blackList[_unlockAddress] = false;
  107.        
  108.         emit Unlock(_unlockAddress);
  109.  
  110.         return true;
  111.     }
  112. }
  113.  
  114. contract Pausable is Ownable {
  115.     event Pause();
  116.     event Unpause();
  117.  
  118.     bool public paused = false;
  119.  
  120.     modifier whenNotPaused() { require(!paused); _; }
  121.     modifier whenPaused() { require(paused); _; }
  122.  
  123.     function pause() onlyOwner whenNotPaused public {
  124.         paused = true;
  125.         emit Pause();
  126.     }
  127.  
  128.     function unpause() onlyOwner whenPaused public {
  129.         paused = false;
  130.         emit Unpause();
  131.     }
  132. }
  133.  
  134. contract StandardToken is ERC20, BasicToken {
  135.  
  136.     mapping (address => mapping (address => uint256)) internal allowed;
  137.  
  138.     function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
  139.         require(_to != address(0));
  140.         require(_value <= balances[_from]);
  141.         require(_value <= allowed[_from][msg.sender]);
  142.  
  143.         balances[_from] = balances[_from].sub(_value);
  144.         balances[_to] = balances[_to].add(_value);
  145.         allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
  146.    
  147.         emit Transfer(_from, _to, _value);
  148.    
  149.         return true;
  150.     }
  151.  
  152.     function approve(address _spender, uint256 _value) public returns (bool) {
  153.         allowed[msg.sender][_spender] = _value;
  154.    
  155.         emit Approval(msg.sender, _spender, _value);
  156.    
  157.         return true;
  158.     }
  159.  
  160.     function allowance(address _owner, address _spender) public view returns (uint256) {
  161.         return allowed[_owner][_spender];
  162.     }
  163.  
  164.     function increaseApproval(address _spender, uint256 _addedValue) public returns (bool) {
  165.         allowed[msg.sender][_spender] = (allowed[msg.sender][_spender].add(_addedValue));
  166.    
  167.         emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
  168.    
  169.         return true;
  170.     }
  171.  
  172.     function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool) {
  173.         uint256 oldValue = allowed[msg.sender][_spender];
  174.    
  175.         if (_subtractedValue > oldValue) {
  176.         allowed[msg.sender][_spender] = 0;
  177.         } else {
  178.         allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
  179.         }
  180.    
  181.         emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
  182.         return true;
  183.     }
  184. }
  185.  
  186. contract MultiTransferToken is StandardToken, Ownable {
  187.  
  188.     function MultiTransfer(address[] _to, uint256[] _amount) onlyOwner public returns (bool) {
  189.         require(_to.length == _amount.length);
  190.  
  191.         uint256 ui;
  192.         uint256 amountSum = 0;
  193.    
  194.         for (ui = 0; ui < _to.length; ui++) {
  195.             require(_to[ui] != address(0));
  196.  
  197.             amountSum = amountSum.add(_amount[ui]);
  198.         }
  199.  
  200.         require(amountSum <= balances[msg.sender]);
  201.  
  202.         for (ui = 0; ui < _to.length; ui++) {
  203.             balances[msg.sender] = balances[msg.sender].sub(_amount[ui]);
  204.             balances[_to[ui]] = balances[_to[ui]].add(_amount[ui]);
  205.        
  206.             emit Transfer(msg.sender, _to[ui], _amount[ui]);
  207.         }
  208.    
  209.         return true;
  210.     }
  211. }
  212. contract BurnableToken is StandardToken, Ownable {
  213.  
  214.     event BurnAdminAmount(address indexed burner, uint256 value);
  215.  
  216.     function burnAdminAmount(uint256 _value) onlyOwner public {
  217.         require(_value <= balances[msg.sender]);
  218.  
  219.         balances[msg.sender] = balances[msg.sender].sub(_value);
  220.         totalSupply_ = totalSupply_.sub(_value);
  221.    
  222.         emit BurnAdminAmount(msg.sender, _value);
  223.         emit Transfer(msg.sender, address(0), _value);
  224.     }
  225. }
  226.  
  227. contract MintableToken is StandardToken, Ownable {
  228.     event Mint(address indexed to, uint256 amount);
  229.     event MintFinished();
  230.  
  231.     bool public mintingFinished = false;
  232.  
  233.     modifier canMint() { require(!mintingFinished); _; }
  234.     modifier cannotMint() { require(mintingFinished); _; }
  235.  
  236.     function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
  237.         totalSupply_ = totalSupply_.add(_amount);
  238.         balances[_to] = balances[_to].add(_amount);
  239.    
  240.         emit Mint(_to, _amount);
  241.         emit Transfer(address(0), _to, _amount);
  242.    
  243.         return true;
  244.     }
  245.  
  246.     function finishMinting() onlyOwner canMint public returns (bool) {
  247.         mintingFinished = true;
  248.         emit MintFinished();
  249.         return true;
  250.     }
  251. }
  252.  
  253. contract PausableToken is StandardToken, Pausable, BlackList {
  254.  
  255.     function transfer(address _to, uint256 _value) public whenNotPaused CheckBlackList returns (bool) {
  256.         return super.transfer(_to, _value);
  257.     }
  258.  
  259.     function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused CheckBlackList returns (bool) {
  260.         return super.transferFrom(_from, _to, _value);
  261.     }
  262.  
  263.     function approve(address _spender, uint256 _value) public whenNotPaused CheckBlackList returns (bool) {
  264.         return super.approve(_spender, _value);
  265.     }
  266.  
  267.     function increaseApproval(address _spender, uint _addedValue) public whenNotPaused CheckBlackList returns (bool success) {
  268.         return super.increaseApproval(_spender, _addedValue);
  269.     }
  270.  
  271.     function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused CheckBlackList returns (bool success) {
  272.         return super.decreaseApproval(_spender, _subtractedValue);
  273.     }
  274. }
  275.  
  276. contract toImkyungJin is PausableToken, MintableToken, BurnableToken, MultiTransferToken {
  277.     string public name = "경진이에게";
  278.     string public symbol = "IKJ";
  279.     uint256 public decimals = 18;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top