SHARE
TWEET

Untitled

a guest Jun 20th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pragma solidity >=0.4.23 <0.6.0;
  2.  
  3. interface IERC20 {
  4.   function totalSupply() external view returns (uint256);
  5.   function balanceOf(address who) external view returns (uint256);
  6.   function allowance(address owner, address spender) external view returns (uint256);
  7.   function transfer(address to, uint256 value) external returns (bool);
  8.   function approve(address spender, uint256 value) external returns (bool);
  9.   function transferFrom(address from, address to, uint256 value) external returns (bool);
  10.  
  11.   event Transfer(address indexed from, address indexed to, uint256 value);
  12.   event Approval(address indexed owner, address indexed spender, uint256 value);
  13. }
  14.  
  15. library SafeMath {
  16.   function mul(uint256 a, uint256 b) internal pure returns (uint256) {
  17.     if (a == 0) {
  18.       return 0;
  19.     }
  20.     uint256 c = a * b;
  21.     assert(c / a == b);
  22.     return c;
  23.   }
  24.  
  25.   function div(uint256 a, uint256 b) internal pure returns (uint256) {
  26.     uint256 c = a / b;
  27.     return c;
  28.   }
  29.  
  30.   function sub(uint256 a, uint256 b) internal pure returns (uint256) {
  31.     assert(b <= a);
  32.     return a - b;
  33.   }
  34.  
  35.   function add(uint256 a, uint256 b) internal pure returns (uint256) {
  36.     uint256 c = a + b;
  37.     assert(c >= a);
  38.     return c;
  39.   }
  40.  
  41.   function ceil(uint256 a, uint256 m) internal pure returns (uint256) {
  42.     uint256 c = add(a,m);
  43.     uint256 d = sub(c,1);
  44.     return mul(div(d,m),m);
  45.   }
  46. }
  47.  
  48. contract ApproveAndCallFallBack {
  49.     function receiveApproval(address from, uint256 tokens, address token, bytes memory data) public;
  50. }
  51.  
  52. contract VoidToken is IERC20 {
  53.   using SafeMath for uint256;
  54.  
  55.   string constant tokenName = "Void Token";
  56.   string constant tokenSymbol = "VOID";
  57.   uint8  constant tokenDecimals = 18;               // 18 decimal places
  58.   uint256 public totalSupply = 10000000e18;         // 10m VOID supply
  59.  
  60.   uint256 constant burnPercentage = 3;              // 3% burning percentage
  61.   uint256 constant totalPercent = 100;             // 100% percent
  62.  
  63.   mapping (address => uint256) private balances;
  64.   mapping (address => mapping (address => uint256)) private allowed;
  65.  
  66.   constructor() public {
  67.     _mint(msg.sender, totalSupply.div(2)); // 50% to formal airdrop wallet  411ebad5e0db6be9ffa93f22d689ec0e6ecdd267e7
  68.     _mint(0xa37c447D56fF886F956276a75A34A2f5a4A0334A, totalSupply.mul(4).div(10));// 40% to promo wallet  41a37c447d56ff886f956276a75a34a2f5a4a0334a
  69.     _mint(0xF80C654aA6B38C4Ea95576E8fed552e250f27DEB, totalSupply.div(10));// 10% to dev wallet  41f80c654aa6b38c4ea95576e8fed552e250f27deb
  70.   }
  71.  
  72.   function name() public pure returns(string memory) {
  73.     return tokenName;
  74.   }
  75.  
  76.   function symbol() public pure returns(string memory) {
  77.     return tokenSymbol;
  78.   }
  79.  
  80.   function decimals() public pure returns(uint8) {
  81.     return tokenDecimals;
  82.   }
  83.  
  84.   function totalSupply() public view returns (uint256) {
  85.     return totalSupply;
  86.   }
  87.  
  88.   function balanceOf(address owner) public view returns (uint256) {
  89.     return balances[owner];
  90.   }
  91.  
  92.   function allowance(address owner, address spender) public view returns (uint256) {
  93.     return allowed[owner][spender];
  94.   }
  95.  
  96.   function transfer(address to, uint256 value) public returns (bool) {
  97.     require(value <= balances[msg.sender]);
  98.     require(to != address(0));
  99.  
  100.     uint256 tokensToBurn = value.mul(burnPercentage).div(totalPercent);
  101.     uint256 tokensToTransfer = value.sub(tokensToBurn);
  102.  
  103.     balances[msg.sender] = balances[msg.sender].sub(value);
  104.     balances[to] = balances[to].add(tokensToTransfer);
  105.  
  106.     totalSupply = totalSupply.sub(tokensToBurn);
  107.  
  108.     emit Transfer(msg.sender, to, tokensToTransfer);
  109.     emit Transfer(msg.sender, address(0), tokensToBurn);
  110.  
  111.     return true;
  112.   }
  113.  
  114.   function multiTransfer(address[] memory receivers, uint256[] memory amounts) public {
  115.     for (uint256 i = 0; i < receivers.length; i++) {
  116.       transfer(receivers[i], amounts[i]);
  117.     }
  118.   }
  119.  
  120.   function approveAndCall(address spender, uint value, bytes memory data) public returns (bool success) {
  121.     require(spender != address(0));
  122.     allowed[msg.sender][spender] = value;
  123.     emit Approval(msg.sender, spender, value);
  124.     if (isContract(spender)) {
  125.       ApproveAndCallFallBack(spender).receiveApproval(msg.sender, value, address(this), data);
  126.     }
  127.  
  128.     return true;
  129.   }
  130.  
  131.   function approve(address spender, uint256 value) public returns (bool) {
  132.     require(spender != address(0));
  133.     allowed[msg.sender][spender] = value;
  134.     emit Approval(msg.sender, spender, value);
  135.  
  136.     return true;
  137.   }
  138.  
  139.   function transferFrom(address from, address to, uint256 value) public returns (bool) {
  140.     require(value <= balances[from]);
  141.     require(value <= allowed[from][msg.sender]);
  142.     require(to != address(0));
  143.  
  144.     balances[from] = balances[from].sub(value);
  145.  
  146.     uint256 tokensToBurn = value.mul(burnPercentage).div(totalPercent);
  147.     uint256 tokensToTransfer = value.sub(tokensToBurn);
  148.  
  149.     balances[to] = balances[to].add(tokensToTransfer);
  150.     totalSupply = totalSupply.sub(tokensToBurn);
  151.  
  152.     allowed[from][msg.sender] = allowed[from][msg.sender].sub(value);
  153.  
  154.     emit Transfer(from, to, tokensToTransfer);
  155.     emit Transfer(from, address(0), tokensToBurn);
  156.  
  157.     return true;
  158.   }
  159.  
  160.   function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
  161.     require(spender != address(0));
  162.     allowed[msg.sender][spender] = (allowed[msg.sender][spender].add(addedValue));
  163.     emit Approval(msg.sender, spender, allowed[msg.sender][spender]);
  164.  
  165.     return true;
  166.   }
  167.  
  168.   function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
  169.     require(spender != address(0));
  170.     allowed[msg.sender][spender] = (allowed[msg.sender][spender].sub(subtractedValue));
  171.     emit Approval(msg.sender, spender, allowed[msg.sender][spender]);
  172.  
  173.     return true;
  174.   }
  175.  
  176.   function _mint(address account, uint256 amount) internal {
  177.     require(amount != 0);
  178.     balances[account] = balances[account].add(amount);
  179.     emit Transfer(address(0), account, amount);
  180.   }
  181.  
  182.   function burn(uint256 amount) external {
  183.     _burn(msg.sender, amount);
  184.   }
  185.  
  186.   function burnFrom(address account, uint256 amount) external {
  187.     require(amount <= allowed[account][msg.sender]);
  188.     allowed[account][msg.sender] = allowed[account][msg.sender].sub(amount);
  189.     _burn(account, amount);
  190.   }
  191.  
  192.   function _burn(address account, uint256 amount) internal {
  193.     require(amount != 0);
  194.     require(amount <= balances[account]);
  195.     totalSupply = totalSupply.sub(amount);
  196.     balances[account] = balances[account].sub(amount);
  197.     emit Transfer(account, address(0), amount);
  198.   }
  199.  
  200.   function isContract(address _addr) private view returns (bool hasCode) {
  201.     uint length;
  202.     assembly { length := extcodesize(_addr) }
  203.     return length > 0;
  204.   }
  205. }
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