Skip to content

Instantly share code, notes, and snippets.

@szerintedmi
Created January 15, 2018 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save szerintedmi/2a62d109193447c61a97ef85283da5dd to your computer and use it in GitHub Desktop.
Save szerintedmi/2a62d109193447c61a97ef85283da5dd to your computer and use it in GitHub Desktop.
/* 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