Skip to content

Commit 7957a0e

Browse files
authored
Merge pull request #306 from windingtree/add-return-purchase
Add return purchase function in crowdsale
2 parents 216a3a1 + a9fab99 commit 7957a0e

File tree

5 files changed

+190
-89
lines changed

5 files changed

+190
-89
lines changed

contracts/LifCrowdsale.sol

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,22 @@ contract LifCrowdsale is Ownable, Pausable {
387387
msg.sender.transfer(toReturn);
388388
}
389389

390+
/**
391+
@dev Allows the owner to return an purchase to a contributor
392+
*/
393+
function returnPurchase(address contributor)
394+
public hasEnded onlyOwner
395+
{
396+
require(!isFinalized);
397+
398+
uint256 toReturn = purchases[contributor];
399+
assert(toReturn > 0);
400+
401+
purchases[contributor] = 0;
402+
403+
contributor.transfer(toReturn);
404+
}
405+
390406
/**
391407
@dev Finalizes the crowdsale, taking care of transfer of funds to the
392408
Winding Tree Foundation and creation and funding of the Market Validation
@@ -401,9 +417,8 @@ contract LifCrowdsale is Ownable, Pausable {
401417

402418
forwardFunds();
403419

404-
// finish the minting of the token and unpause it
420+
// finish the minting of the token
405421
token.finishMinting();
406-
token.unpause();
407422

408423
// transfer the ownership of the token to the foundation
409424
token.transferOwnership(owner);

0 commit comments

Comments
 (0)