I deposited ETH into a simple contract, and I want to get it back. I have this function:

function refundBalance() public onlyOwner {
    uint256 balance = address(this).balance;
    emit LogReturnedFunds(msg.sender, balance);

I call it via node and web3@1.0.0-beta.35 in the terminal:


Alas, I only get this empty response: Result {} and no state update on Ropsten. Is there something I'm missing here?


try this:


call is used for functions that do not change the state. They're decared as view or pure. However, refundBalance() does change the state. Therefore, use send

| improve this answer | |

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.