Replaced transfer() with sendValue()

This commit is contained in:
Thrilok Kumar 2020-10-07 20:49:11 +05:30
parent d3b423ba62
commit 4bff80010d

View File

@ -4,6 +4,7 @@ pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC20/ERC20Pausable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import { DSMath } from "../libs/safeMath.sol";
@ -146,7 +147,7 @@ contract PoolETH is ReentrancyGuard, ERC20Pausable, DSMath {
require(wdAmt <= address(this).balance, "not-enough-liquidity-available");
_burn(msg.sender, _burnAmt);
payable(target).transfer(wdAmt);
Address.sendValue(payable(target), wdAmt);
emit LogWithdraw(msg.sender, wdAmt, _burnAmt);
}
@ -159,7 +160,7 @@ contract PoolETH is ReentrancyGuard, ERC20Pausable, DSMath {
function withdrawFee(uint wdAmt) external {
require(msg.sender == instaIndex.master(), "not-master");
if (wdAmt > feeAmt) wdAmt = feeAmt;
msg.sender.transfer(wdAmt);
Address.sendValue(payable(msg.sender), wdAmt);
feeAmt = sub(feeAmt, wdAmt);
emit LogWithdrawFee(wdAmt);
}