-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBitFluxADContract
More file actions
55 lines (47 loc) · 1.87 KB
/
Copy pathBitFluxADContract
File metadata and controls
55 lines (47 loc) · 1.87 KB
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
pragma solidity ^0.4.11;
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
contract BitFluxADContract {
// The token being sold
ERC20Interface public token;
// address where funds are collected
// address where tokens are deposited and from where we send tokens to buyers
address public wallet;
/**
* event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
function BitFluxADContract(address _wallet, address _tokenAddress) public
{
require(_wallet != 0x0);
require (_tokenAddress != 0x0);
wallet = _wallet;
token = ERC20Interface(_tokenAddress);
}
// fallback function can be used to buy tokens
function () public payable {
throw;
}
/**
* airdrop to token holders
**/
function BulkTransfer(address[] tokenHolders, uint amount) public {
require(msg.sender==wallet);
for(uint i = 0; i<tokenHolders.length; i++)
{
token.transferFrom(wallet,tokenHolders[i],amount);
}
}
}