Created
June 26, 2018 02:05
-
-
Save TsuiAnthonYVR/2b51d3fb430ca021b5df710a79696432 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.16; | |
import "https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/token/ERC20/MintableToken.sol"; | |
contract VansToken is MintableToken { | |
// Coin Properties | |
string public name = "Vans Token"; | |
string public symbol = "Vans"; | |
uint256 public decimals = 18; | |
function transfer(address _to, uint _value) public returns (bool) { | |
return super.transfer(_to, _value); | |
} | |
function transferFrom(address _from, address _to, uint _value) public returns (bool) { | |
return super.transferFrom(_from, _to, _value); | |
} | |
function transferBatch(address[] _receivers, uint256 _value) public returns(bool){ | |
uint cnt = _receivers.length; | |
uint256 amount = uint256(cnt)*_value; | |
require(cnt > 0 && cnt <= 20); | |
require(_value > 0 && balances[msg.sender] >= amount); | |
balances[msg.sender] = balances[msg.sender].sub(amount); | |
for(uint i = 0; i<cnt; i++){ | |
balances[_receivers[i]] = balances[_receivers[i]].add(_value); | |
Transfer(msg.sender,_receivers[i],_value); | |
} | |
return true; | |
} | |
function ERC20Drain( ERC20 unwanted_token, uint amount ) public { | |
unwanted_token.transfer(owner, amount); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment