|
@@ -27,6 +27,13 @@ library SafeERC20 {
|
|
|
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @dev 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 {
|
|
|
// safeApprove should only be called when setting an initial allowance,
|
|
|
// or when resetting it to zero. To increase and decrease it, use
|