-
Notifications
You must be signed in to change notification settings - Fork 97
/
Copy path0x1b22c32cd936cb97c28c5690a0695a82abf688e6-WISH-MyWish.sol
743 lines (619 loc) · 23.8 KB
/
0x1b22c32cd936cb97c28c5690a0695a82abf688e6-WISH-MyWish.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
pragma solidity ^0.4.18;
/**
* @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;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @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 {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract usingMyWishConsts {
uint constant TOKEN_DECIMALS = 18;
uint8 constant TOKEN_DECIMALS_UINT8 = 18;
uint constant TOKEN_DECIMAL_MULTIPLIER = 10 ** TOKEN_DECIMALS;
uint constant TEAM_TOKENS = 3161200 * TOKEN_DECIMAL_MULTIPLIER;
uint constant BOUNTY_TOKENS = 2000000 * TOKEN_DECIMAL_MULTIPLIER;
uint constant PREICO_TOKENS = 3038800 * TOKEN_DECIMAL_MULTIPLIER;
uint constant MINIMAL_PURCHASE = 0.05 ether;
address constant TEAM_ADDRESS = 0xE4F0Ff4641f3c99de342b06c06414d94A585eFfb;
address constant BOUNTY_ADDRESS = 0x76d4136d6EE53DB4cc087F2E2990283d5317A5e9;
address constant PREICO_ADDRESS = 0x195610851A43E9685643A8F3b49F0F8a019204f1;
address constant COLD_WALLET = 0x80826b5b717aDd3E840343364EC9d971FBa3955C;
string constant TOKEN_NAME = "MyWish Token";
bytes32 constant TOKEN_SYMBOL = "WISH";
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) constant returns (uint256);
function transfer(address to, uint256 value) returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) constant returns (uint256);
function transferFrom(address from, address to, uint256 value) returns (bool);
function approve(address spender, uint256 value) returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping (address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) returns (bool) {
require(_to != address(0));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) returns (bool) {
require(_to != address(0));
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) returns (bool) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval(address _spender, uint _addedValue) returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
}
else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint returns (bool) {
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(0x0, _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
}
contract MyWishToken is usingMyWishConsts, MintableToken, BurnableToken {
/**
* @dev Pause token transfer. After successfully finished crowdsale it becomes true.
*/
bool public paused = true;
/**
* @dev Accounts who can transfer token even if paused. Works only during crowdsale.
*/
mapping(address => bool) excluded;
function name() constant public returns (string _name) {
return TOKEN_NAME;
}
function symbol() constant public returns (bytes32 _symbol) {
return TOKEN_SYMBOL;
}
function decimals() constant public returns (uint8 _decimals) {
return TOKEN_DECIMALS_UINT8;
}
function crowdsaleFinished() onlyOwner {
paused = false;
finishMinting();
}
function addExcluded(address _toExclude) onlyOwner {
excluded[_toExclude] = true;
}
function transferFrom(address _from, address _to, uint256 _value) returns (bool) {
require(!paused || excluded[_from]);
return super.transferFrom(_from, _to, _value);
}
function transfer(address _to, uint256 _value) returns (bool) {
require(!paused || excluded[msg.sender]);
return super.transfer(_to, _value);
}
/**
* @dev Burn tokens from the specified address.
* @param _from address The address which you want to burn tokens from.
* @param _value uint The amount of tokens to be burned.
*/
function burnFrom(address _from, uint256 _value) returns (bool) {
require(_value > 0);
var allowance = allowed[_from][msg.sender];
balances[_from] = balances[_from].sub(_value);
totalSupply = totalSupply.sub(_value);
allowed[_from][msg.sender] = allowance.sub(_value);
Burn(_from, _value);
return true;
}
}
contract MyWishRateProviderI {
/**
* @dev Calculate actual rate using the specified parameters.
* @param buyer Investor (buyer) address.
* @param totalSold Amount of sold tokens.
* @param amountWei Amount of wei to purchase.
* @return ETH to Token rate.
*/
function getRate(address buyer, uint totalSold, uint amountWei) public constant returns (uint);
/**
* @dev rate scale (or divider), to support not integer rates.
* @return Rate divider.
*/
function getRateScale() public constant returns (uint);
/**
* @return Absolute base rate.
*/
function getBaseRate() public constant returns (uint);
}
contract MyWishRateProvider is usingMyWishConsts, MyWishRateProviderI, Ownable {
// rate calculate accuracy
uint constant RATE_SCALE = 10000;
uint constant STEP_30 = 3200000 * TOKEN_DECIMAL_MULTIPLIER;
uint constant STEP_20 = 6400000 * TOKEN_DECIMAL_MULTIPLIER;
uint constant STEP_10 = 9600000 * TOKEN_DECIMAL_MULTIPLIER;
uint constant RATE_30 = 1950 * RATE_SCALE;
uint constant RATE_20 = 1800 * RATE_SCALE;
uint constant RATE_10 = 1650 * RATE_SCALE;
uint constant BASE_RATE = 1500 * RATE_SCALE;
struct ExclusiveRate {
// be careful, accuracies this about 15 minutes
uint32 workUntil;
// exclusive rate or 0
uint rate;
// rate bonus percent, which will be divided by 1000 or 0
uint16 bonusPercent1000;
// flag to check, that record exists
bool exists;
}
mapping(address => ExclusiveRate) exclusiveRate;
function getRateScale() public constant returns (uint) {
return RATE_SCALE;
}
function getBaseRate() public constant returns (uint) {
return BASE_RATE;
}
function getRate(address buyer, uint totalSold, uint amountWei) public constant returns (uint) {
uint rate;
// apply sale
if (totalSold < STEP_30) {
rate = RATE_30;
}
else if (totalSold < STEP_20) {
rate = RATE_20;
}
else if (totalSold < STEP_10) {
rate = RATE_10;
}
else {
rate = BASE_RATE;
}
// apply bonus for amount
if (amountWei >= 1000 ether) {
rate += rate * 13 / 100;
}
else if (amountWei >= 500 ether) {
rate += rate * 10 / 100;
}
else if (amountWei >= 100 ether) {
rate += rate * 7 / 100;
}
else if (amountWei >= 50 ether) {
rate += rate * 5 / 100;
}
else if (amountWei >= 30 ether) {
rate += rate * 4 / 100;
}
else if (amountWei >= 10 ether) {
rate += rate * 25 / 1000;
}
ExclusiveRate memory eRate = exclusiveRate[buyer];
if (eRate.exists && eRate.workUntil >= now) {
if (eRate.rate != 0) {
rate = eRate.rate;
}
rate += rate * eRate.bonusPercent1000 / 1000;
}
return rate;
}
function setExclusiveRate(address _investor, uint _rate, uint16 _bonusPercent1000, uint32 _workUntil) onlyOwner {
exclusiveRate[_investor] = ExclusiveRate(_workUntil, _rate, _bonusPercent1000, true);
}
function removeExclusiveRate(address _investor) onlyOwner {
delete exclusiveRate[_investor];
}
}
/**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale.
*
* Crowdsales have a start and end timestamps, where investors can make
* token purchases and the crowdsale will assign them tokens based
* on a token per ETH rate. Funds collected are forwarded to a wallet
* as they arrive.
*/
contract Crowdsale {
using SafeMath for uint;
// The token being sold
MintableToken public token;
// start and end timestamps where investments are allowed (both inclusive)
uint32 internal startTime;
uint32 internal endTime;
// address where funds are collected
address public wallet;
// amount of raised money in wei
uint public weiRaised;
/**
* @dev Amount of already sold tokens.
*/
uint public soldTokens;
/**
* @dev Maximum amount of tokens to mint.
*/
uint internal hardCap;
/**
* 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, uint value, uint amount);
function Crowdsale(uint _startTime, uint _endTime, uint _hardCap, address _wallet) {
require(_endTime >= _startTime);
require(_wallet != 0x0);
require(_hardCap > 0);
token = createTokenContract();
startTime = uint32(_startTime);
endTime = uint32(_endTime);
hardCap = _hardCap;
wallet = _wallet;
}
// creates the token to be sold.
// override this method to have crowdsale of a specific mintable token.
function createTokenContract() internal returns (MintableToken) {
return new MintableToken();
}
/**
* @dev this method might be overridden for implementing any sale logic.
* @return Actual rate.
*/
function getRate(uint amount) internal constant returns (uint);
function getBaseRate() internal constant returns (uint);
/**
* @dev rate scale (or divider), to support not integer rates.
* @return Rate divider.
*/
function getRateScale() internal constant returns (uint) {
return 1;
}
// fallback function can be used to buy tokens
function() payable {
buyTokens(msg.sender, msg.value);
}
// low level token purchase function
function buyTokens(address beneficiary, uint amountWei) internal {
require(beneficiary != 0x0);
// total minted tokens
uint totalSupply = token.totalSupply();
// actual token minting rate (with considering bonuses and discounts)
uint actualRate = getRate(amountWei);
uint rateScale = getRateScale();
require(validPurchase(amountWei, actualRate, totalSupply));
// calculate token amount to be created
uint tokens = amountWei.mul(actualRate).div(rateScale);
// update state
weiRaised = weiRaised.add(amountWei);
soldTokens = soldTokens.add(tokens);
token.mint(beneficiary, tokens);
TokenPurchase(msg.sender, beneficiary, amountWei, tokens);
forwardFunds(amountWei);
}
// send ether to the fund collection wallet
// override to create custom fund forwarding mechanisms
function forwardFunds(uint amountWei) internal {
wallet.transfer(amountWei);
}
/**
* @dev Check if the specified purchase is valid.
* @return true if the transaction can buy tokens
*/
function validPurchase(uint _amountWei, uint _actualRate, uint _totalSupply) internal constant returns (bool) {
bool withinPeriod = now >= startTime && now <= endTime;
bool nonZeroPurchase = _amountWei != 0;
bool hardCapNotReached = _totalSupply <= hardCap;
return withinPeriod && nonZeroPurchase && hardCapNotReached;
}
/**
* @dev Because of discount hasEnded might be true, but validPurchase returns false.
* @return true if crowdsale event has ended
*/
function hasEnded() public constant returns (bool) {
return now > endTime || token.totalSupply() > hardCap;
}
/**
* @return true if crowdsale event has started
*/
function hasStarted() public constant returns (bool) {
return now >= startTime;
}
}
contract FinalizableCrowdsale is Crowdsale, Ownable {
using SafeMath for uint256;
bool public isFinalized = false;
event Finalized();
function FinalizableCrowdsale(uint _startTime, uint _endTime, uint _hardCap, address _wallet)
Crowdsale(_startTime, _endTime, _hardCap, _wallet) {
}
/**
* @dev Must be called after crowdsale ends, to do some extra finalization
* work. Calls the contract's finalization function.
*/
function finalize() onlyOwner notFinalized {
require(hasEnded());
finalization();
Finalized();
isFinalized = true;
}
/**
* @dev Can be overriden to add finalization logic. The overriding function
* should call super.finalization() to ensure the chain of finalization is
* executed entirely.
*/
function finalization() internal {
}
modifier notFinalized() {
require(!isFinalized);
_;
}
}
contract MyWishCrowdsale is usingMyWishConsts, FinalizableCrowdsale {
MyWishRateProviderI public rateProvider;
function MyWishCrowdsale(
uint _startTime,
uint _endTime,
uint _hardCapTokens
)
FinalizableCrowdsale(_startTime, _endTime, _hardCapTokens * TOKEN_DECIMAL_MULTIPLIER, COLD_WALLET) {
token.mint(TEAM_ADDRESS, TEAM_TOKENS);
token.mint(BOUNTY_ADDRESS, BOUNTY_TOKENS);
token.mint(PREICO_ADDRESS, PREICO_TOKENS);
MyWishToken(token).addExcluded(TEAM_ADDRESS);
MyWishToken(token).addExcluded(BOUNTY_ADDRESS);
MyWishToken(token).addExcluded(PREICO_ADDRESS);
MyWishRateProvider provider = new MyWishRateProvider();
provider.transferOwnership(owner);
rateProvider = provider;
}
/**
* @dev override token creation to integrate with MyWill token.
*/
function createTokenContract() internal returns (MintableToken) {
return new MyWishToken();
}
/**
* @dev override getRate to integrate with rate provider.
*/
function getRate(uint _value) internal constant returns (uint) {
return rateProvider.getRate(msg.sender, soldTokens, _value);
}
function getBaseRate() internal constant returns (uint) {
return rateProvider.getRate(msg.sender, soldTokens, MINIMAL_PURCHASE);
}
/**
* @dev override getRateScale to integrate with rate provider.
*/
function getRateScale() internal constant returns (uint) {
return rateProvider.getRateScale();
}
/**
* @dev Admin can set new rate provider.
* @param _rateProviderAddress New rate provider.
*/
function setRateProvider(address _rateProviderAddress) onlyOwner {
require(_rateProviderAddress != 0);
rateProvider = MyWishRateProviderI(_rateProviderAddress);
}
/**
* @dev Admin can move end time.
* @param _endTime New end time.
*/
function setEndTime(uint _endTime) onlyOwner notFinalized {
require(_endTime > startTime);
endTime = uint32(_endTime);
}
function setHardCap(uint _hardCapTokens) onlyOwner notFinalized {
require(_hardCapTokens * TOKEN_DECIMAL_MULTIPLIER > hardCap);
hardCap = _hardCapTokens * TOKEN_DECIMAL_MULTIPLIER;
}
function setStartTime(uint _startTime) onlyOwner notFinalized {
require(_startTime < endTime);
startTime = uint32(_startTime);
}
function addExcluded(address _address) onlyOwner notFinalized {
MyWishToken(token).addExcluded(_address);
}
function validPurchase(uint _amountWei, uint _actualRate, uint _totalSupply) internal constant returns (bool) {
if (_amountWei < MINIMAL_PURCHASE) {
return false;
}
return super.validPurchase(_amountWei, _actualRate, _totalSupply);
}
function finalization() internal {
super.finalization();
token.finishMinting();
MyWishToken(token).crowdsaleFinished();
token.transferOwnership(owner);
}
}