LSDVault - Dependencies
TransferHelper.sol
This is a Solidity library file named 'TransferHelper'. It contains helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true or false. It has four functions: safeApprove, safeTransfer, safeTransferFrom, and safeTransferETH.
This library provides methods for ERC20 token and ETH transfers.
safeApprove(address token, address to, uint value)
Approves the transfer of a specific ERC20 token to a recipient.
token
address
: The ERC20 token to approve.to
address
: The recipient of the token.value
uint
: The amount of the token to approve.void
: No return value.APPROVE_FAILED: The token approval failed.
safeTransfer(address token, address to, uint value)
Transfers a specific ERC20 token to a recipient.
token
address
: The ERC20 token to transfer.to
address
: The recipient of the token.value
uint
: The amount of the token to transfer.void
: No return value.TRANSFER_FAILED: The token transfer failed.
safeTransferFrom(address token, address from, address to, uint value)
Transfers a specific ERC20 token from one address to another.
token
address
: The ERC20 token to transfer.from
address
: The sender of the token.to
address
: The recipient of the token.value
uint
: The amount of the token to transfer.void
: No return value.TRANSFER_FROM_FAILED: The token transfer from an address to another failed.
safeTransferETH(address to, uint value)
Transfers a specific amount of ETH to a recipient.
to
address
: The recipient of the ETH.value
uint
: The amount of ETH to transfer.void
: No return value.ETH_TRANSFER_FAILED: The ETH transfer failed.