Update docs for `SafeERC20.forceApprove` (#4231)

frangio-patch-1
Paul Razvan Berg 2 years ago committed by GitHub
parent 37270eb08a
commit 06861dce54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      contracts/token/ERC20/utils/SafeERC20.sol

@ -70,8 +70,8 @@ library SafeERC20 {
/** /**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* 0 before setting it to a non-zero value. * to be set to zero before setting it to a non-zero value, such as USDT.
*/ */
function forceApprove(IERC20 token, address spender, uint256 value) internal { function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value)); bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

Loading…
Cancel
Save