0

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?

3

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

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

| improve this answer | |
  • plus if you don't provide any functions for dealing with the Ether, it will just be stuck there forever – comodoro Jul 17 '17 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 Jul 17 '17 at 4:40

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.