This commit is contained in:
SylTi
2017-08-24 21:35:19 +02:00
parent 406004a99a
commit 51906bae6c
2 changed files with 5 additions and 6 deletions

View File

@ -13,12 +13,11 @@ contract CanReclaimToken is Ownable {
/** /**
* @dev Reclaim all ERC20Basic compatible tokens * @dev Reclaim all ERC20Basic compatible tokens
* @param tokenAddr address The address of the token contract * @param token ERC20Basic The address of the token contract
*/ */
function reclaimToken(address tokenAddr) external onlyOwner { function reclaimToken(ERC20Basic token) external onlyOwner {
ERC20Basic tokenInst = ERC20Basic(tokenAddr); uint256 balance = token.balanceOf(this);
uint256 balance = tokenInst.balanceOf(this); token.transfer(owner, balance);
tokenInst.transfer(owner, balance);
} }
} }

View File

@ -8,7 +8,7 @@ contract('CanReclaimToken', function(accounts) {
let token = null; let token = null;
let canReclaimToken = null; let canReclaimToken = null;
beforeEach(async () => { beforeEach(async function() {
// Create contract and token // Create contract and token
token = await BasicTokenMock.new(accounts[0], 100); token = await BasicTokenMock.new(accounts[0], 100);
canReclaimToken = await CanReclaimToken.new(); canReclaimToken = await CanReclaimToken.new();