I fail my transaction, anyone know how to solve this problem?
https://kovan.etherscan.io/tx/0x005e623b4da95151c1ef68a71e94a5d94adffe0f1e1b17c27f63c7dbc8ed167d
share the code of the contract, the contract is not verified so cant check by myself
pragma solidity >=0.7.0 <0.9.0; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/utils/SafeERC20.sol"; contract MoveETH { address public owner; event TransferSent(address _form, address _desAddr, uint _amount); constructor() { owner = msg.sender; // address payable addr = payable(address(sendToAddress)); // selfdestruct(addr); } function transferECR20(IERC20 token, address to, uint amount) public{ require(msg.sender == owner, "Only can withdraw funds"); uint256 erc20balance = token.balanceOf(address(this))); require(amount <= erc20balance, "balance is low"); token.transferFrom(msg.sender ,to, amount); emit TransferSent(msg.sender, to, amount); } function getBalanceMe(IERC20 _token) public view returns(uint){ return _token.balanceOf(address(msg.sender)); } }
Обсуждают сегодня