Merge pull request #430 from frangio/fix-unchecked-transfer

Use SafeERC20 to transfer tokens safely
This commit is contained in:
Francisco Giordano
2017-09-07 20:33:43 -03:00
committed by GitHub
2 changed files with 7 additions and 3 deletions

View File

@ -2,6 +2,7 @@ pragma solidity ^0.4.11;
import './ERC20Basic.sol';
import "../token/SafeERC20.sol";
/**
* @title TokenTimelock
@ -9,6 +10,7 @@ import './ERC20Basic.sol';
* beneficiary to extract the tokens after a given release time
*/
contract TokenTimelock {
using SafeERC20 for ERC20Basic;
// ERC20 basic token contract being held
ERC20Basic token;
@ -44,6 +46,6 @@ contract TokenTimelock {
uint256 amount = token.balanceOf(this);
require(amount > 0);
token.transfer(beneficiary, amount);
token.safeTransfer(beneficiary, amount);
}
}