TransferHelper

This library provides helper methods for interacting with ERC20 tokens and sending ETH. These methods ensure safe and reliable token transfers by checking the success of the transfer operations.

Internal Functions

safeApprove

Safely approves the specified to address to spend the specified value amount of tokens from the token contract. It uses the approve function of the ERC20 token.

Parameters

safeTransfer

Safely transfers the specified value amount of tokens from the caller's address to the to address. It uses the transfer function of the ERC20 token.

Parameters

safeTransferFrom

Safely transfers the specified value amount of tokens from the from address to the to address. It uses the transferFrom function of the ERC20 token.

Parameters

safeTransferETH

Safely sends the specified value amount of Ether to the to address.

Parameters

decimals

Retrieves the number of decimal places used by the specified ERC20 token contract.

Parameters

Returns

Last updated