* Consolidted ERC20 Interface and Implementation Files * Fixed CanReclaimToken's tests to use StandardTokenMock instead of BasicTokenMock * Changed token's variable type in TokenTimelock to ERC20 * Merged the StandardBurnableToken with BurnableToken since it now inherits from StandardToken; Fixed TokenTimelock so it uses SafeERC20 for ERC20 * Fixed variable type for _token in TokenTimelock constructor * Fixed linting warning in BurnableToken * Added back burnFrom tests.
27 lines
730 B
Solidity
27 lines
730 B
Solidity
pragma solidity ^0.4.24;
|
|
|
|
import "./Ownable.sol";
|
|
import "../token/ERC20/ERC20.sol";
|
|
import "../token/ERC20/SafeERC20.sol";
|
|
|
|
|
|
/**
|
|
* @title Contracts that should be able to recover tokens
|
|
* @author SylTi
|
|
* @dev This allow a contract to recover any ERC20 token received in a contract by transferring the balance to the contract owner.
|
|
* This will prevent any accidental loss of tokens.
|
|
*/
|
|
contract CanReclaimToken is Ownable {
|
|
using SafeERC20 for ERC20;
|
|
|
|
/**
|
|
* @dev Reclaim all ERC20 compatible tokens
|
|
* @param _token ERC20 The address of the token contract
|
|
*/
|
|
function reclaimToken(ERC20 _token) external onlyOwner {
|
|
uint256 balance = _token.balanceOf(this);
|
|
_token.safeTransfer(owner, balance);
|
|
}
|
|
|
|
}
|