Comments for readability in exchange core and mixin match orders
This commit is contained in:
@@ -169,8 +169,9 @@ contract MixinExchangeCore is
|
|||||||
internal
|
internal
|
||||||
{
|
{
|
||||||
// Ensure order is valid
|
// Ensure order is valid
|
||||||
// An order can only be filled if it is Status.FILLABLE;
|
// An order can only be filled if its status is FILLABLE;
|
||||||
// however, only invalid statuses result in a throw.
|
// however, only invalid statuses result in a throw.
|
||||||
|
// See LibStatus for a complete description of order statuses.
|
||||||
require(
|
require(
|
||||||
orderStatus != uint8(Status.ORDER_INVALID_MAKER_ASSET_AMOUNT),
|
orderStatus != uint8(Status.ORDER_INVALID_MAKER_ASSET_AMOUNT),
|
||||||
INVALID_ORDER_MAKER_ASSET_AMOUNT
|
INVALID_ORDER_MAKER_ASSET_AMOUNT
|
||||||
@@ -323,8 +324,9 @@ contract MixinExchangeCore is
|
|||||||
internal
|
internal
|
||||||
{
|
{
|
||||||
// Ensure order is valid
|
// Ensure order is valid
|
||||||
// An order can only be cancelled if it is Status.FILLABLE;
|
// An order can only be cancelled if its status is FILLABLE;
|
||||||
// however, only invalid statuses result in a throw.
|
// however, only invalid statuses result in a throw.
|
||||||
|
// See LibStatus for a complete description of order statuses.
|
||||||
require(
|
require(
|
||||||
orderStatus != uint8(Status.ORDER_INVALID_MAKER_ASSET_AMOUNT),
|
orderStatus != uint8(Status.ORDER_INVALID_MAKER_ASSET_AMOUNT),
|
||||||
INVALID_ORDER_MAKER_ASSET_AMOUNT
|
INVALID_ORDER_MAKER_ASSET_AMOUNT
|
||||||
@@ -366,6 +368,7 @@ contract MixinExchangeCore is
|
|||||||
returns (bool stateUpdated)
|
returns (bool stateUpdated)
|
||||||
{
|
{
|
||||||
// Ensure order is fillable (otherwise cancelling does nothing)
|
// Ensure order is fillable (otherwise cancelling does nothing)
|
||||||
|
// See LibStatus for a complete description of order statuses.
|
||||||
if (orderStatus != uint8(Status.ORDER_FILLABLE)) {
|
if (orderStatus != uint8(Status.ORDER_FILLABLE)) {
|
||||||
emit ExchangeStatus(uint8(orderStatus), orderHash);
|
emit ExchangeStatus(uint8(orderStatus), orderHash);
|
||||||
stateUpdated = false;
|
stateUpdated = false;
|
||||||
@@ -390,7 +393,7 @@ contract MixinExchangeCore is
|
|||||||
|
|
||||||
/// @dev Gets information about an order: status, hash, and amount filled.
|
/// @dev Gets information about an order: status, hash, and amount filled.
|
||||||
/// @param order Order to gather information on.
|
/// @param order Order to gather information on.
|
||||||
/// @return status Status of order. Statuses are defined in the LibStatus.Status struct.
|
/// @return status Status of order. See LibStatus for a complete description of order statuses.
|
||||||
/// @return orderHash Keccak-256 EIP712 hash of the order.
|
/// @return orderHash Keccak-256 EIP712 hash of the order.
|
||||||
/// @return takerAssetFilledAmount Amount of order that has been filled.
|
/// @return takerAssetFilledAmount Amount of order that has been filled.
|
||||||
function getOrderInfo(Order memory order)
|
function getOrderInfo(Order memory order)
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ contract MixinMatchOrders is
|
|||||||
/// @param leftSignature Proof that order was created by the left maker.
|
/// @param leftSignature Proof that order was created by the left maker.
|
||||||
/// @param rightSignature Proof that order was created by the right maker.
|
/// @param rightSignature Proof that order was created by the right maker.
|
||||||
/// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.
|
/// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.
|
||||||
|
/// TODO: Make this function external once supported by Solidity (See Solidity Issues #3199, #1603)
|
||||||
function matchOrders(
|
function matchOrders(
|
||||||
Order memory leftOrder,
|
Order memory leftOrder,
|
||||||
Order memory rightOrder,
|
Order memory rightOrder,
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ contract IExchangeCore {
|
|||||||
|
|
||||||
/// @dev Gets information about an order: status, hash, and amount filled.
|
/// @dev Gets information about an order: status, hash, and amount filled.
|
||||||
/// @param order Order to gather information on.
|
/// @param order Order to gather information on.
|
||||||
/// @return status Status of order. Statuses are defined in the LibStatus.Status struct.
|
/// @return status Status of order. See LibStatus for a complete description of order statuses.
|
||||||
/// @return orderHash Keccak-256 EIP712 hash of the order.
|
/// @return orderHash Keccak-256 EIP712 hash of the order.
|
||||||
/// @return takerAssetFilledAmount Amount of order that has been filled.
|
/// @return takerAssetFilledAmount Amount of order that has been filled.
|
||||||
function getOrderInfo(LibOrder.Order memory order)
|
function getOrderInfo(LibOrder.Order memory order)
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ contract IMatchOrders {
|
|||||||
/// @param leftSignature Proof that order was created by the left maker.
|
/// @param leftSignature Proof that order was created by the left maker.
|
||||||
/// @param rightSignature Proof that order was created by the right maker.
|
/// @param rightSignature Proof that order was created by the right maker.
|
||||||
/// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.
|
/// @return matchedFillResults Amounts filled and fees paid by maker and taker of matched orders.
|
||||||
|
/// TODO: Make this function external once supported by Solidity (See Solidity Issues #3199, #1603)
|
||||||
function matchOrders(
|
function matchOrders(
|
||||||
LibOrder.Order memory leftOrder,
|
LibOrder.Order memory leftOrder,
|
||||||
LibOrder.Order memory rightOrder,
|
LibOrder.Order memory rightOrder,
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ contract LibStatus {
|
|||||||
INVALID_MAKER, // Invalid maker
|
INVALID_MAKER, // Invalid maker
|
||||||
|
|
||||||
/// Order State Statuses ///
|
/// Order State Statuses ///
|
||||||
|
// A valid order remains fillable until it is expired, fully filled, or cancelled.
|
||||||
|
// An order's state is unaffected by external factors, like account balances.
|
||||||
ORDER_INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount
|
ORDER_INVALID_MAKER_ASSET_AMOUNT, // Order does not have a valid maker asset amount
|
||||||
ORDER_INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount
|
ORDER_INVALID_TAKER_ASSET_AMOUNT, // Order does not have a valid taker asset amount
|
||||||
ORDER_FILLABLE, // Order is fillable
|
ORDER_FILLABLE, // Order is fillable
|
||||||
|
|||||||
Reference in New Issue
Block a user