orderFilledAmount -> orderTakerAssetFilledAmount
This commit is contained in:
@@ -92,7 +92,7 @@ contract MixinExchangeCore is
|
||||
orderInfo.orderStatus,
|
||||
orderInfo.orderHash,
|
||||
takerAddress,
|
||||
orderInfo.orderFilledAmount,
|
||||
orderInfo.orderTakerAssetFilledAmount,
|
||||
takerAssetFillAmount,
|
||||
signature
|
||||
);
|
||||
@@ -102,7 +102,7 @@ contract MixinExchangeCore is
|
||||
(status, fillResults) = calculateFillResults(
|
||||
order,
|
||||
orderInfo.orderStatus,
|
||||
orderInfo.orderFilledAmount,
|
||||
orderInfo.orderTakerAssetFilledAmount,
|
||||
takerAssetFillAmount
|
||||
);
|
||||
if (status != uint8(Status.SUCCESS)) {
|
||||
@@ -118,7 +118,7 @@ contract MixinExchangeCore is
|
||||
order,
|
||||
takerAddress,
|
||||
orderInfo.orderHash,
|
||||
orderInfo.orderFilledAmount,
|
||||
orderInfo.orderTakerAssetFilledAmount,
|
||||
fillResults
|
||||
);
|
||||
return fillResults;
|
||||
@@ -166,7 +166,7 @@ contract MixinExchangeCore is
|
||||
}
|
||||
|
||||
// If order.takerAssetAmount is zero, then the order will always
|
||||
// be considered filled because 0 == takerAssetAmount == orderFilledAmount
|
||||
// be considered filled because 0 == takerAssetAmount == orderTakerAssetFilledAmount
|
||||
// Instead of distinguishing between unfilled and filled zero taker
|
||||
// amount orders, we choose not to support them.
|
||||
if (order.takerAssetAmount == 0) {
|
||||
@@ -191,8 +191,8 @@ contract MixinExchangeCore is
|
||||
}
|
||||
|
||||
// Fetch filled amount and validate order availability
|
||||
orderInfo.orderFilledAmount = filled[orderInfo.orderHash];
|
||||
if (orderInfo.orderFilledAmount >= order.takerAssetAmount) {
|
||||
orderInfo.orderTakerAssetFilledAmount = filled[orderInfo.orderHash];
|
||||
if (orderInfo.orderTakerAssetFilledAmount >= order.takerAssetAmount) {
|
||||
orderInfo.orderStatus = uint8(Status.ORDER_FULLY_FILLED);
|
||||
return orderInfo;
|
||||
}
|
||||
@@ -205,14 +205,14 @@ contract MixinExchangeCore is
|
||||
/// @dev Calculates amounts filled and fees paid by maker and taker.
|
||||
/// @param order to be filled.
|
||||
/// @param orderStatus Status of order to be filled.
|
||||
/// @param orderFilledAmount Amount of order already filled.
|
||||
/// @param orderTakerAssetFilledAmount Amount of order already filled.
|
||||
/// @param takerAssetFillAmount Desired amount of order to fill by taker.
|
||||
/// @return status Return status of calculating fill amounts. Returns Status.SUCCESS on success.
|
||||
/// @return fillResults Amounts filled and fees paid by maker and taker.
|
||||
function calculateFillResults(
|
||||
Order memory order,
|
||||
uint8 orderStatus,
|
||||
uint256 orderFilledAmount,
|
||||
uint256 orderTakerAssetFilledAmount,
|
||||
uint256 takerAssetFillAmount
|
||||
)
|
||||
public
|
||||
@@ -235,7 +235,7 @@ contract MixinExchangeCore is
|
||||
}
|
||||
|
||||
// Compute takerAssetFilledAmount
|
||||
uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderFilledAmount);
|
||||
uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderTakerAssetFilledAmount);
|
||||
uint256 takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetAmount);
|
||||
|
||||
// Validate fill order rounding
|
||||
@@ -277,7 +277,7 @@ contract MixinExchangeCore is
|
||||
/// @param orderStatus Status of order to be filled.
|
||||
/// @param orderHash Hash of order to be filled.
|
||||
/// @param takerAddress Address of order taker.
|
||||
/// @param orderFilledAmount Amount of order already filled.
|
||||
/// @param orderTakerAssetFilledAmount Amount of order already filled.
|
||||
/// @param takerAssetFillAmount Desired amount of order to fill by taker.
|
||||
/// @param signature Proof that the orders was created by its maker.
|
||||
function assertValidFill(
|
||||
@@ -285,7 +285,7 @@ contract MixinExchangeCore is
|
||||
uint8 orderStatus,
|
||||
bytes32 orderHash,
|
||||
address takerAddress,
|
||||
uint256 orderFilledAmount,
|
||||
uint256 orderTakerAssetFilledAmount,
|
||||
uint256 takerAssetFillAmount,
|
||||
bytes memory signature
|
||||
)
|
||||
@@ -305,7 +305,7 @@ contract MixinExchangeCore is
|
||||
);
|
||||
|
||||
// Validate Maker signature (check only if first time seen)
|
||||
if (orderFilledAmount == 0) {
|
||||
if (orderTakerAssetFilledAmount == 0) {
|
||||
require(
|
||||
isValidSignature(orderHash, order.makerAddress, signature),
|
||||
SIGNATURE_VALIDATION_FAILED
|
||||
@@ -336,19 +336,19 @@ contract MixinExchangeCore is
|
||||
/// @dev Updates state with results of a fill order.
|
||||
/// @param order that was filled.
|
||||
/// @param takerAddress Address of taker who filled the order.
|
||||
/// @param orderFilledAmount Amount of order already filled.
|
||||
/// @param orderTakerAssetFilledAmount Amount of order already filled.
|
||||
/// @return fillResults Amounts filled and fees paid by maker and taker.
|
||||
function updateFilledState(
|
||||
Order memory order,
|
||||
address takerAddress,
|
||||
bytes32 orderHash,
|
||||
uint256 orderFilledAmount,
|
||||
uint256 orderTakerAssetFilledAmount,
|
||||
FillResults memory fillResults
|
||||
)
|
||||
internal
|
||||
{
|
||||
// Update state
|
||||
filled[orderHash] = safeAdd(orderFilledAmount, fillResults.takerAssetFilledAmount);
|
||||
filled[orderHash] = safeAdd(orderTakerAssetFilledAmount, fillResults.takerAssetFilledAmount);
|
||||
|
||||
// Log order
|
||||
emit Fill(
|
||||
|
@@ -74,8 +74,8 @@ contract MixinMatchOrders is
|
||||
rightOrder,
|
||||
leftOrderInfo.orderStatus,
|
||||
rightOrderInfo.orderStatus,
|
||||
leftOrderInfo.orderFilledAmount,
|
||||
rightOrderInfo.orderFilledAmount
|
||||
leftOrderInfo.orderTakerAssetFilledAmount,
|
||||
rightOrderInfo.orderTakerAssetFilledAmount
|
||||
);
|
||||
|
||||
// Validate fill contexts
|
||||
@@ -84,7 +84,7 @@ contract MixinMatchOrders is
|
||||
leftOrderInfo.orderStatus,
|
||||
leftOrderInfo.orderHash,
|
||||
takerAddress,
|
||||
leftOrderInfo.orderFilledAmount,
|
||||
leftOrderInfo.orderTakerAssetFilledAmount,
|
||||
matchedFillResults.left.takerAssetFilledAmount,
|
||||
leftSignature
|
||||
);
|
||||
@@ -93,7 +93,7 @@ contract MixinMatchOrders is
|
||||
rightOrderInfo.orderStatus,
|
||||
rightOrderInfo.orderHash,
|
||||
takerAddress,
|
||||
rightOrderInfo.orderFilledAmount,
|
||||
rightOrderInfo.orderTakerAssetFilledAmount,
|
||||
matchedFillResults.right.takerAssetFilledAmount,
|
||||
rightSignature
|
||||
);
|
||||
@@ -111,14 +111,14 @@ contract MixinMatchOrders is
|
||||
leftOrder,
|
||||
takerAddress,
|
||||
leftOrderInfo.orderHash,
|
||||
leftOrderInfo.orderFilledAmount,
|
||||
leftOrderInfo.orderTakerAssetFilledAmount,
|
||||
matchedFillResults.left
|
||||
);
|
||||
updateFilledState(
|
||||
rightOrder,
|
||||
takerAddress,
|
||||
rightOrderInfo.orderHash,
|
||||
rightOrderInfo.orderFilledAmount,
|
||||
rightOrderInfo.orderTakerAssetFilledAmount,
|
||||
matchedFillResults.right
|
||||
);
|
||||
|
||||
|
@@ -61,14 +61,14 @@ contract IExchangeCore {
|
||||
/// @dev Calculates amounts filled and fees paid by maker and taker.
|
||||
/// @param order to be filled.
|
||||
/// @param orderStatus Status of order to be filled.
|
||||
/// @param orderFilledAmount Amount of order already filled.
|
||||
/// @param orderTakerAssetFilledAmount Amount of order already filled.
|
||||
/// @param takerAssetFillAmount Desired amount of order to fill by taker.
|
||||
/// @return status Return status of calculating fill amounts. Returns Status.SUCCESS on success.
|
||||
/// @return fillResults Amounts filled and fees paid by maker and taker.
|
||||
function calculateFillResults(
|
||||
LibOrder.Order memory order,
|
||||
uint8 orderStatus,
|
||||
uint256 orderFilledAmount,
|
||||
uint256 orderTakerAssetFilledAmount,
|
||||
uint256 takerAssetFillAmount
|
||||
)
|
||||
public
|
||||
|
@@ -57,7 +57,7 @@ contract LibOrder {
|
||||
// Keccak-256 EIP712 hash of the order
|
||||
bytes32 orderHash;
|
||||
// Amount of order that has been filled
|
||||
uint256 orderFilledAmount;
|
||||
uint256 orderTakerAssetFilledAmount;
|
||||
}
|
||||
|
||||
/// @dev Calculates Keccak-256 hash of the order.
|
||||
|
@@ -61,7 +61,7 @@ contract MExchangeCore is
|
||||
/// @param orderStatus Status of order to be filled.
|
||||
/// @param orderHash Hash of order to be filled.
|
||||
/// @param takerAddress Address of order taker.
|
||||
/// @param orderFilledAmount Amount of order already filled.
|
||||
/// @param orderTakerAssetFilledAmount Amount of order already filled.
|
||||
/// @param takerAssetFillAmount Desired amount of order to fill by taker.
|
||||
/// @param signature Proof that the orders was created by its maker.
|
||||
function assertValidFill(
|
||||
@@ -69,7 +69,7 @@ contract MExchangeCore is
|
||||
uint8 orderStatus,
|
||||
bytes32 orderHash,
|
||||
address takerAddress,
|
||||
uint256 orderFilledAmount,
|
||||
uint256 orderTakerAssetFilledAmount,
|
||||
uint256 takerAssetFillAmount,
|
||||
bytes memory signature
|
||||
)
|
||||
@@ -78,13 +78,13 @@ contract MExchangeCore is
|
||||
/// @dev Updates state with results of a fill order.
|
||||
/// @param order that was filled.
|
||||
/// @param takerAddress Address of taker who filled the order.
|
||||
/// @param orderFilledAmount Amount of order already filled.
|
||||
/// @param orderTakerAssetFilledAmount Amount of order already filled.
|
||||
/// @return fillResults Amounts filled and fees paid by maker and taker.
|
||||
function updateFilledState(
|
||||
LibOrder.Order memory order,
|
||||
address takerAddress,
|
||||
bytes32 orderHash,
|
||||
uint256 orderFilledAmount,
|
||||
uint256 orderTakerAssetFilledAmount,
|
||||
LibFillResults.FillResults memory fillResults
|
||||
)
|
||||
internal;
|
||||
|
@@ -178,7 +178,7 @@ export interface TransferAmountsByMatchOrders {
|
||||
export interface OrderInfo {
|
||||
orderStatus: number;
|
||||
orderHash: string;
|
||||
orderFilledAmount: BigNumber;
|
||||
orderTakerAssetFilledAmount: BigNumber;
|
||||
}
|
||||
|
||||
export interface ERC20ProxyData {
|
||||
|
Reference in New Issue
Block a user