Skip to content

Commit

Permalink
fix: use OpenZeppelin Address to transfer ETH (OZ L-04)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maikol committed Aug 24, 2024
1 parent 63f6ea1 commit d3f5ece
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.26;

import { Address } from "@openzeppelin/contracts/utils/Address.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { IDataServiceRescuable } from "../interfaces/IDataServiceRescuable.sol";

Expand Down Expand Up @@ -66,7 +67,7 @@ abstract contract DataServiceRescuable is DataService, IDataServiceRescuable {
function _rescueTokens(address _to, address _token, uint256 _tokens) internal {
require(_tokens != 0, DataServiceRescuableCannotRescueZero());

if (Denominations.isNativeToken(_token)) payable(_to).transfer(_tokens);
if (Denominations.isNativeToken(_token)) Address.sendValue(payable(_to), _tokens);
else SafeERC20.safeTransfer(IERC20(_token), _to, _tokens);

emit TokensRescued(msg.sender, _to, _tokens);
Expand Down

0 comments on commit d3f5ece

Please sign in to comment.