I am trying to send ETH to a contract I have just created and I am getting errors

pragma solidity ^0.4.6;
contract Owned {
    modifier only_owner {
        if (msg.sender != owner) return; _;

    event NewOwner(address indexed old, address indexed current);

    function setOwner(address _new) only_owner { NewOwner(owner, _new); owner = _new; }

    address public owner = msg.sender;

enter image description here

Anyone have any ideas what is going on?

1 Answer 1


I think any function that accepts Ether should be set as "payable"

Read more here: https://solidity.readthedocs.io/en/develop/contracts.html

  • plus if you don't provide any functions for dealing with the Ether, it will just be stuck there forever
    – comodoro
    Commented Jul 17, 2017 at 3:58
  • Im okay with it being stuck there.. i just wanted to test if i can change the owner by sending some ether to it
    – rissicay
    Commented Jul 17, 2017 at 4:40

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.