Skip to content

Commit

Permalink
withdraw tokens (issue TokenMarketNet#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
agnesenvaite committed May 18, 2019
1 parent 7cdfe3b commit df9d272
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions contracts/CrowdsaleBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -118,24 +118,24 @@ contract CrowdsaleBase is Haltable {

multisigWallet = _multisigWallet;
if(multisigWallet == 0) {
throw;
throw;
}

if(_start == 0) {
throw;
throw;
}

startsAt = _start;

if(_end == 0) {
throw;
throw;
}

endsAt = _end;

// Don't mess the dates
if(startsAt >= endsAt) {
throw;
throw;
}

// Minimum funding goal can be zero
Expand Down Expand Up @@ -183,8 +183,8 @@ contract CrowdsaleBase is Haltable {
require(tokenAmount != 0);

if(investedAmountOf[receiver] == 0) {
// A new investor
investorCount++;
// A new investor
investorCount++;
}

// Update investor
Expand All @@ -196,7 +196,7 @@ contract CrowdsaleBase is Haltable {
tokensSold = tokensSold.plus(tokenAmount);

if(pricingStrategy.isPresalePurchase(receiver)) {
presaleWeiRaised = presaleWeiRaised.plus(weiAmount);
presaleWeiRaised = presaleWeiRaised.plus(weiAmount);
}

// Check that we did not bust the cap
Expand Down Expand Up @@ -360,6 +360,18 @@ contract CrowdsaleBase is Haltable {
Refund(msg.sender, weiValue);
if (!msg.sender.send(weiValue)) throw;
}
/**
* Withdraw tokens
*/

function withdrawTokens ( address _token , address to , uint256 amount )
public
onlyOwner
{
FractionalERC20 token = FractionalERC20(_token);

if(!token.transfer(to , amount )) throw ;
}

/**
* @return true if the crowdsale has raised enough money to be a successful.
Expand Down

0 comments on commit df9d272

Please sign in to comment.