add gamebitAdapter
This commit is contained in:
@@ -29,7 +29,7 @@ module.exports = {
|
||||
DPP: "0xFF83897590Ac2f48aDFdEb9f497fe68A34B893C0",
|
||||
DSP: "0xD0751f77d36aDaBA0067a151a8cF11475880c874",
|
||||
DPPAdmin: "0x1dc8D1f1600B7C1D39e6b60FBC7b021Bc4F9C993",
|
||||
CP: "0xC39EE45A98d16D4587bB60596a22973b5d71AA3a",
|
||||
CP: "0xa6E6d3a0CBDDf00a374860bb0F5Da6CF6c905e80",
|
||||
ERC20MineV2: "0xe91067189C71dB0696bD6fBC14535CB159F98b5C",
|
||||
ERC20MineV3: "0x973CAB76C35BB1da47e044A63546c69A8Ac1143c",
|
||||
ERC20: "0xBb245F54569841906eC7eDFFf72a910557B81378",
|
||||
|
||||
28
contracts/SmartRoute/adapter/GambitAdapter.sol
Normal file
28
contracts/SmartRoute/adapter/GambitAdapter.sol
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
6
contracts/SmartRoute/intf/IGambit.sol
Normal file
6
contracts/SmartRoute/intf/IGambit.sol
Normal file
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user