diff --git a/contracts/arbitrum/connectors/kyber_v3/events.sol b/contracts/arbitrum/connectors/kyber_aggregator/events.sol similarity index 100% rename from contracts/arbitrum/connectors/kyber_v3/events.sol rename to contracts/arbitrum/connectors/kyber_aggregator/events.sol diff --git a/contracts/arbitrum/connectors/kyber_v3/helpers.sol b/contracts/arbitrum/connectors/kyber_aggregator/helpers.sol similarity index 92% rename from contracts/arbitrum/connectors/kyber_v3/helpers.sol rename to contracts/arbitrum/connectors/kyber_aggregator/helpers.sol index e4ea6d8b..5d2d297a 100644 --- a/contracts/arbitrum/connectors/kyber_v3/helpers.sol +++ b/contracts/arbitrum/connectors/kyber_aggregator/helpers.sol @@ -18,7 +18,7 @@ abstract contract Helpers is DSMath, Basic { address internal constant kyberswap = 0x6131B5fae19EA4f9D964eAc0408E4408b66337b5; - function _swapHelper(SwapData memory swapData, uint256 wethAmt) + function _swapHelper(SwapData memory swapData, uint256 ethAmt) internal returns (uint256 buyAmt) { @@ -34,7 +34,7 @@ abstract contract Helpers is DSMath, Basic { ); uint256 initalBal = getTokenBal(buyToken); - (bool success, ) = kyberswap.call{value: wethAmt}(swapData.callData); + (bool success, ) = kyberswap.call{value: ethAmt}(swapData.callData); if (!success) revert("kyberswap-failed"); uint256 finalBal = getTokenBal(buyToken); diff --git a/contracts/arbitrum/connectors/kyber_v3/main.sol b/contracts/arbitrum/connectors/kyber_aggregator/main.sol similarity index 93% rename from contracts/arbitrum/connectors/kyber_v3/main.sol rename to contracts/arbitrum/connectors/kyber_aggregator/main.sol index e0f1675d..6d151700 100644 --- a/contracts/arbitrum/connectors/kyber_v3/main.sol +++ b/contracts/arbitrum/connectors/kyber_aggregator/main.sol @@ -54,6 +54,6 @@ abstract contract KyberArbitrumResolver is Helpers { } } -contract ConnectV2KyberV3Arbitrum is KyberArbitrumResolver { - string public name = "Kyber-v3"; +contract ConnectV2KyberAggregatorArbitrum is KyberArbitrumResolver { + string public name = "Kyber-aggregator-v1.0"; } diff --git a/contracts/arbitrum/connectors/kyber_v3/interface.sol b/contracts/arbitrum/connectors/kyber_v3/interface.sol deleted file mode 100644 index 7de1fbbf..00000000 --- a/contracts/arbitrum/connectors/kyber_v3/interface.sol +++ /dev/null @@ -1,6 +0,0 @@ -//SPDX-License-Identifier: MIT -pragma solidity ^0.7.0; - -interface AugustusSwapperInterface { - function getTokenTransferProxy() external view returns (address); -} \ No newline at end of file diff --git a/contracts/avalanche/connectors/kyber_v3/events.sol b/contracts/avalanche/connectors/kyber_aggregator/events.sol similarity index 100% rename from contracts/avalanche/connectors/kyber_v3/events.sol rename to contracts/avalanche/connectors/kyber_aggregator/events.sol diff --git a/contracts/avalanche/connectors/kyber_v3/helpers.sol b/contracts/avalanche/connectors/kyber_aggregator/helpers.sol similarity index 86% rename from contracts/avalanche/connectors/kyber_v3/helpers.sol rename to contracts/avalanche/connectors/kyber_aggregator/helpers.sol index 2cd1c299..ac5c7651 100644 --- a/contracts/avalanche/connectors/kyber_v3/helpers.sol +++ b/contracts/avalanche/connectors/kyber_aggregator/helpers.sol @@ -18,7 +18,7 @@ abstract contract Helpers is DSMath, Basic { address internal constant kyberswap = 0x6131B5fae19EA4f9D964eAc0408E4408b66337b5; - function _swapHelper(SwapData memory swapData, uint256 wethAmt) + function _swapHelper(SwapData memory swapData, uint256 avaxAmt) internal returns (uint256 buyAmt) { @@ -34,7 +34,7 @@ abstract contract Helpers is DSMath, Basic { ); uint256 initalBal = getTokenBal(buyToken); - (bool success, ) = kyberswap.call{value: wethAmt}(swapData.callData); + (bool success, ) = kyberswap.call{value: avaxAmt}(swapData.callData); if (!success) revert("kyberswap-failed"); uint256 finalBal = getTokenBal(buyToken); @@ -50,14 +50,14 @@ abstract contract Helpers is DSMath, Basic { { TokenInterface _sellAddr = swapData.sellToken; - uint256 ethAmt; + uint256 avaxAmt; if (address(_sellAddr) == avaxAddr) { - ethAmt = swapData._sellAmt; + avaxAmt = swapData._sellAmt; } else { approve(TokenInterface(_sellAddr), kyberswap, swapData._sellAmt); } - swapData._buyAmt = _swapHelper(swapData, ethAmt); + swapData._buyAmt = _swapHelper(swapData, avaxAmt); setUint(setId, swapData._buyAmt); diff --git a/contracts/avalanche/connectors/kyber_v3/main.sol b/contracts/avalanche/connectors/kyber_aggregator/main.sol similarity index 79% rename from contracts/avalanche/connectors/kyber_v3/main.sol rename to contracts/avalanche/connectors/kyber_aggregator/main.sol index 50e98c20..5bd2f25c 100644 --- a/contracts/avalanche/connectors/kyber_v3/main.sol +++ b/contracts/avalanche/connectors/kyber_aggregator/main.sol @@ -12,10 +12,10 @@ import {Helpers} from "./helpers.sol"; abstract contract KyberAvalancheResolver is Helpers { /** - * @dev Sell ETH/ERC20_Token using KyberSwap. + * @dev Sell AVAX/ERC20_Token using KyberSwap. * @notice Swap tokens from exchanges like kyber, 0x etc, with calculation done off-chain. - * @param buyAddr The address of the token to buy.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) - * @param sellAddr The address of the token to sell.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param buyAddr The address of the token to buy.(For AVAX: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param sellAddr The address of the token to sell.(For AVAX: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) * @param sellAmt The amount of the token to sell. * @param unitAmt The amount of buyAmt/sellAmt with slippage. * @param callData Data from kyberswap API. @@ -54,6 +54,6 @@ abstract contract KyberAvalancheResolver is Helpers { } } -contract ConnectV2KyberV3Avalanche is KyberAvalancheResolver { - string public name = "Kyber-v3"; +contract ConnectV2KyberAggregatorAvalanche is KyberAvalancheResolver { + string public name = "Kyber-aggregator-v1.0"; } diff --git a/contracts/avalanche/connectors/kyber_v3/interface.sol b/contracts/avalanche/connectors/kyber_v3/interface.sol deleted file mode 100644 index 7de1fbbf..00000000 --- a/contracts/avalanche/connectors/kyber_v3/interface.sol +++ /dev/null @@ -1,6 +0,0 @@ -//SPDX-License-Identifier: MIT -pragma solidity ^0.7.0; - -interface AugustusSwapperInterface { - function getTokenTransferProxy() external view returns (address); -} \ No newline at end of file diff --git a/contracts/fantom/connectors/kyber_v3/events.sol b/contracts/fantom/connectors/kyber_aggregator/events.sol similarity index 100% rename from contracts/fantom/connectors/kyber_v3/events.sol rename to contracts/fantom/connectors/kyber_aggregator/events.sol diff --git a/contracts/fantom/connectors/kyber_v3/helpers.sol b/contracts/fantom/connectors/kyber_aggregator/helpers.sol similarity index 85% rename from contracts/fantom/connectors/kyber_v3/helpers.sol rename to contracts/fantom/connectors/kyber_aggregator/helpers.sol index cb5dae6d..188f7da1 100644 --- a/contracts/fantom/connectors/kyber_v3/helpers.sol +++ b/contracts/fantom/connectors/kyber_aggregator/helpers.sol @@ -18,7 +18,7 @@ abstract contract Helpers is DSMath, Basic { address internal constant kyberswap = 0x6131B5fae19EA4f9D964eAc0408E4408b66337b5; - function _swapHelper(SwapData memory swapData, uint256 wethAmt) + function _swapHelper(SwapData memory swapData, uint256 ftmAmt) internal returns (uint256 buyAmt) { @@ -34,7 +34,7 @@ abstract contract Helpers is DSMath, Basic { ); uint256 initalBal = getTokenBal(buyToken); - (bool success, ) = kyberswap.call{value: wethAmt}(swapData.callData); + (bool success, ) = kyberswap.call{value: ftmAmt}(swapData.callData); if (!success) revert("kyberswap-failed"); uint256 finalBal = getTokenBal(buyToken); @@ -50,14 +50,14 @@ abstract contract Helpers is DSMath, Basic { { TokenInterface _sellAddr = swapData.sellToken; - uint256 ethAmt; + uint256 ftmAmt; if (address(_sellAddr) == ftmAddr) { - ethAmt = swapData._sellAmt; + ftmAmt = swapData._sellAmt; } else { approve(TokenInterface(_sellAddr), kyberswap, swapData._sellAmt); } - swapData._buyAmt = _swapHelper(swapData, ethAmt); + swapData._buyAmt = _swapHelper(swapData, ftmAmt); setUint(setId, swapData._buyAmt); diff --git a/contracts/fantom/connectors/kyber_v3/main.sol b/contracts/fantom/connectors/kyber_aggregator/main.sol similarity index 84% rename from contracts/fantom/connectors/kyber_v3/main.sol rename to contracts/fantom/connectors/kyber_aggregator/main.sol index e468a8df..fa5603a6 100644 --- a/contracts/fantom/connectors/kyber_v3/main.sol +++ b/contracts/fantom/connectors/kyber_aggregator/main.sol @@ -12,10 +12,10 @@ import {Helpers} from "./helpers.sol"; abstract contract KyberFantomResolver is Helpers { /** - * @dev Sell ETH/ERC20_Token using KyberSwap. + * @dev Sell ftm/ERC20_Token using KyberSwap. * @notice Swap tokens from exchanges like kyber, 0x etc, with calculation done off-chain. - * @param buyAddr The address of the token to buy.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) - * @param sellAddr The address of the token to sell.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param buyAddr The address of the token to buy.(For FTM: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param sellAddr The address of the token to sell.(For FTM: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) * @param sellAmt The amount of the token to sell. * @param unitAmt The amount of buyAmt/sellAmt with slippage. * @param callData Data from kyberswap API. @@ -54,6 +54,6 @@ abstract contract KyberFantomResolver is Helpers { } } -contract ConnectV2KyberV3Fantom is KyberFantomResolver { - string public name = "Kyber-v3"; +contract ConnectV2KyberAggregatorFantom is KyberFantomResolver { + string public name = "Kyber-aggregator-v1.0"; } diff --git a/contracts/fantom/connectors/kyber_v3/interface.sol b/contracts/fantom/connectors/kyber_v3/interface.sol deleted file mode 100644 index 7de1fbbf..00000000 --- a/contracts/fantom/connectors/kyber_v3/interface.sol +++ /dev/null @@ -1,6 +0,0 @@ -//SPDX-License-Identifier: MIT -pragma solidity ^0.7.0; - -interface AugustusSwapperInterface { - function getTokenTransferProxy() external view returns (address); -} \ No newline at end of file diff --git a/contracts/mainnet/connectors/kyber/kyber_v3/events.sol b/contracts/mainnet/connectors/kyber/kyber_aggregator/events.sol similarity index 100% rename from contracts/mainnet/connectors/kyber/kyber_v3/events.sol rename to contracts/mainnet/connectors/kyber/kyber_aggregator/events.sol diff --git a/contracts/mainnet/connectors/kyber/kyber_v3/helpers.sol b/contracts/mainnet/connectors/kyber/kyber_aggregator/helpers.sol similarity index 92% rename from contracts/mainnet/connectors/kyber/kyber_v3/helpers.sol rename to contracts/mainnet/connectors/kyber/kyber_aggregator/helpers.sol index 5b38d196..1b429f2d 100644 --- a/contracts/mainnet/connectors/kyber/kyber_v3/helpers.sol +++ b/contracts/mainnet/connectors/kyber/kyber_aggregator/helpers.sol @@ -18,7 +18,7 @@ abstract contract Helpers is DSMath, Basic { address internal constant kyberswap = 0x6131B5fae19EA4f9D964eAc0408E4408b66337b5; - function _swapHelper(SwapData memory swapData, uint256 wethAmt) + function _swapHelper(SwapData memory swapData, uint256 ethAmt) internal returns (uint256 buyAmt) { @@ -34,7 +34,7 @@ abstract contract Helpers is DSMath, Basic { ); uint256 initalBal = getTokenBal(buyToken); - (bool success, ) = kyberswap.call{value: wethAmt}(swapData.callData); + (bool success, ) = kyberswap.call{value: ethAmt}(swapData.callData); if (!success) revert("kyberswap-failed"); uint256 finalBal = getTokenBal(buyToken); diff --git a/contracts/mainnet/connectors/kyber/kyber_v3/main.sol b/contracts/mainnet/connectors/kyber/kyber_aggregator/main.sol similarity index 100% rename from contracts/mainnet/connectors/kyber/kyber_v3/main.sol rename to contracts/mainnet/connectors/kyber/kyber_aggregator/main.sol diff --git a/contracts/mainnet/connectors/kyber/kyber_v3/interface.sol b/contracts/mainnet/connectors/kyber/kyber_v3/interface.sol deleted file mode 100644 index 7de1fbbf..00000000 --- a/contracts/mainnet/connectors/kyber/kyber_v3/interface.sol +++ /dev/null @@ -1,6 +0,0 @@ -//SPDX-License-Identifier: MIT -pragma solidity ^0.7.0; - -interface AugustusSwapperInterface { - function getTokenTransferProxy() external view returns (address); -} \ No newline at end of file diff --git a/contracts/optimism/connectors/kyber_v3/events.sol b/contracts/optimism/connectors/kyber_aggregator/events.sol similarity index 100% rename from contracts/optimism/connectors/kyber_v3/events.sol rename to contracts/optimism/connectors/kyber_aggregator/events.sol diff --git a/contracts/optimism/connectors/kyber_v3/helpers.sol b/contracts/optimism/connectors/kyber_aggregator/helpers.sol similarity index 92% rename from contracts/optimism/connectors/kyber_v3/helpers.sol rename to contracts/optimism/connectors/kyber_aggregator/helpers.sol index e4ea6d8b..5d2d297a 100644 --- a/contracts/optimism/connectors/kyber_v3/helpers.sol +++ b/contracts/optimism/connectors/kyber_aggregator/helpers.sol @@ -18,7 +18,7 @@ abstract contract Helpers is DSMath, Basic { address internal constant kyberswap = 0x6131B5fae19EA4f9D964eAc0408E4408b66337b5; - function _swapHelper(SwapData memory swapData, uint256 wethAmt) + function _swapHelper(SwapData memory swapData, uint256 ethAmt) internal returns (uint256 buyAmt) { @@ -34,7 +34,7 @@ abstract contract Helpers is DSMath, Basic { ); uint256 initalBal = getTokenBal(buyToken); - (bool success, ) = kyberswap.call{value: wethAmt}(swapData.callData); + (bool success, ) = kyberswap.call{value: ethAmt}(swapData.callData); if (!success) revert("kyberswap-failed"); uint256 finalBal = getTokenBal(buyToken); diff --git a/contracts/optimism/connectors/kyber_v3/main.sol b/contracts/optimism/connectors/kyber_aggregator/main.sol similarity index 93% rename from contracts/optimism/connectors/kyber_v3/main.sol rename to contracts/optimism/connectors/kyber_aggregator/main.sol index 4c5979a9..4e8acb9c 100644 --- a/contracts/optimism/connectors/kyber_v3/main.sol +++ b/contracts/optimism/connectors/kyber_aggregator/main.sol @@ -54,6 +54,6 @@ abstract contract KyberOptimismResolver is Helpers { } } -contract ConnectV2KyberV3Optimism is KyberOptimismResolver { - string public name = "Kyber-v3"; +contract ConnectV2KyberAggregatorOptimism is KyberOptimismResolver { + string public name = "Kyber-aggregator-v1.0"; } diff --git a/contracts/optimism/connectors/kyber_v3/interface.sol b/contracts/optimism/connectors/kyber_v3/interface.sol deleted file mode 100644 index 7de1fbbf..00000000 --- a/contracts/optimism/connectors/kyber_v3/interface.sol +++ /dev/null @@ -1,6 +0,0 @@ -//SPDX-License-Identifier: MIT -pragma solidity ^0.7.0; - -interface AugustusSwapperInterface { - function getTokenTransferProxy() external view returns (address); -} \ No newline at end of file diff --git a/contracts/polygon/connectors/kyber_v3/events.sol b/contracts/polygon/connectors/kyber_aggregator/events.sol similarity index 100% rename from contracts/polygon/connectors/kyber_v3/events.sol rename to contracts/polygon/connectors/kyber_aggregator/events.sol diff --git a/contracts/polygon/connectors/kyber_v3/helpers.sol b/contracts/polygon/connectors/kyber_aggregator/helpers.sol similarity index 85% rename from contracts/polygon/connectors/kyber_v3/helpers.sol rename to contracts/polygon/connectors/kyber_aggregator/helpers.sol index 926f00cc..1cc47870 100644 --- a/contracts/polygon/connectors/kyber_v3/helpers.sol +++ b/contracts/polygon/connectors/kyber_aggregator/helpers.sol @@ -18,7 +18,7 @@ abstract contract Helpers is DSMath, Basic { address internal constant kyberswap = 0x6131B5fae19EA4f9D964eAc0408E4408b66337b5; - function _swapHelper(SwapData memory swapData, uint256 wethAmt) + function _swapHelper(SwapData memory swapData, uint256 maticAmt) internal returns (uint256 buyAmt) { @@ -34,7 +34,7 @@ abstract contract Helpers is DSMath, Basic { ); uint256 initalBal = getTokenBal(buyToken); - (bool success, ) = kyberswap.call{value: wethAmt}(swapData.callData); + (bool success, ) = kyberswap.call{value: maticAmt}(swapData.callData); if (!success) revert("kyberswap-failed"); uint256 finalBal = getTokenBal(buyToken); @@ -50,14 +50,14 @@ abstract contract Helpers is DSMath, Basic { { TokenInterface _sellAddr = swapData.sellToken; - uint256 ethAmt; + uint256 maticAmt; if (address(_sellAddr) == maticAddr) { - ethAmt = swapData._sellAmt; + maticAmt = swapData._sellAmt; } else { approve(TokenInterface(_sellAddr), kyberswap, swapData._sellAmt); } - swapData._buyAmt = _swapHelper(swapData, ethAmt); + swapData._buyAmt = _swapHelper(swapData, maticAmt); setUint(setId, swapData._buyAmt); diff --git a/contracts/polygon/connectors/kyber_v3/main.sol b/contracts/polygon/connectors/kyber_aggregator/main.sol similarity index 82% rename from contracts/polygon/connectors/kyber_v3/main.sol rename to contracts/polygon/connectors/kyber_aggregator/main.sol index 55d35dbd..134ab153 100644 --- a/contracts/polygon/connectors/kyber_v3/main.sol +++ b/contracts/polygon/connectors/kyber_aggregator/main.sol @@ -12,10 +12,10 @@ import {Helpers} from "./helpers.sol"; abstract contract KyberPolygonResolver is Helpers { /** - * @dev Sell ETH/ERC20_Token using KyberSwap. + * @dev Sell MATIC/ERC20_Token using KyberSwap. * @notice Swap tokens from exchanges like kyber, 0x etc, with calculation done off-chain. - * @param buyAddr The address of the token to buy.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) - * @param sellAddr The address of the token to sell.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param buyAddr The address of the token to buy.(For MATIC: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) + * @param sellAddr The address of the token to sell.(For MATIC: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) * @param sellAmt The amount of the token to sell. * @param unitAmt The amount of buyAmt/sellAmt with slippage. * @param callData Data from kyberswap API. @@ -54,6 +54,6 @@ abstract contract KyberPolygonResolver is Helpers { } } -contract ConnectV2KyberV3Polygon is KyberPolygonResolver { - string public name = "Kyber-v3"; +contract ConnectV2KyberAggregatorPolygon is KyberPolygonResolver { + string public name = "Kyber-aggregator-v1.0"; } diff --git a/contracts/polygon/connectors/kyber_v3/interface.sol b/contracts/polygon/connectors/kyber_v3/interface.sol deleted file mode 100644 index 7de1fbbf..00000000 --- a/contracts/polygon/connectors/kyber_v3/interface.sol +++ /dev/null @@ -1,6 +0,0 @@ -//SPDX-License-Identifier: MIT -pragma solidity ^0.7.0; - -interface AugustusSwapperInterface { - function getTokenTransferProxy() external view returns (address); -} \ No newline at end of file