Skip to content
This repository was archived by the owner on Mar 19, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 16 additions & 23 deletions contracts/LoopringProtocol.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ pragma experimental "ABIEncoderV2";
contract LoopringProtocol {
uint8 public constant MARGIN_SPLIT_PERCENTAGE_BASE = 100;

uint8 public constant OPTION_MASK_CAP_BY_AMOUNTB = 0x01;

event RingMined(
uint _ringIndex,
bytes32 indexed _ringHash,
Expand All @@ -50,23 +52,19 @@ contract LoopringProtocol {
);

/// @dev Cancel a order. cancel amount(amountS or amountB) can be specified
/// in orderValues.
/// in values.
/// @param addresses owner, tokenS, tokenB, wallet, authAddr
/// @param orderValues amountS, amountB, validSince (second),
/// @param values amountS, amountB, validSince (second),
/// validUntil (second), lrcFee, and cancelAmount.
/// @param buyNoMoreThanAmountB -
/// This indicates when a order should be considered
/// @param option This indicates when a order should be considered
/// as 'completely filled'.
/// @param marginSplitPercentage -
/// Percentage of margin split to share with miner.
/// @param v Order ECDSA signature parameter v.
/// @param r Order ECDSA signature parameters r.
/// @param s Order ECDSA signature parameters s.
function cancelOrder(
address[5] addresses,
uint[6] orderValues,
bool buyNoMoreThanAmountB,
uint8 marginSplitPercentage,
uint[6] values,
uint8 option,
uint8 v,
bytes32 r,
bytes32 s
Expand Down Expand Up @@ -96,17 +94,13 @@ contract LoopringProtocol {
external;

/// @dev Submit a order-ring for validation and settlement.
/// @param addressList List of each order's owner, tokenS, wallet, authAddr.
/// Note that next order's `tokenS` equals this order's
/// `tokenB`.
/// @param uintArgsList List of uint-type arguments in this order:
/// @param addressesList List of each order's owner, tokenS, wallet, authAddr.
/// Note that next order's `tokenS` equals this order's
/// `tokenB`.
/// @param valuesList List of uint-type arguments in this order:
/// amountS, amountB, validSince (second),
/// validUntil (second), lrcFee, and rateAmountS.
/// @param uint8ArgsList -
/// List of unit8-type arguments, in this order:
/// marginSplitPercentageList.
/// @param buyNoMoreThanAmountBList -
/// This indicates when a order should be considered
/// @param optionList This indicates when a order should be considered
/// @param vList List of v for each order. This list is 1-larger than
/// the previous lists, with the last element being the
/// v value of the ring signature.
Expand All @@ -121,15 +115,14 @@ contract LoopringProtocol {
/// Bits to indicate fee selections. `1` represents margin
/// split and `0` represents LRC as fee.
function submitRing(
address[4][] addressList,
uint[6][] uintArgsList,
uint8[1][] uint8ArgsList,
bool[] buyNoMoreThanAmountBList,
address[4][] addressesList,
uint[6][] valuesList,
bool[] optionList,
uint8[] vList,
bytes32[] rList,
bytes32[] sList,
address miner,
uint16 feeSelections
uint8 feeSelections
)
public;
}
Loading