// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.6.0; import '@aryze/v3-periphery/contracts/libraries/TransferHelper.sol'; import '@openzeppelin/contracts/utils/Address.sol'; library TransferHelperExtended { using Address for address; /// @notice Transfers tokens from the targeted address to the given destination /// @notice Errors with 'STF' if transfer fails /// @param token The contract address of the token to be transferred /// @param from The originating address from which the tokens will be transferred /// @param to The destination address of the transfer /// @param value The amount to be transferred function safeTransferFrom( address token, address from, address to, uint256 value ) internal { require(token.isContract(), 'TransferHelperExtended::safeTransferFrom: call to non-contract'); TransferHelper.safeTransferFrom(token, from, to, value); } /// @notice Transfers tokens from msg.sender to a recipient /// @dev Errors with ST if transfer fails /// @param token The contract address of the token which will be transferred /// @param to The recipient of the transfer /// @param value The value of the transfer function safeTransfer( address token, address to, uint256 value ) internal { require(token.isContract(), 'TransferHelperExtended::safeTransfer: call to non-contract'); TransferHelper.safeTransfer(token, to, value); } }