2017-07-05 10:28:15 +00:00
|
|
|
pragma solidity ^0.4.11;
|
|
|
|
|
|
|
|
import "./Ownable.sol";
|
|
|
|
import "../token/ERC20Basic.sol";
|
|
|
|
|
2018-08-01 19:57:12 +00:00
|
|
|
/**
|
2017-07-05 10:28:15 +00:00
|
|
|
* @title Contracts that should not own Tokens
|
|
|
|
* @author Remco Bloemen <remco@2π.com>
|
|
|
|
* @dev This blocks incoming ERC23 tokens to prevent accidental loss of tokens.
|
|
|
|
* Should tokens (any ERC20Basic compatible) end up in the contract, it allows the
|
|
|
|
* owner to reclaim the tokens.
|
|
|
|
*/
|
|
|
|
contract HasNoTokens is Ownable {
|
|
|
|
|
2018-08-01 19:57:12 +00:00
|
|
|
/**
|
2017-07-05 10:28:15 +00:00
|
|
|
* @dev Reject all ERC23 compatible tokens
|
|
|
|
* @param from_ address The address that is transferring the tokens
|
|
|
|
* @param value_ uint256 the amount of the specified token
|
|
|
|
* @param data_ Bytes The data passed from the caller.
|
|
|
|
*/
|
|
|
|
function tokenFallback(address from_, uint256 value_, bytes data_) external {
|
2018-07-11 23:49:00 +00:00
|
|
|
revert();
|
2017-07-05 10:28:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dev Reclaim all ERC20Basic compatible tokens
|
|
|
|
* @param tokenAddr address The address of the token contract
|
|
|
|
*/
|
|
|
|
function reclaimToken(address tokenAddr) external onlyOwner {
|
|
|
|
ERC20Basic tokenInst = ERC20Basic(tokenAddr);
|
2018-07-12 18:07:16 +00:00
|
|
|
uint256 balance = tokenInst.balanceOf(address(this));
|
2017-07-05 10:28:15 +00:00
|
|
|
tokenInst.transfer(owner, balance);
|
|
|
|
}
|
|
|
|
}
|