-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIOneSplit.sol
More file actions
60 lines (55 loc) · 2.75 KB
/
Copy pathIOneSplit.sol
File metadata and controls
60 lines (55 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
pragma solidity ^0.5.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.5.0/contracts/token/ERC20/IERC20.sol";
contract IOneSplitConsts {
// disableFlags = FLAG_DISABLE_UNISWAP + FLAG_DISABLE_KYBER + ...
uint256 public constant FLAG_DISABLE_UNISWAP = 0x01;
uint256 public constant FLAG_DISABLE_KYBER = 0x02;
uint256 public constant FLAG_ENABLE_KYBER_UNISWAP_RESERVE = 0x100000000; // Turned off by default
uint256 public constant FLAG_ENABLE_KYBER_OASIS_RESERVE = 0x200000000; // Turned off by default
uint256 public constant FLAG_ENABLE_KYBER_BANCOR_RESERVE = 0x400000000; // Turned off by default
uint256 public constant FLAG_DISABLE_BANCOR = 0x04;
uint256 public constant FLAG_DISABLE_OASIS = 0x08;
uint256 public constant FLAG_DISABLE_COMPOUND = 0x10;
uint256 public constant FLAG_DISABLE_FULCRUM = 0x20;
uint256 public constant FLAG_DISABLE_CHAI = 0x40;
uint256 public constant FLAG_DISABLE_AAVE = 0x80;
uint256 public constant FLAG_DISABLE_SMART_TOKEN = 0x100;
uint256 public constant FLAG_ENABLE_MULTI_PATH_ETH = 0x200; // Turned off by default
uint256 public constant FLAG_DISABLE_BDAI = 0x400;
uint256 public constant FLAG_DISABLE_IEARN = 0x800;
uint256 public constant FLAG_DISABLE_CURVE_COMPOUND = 0x1000;
uint256 public constant FLAG_DISABLE_CURVE_USDT = 0x2000;
uint256 public constant FLAG_DISABLE_CURVE_Y = 0x4000;
uint256 public constant FLAG_DISABLE_CURVE_BINANCE = 0x8000;
uint256 public constant FLAG_ENABLE_MULTI_PATH_DAI = 0x10000; // Turned off by default
uint256 public constant FLAG_ENABLE_MULTI_PATH_USDC = 0x20000; // Turned off by default
uint256 public constant FLAG_DISABLE_CURVE_SYNTHETIX = 0x40000;
uint256 public constant FLAG_DISABLE_WETH = 0x80000;
uint256 public constant FLAG_ENABLE_UNISWAP_COMPOUND = 0x100000; // Works only when one of assets is ETH or FLAG_ENABLE_MULTI_PATH_ETH
uint256 public constant FLAG_ENABLE_UNISWAP_CHAI = 0x200000; // Works only when ETH<>DAI or FLAG_ENABLE_MULTI_PATH_ETH
uint256 public constant FLAG_ENABLE_UNISWAP_AAVE = 0x400000; // Works only when one of assets is ETH or FLAG_ENABLE_MULTI_PATH_ETH
uint256 public constant FLAG_DISABLE_IDLE = 0x800000;
}
contract IOneSplit is IOneSplitConsts {
function getExpectedReturn(
IERC20 fromToken,
IERC20 toToken,
uint256 amount,
uint256 parts,
uint256 disableFlags
)
public
view
returns(
uint256 returnAmount,
uint256[] memory distribution
);
function swap(
IERC20 fromToken,
IERC20 toToken,
uint256 amount,
uint256 minReturn,
uint256[] memory distribution,
uint256 disableFlags
) public payable;
}