I created a basic contract.But don't know the withdrawal function.I tried creating a basic function but it doesn't work.I want to write a function to withdraw eth from a contract .
can everyone help me write eth withdrawal function ?
This is my contract :https://goerli.etherscan.io/address/0x2196cbcc5200ea6d9984fcc425dacc83932e3cf9#code
I have compiled successfully but i got 1 new error This is :Gas estimation failed you can help me ?
Code to reproduce
function withdrawToken(address _tokenContract, uint256 _amount) external {
IERC20 tokenContract = IERC20(_tokenContract);
// transfer the token from address of this contract
// to address of the user (executing the withdrawToken() function)
tokenContract.transfer(msg.sender, _amount);
}
Environment
I used pragma solidity ^0.5.0;