I am a newbie in Both Solidity and Programming. I want to deploy a contract in MIST test network with some ethar. whan i pressing the publish button following error is showing.

i have added the following payable function...

function payTestFunds() payable{
    //do nothing function

my intention is to give some ethar to my contract account so that it can process some further transaction by itself.

function payRentToCarRentalServiceProvider(address _providerAddress) returns (bool){

    bool payStatus = true;
        rentCar[_providerAddress].rent = 0;
        return payStatus;
        return !payStatus;

kindly help me...Thanks in advance

enter image description here

1 Answer 1


I think if you want to send Ether during contract creation your function must be payable. If you are creating a new contract, making the function "payTestFunds()" payable is probably not enough, since the constructor is being called, not this method. Is your constructor also payable? For simplicity, start by deploying the contract without any initial Ether. Then send Ether once the contract is created.

Also, why are you declaring a variable that is only ever true and never changes? Just do

if (...) {
  return true; 
} else {
  return false;
  • Agree with Max. To send ETH to the constructor, the constructor would have to be payable. Send nothing while you deploy the contract and then send a transaction to new payTestFunds() function after the contract is deployed. It's a 2-step. Commented Feb 9, 2017 at 14:33
  • how can i make my constractor payable???i have tried tosome rther send after deploying but not worked :-( Commented Feb 9, 2017 at 14:36
  • it works properly i have made my contractor also payable, simple write the payable keyword after the constractor name. Thanks a lot for your help Commented Feb 9, 2017 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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