CanReclaimToken.sol 738 B

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