SafeERC20

Git Source

Functions

safeTransfer

function safeTransfer(IERC20 token, address to, uint256 value) internal;

safeTransferFrom

function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal;

safeApprove

Deprecated. This function has issues similar to the ones found in IERC20-approve, and its usage is discouraged. Whenever possible, use {safeIncreaseAllowance} and {safeDecreaseAllowance} instead.

function safeApprove(IERC20 token, address spender, uint256 value) internal;

safeIncreaseAllowance

function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal;

safeDecreaseAllowance

function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal;

_callOptionalReturn

Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement on the return value: the return value is optional (but if data is returned, it must not be false).

function _callOptionalReturn(IERC20 token, bytes memory data) private;

Parameters

NameTypeDescription
tokenIERC20The token targeted by the call.
databytesThe call data (encoded using abi.encode or one of its variants).