Skip to content

Commit d3ca5da

Browse files
committed
Add returnPurchase function to Crowdsale contract
1 parent 1fbc7af commit d3ca5da

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

contracts/LifCrowdsale.sol

Lines changed: 16 additions & 0 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[msg.sender] = 0;
402+
403+
msg.sender.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

0 commit comments

Comments
 (0)