diff --git a/config/arb-config.js b/config/arb-config.js index 1ea55b0..afd4605 100644 --- a/config/arb-config.js +++ b/config/arb-config.js @@ -29,7 +29,7 @@ module.exports = { DPP: "0xFF83897590Ac2f48aDFdEb9f497fe68A34B893C0", DSP: "0xD0751f77d36aDaBA0067a151a8cF11475880c874", DPPAdmin: "0x1dc8D1f1600B7C1D39e6b60FBC7b021Bc4F9C993", - CP: "0xC39EE45A98d16D4587bB60596a22973b5d71AA3a", + CP: "0xa6E6d3a0CBDDf00a374860bb0F5Da6CF6c905e80", ERC20MineV2: "0xe91067189C71dB0696bD6fBC14535CB159F98b5C", ERC20MineV3: "0x973CAB76C35BB1da47e044A63546c69A8Ac1143c", ERC20: "0xBb245F54569841906eC7eDFFf72a910557B81378", diff --git a/contracts/SmartRoute/adapter/GambitAdapter.sol b/contracts/SmartRoute/adapter/GambitAdapter.sol new file mode 100644 index 0000000..19ef7ae --- /dev/null +++ b/contracts/SmartRoute/adapter/GambitAdapter.sol @@ -0,0 +1,28 @@ +/* + + Copyright 2020 DODO ZOO. + SPDX-License-Identifier: Apache-2.0 + +*/ + +pragma solidity 0.6.9; + +import {IGambit} from "../intf/IGambit.sol"; +import {IDODOAdapter} from "../intf/IDODOAdapter.sol"; + +contract GambitAdapter is IDODOAdapter { + + function _gambitSwap(address to, address pool, bytes memory moreInfo) internal { + (address tokenIn, address tokenOut) = abi.decode(moreInfo, (address, address)); + + IGambit(pool).swap(tokenIn, tokenOut, to); + } + + function sellBase(address to, address pool, bytes memory moreInfo) external override { + _gambitSwap(to, pool, moreInfo); + } + + function sellQuote(address to, address pool, bytes memory moreInfo) external override { + _gambitSwap(to, pool, moreInfo); + } +} \ No newline at end of file diff --git a/contracts/SmartRoute/intf/IGambit.sol b/contracts/SmartRoute/intf/IGambit.sol new file mode 100644 index 0000000..e32c725 --- /dev/null +++ b/contracts/SmartRoute/intf/IGambit.sol @@ -0,0 +1,6 @@ +pragma solidity 0.6.9; +pragma experimental ABIEncoderV2; + +interface IGambit { + function swap(address _tokenIn, address _tokenOut, address _receiver) external returns (uint256); +} \ No newline at end of file