Skip to content

Instantly share code, notes, and snippets.

@Gim6626
Created October 8, 2018 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gim6626/0b77595e1fb8a09adc9d905c1a4aa707 to your computer and use it in GitHub Desktop.
Save Gim6626/0b77595e1fb8a09adc9d905c1a4aa707 to your computer and use it in GitHub Desktop.
Air Dropper Improved
pragma solidity ^0.4.24;
contract ERC20Basic {
uint public totalSupply;
function balanceOf(address who) constant returns (uint);
function transfer(address to, uint value);
event Transfer(address indexed from, address indexed to, uint value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) constant returns (uint);
function transferFrom(address from, address to, uint value);
function approve(address spender, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
contract AirDropperImproved is Ownable {
function multisend(address _tokenAddr, address[] dests, uint256[] values) onlyOwner returns (uint256) {
uint256 i = 0;
while (i < dests.length) {
ERC20(_tokenAddr).transfer(dests[i], values[i]);
i += 1;
}
return(i);
}
function tokenFallback(address _from, uint _value, bytes _data) public {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment