CanReclaimToken.sol 725 B

123456789101112131415161718192021222324
  1. pragma solidity ^0.4.11;
  2. import "./Ownable.sol";
  3. import "../token/ERC20Basic.sol";
  4. /**
  5. * @title Contracts that should be able to recover tokens
  6. * @author SylTi
  7. * @dev This allow a contract to recover any ERC20 token received in a contract by transfering the balance to the contract owner.
  8. * This will prevent any accidental loss of tokens.
  9. */
  10. contract CanReclaimToken is Ownable {
  11. /**
  12. * @dev Reclaim all ERC20Basic compatible tokens
  13. * @param tokenAddr address The address of the token contract
  14. */
  15. function reclaimToken(address tokenAddr) external onlyOwner {
  16. ERC20Basic tokenInst = ERC20Basic(tokenAddr);
  17. uint256 balance = tokenInst.balanceOf(this);
  18. tokenInst.transfer(owner, balance);
  19. }
  20. }