This repository was archived by the owner on Feb 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 321
Expand file tree
/
Copy pathIOneSplit.sol
More file actions
80 lines (73 loc) · 3.1 KB
/
IOneSplit.sol
File metadata and controls
80 lines (73 loc) · 3.1 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
pragma solidity ^0.5.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
//
// ||
// ||
// \/
// +--------------+
// | OneSplitWrap |
// +--------------+
// ||
// || (delegatecall)
// \/
// +--------------+
// | OneSplit |
// +--------------+
//
//
contract IOneSplitConsts {
// flags = 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;
uint256 public constant FLAG_DISABLE_UNISWAP_POOL_TOKEN = 0x1000000;
uint256 public constant FLAG_DISABLE_BALANCER_POOL_TOKEN = 0x2000000;
uint256 public constant FLAG_DISABLE_CURVE_ZAP = 0x4000000;
}
contract IOneSplit is IOneSplitConsts {
function getExpectedReturn(
IERC20 fromToken,
IERC20 toToken,
uint256 amount,
uint256 parts,
uint256 flags
)
public
view
returns(
uint256 returnAmount,
uint256[] memory distribution
);
function swap(
IERC20 fromToken,
IERC20 toToken,
uint256 amount,
uint256 minReturn,
uint256[] memory distribution,
uint256 flags
) public payable;
}