0

I have this code (payable function):

function() payable inTime at_stage(Stages.InProgress) 
active
{
    require(totalTokens <= totalTokensCapMax);

    require(token.isWhiteListed(msg.sender));

    require(msg.value>=minAcceptedAmount);

    totalTokens = safeAdd(totalTokens,safeMul(msg.value, intermedfinalConvRateETH));

    totalEtherContributed = safeAdd(totalEtherContributed,msg.value);

    insertToInvestorsArray(msg.sender);

    investedAmount[msg.sender] = contributor({
      amount:safeAdd(investedAmount[msg.sender].amount,msg.value),
      coin:"ETH"
    });
    beneficiary.send(msg.value);
    Contribution(msg.sender, msg.value, totalTokens);
}

now, the Crowdsale end without success. how do I retrieve the ETH back to the clients? from the beneficiary account?

because now, only the beneficiary holds the money now - not the contract.

thanks!

0

One possibility is to use OpenZeppelin's RefundVault.

The idea is to have a separate contract from the Crowdsale that hold funds while the crowdsale is ongoing.

Once the crowdsale finishes successfully the owner can transfer the deposited amount to the main benefitiary.

If the crowdsale didn't reach it goals it allows each investor to retrieve its contribution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.