@@ -41,6 +41,15 @@ contract PolyDistribution is Ownable {
41
41
uint256 amountClaimed; // Total tokens claimed
42
42
}
43
43
mapping (address => Allocation) public allocations;
44
+
45
+ mapping (address => bool ) public airdropAdmins;
46
+
47
+ mapping (address => bool ) public airdrops;
48
+
49
+ modifier onlyOwnerOrAdmin () {
50
+ require (msg .sender == owner || airdropAdmins[msg .sender ]);
51
+ _;
52
+ }
44
53
45
54
event LogNewAllocation (address indexed _recipient , AllocationType indexed _fromSupply , uint256 _totalAllocated , uint256 _grandTotalAllocated );
46
55
event LogPolyClaimed (address indexed _recipient , uint8 indexed _fromSupply , uint256 _amountClaimed , uint256 _totalAllocated , uint256 _grandTotalClaimed );
@@ -72,9 +81,6 @@ contract PolyDistribution is Ownable {
72
81
} else if (_supply == AllocationType.FOUNDER) {
73
82
AVAILABLE_FOUNDER_SUPPLY = AVAILABLE_FOUNDER_SUPPLY.sub (_totalAllocated);
74
83
allocations[_recipient] = Allocation (uint8 (AllocationType.FOUNDER), startTime + 1 years, startTime + 4 years, _totalAllocated, 0 );
75
- } else if (_supply == AllocationType.AIRDROP) {
76
- AVAILABLE_AIRDROP_SUPPLY = AVAILABLE_AIRDROP_SUPPLY.sub (_totalAllocated);
77
- allocations[_recipient] = Allocation (uint8 (AllocationType.AIRDROP), 0 , 0 , _totalAllocated, 0 );
78
84
} else if (_supply == AllocationType.ADVISOR) {
79
85
AVAILABLE_ADVISOR_SUPPLY = AVAILABLE_ADVISOR_SUPPLY.sub (_totalAllocated);
80
86
allocations[_recipient] = Allocation (uint8 (AllocationType.ADVISOR), startTime + 212 days, 0 , _totalAllocated, 0 );
@@ -94,6 +100,35 @@ contract PolyDistribution is Ownable {
94
100
AVAILABLE_TOTAL_SUPPLY = AVAILABLE_TOTAL_SUPPLY.sub (_totalAllocated);
95
101
LogNewAllocation (_recipient, _supply, _totalAllocated, grandTotalAllocated ());
96
102
}
103
+
104
+ /**
105
+ * @dev Add an airdrop admin
106
+ * @param _admin
107
+ * @param _isAdmin
108
+ */
109
+ function setAirdropAdmin (address _admin , bool _isAdmin ) public onlyOwner {
110
+ airdropAdmins[_admin] = _isAdmin;
111
+ }
112
+
113
+ /**
114
+ * @dev perform a transfer of allocations
115
+ * @param _reciepients
116
+ * @param _allocated
117
+ */
118
+ function airdropTokens (address [] _recipient ) public onlyOwnerOrAdmin {
119
+ require (_startTime >= now );
120
+ uint airdropped;
121
+ for (uint8 i = 0 ; i< _recipient.length ; i++ )
122
+ {
123
+ if (! airdrops[_recipient[i]]) {
124
+ airdrops[_recipient[i]] = true ;
125
+ require (POLY.transfer (_recipient[i], 250 * (decimalsFactor));
126
+ airdropped = airdropped.add (250 * decimalsFactor);
127
+ }
128
+ }
129
+ AVAILABLE_AIRDROP_SUPPLY = AVAILABLE_AIRDROP_SUPPLY.sub (airdropped);
130
+ AVAILABLE_TOTAL_SUPPLY = AVAILABLE_TOTAL_SUPPLY.sub (airdropped);
131
+ }
97
132
98
133
/**
99
134
* @dev Transfer a recipients available allocation to their address
0 commit comments