diff --git a/contracts/libraries/SafeERC20.sol b/contracts/libraries/SafeERC20.sol index 1db23467..c6a7e4b0 100644 --- a/contracts/libraries/SafeERC20.sol +++ b/contracts/libraries/SafeERC20.sol @@ -30,7 +30,6 @@ library SafeERC20 { // Uniswap Permit2 address address private constant _PERMIT2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3; bytes4 private constant _PERMIT_LENGTH_ERROR = 0x68275857; // SafePermitBadLength.selector - uint256 private constant _RAW_CALL_GAS_LIMIT = 5000; /** * @notice Fetches the balance of a specific ERC20 token held by an account. @@ -483,7 +482,7 @@ library SafeERC20 { safeWithdraw(weth, amount); if (to != address(this)) { assembly ("memory-safe") { // solhint-disable-line no-inline-assembly - if iszero(call(_RAW_CALL_GAS_LIMIT, to, amount, 0, 0, 0, 0)) { + if iszero(call(gas(), to, amount, 0, 0, 0, 0)) { let ptr := mload(0x40) returndatacopy(ptr, 0, returndatasize()) revert(ptr, returndatasize()) diff --git a/contracts/libraries/UniERC20.sol b/contracts/libraries/UniERC20.sol index ceecae94..d7a02627 100644 --- a/contracts/libraries/UniERC20.sol +++ b/contracts/libraries/UniERC20.sol @@ -23,7 +23,6 @@ library UniERC20 { error ToIsNotThis(); error ETHTransferFailed(); - uint256 private constant _RAW_CALL_GAS_LIMIT = 5000; IERC20 private constant _ETH_ADDRESS = IERC20(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE); IERC20 private constant _ZERO_ADDRESS = IERC20(address(0)); @@ -66,7 +65,7 @@ library UniERC20 { if (isETH(token)) { if (address(this).balance < amount) revert InsufficientBalance(); // solhint-disable-next-line avoid-low-level-calls - (bool success, ) = to.call{value: amount, gas: _RAW_CALL_GAS_LIMIT}(""); + (bool success, ) = to.call{value: amount}(""); if (!success) revert ETHTransferFailed(); } else { token.safeTransfer(to, amount); @@ -97,7 +96,7 @@ library UniERC20 { // Return remainder if exist unchecked { // solhint-disable-next-line avoid-low-level-calls - (bool success, ) = from.call{value: msg.value - amount, gas: _RAW_CALL_GAS_LIMIT}(""); + (bool success, ) = from.call{value: msg.value - amount}(""); if (!success) revert ETHTransferFailed(); } } diff --git a/package.json b/package.json index 93ecf345..871e771b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@1inch/solidity-utils", - "version": "6.3.2", + "version": "6.4.0", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", "exports": {