-
Notifications
You must be signed in to change notification settings - Fork 0
/
AirDrop.sol
41 lines (30 loc) · 1.03 KB
/
AirDrop.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
pragma solidity ^0.4.18;
contract Ownable {
address public owner;
function Ownable() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
}
interface Token {
function balanceOf(address _owner) public constant returns (uint256 );
function transfer(address _to, uint256 _value) public ;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
}
contract Airdropper is Ownable {
function AirTransfer(address[] _recipients, uint _values, address _tokenAddress) onlyOwner public returns (bool) {
require(_recipients.length > 0);
Token token = Token(_tokenAddress);
for(uint j = 0; j < _recipients.length; j++){
token.transfer(_recipients[j], _values);
}
return true;
}
function withdrawalToken(address _tokenAddress) onlyOwner public {
Token token = Token(_tokenAddress);
token.transfer(owner, token.balanceOf(this));
}
}