This repository has been archived by the owner on Sep 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
/
IBatchExchange.sol
60 lines (46 loc) · 1.55 KB
/
IBatchExchange.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.10;
pragma experimental ABIEncoderV2;
struct Order {
uint16 buyToken;
uint16 sellToken;
uint32 validFrom; // order is valid from auction collection period: validFrom inclusive
uint32 validUntil; // order is valid till auction collection period: validUntil inclusive
uint128 priceNumerator;
uint128 priceDenominator;
uint128 usedAmount; // remainingAmount = priceDenominator - usedAmount
}
interface IBatchExchange {
function withdraw(address user, address token)
external;
function deposit(address token, uint256 amount)
external;
function getPendingWithdraw(address user, address token)
external
view
returns (uint256, uint32);
function getCurrentBatchId()
external
view
returns (uint32);
function hasValidWithdrawRequest(address user, address token)
external
view
returns (bool);
function tokenAddressToIdMap(address addr)
external
view
returns (uint16);
function orders(address userAddress)
external
view
returns (Order[] memory);
// Returns orderId
function placeOrder(uint16 buyToken, uint16 sellToken, uint32 validUntil, uint128 buyAmount, uint128 sellAmount)
external
returns (uint256);
function requestFutureWithdraw(address token, uint256 amount, uint32 batchId)
external;
function requestWithdraw(address token, uint256 amount)
external;
}