From 74a62a1314c0c7b68a0d0e7b18b34abdc62b65fa Mon Sep 17 00:00:00 2001 From: Doug Crescenzi Date: Sat, 16 Jun 2018 11:46:19 -0400 Subject: [PATCH] using SafeERC20 to implement safeTransfer in Crowdsale (#1006) * introduced safeTransfer to Crowdsale * Removed .node-xmlhttprequest-sync-7601 --- contracts/crowdsale/Crowdsale.sol | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contracts/crowdsale/Crowdsale.sol b/contracts/crowdsale/Crowdsale.sol index da75a526e..81ceac2c7 100644 --- a/contracts/crowdsale/Crowdsale.sol +++ b/contracts/crowdsale/Crowdsale.sol @@ -2,6 +2,7 @@ pragma solidity ^0.4.24; import "../token/ERC20/ERC20.sol"; import "../math/SafeMath.sol"; +import "../token/ERC20/SafeERC20.sol"; /** @@ -18,6 +19,7 @@ import "../math/SafeMath.sol"; */ contract Crowdsale { using SafeMath for uint256; + using SafeERC20 for ERC20; // The token being sold ERC20 public token; @@ -147,7 +149,7 @@ contract Crowdsale { ) internal { - token.transfer(_beneficiary, _tokenAmount); + token.safeTransfer(_beneficiary, _tokenAmount); } /** @@ -195,4 +197,4 @@ contract Crowdsale { function _forwardFunds() internal { wallet.transfer(msg.value); } -} +} \ No newline at end of file