CanReclaimToken.sol 665 B

1234567891011121314151617181920212223
  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 token ERC20Basic The address of the token contract
  14. */
  15. function reclaimToken(ERC20Basic token) external onlyOwner {
  16. uint256 balance = token.balanceOf(this);
  17. token.transfer(owner, balance);
  18. }
  19. }