Skip to content

Commit

Permalink
Use .call value syntax in lib contracts instead of .transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
elenadimitrova committed Apr 15, 2021
1 parent 8dccbc2 commit 8c903b8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib_0.5/compound/CEther.sol
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ contract CEther is CToken {

function doTransferOut(address payable to, uint amount) internal returns (Error) {
/* Send the Ether, with minimal gas and revert on failure */
to.transfer(amount);
to.call.value(amount)("");
return Error.NO_ERROR;
}

Expand Down
2 changes: 1 addition & 1 deletion lib_0.5/maker/WETH9.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ contract WETH9 {
function withdraw(uint wad) public {
require(balanceOf[msg.sender] >= wad);
balanceOf[msg.sender] -= wad;
msg.sender.transfer(wad);
msg.sender.call.value(wad)("");
emit Withdrawal(msg.sender, wad);
}

Expand Down
2 changes: 1 addition & 1 deletion lib_0.7/yearn/yVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ contract yVault is ERC20 {
}

IWETH(address(token)).withdraw(r);
payable(msg.sender).transfer(r);
payable(msg.sender).call{value: r}("");
}

function withdrawAllETH() external {
Expand Down

0 comments on commit 8c903b8

Please sign in to comment.