From 39385f9f4ec49642ec54ae6a1173b9164827d95a Mon Sep 17 00:00:00 2001 From: Doug Crescenzi Date: Fri, 8 Jun 2018 20:00:46 -0400 Subject: [PATCH] Addressed unchecked return value in AllowanceCrowdsale #945 using SafeERC20 (#946) * addressed unchecked return value in AllowanceCrowdsale #945 using SafeERC20 --- contracts/crowdsale/emission/AllowanceCrowdsale.sol | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/contracts/crowdsale/emission/AllowanceCrowdsale.sol b/contracts/crowdsale/emission/AllowanceCrowdsale.sol index a79716b32f1..b85b7d022d9 100644 --- a/contracts/crowdsale/emission/AllowanceCrowdsale.sol +++ b/contracts/crowdsale/emission/AllowanceCrowdsale.sol @@ -2,15 +2,16 @@ pragma solidity ^0.4.23; import "../Crowdsale.sol"; import "../../token/ERC20/ERC20.sol"; +import "../../token/ERC20/ERC20Basic.sol"; +import "../../token/ERC20/SafeERC20.sol"; import "../../math/SafeMath.sol"; - - /** * @title AllowanceCrowdsale * @dev Extension of Crowdsale where tokens are held by a wallet, which approves an allowance to the crowdsale. */ contract AllowanceCrowdsale is Crowdsale { using SafeMath for uint256; + using SafeERC20 for ERC20; address public tokenWallet; @@ -42,6 +43,6 @@ contract AllowanceCrowdsale is Crowdsale { ) internal { - token.transferFrom(tokenWallet, _beneficiary, _tokenAmount); + token.safeTransferFrom(tokenWallet, _beneficiary, _tokenAmount); } }