Skip to content

Instantly share code, notes, and snippets.

@SeptiyanAndika
Created April 2, 2019 18:19
Show Gist options
  • Save SeptiyanAndika/d2f50b246d187482554c0a4268a7fd0a to your computer and use it in GitHub Desktop.
Save SeptiyanAndika/d2f50b246d187482554c0a4268a7fd0a to your computer and use it in GitHub Desktop.
pragma solidity >=0.4.22 <0.6.0;
import "./ERC20Interface.sol";
contract SimpleWallet {
function flushTokens(address _tokenContractAddress,address _collectorAddress) public {
ERC20Interface instance = ERC20Interface(_tokenContractAddress);
address forwarderAddress = address(this);
uint256 forwarderBalance = instance.balanceOf(forwarderAddress);
if (forwarderBalance == 0) {
return;
}
require(instance.transfer(_collectorAddress, forwarderBalance));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment