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!!!!

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;
  }
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.

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.