2

I am having issues in deploying contracts in ethereum testnet after updating geth version to the 1.5.6. I have been trying to deploy the basic contract as follows

 pragma solidity ^0.4.2;
 contract Sha_hash_bytes_links
 {
     function return_int()returns(uint x) 
        {
            return(0);
        }
  }

But I keep getting the following error.

enter image description here

My testnet account address is 0x03a4406f8A50192986Ab6Ad7057AA0A958823Ed5 which has close to 36 ethers in it so it should not be a problem of not having sufficient funds. I was also able to deploy other contracts before this update. Could someone kindly direct me ?

2

The error means the wallet is evaluating the transaction and finding a problem that's going to result in an error. The error isn't necessarily in the contract code, which looks valid.

Be sure you're not inadvertently sending ether with the transaction. This is easy to overlook, especially when iterating quickly through tests. msg.value must be zero when you create this contract.

For completeness, if you wanted the contract to accept and store some initial ether, you would have to explicitly declare a constructor with the payable keyword. This isn't present, so deployment will fail if there is any ether sent when the contract is created.

Hope it helps.

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.