1

I'm having a precrowdsale and a crowdsale, How can I send the ether from the first to the second once the precrowdsale is over? this is the script I have:

//send to crowdsale

if(receiver_address.send(amount_in_Wei)){

//sending is successful

} else {

// sending failed } }


but Ethereum Wallet compiler says: Could not compile source code.

Expected import directive or contract definition. if(receiver_address.send(amount_in_Wei)){ ^

What's wrong? Thank you!!!!

deathloser
  • 29
  • 2

2 Answers2

1

Take a look here, at the end of the file:

  /**
   * Set the target crowdsale where we will move presale funds when the crowdsale opens.
   */
  function setCrowdsale(Crowdsale _crowdsale) public onlyOwner {
     crowdsale = _crowdsale;
  }
NineCattoRules
  • 457
  • 1
  • 6
  • 15
0

I'm using a code like this:

if (!wallet.send(msg.value)) {
    ...
}

and it compiles without errors. Are you using a pragma?

pragma solidity ^0.4.11;

Try using it at the very first line of code.