1

I pushed this contract

https://ropsten.etherscan.io/address/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2#code

I want to issue test ERC20 token. But when I try to send ETH to my contract I see error.

What I missed?

1 Answer 1

3

This contract doesn't appear to implement a fallback function that accepts ether, so the transaction gets reverted.

If you want your contract to do something when sent ether, implement a payable fallback function:

function() external payable {
    // do stuff
}
1
  • Thanks a lot, I forgot about this!
    – Alex
    Commented May 1, 2019 at 7:07

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.