-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathIDexSwap.sol
36 lines (31 loc) · 971 Bytes
/
IDexSwap.sol
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
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.17;
struct DexSwapData {
address fromAsset;
uint256 fromAssetAmount;
address toAsset;
uint256 minToAssetAmount;
bytes data; // Data required for a specific swap implementation. eg 1Inch
}
/**
* @title Dex Swap interface
* @author mStable
* @notice Generic on-chain ABI to Swap tokens on a DEX.
* @dev VERSION: 1.0
* DATE: 2022-03-07
*/
interface IDexSwap {
function swap(DexSwapData memory _swap) external returns (uint256 toAssetAmount);
}
/**
* @title Dex Asynchronous Swap interface
* @author mStable
* @notice Generic on-chain ABI to Swap asynchronous tokens on a DEX.
* @dev VERSION: 1.0
* DATE: 2022-06-07
*/
interface IDexAsyncSwap {
function initiateSwap(DexSwapData memory _swap) external;
function settleSwap(DexSwapData memory _swap) external;
function cancelSwap(bytes calldata orderUid) external;
}