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?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.
Sign up to join this communityI 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?
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
}