1

I'm facing an issue with sending value to my smart contract. I created a very simple smart contract and deployed it using MetaMask & Remix to Ropsten Testnet. Contract created successfully.

Now I'm trying to send some value to my contract address and its continuously failing. I have tried this on different Testnets too e.g Rinkeby but same error.

"Value transfer did not complete, most likely as a result of REVERT opcode "

Contract code

pragma solidity ^0.4.18;

contract HelloWorld {  
    event log_string(bytes32 log); // Event

    function () public { // Fallback Function
        log_string("Hello World!");
    }
}

Transaction for contract creation
Transaction for sending value

2

The transaction you linked to has ether attached to it (0.5 ether), but the function you're calling (the fallback function) is not marked payable. If you want to be allowed to send ether to this function, use:

function () public payable { ... }

See https://programtheblockchain.com/posts/2017/12/15/writing-a-contract-that-handles-ether/.

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.