@1inch/solidity-utils 2.2.13 → 2.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,7 +30,7 @@ library SafeERC20 {
30
30
  bool permit2
31
31
  ) internal {
32
32
  if (permit2) {
33
- safeTransferFromPermit2(token, from, to, amount);
33
+ safeTransferFromPermit2(token, from, to, uint160(amount));
34
34
  } else {
35
35
  safeTransferFrom(token, from, to, amount);
36
36
  }
@@ -72,7 +72,7 @@ library SafeERC20 {
72
72
  IERC20 token,
73
73
  address from,
74
74
  address to,
75
- uint256 amount
75
+ uint160 amount
76
76
  ) internal {
77
77
  bytes4 selector = IPermit2.transferFrom.selector;
78
78
  bool success;
@@ -85,15 +85,9 @@ library SafeERC20 {
85
85
  mstore(add(data, 0x24), to)
86
86
  mstore(add(data, 0x44), amount)
87
87
  mstore(add(data, 0x64), token)
88
- success := call(gas(), _PERMIT2, 0, data, 0x84, 0x0, 0x20)
88
+ success := call(gas(), _PERMIT2, 0, data, 0x84, 0x0, 0x0)
89
89
  if success {
90
- switch returndatasize()
91
- case 0 {
92
- success := gt(extcodesize(token), 0)
93
- }
94
- default {
95
- success := and(gt(returndatasize(), 31), eq(mload(0), 1))
96
- }
90
+ success := gt(extcodesize(_PERMIT2), 0)
97
91
  }
98
92
  }
99
93
  if (!success) revert SafeTransferFromFailed();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1inch/solidity-utils",
3
- "version": "2.2.13",
3
+ "version": "2.2.14",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "repository": {