diff --git a/contracts/arbitrum/connectors/1inch/helpers.sol b/contracts/arbitrum/connectors/1inch/helpers.sol index 41cc4b0d..7e04a7d2 100644 --- a/contracts/arbitrum/connectors/1inch/helpers.sol +++ b/contracts/arbitrum/connectors/1inch/helpers.sol @@ -9,15 +9,5 @@ abstract contract Helpers is DSMath, Basic { /** * @dev 1Inch Address */ - address internal constant oneInchAddr = 0x11111112542D85B3EF69AE05771c2dCCff4fAa26; - - /** - * @dev 1inch swap function sig - */ - bytes4 internal constant oneInchSwapSig = 0x7c025200; - - /** - * @dev 1inch swap function sig - */ - bytes4 internal constant oneInchUnoswapSig = 0x2e95b6c8; + address internal constant oneInchAddr = 0x1111111254fb6c44bAC0beD2854e76F90643097d; } \ No newline at end of file diff --git a/contracts/arbitrum/connectors/1inch/main.sol b/contracts/arbitrum/connectors/1inch/main.sol index 7adef93c..b2a1dafa 100644 --- a/contracts/arbitrum/connectors/1inch/main.sol +++ b/contracts/arbitrum/connectors/1inch/main.sol @@ -14,20 +14,6 @@ import { Helpers } from "./helpers.sol"; import { Events } from "./events.sol"; abstract contract OneInchResolver is Helpers, Events { - /** - * @dev 1inch swap uses `.call()`. This function restrict it to call only swap/trade functionality - * @param callData - calldata to extract the first 4 bytes for checking function signature - */ - function checkOneInchSig(bytes memory callData) internal pure returns(bool isOk) { - bytes memory _data = callData; - bytes4 sig; - // solium-disable-next-line security/no-inline-assembly - assembly { - sig := mload(add(_data, 32)) - } - isOk = sig == oneInchSwapSig || sig == oneInchUnoswapSig; - } - /** * @dev 1inch API swap handler * @param oneInchData - contains data returned from 1inch API. Struct defined in interfaces.sol @@ -77,14 +63,10 @@ abstract contract OneInchResolverHelpers is OneInchResolver { approve(TokenInterface(_sellAddr), oneInchAddr, oneInchData._sellAmt); } - require(checkOneInchSig(oneInchData.callData), "Not-swap-function"); - oneInchData._buyAmt = oneInchSwap(oneInchData, ethAmt); setUint(setId, oneInchData._buyAmt); return oneInchData; - - // emitLogSellThree(oneInchData, setId); } } @@ -124,5 +106,5 @@ abstract contract OneInch is OneInchResolverHelpers { } contract ConnectV2OneInchArbitrum is OneInch { - string public name = "1Inch-v1.0"; + string public name = "1Inch-v4-v1.0"; } diff --git a/contracts/mainnet/connectors/1inch/helpers.sol b/contracts/mainnet/connectors/1inch/helpers.sol index 41cc4b0d..7e04a7d2 100644 --- a/contracts/mainnet/connectors/1inch/helpers.sol +++ b/contracts/mainnet/connectors/1inch/helpers.sol @@ -9,15 +9,5 @@ abstract contract Helpers is DSMath, Basic { /** * @dev 1Inch Address */ - address internal constant oneInchAddr = 0x11111112542D85B3EF69AE05771c2dCCff4fAa26; - - /** - * @dev 1inch swap function sig - */ - bytes4 internal constant oneInchSwapSig = 0x7c025200; - - /** - * @dev 1inch swap function sig - */ - bytes4 internal constant oneInchUnoswapSig = 0x2e95b6c8; + address internal constant oneInchAddr = 0x1111111254fb6c44bAC0beD2854e76F90643097d; } \ No newline at end of file diff --git a/contracts/mainnet/connectors/1inch/main.sol b/contracts/mainnet/connectors/1inch/main.sol index bf215788..a374bf54 100644 --- a/contracts/mainnet/connectors/1inch/main.sol +++ b/contracts/mainnet/connectors/1inch/main.sol @@ -14,20 +14,6 @@ import { Helpers } from "./helpers.sol"; import { Events } from "./events.sol"; abstract contract OneInchResolver is Helpers, Events { - /** - * @dev 1inch swap uses `.call()`. This function restrict it to call only swap/trade functionality - * @param callData - calldata to extract the first 4 bytes for checking function signature - */ - function checkOneInchSig(bytes memory callData) internal pure returns(bool isOk) { - bytes memory _data = callData; - bytes4 sig; - // solium-disable-next-line security/no-inline-assembly - assembly { - sig := mload(add(_data, 32)) - } - isOk = sig == oneInchSwapSig || sig == oneInchUnoswapSig; - } - /** * @dev 1inch API swap handler * @param oneInchData - contains data returned from 1inch API. Struct defined in interfaces.sol @@ -77,8 +63,6 @@ abstract contract OneInchResolverHelpers is OneInchResolver { approve(TokenInterface(_sellAddr), oneInchAddr, oneInchData._sellAmt); } - require(checkOneInchSig(oneInchData.callData), "Not-swap-function"); - oneInchData._buyAmt = oneInchSwap(oneInchData, ethAmt); setUint(setId, oneInchData._buyAmt); @@ -124,5 +108,5 @@ abstract contract OneInch is OneInchResolverHelpers { } contract ConnectV2OneInch is OneInch { - string public name = "1Inch-v1.2"; + string public name = "1Inch-v4-v1.0"; } diff --git a/contracts/polygon/connectors/1inch/helpers.sol b/contracts/polygon/connectors/1inch/helpers.sol index 41cc4b0d..7e04a7d2 100644 --- a/contracts/polygon/connectors/1inch/helpers.sol +++ b/contracts/polygon/connectors/1inch/helpers.sol @@ -9,15 +9,5 @@ abstract contract Helpers is DSMath, Basic { /** * @dev 1Inch Address */ - address internal constant oneInchAddr = 0x11111112542D85B3EF69AE05771c2dCCff4fAa26; - - /** - * @dev 1inch swap function sig - */ - bytes4 internal constant oneInchSwapSig = 0x7c025200; - - /** - * @dev 1inch swap function sig - */ - bytes4 internal constant oneInchUnoswapSig = 0x2e95b6c8; + address internal constant oneInchAddr = 0x1111111254fb6c44bAC0beD2854e76F90643097d; } \ No newline at end of file diff --git a/contracts/polygon/connectors/1inch/main.sol b/contracts/polygon/connectors/1inch/main.sol index 38a720c0..1a986074 100644 --- a/contracts/polygon/connectors/1inch/main.sol +++ b/contracts/polygon/connectors/1inch/main.sol @@ -14,20 +14,6 @@ import { Helpers } from "./helpers.sol"; import { Events } from "./events.sol"; abstract contract OneInchResolver is Helpers, Events { - /** - * @dev 1inch swap uses `.call()`. This function restrict it to call only swap/trade functionality - * @param callData - calldata to extract the first 4 bytes for checking function signature - */ - function checkOneInchSig(bytes memory callData) internal pure returns(bool isOk) { - bytes memory _data = callData; - bytes4 sig; - // solium-disable-next-line security/no-inline-assembly - assembly { - sig := mload(add(_data, 32)) - } - isOk = sig == oneInchSwapSig || sig == oneInchUnoswapSig; - } - /** * @dev 1inch API swap handler * @param oneInchData - contains data returned from 1inch API. Struct defined in interfaces.sol @@ -77,8 +63,6 @@ abstract contract OneInchResolverHelpers is OneInchResolver { approve(TokenInterface(_sellAddr), oneInchAddr, oneInchData._sellAmt); } - require(checkOneInchSig(oneInchData.callData), "Not-swap-function"); - oneInchData._buyAmt = oneInchSwap(oneInchData, ethAmt); setUint(setId, oneInchData._buyAmt); @@ -124,5 +108,5 @@ abstract contract OneInch is OneInchResolverHelpers { } contract ConnectV2OneInchPolygon is OneInch { - string public name = "1Inch-v1"; + string public name = "1Inch-v4-v1"; }