SylTi 8 年之前
父节点
当前提交
51906bae6c
共有 2 个文件被更改,包括 5 次插入6 次删除
  1. 4 5
      contracts/ownership/CanReclaimToken.sol
  2. 1 1
      test/CanReclaimToken.js

+ 4 - 5
contracts/ownership/CanReclaimToken.sol

@@ -13,12 +13,11 @@ contract CanReclaimToken is Ownable {
 
   /**
    * @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 {
-    ERC20Basic tokenInst = ERC20Basic(tokenAddr);
-    uint256 balance = tokenInst.balanceOf(this);
-    tokenInst.transfer(owner, balance);
+  function reclaimToken(ERC20Basic token) external onlyOwner {
+    uint256 balance = token.balanceOf(this);
+    token.transfer(owner, balance);
   }
 
 }

+ 1 - 1
test/CanReclaimToken.js

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