2

I have tried many times but cannot transfer ETH to Contract Address. https://rinkeby.etherscan.io/address/0xe9d0430dea9b84a9e32801d6e6072175fd48fb85

Errors such as: Warning! Error encountered during contract execution [out of gas] Warning! Error encountered during contract execution [execution reverted]

I tried increasing the Gas Limit but all failed, I'm really confused and stuck. Please help me.

1 Answers1

1

Your contract needs to contain either the fallback() or the receive() function to be able to receive ETH.

pragma solidity ^0.8.0;

contract JetToken is ERC20 {
    // TODO rest of your code

    receive() external payable {
        // you can leave this function body empty
    }
}

Docs: https://docs.soliditylang.org/en/v0.8.6/contracts.html#receive-ether-function

Petr Hejda
  • 40,554
  • 8
  • 72
  • 100