-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEwaDistribution.sol
More file actions
42 lines (34 loc) · 1.2 KB
/
EwaDistribution.sol
File metadata and controls
42 lines (34 loc) · 1.2 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
pragma solidity ^0.4.19;
import "./EwaAuction.sol";
/// @title Distributor contract - distribution of tokens after an auction has ended.
/// @dev Distibution is best one week to two weeks after auction.
contract Distributor {
/*
* Storage
*/
DutchAuction public auction;
/*
* Events
*/
event Deployed();
/*
* Public functions
*/
/// @dev Contract constructor function, sets the auction contract address.
/// @param _auction_address Address of auction contract.
function Distributor(address _auction_address) public {
require(_auction_address != 0x0);
auction = DutchAuction(_auction_address);
emit Deployed();
}
/// @notice Claim tokens in behalf of the following token owners: `addresses`.
/// @dev Function that is called with an array of addresses for claiming tokens in their behalf.
/// @param addresses Addresses of auction bidders that will be assigned tokens.
function distribute(address[] addresses) public {
for (uint32 i = 0; i < addresses.length; i++) {
if (auction.bids(addresses[i]) > 0) {
auction.proxyClaimTokens(addresses[i]);
}
}
}
}