forked from indorseio/airdrop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
indorser.sol
60 lines (49 loc) · 1.42 KB
/
indorser.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
pragma solidity ^0.4.11;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = "0x1428452bff9f56D194F63d910cb16E745b9ee048";
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
if (msg.sender != owner) {
throw;
}
_;
}
/**
* @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 Token{
function transfer(address to, uint value) returns (bool);
}
contract Indorser is Ownable {
function multisend(address _tokenAddr, address[] _to, uint256[] _value)
returns (bool _success) {
assert(_to.length == _value.length);
assert(_to.length <= 150);
// loop through to addresses and send value
for (uint8 i = 0; i < _to.length; i++) {
assert((Token(_tokenAddr).transfer(_to[i], _value[i])) == true);
}
return true;
}
}