Created
January 15, 2018 18:03
-
-
Save szerintedmi/2a62d109193447c61a97ef85283da5dd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Interface for Augmint's internal Exchange | |
TODO: rates setter? | |
TODO: make a rates interface and use it instead? | |
TODO: uint32 for now? | |
*/ | |
pragma solidity 0.4.18; | |
import "../generic/SafeMath.sol"; | |
import "../generic/Restricted.sol"; | |
import "./AugmintTokenInterface.sol"; | |
import "../Rates.sol"; | |
contract ExchangeInterface is Restricted { | |
using SafeMath for uint256; | |
AugmintTokenInterface public augmintToken; | |
Rates public rates; | |
struct Order { | |
address maker; | |
uint addedTime; | |
uint price; | |
uint amount; // SELL_ETH: amount in wei BUY_ETH: token amount with 4 decimals | |
} | |
Order[] public sellEthOrders; | |
Order[] public buyEthOrders; | |
mapping(address => uint[]) public mSellEthOrders; | |
mapping(address => uint[]) public mBuyEthOrders; | |
function placeSellEthOrder(uint price) external payable returns (uint sellEthOrderId); | |
function placeBuyEthOrder(uint price, uint tokenAmount) external returns (uint buyEthOrderId); | |
function cancelBuyEthOrder(uint buyEthOrderId) external; | |
function cancelSellEthOrder(uint sellEthOrderId) external; | |
function matchOrders(uint sellEthOrderId, uint buyEthOrderId) external; | |
function matchMultipleOrders(uint[] orderIds1, uint[] orderIds2) external; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment