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?

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
}
  • Thanks a lot, I forgot about this! – Alex May 1 at 7:07

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.