TransferHelper
The TransferHelper library provides functions for safely interacting with ERC-20 tokens and Ether transfers.
safeApprove
Safely approves spending of a specified amount of tokens by a target address.
Parameters:
Name | Type | Description |
---|---|---|
token | address | Address of the ERC-20 token. |
to | address | Address that will be approved to spend the tokens. |
value | uint | Amount of tokens to approve. |
safeTransfer
Safely transfers a specified amount of tokens to a target address.
Parameters:
Name | Type | Description |
---|---|---|
token | address | Address of the ERC-20 token. |
to | address | Address to which the tokens will be transferred. |
value | uint | Amount of tokens to transfer. |
safeTransferFrom
Safely transfers a specified amount of tokens from one address to another.
Parameters:
Name | Type | Description |
---|---|---|
token | address | Address of the ERC-20 token. |
from | address | Address from which the tokens will be transferred. |
to | address | Address to which the tokens will be transferred. |
value | uint | Amount of tokens to transfer. |
safeTransferETH
Safely transfers a specified amount of Ether to a target address.
Parameters:
Name | Type | Description |
---|---|---|
to | address | Address to which the Ether will be transferred. |
value | uint | Amount of Ether to transfer. |
Last updated