using SafeERC20 to implement safeTransfer in Crowdsale (#1006)
* introduced safeTransfer to Crowdsale * Removed .node-xmlhttprequest-sync-7601
This commit is contained in:
committed by
Francisco Giordano
parent
92b695f2fb
commit
74a62a1314
@ -2,6 +2,7 @@ pragma solidity ^0.4.24;
|
|||||||
|
|
||||||
import "../token/ERC20/ERC20.sol";
|
import "../token/ERC20/ERC20.sol";
|
||||||
import "../math/SafeMath.sol";
|
import "../math/SafeMath.sol";
|
||||||
|
import "../token/ERC20/SafeERC20.sol";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -18,6 +19,7 @@ import "../math/SafeMath.sol";
|
|||||||
*/
|
*/
|
||||||
contract Crowdsale {
|
contract Crowdsale {
|
||||||
using SafeMath for uint256;
|
using SafeMath for uint256;
|
||||||
|
using SafeERC20 for ERC20;
|
||||||
|
|
||||||
// The token being sold
|
// The token being sold
|
||||||
ERC20 public token;
|
ERC20 public token;
|
||||||
@ -147,7 +149,7 @@ contract Crowdsale {
|
|||||||
)
|
)
|
||||||
internal
|
internal
|
||||||
{
|
{
|
||||||
token.transfer(_beneficiary, _tokenAmount);
|
token.safeTransfer(_beneficiary, _tokenAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -195,4 +197,4 @@ contract Crowdsale {
|
|||||||
function _forwardFunds() internal {
|
function _forwardFunds() internal {
|
||||||
wallet.transfer(msg.value);
|
wallet.transfer(msg.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user