2
 /* If I change it like that it still fails */
    function () {
        amount += msg.value;     
    }

Is there something like, it's generally not possible to send eth to a token contract?

1 Answer 1

3

If you are using Solidity >= 0.4, you will need to add payable to the function for it to accept Ether.

function() payable {
    amount += msg.value;
}

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.