aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-04-22 07:55:03 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-04-22 08:31:17 +0800
commit3335fc7bafcd9e1c7b23747622933e535a72460d (patch)
tree85c5dd894ac63fac81016156c7f7a59848601b03 /packages/contracts/src
parent63abf346643146e7df7d70daa31930e444cb837f (diff)
downloaddexon-0x-contracts-3335fc7bafcd9e1c7b23747622933e535a72460d.tar.gz
dexon-0x-contracts-3335fc7bafcd9e1c7b23747622933e535a72460d.tar.zst
dexon-0x-contracts-3335fc7bafcd9e1c7b23747622933e535a72460d.zip
Rename token => asset
Diffstat (limited to 'packages/contracts/src')
-rw-r--r--packages/contracts/src/contracts/current/protocol/Exchange/IExchange.sol88
-rw-r--r--packages/contracts/src/contracts/current/protocol/Exchange/LibOrder.sol12
-rw-r--r--packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol38
-rw-r--r--packages/contracts/src/contracts/current/protocol/Exchange/MixinSettlementProxy.sol16
-rw-r--r--packages/contracts/src/contracts/current/protocol/Exchange/MixinWrapperFunctions.sol128
-rw-r--r--packages/contracts/src/contracts/current/protocol/Exchange/mixins/MExchangeCore.sol6
-rw-r--r--packages/contracts/src/contracts/current/protocol/Exchange/mixins/MSettlement.sol4
-rw-r--r--packages/contracts/src/utils/exchange_wrapper.ts60
-rw-r--r--packages/contracts/src/utils/formatters.ts16
-rw-r--r--packages/contracts/src/utils/order_utils.ts20
-rw-r--r--packages/contracts/src/utils/types.ts18
11 files changed, 203 insertions, 203 deletions
diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/IExchange.sol b/packages/contracts/src/contracts/current/protocol/Exchange/IExchange.sol
index 3af51e915..0550d6c4b 100644
--- a/packages/contracts/src/contracts/current/protocol/Exchange/IExchange.sol
+++ b/packages/contracts/src/contracts/current/protocol/Exchange/IExchange.sol
@@ -37,8 +37,8 @@ contract IExchange {
address indexed feeRecipient,
bytes makerAssetData,
bytes takerAssetData,
- uint256 makerTokenFilledAmount,
- uint256 takerTokenFilledAmount,
+ uint256 makerAssetFilledAmount,
+ uint256 takerAssetFilledAmount,
uint256 makerFeePaid,
uint256 takerFeePaid,
bytes32 indexed orderHash
@@ -49,8 +49,8 @@ contract IExchange {
address indexed feeRecipient,
bytes makerAssetData,
bytes takerAssetData,
- uint256 makerTokenCancelledAmount,
- uint256 takerTokenCancelledAmount,
+ uint256 makerAssetCancelledAmount,
+ uint256 takerAssetCancelledAmount,
bytes32 indexed orderHash
);
@@ -100,8 +100,8 @@ contract IExchange {
returns (bool isError);
/// @dev Calculates Keccak-256 hash of order with specified parameters.
- /// @param orderAddresses Array of order's maker, taker, makerToken, takerToken, and feeRecipient.
- /// @param orderValues Array of order's makerTokenAmount, takerTokenAmount, makerFee, takerFee, expirationTimestampInSec, and salt.
+ /// @param orderAddresses Array of order's maker, taker, makerAsset, takerAsset, and feeRecipient.
+ /// @param orderValues Array of order's makerAssetAmount, takerAssetAmount, makerFee, takerFee, expirationTimestampInSec, and salt.
/// @return Keccak-256 hash of order.
function getOrderHash(address[5] orderAddresses, uint256[6] orderValues)
public view
@@ -124,34 +124,34 @@ contract IExchange {
returns (bool isValid);
/// @dev Fills the input order.
- /// @param orderAddresses Array of order's maker, taker, makerToken, takerToken, and feeRecipient.
- /// @param orderValues Array of order's makerTokenAmount, takerTokenAmount, makerFee, takerFee, expirationTimestampInSec, and salt.
- /// @param takerTokenFillAmount Desired amount of takerToken to fill.
+ /// @param orderAddresses Array of order's maker, taker, makerAsset, takerAsset, and feeRecipient.
+ /// @param orderValues Array of order's makerAssetAmount, takerAssetAmount, makerFee, takerFee, expirationTimestampInSec, and salt.
+ /// @param takerAssetFillAmount Desired amount of takerAsset to fill.
/// @param v ECDSA signature parameter v.
/// @param r ECDSA signature parameters r.
/// @param s ECDSA signature parameters s.
- /// @return Total amount of takerToken filled in trade.
+ /// @return Total amount of takerAsset filled in trade.
function fillOrder(
address[5] orderAddresses,
uint256[6] orderValues,
- uint256 takerTokenFillAmount,
+ uint256 takerAssetFillAmount,
uint8 v,
bytes32 r,
bytes32 s)
public
- returns (uint256 takerTokenFilledAmount);
+ returns (uint256 takerAssetFilledAmount);
/// @dev Cancels the input order.
- /// @param orderAddresses Array of order's maker, taker, makerToken, takerToken, and feeRecipient.
- /// @param orderValues Array of order's makerTokenAmount, takerTokenAmount, makerFee, takerFee, expirationTimestampInSec, and salt.
- /// @param takerTokenCancelAmount Desired amount of takerToken to cancel in order.
- /// @return Amount of takerToken cancelled.
+ /// @param orderAddresses Array of order's maker, taker, makerAsset, takerAsset, and feeRecipient.
+ /// @param orderValues Array of order's makerAssetAmount, takerAssetAmount, makerFee, takerFee, expirationTimestampInSec, and salt.
+ /// @param takerAssetCancelAmount Desired amount of takerAsset to cancel in order.
+ /// @return Amount of takerAsset cancelled.
function cancelOrder(
address[5] orderAddresses,
uint256[6] orderValues,
- uint256 takerTokenCancelAmount)
+ uint256 takerAssetCancelAmount)
public
- returns (uint256 takerTokenCancelledAmount);
+ returns (uint256 takerAssetCancelledAmount);
/// @dev Cancels all orders for a specified maker up to a certain time.
/// @param salt Orders created with a salt less or equal to this value will be cancelled.
@@ -159,51 +159,51 @@ contract IExchange {
external;
/// @dev Fills an order with specified parameters and ECDSA signature. Throws if specified amount not filled entirely.
- /// @param orderAddresses Array of order's maker, taker, makerToken, takerToken, and feeRecipient.
- /// @param orderValues Array of order's makerTokenAmount, takerTokenAmount, makerFee, takerFee, expirationTimestampInSec, and salt.
- /// @param takerTokenFillAmount Desired amount of takerToken to fill.
+ /// @param orderAddresses Array of order's maker, taker, makerAsset, takerAsset, and feeRecipient.
+ /// @param orderValues Array of order's makerAssetAmount, takerAssetAmount, makerFee, takerFee, expirationTimestampInSec, and salt.
+ /// @param takerAssetFillAmount Desired amount of takerAsset to fill.
/// @param v ECDSA signature parameter v.
/// @param r ECDSA signature parameters r.
/// @param s ECDSA signature parameters s.
function fillOrKillOrder(
address[5] orderAddresses,
uint256[6] orderValues,
- uint256 takerTokenFillAmount,
+ uint256 takerAssetFillAmount,
uint8 v,
bytes32 r,
bytes32 s)
public;
/// @dev Fills an order with specified parameters and ECDSA signature. Returns false if the transaction would otherwise revert.
- /// @param orderAddresses Array of order's maker, taker, makerToken, takerToken, and feeRecipient.
- /// @param orderValues Array of order's makerTokenAmount, takerTokenAmount, makerFee, takerFee, expirationTimestampInSec, and salt.
- /// @param takerTokenFillAmount Desired amount of takerToken to fill.
+ /// @param orderAddresses Array of order's maker, taker, makerAsset, takerAsset, and feeRecipient.
+ /// @param orderValues Array of order's makerAssetAmount, takerAssetAmount, makerFee, takerFee, expirationTimestampInSec, and salt.
+ /// @param takerAssetFillAmount Desired amount of takerAsset to fill.
/// @param v ECDSA signature parameter v.
/// @param r ECDSA signature parameters r.
/// @param s ECDSA signature parameters s.
/// @return Success if the transaction did not revert.
- /// @return Total amount of takerToken filled in trade.
+ /// @return Total amount of takerAsset filled in trade.
function fillOrderNoThrow(
address[5] orderAddresses,
uint256[6] orderValues,
- uint256 takerTokenFillAmount,
+ uint256 takerAssetFillAmount,
uint8 v,
bytes32 r,
bytes32 s)
public
- returns (bool success, uint256 takerTokenFilledAmount);
+ returns (bool success, uint256 takerAssetFilledAmount);
/// @dev Synchronously executes multiple calls of fillOrder in a single transaction.
/// @param orderAddresses Array of address arrays containing individual order addresses.
/// @param orderValues Array of uint256 arrays containing individual order values.
- /// @param takerTokenFillAmounts Array of desired amounts of takerToken to fill in orders.
+ /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to fill in orders.
/// @param v Array ECDSA signature v parameters.
/// @param r Array of ECDSA signature r parameters.
/// @param s Array of ECDSA signature s parameters.
function batchFillOrders(
address[5][] orderAddresses,
uint256[6][] orderValues,
- uint256[] takerTokenFillAmounts,
+ uint256[] takerAssetFillAmounts,
uint8[] v,
bytes32[] r,
bytes32[] s)
@@ -212,14 +212,14 @@ contract IExchange {
/// @dev Synchronously executes multiple calls of fillOrKill in a single transaction.
/// @param orderAddresses Array of address arrays containing individual order addresses.
/// @param orderValues Array of uint256 arrays containing individual order values.
- /// @param takerTokenFillAmounts Array of desired amounts of takerToken to fill in orders.
+ /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to fill in orders.
/// @param v Array ECDSA signature v parameters.
/// @param r Array of ECDSA signature r parameters.
/// @param s Array of ECDSA signature s parameters.
function batchFillOrKillOrders(
address[5][] orderAddresses,
uint256[6][] orderValues,
- uint256[] takerTokenFillAmounts,
+ uint256[] takerAssetFillAmounts,
uint8[] v,
bytes32[] r,
bytes32[] s)
@@ -228,49 +228,49 @@ contract IExchange {
/// @dev Synchronously executes multiple calls of fillOrderNoThrow in a single transaction.
/// @param orderAddresses Array of address arrays containing individual order addresses.
/// @param orderValues Array of uint256 arrays containing individual order values.
- /// @param takerTokenFillAmounts Array of desired amounts of takerToken to fill in orders.
+ /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to fill in orders.
/// @param v Array ECDSA signature v parameters.
/// @param r Array of ECDSA signature r parameters.
/// @param s Array of ECDSA signature s parameters.
function batchFillOrdersNoThrow(
address[5][] orderAddresses,
uint256[6][] orderValues,
- uint256[] takerTokenFillAmounts,
+ uint256[] takerAssetFillAmounts,
uint8[] v,
bytes32[] r,
bytes32[] s)
external;
- /// @dev Synchronously executes multiple fill orders in a single transaction until total takerTokenFillAmount filled.
+ /// @dev Synchronously executes multiple fill orders in a single transaction until total takerAssetFillAmount filled.
/// @param orderAddresses Array of address arrays containing individual order addresses.
/// @param orderValues Array of uint256 arrays containing individual order values.
- /// @param takerTokenFillAmount Desired total amount of takerToken to fill in orders.
+ /// @param takerAssetFillAmount Desired total amount of takerAsset to fill in orders.
/// @param v Array ECDSA signature v parameters.
/// @param r Array of ECDSA signature r parameters.
/// @param s Array of ECDSA signature s parameters.
- /// @return Total amount of takerTokenFillAmount filled in orders.
+ /// @return Total amount of takerAssetFillAmount filled in orders.
function marketFillOrders(
address[5][] orderAddresses,
uint256[6][] orderValues,
- uint256 takerTokenFillAmount,
+ uint256 takerAssetFillAmount,
uint8[] v,
bytes32[] r,
bytes32[] s)
external
returns (uint256 totalTakerTokenFilledAmount);
- /// @dev Synchronously executes multiple calls of fillOrderNoThrow in a single transaction until total takerTokenFillAmount filled.
+ /// @dev Synchronously executes multiple calls of fillOrderNoThrow in a single transaction until total takerAssetFillAmount filled.
/// @param orderAddresses Array of address arrays containing individual order addresses.
/// @param orderValues Array of uint256 arrays containing individual order values.
- /// @param takerTokenFillAmount Desired total amount of takerToken to fill in orders.
+ /// @param takerAssetFillAmount Desired total amount of takerAsset to fill in orders.
/// @param v Array ECDSA signature v parameters.
/// @param r Array of ECDSA signature r parameters.
/// @param s Array of ECDSA signature s parameters.
- /// @return Total amount of takerTokenFillAmount filled in orders.
+ /// @return Total amount of takerAssetFillAmount filled in orders.
function marketFillOrdersNoThrow(
address[5][] orderAddresses,
uint256[6][] orderValues,
- uint256 takerTokenFillAmount,
+ uint256 takerAssetFillAmount,
uint8[] v,
bytes32[] r,
bytes32[] s)
@@ -280,10 +280,10 @@ contract IExchange {
/// @dev Synchronously cancels multiple orders in a single transaction.
/// @param orderAddresses Array of address arrays containing individual order addresses.
/// @param orderValues Array of uint256 arrays containing individual order values.
- /// @param takerTokenCancelAmounts Array of desired amounts of takerToken to cancel in orders.
+ /// @param takerAssetCancelAmounts Array of desired amounts of takerAsset to cancel in orders.
function batchCancelOrders(
address[5][] orderAddresses,
uint256[6][] orderValues,
- uint256[] takerTokenCancelAmounts)
+ uint256[] takerAssetCancelAmounts)
external;
}
diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/LibOrder.sol b/packages/contracts/src/contracts/current/protocol/Exchange/LibOrder.sol
index d47a0fbbe..61a4a382d 100644
--- a/packages/contracts/src/contracts/current/protocol/Exchange/LibOrder.sol
+++ b/packages/contracts/src/contracts/current/protocol/Exchange/LibOrder.sol
@@ -26,8 +26,8 @@ contract LibOrder {
"address makerAddress",
"address takerAddress",
"address feeRecipientAddress",
- "uint256 makerTokenAmount",
- "uint256 takerTokenAmount",
+ "uint256 makerAssetAmount",
+ "uint256 takerAssetAmount",
"uint256 makerFee",
"uint256 takerFee",
"uint256 expirationTimeSeconds",
@@ -40,8 +40,8 @@ contract LibOrder {
address makerAddress;
address takerAddress;
address feeRecipientAddress;
- uint256 makerTokenAmount;
- uint256 takerTokenAmount;
+ uint256 makerAssetAmount;
+ uint256 takerAssetAmount;
uint256 makerFee;
uint256 takerFee;
uint256 expirationTimeSeconds;
@@ -66,8 +66,8 @@ contract LibOrder {
order.makerAddress,
order.takerAddress,
order.feeRecipientAddress,
- order.makerTokenAmount,
- order.takerTokenAmount,
+ order.makerAssetAmount,
+ order.takerAssetAmount,
order.makerFee,
order.takerFee,
order.expirationTimeSeconds,
diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol b/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol
index ec1bd57ce..10985d6d3 100644
--- a/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol
+++ b/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol
@@ -39,7 +39,7 @@ contract MixinExchangeCore is
LibErrors,
LibPartialAmount
{
- // Mapping of orderHash => amount of takerToken already bought by maker
+ // Mapping of orderHash => amount of takerAsset already bought by maker
mapping (bytes32 => uint256) public filled;
// Mapping of orderHash => cancelled
@@ -55,8 +55,8 @@ contract MixinExchangeCore is
address indexed feeRecipientAddress,
bytes makerAssetData,
bytes takerAssetData,
- uint256 makerTokenFilledAmount,
- uint256 takerTokenFilledAmount,
+ uint256 makerAssetFilledAmount,
+ uint256 takerAssetFilledAmount,
uint256 makerFeePaid,
uint256 takerFeePaid,
bytes32 indexed orderHash
@@ -81,12 +81,12 @@ contract MixinExchangeCore is
/// @dev Fills the input order.
/// @param order Order struct containing order specifications.
- /// @param takerTokenFillAmount Desired amount of takerToken to sell.
+ /// @param takerAssetFillAmount Desired amount of takerAsset to sell.
/// @param signature Proof that order has been created by maker.
/// @return Amounts filled and fees paid by maker and taker.
function fillOrder(
Order memory order,
- uint256 takerTokenFillAmount,
+ uint256 takerAssetFillAmount,
bytes memory signature)
public
returns (FillResults memory fillResults)
@@ -109,8 +109,8 @@ contract MixinExchangeCore is
// Validate order and maker only if first time seen
// TODO: Read filled and cancelled only once
if (filled[orderHash] == 0) {
- require(order.makerTokenAmount > 0);
- require(order.takerTokenAmount > 0);
+ require(order.makerAssetAmount > 0);
+ require(order.takerAssetAmount > 0);
require(isValidSignature(orderHash, order.makerAddress, signature));
}
@@ -118,7 +118,7 @@ contract MixinExchangeCore is
if (order.takerAddress != address(0)) {
require(order.takerAddress == msg.sender);
}
- require(takerTokenFillAmount > 0);
+ require(takerAssetFillAmount > 0);
// Validate order expiration
if (block.timestamp >= order.expirationTimeSeconds) {
@@ -127,26 +127,26 @@ contract MixinExchangeCore is
}
// Validate order availability
- uint256 remainingTakerTokenFillAmount = safeSub(order.takerTokenAmount, filled[orderHash]);
+ uint256 remainingTakerTokenFillAmount = safeSub(order.takerAssetAmount, filled[orderHash]);
if (remainingTakerTokenFillAmount == 0) {
emit ExchangeError(uint8(Errors.ORDER_FULLY_FILLED), orderHash);
return fillResults;
}
// Validate fill order rounding
- fillResults.takerTokenFilledAmount = min256(takerTokenFillAmount, remainingTakerTokenFillAmount);
- if (isRoundingError(fillResults.takerTokenFilledAmount, order.takerTokenAmount, order.makerTokenAmount)) {
+ fillResults.takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerTokenFillAmount);
+ if (isRoundingError(fillResults.takerAssetFilledAmount, order.takerAssetAmount, order.makerAssetAmount)) {
emit ExchangeError(uint8(Errors.ROUNDING_ERROR_TOO_LARGE), orderHash);
- fillResults.takerTokenFilledAmount = 0;
+ fillResults.takerAssetFilledAmount = 0;
return fillResults;
}
// Update state
- filled[orderHash] = safeAdd(filled[orderHash], fillResults.takerTokenFilledAmount);
+ filled[orderHash] = safeAdd(filled[orderHash], fillResults.takerAssetFilledAmount);
// Settle order
- (fillResults.makerTokenFilledAmount, fillResults.makerFeePaid, fillResults.takerFeePaid) =
- settleOrder(order, msg.sender, fillResults.takerTokenFilledAmount);
+ (fillResults.makerAssetFilledAmount, fillResults.makerFeePaid, fillResults.takerFeePaid) =
+ settleOrder(order, msg.sender, fillResults.takerAssetFilledAmount);
// Log order
emit Fill(
@@ -155,8 +155,8 @@ contract MixinExchangeCore is
order.feeRecipientAddress,
order.makerAssetData,
order.takerAssetData,
- fillResults.makerTokenFilledAmount,
- fillResults.takerTokenFilledAmount,
+ fillResults.makerAssetFilledAmount,
+ fillResults.takerAssetFilledAmount,
fillResults.makerFeePaid,
fillResults.takerFeePaid,
orderHash
@@ -176,8 +176,8 @@ contract MixinExchangeCore is
bytes32 orderHash = getOrderHash(order);
// Validate the order
- require(order.makerTokenAmount > 0);
- require(order.takerTokenAmount > 0);
+ require(order.makerAssetAmount > 0);
+ require(order.takerAssetAmount > 0);
require(order.makerAddress == msg.sender);
if (block.timestamp >= order.expirationTimeSeconds) {
diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/MixinSettlementProxy.sol b/packages/contracts/src/contracts/current/protocol/Exchange/MixinSettlementProxy.sol
index 718572d50..5fff2cd60 100644
--- a/packages/contracts/src/contracts/current/protocol/Exchange/MixinSettlementProxy.sol
+++ b/packages/contracts/src/contracts/current/protocol/Exchange/MixinSettlementProxy.sol
@@ -57,30 +57,30 @@ contract MixinSettlementProxy is
function settleOrder(
Order memory order,
address takerAddress,
- uint256 takerTokenFilledAmount)
+ uint256 takerAssetFilledAmount)
internal
returns (
- uint256 makerTokenFilledAmount,
+ uint256 makerAssetFilledAmount,
uint256 makerFeePaid,
uint256 takerFeePaid
)
{
- makerTokenFilledAmount = getPartialAmount(takerTokenFilledAmount, order.takerTokenAmount, order.makerTokenAmount);
+ makerAssetFilledAmount = getPartialAmount(takerAssetFilledAmount, order.takerAssetAmount, order.makerAssetAmount);
ASSET_PROXY_DISPATCHER.transferFrom(
order.makerAssetData,
order.makerAddress,
takerAddress,
- makerTokenFilledAmount
+ makerAssetFilledAmount
);
ASSET_PROXY_DISPATCHER.transferFrom(
order.takerAssetData,
takerAddress,
order.makerAddress,
- takerTokenFilledAmount
+ takerAssetFilledAmount
);
if (order.feeRecipientAddress != address(0)) {
if (order.makerFee > 0) {
- makerFeePaid = getPartialAmount(takerTokenFilledAmount, order.takerTokenAmount, order.makerFee);
+ makerFeePaid = getPartialAmount(takerAssetFilledAmount, order.takerAssetAmount, order.makerFee);
ASSET_PROXY_DISPATCHER.transferFrom(
ZRX_PROXY_DATA,
order.makerAddress,
@@ -89,7 +89,7 @@ contract MixinSettlementProxy is
);
}
if (order.takerFee > 0) {
- takerFeePaid = getPartialAmount(takerTokenFilledAmount, order.takerTokenAmount, order.takerFee);
+ takerFeePaid = getPartialAmount(takerAssetFilledAmount, order.takerAssetAmount, order.takerFee);
ASSET_PROXY_DISPATCHER.transferFrom(
ZRX_PROXY_DATA,
takerAddress,
@@ -98,6 +98,6 @@ contract MixinSettlementProxy is
);
}
}
- return (makerTokenFilledAmount, makerFeePaid, takerFeePaid);
+ return (makerAssetFilledAmount, makerFeePaid, takerFeePaid);
}
}
diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/MixinWrapperFunctions.sol b/packages/contracts/src/contracts/current/protocol/Exchange/MixinWrapperFunctions.sol
index 027fcd87f..caa391aed 100644
--- a/packages/contracts/src/contracts/current/protocol/Exchange/MixinWrapperFunctions.sol
+++ b/packages/contracts/src/contracts/current/protocol/Exchange/MixinWrapperFunctions.sol
@@ -31,35 +31,35 @@ contract MixinWrapperFunctions is
LibBytes,
LibPartialAmount
{
- /// @dev Fills the input order. Reverts if exact takerTokenFillAmount not filled.
+ /// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.
/// @param order Order struct containing order specifications.
- /// @param takerTokenFillAmount Desired amount of takerToken to sell.
+ /// @param takerAssetFillAmount Desired amount of takerAsset to sell.
/// @param signature Proof that order has been created by maker.
function fillOrKillOrder(
Order memory order,
- uint256 takerTokenFillAmount,
+ uint256 takerAssetFillAmount,
bytes memory signature)
public
returns (FillResults memory fillResults)
{
fillResults = fillOrder(
order,
- takerTokenFillAmount,
+ takerAssetFillAmount,
signature
);
- require(fillResults.takerTokenFilledAmount == takerTokenFillAmount);
+ require(fillResults.takerAssetFilledAmount == takerAssetFillAmount);
return fillResults;
}
/// @dev Fills an order with specified parameters and ECDSA signature.
/// Returns false if the transaction would otherwise revert.
/// @param order Order struct containing order specifications.
- /// @param takerTokenFillAmount Desired amount of takerToken to sell.
+ /// @param takerAssetFillAmount Desired amount of takerAsset to sell.
/// @param signature Proof that order has been created by maker.
/// @return Amounts filled and fees paid by maker and taker.
function fillOrderNoThrow(
Order memory order,
- uint256 takerTokenFillAmount,
+ uint256 takerAssetFillAmount,
bytes memory signature)
public
returns (FillResults memory fillResults)
@@ -73,14 +73,14 @@ contract MixinWrapperFunctions is
// | Header | 0x00 | 4 | function selector |
// | Params | | 3 * 32 | function parameters: |
// | | 0x00 | | 1. offset to order (*) |
- // | | 0x20 | | 2. takerTokenFillAmount |
+ // | | 0x20 | | 2. takerAssetFillAmount |
// | | 0x40 | | 3. offset to signature (*) |
// | Data | | 11 * 32 | order: |
// | | 0x000 | | 1. makerAddress |
// | | 0x020 | | 2. takerAddress |
// | | 0x040 | | 3. feeRecipientAddress |
- // | | 0x060 | | 4. makerTokenAmount |
- // | | 0x080 | | 5. takerTokenAmount |
+ // | | 0x060 | | 4. makerAssetAmount |
+ // | | 0x080 | | 5. takerAssetAmount |
// | | 0x0A0 | | 6. makerFeeAmount |
// | | 0x0C0 | | 7. takerFeeAmount |
// | | 0x0E0 | | 8. expirationTimeSeconds |
@@ -150,8 +150,8 @@ contract MixinWrapperFunctions is
mstore(dataAreaEnd, mload(sourceOffset)) // makerAddress
mstore(add(dataAreaEnd, 0x20), mload(add(sourceOffset, 0x20))) // takerAddress
mstore(add(dataAreaEnd, 0x40), mload(add(sourceOffset, 0x40))) // feeRecipientAddress
- mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // makerTokenAmount
- mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // takerTokenAmount
+ mstore(add(dataAreaEnd, 0x60), mload(add(sourceOffset, 0x60))) // makerAssetAmount
+ mstore(add(dataAreaEnd, 0x80), mload(add(sourceOffset, 0x80))) // takerAssetAmount
mstore(add(dataAreaEnd, 0xA0), mload(add(sourceOffset, 0xA0))) // makerFeeAmount
mstore(add(dataAreaEnd, 0xC0), mload(add(sourceOffset, 0xC0))) // takerFeeAmount
mstore(add(dataAreaEnd, 0xE0), mload(add(sourceOffset, 0xE0))) // expirationTimeSeconds
@@ -199,8 +199,8 @@ contract MixinWrapperFunctions is
sourceOffset := add(sourceOffset, 0x20)
}
- /////// Write takerTokenFillAmount ///////
- mstore(paramsAreaOffset, takerTokenFillAmount)
+ /////// Write takerAssetFillAmount ///////
+ mstore(paramsAreaOffset, takerAssetFillAmount)
paramsAreaOffset := add(paramsAreaOffset, 0x20)
/////// Write signature ///////
@@ -252,18 +252,18 @@ contract MixinWrapperFunctions is
/// @dev Synchronously executes multiple calls of fillOrder.
/// @param orders Array of order specifications.
- /// @param takerTokenFillAmounts Array of desired amounts of takerToken to sell in orders.
+ /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.
/// @param signatures Proofs that orders have been created by makers.
function batchFillOrders(
Order[] memory orders,
- uint256[] memory takerTokenFillAmounts,
+ uint256[] memory takerAssetFillAmounts,
bytes[] memory signatures)
public
{
for (uint256 i = 0; i < orders.length; i++) {
fillOrder(
orders[i],
- takerTokenFillAmounts[i],
+ takerAssetFillAmounts[i],
signatures[i]
);
}
@@ -271,18 +271,18 @@ contract MixinWrapperFunctions is
/// @dev Synchronously executes multiple calls of fillOrKill.
/// @param orders Array of order specifications.
- /// @param takerTokenFillAmounts Array of desired amounts of takerToken to sell in orders.
+ /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.
/// @param signatures Proofs that orders have been created by makers.
function batchFillOrKillOrders(
Order[] memory orders,
- uint256[] memory takerTokenFillAmounts,
+ uint256[] memory takerAssetFillAmounts,
bytes[] memory signatures)
public
{
for (uint256 i = 0; i < orders.length; i++) {
fillOrKillOrder(
orders[i],
- takerTokenFillAmounts[i],
+ takerAssetFillAmounts[i],
signatures[i]
);
}
@@ -291,31 +291,31 @@ contract MixinWrapperFunctions is
/// @dev Fills an order with specified parameters and ECDSA signature.
/// Returns false if the transaction would otherwise revert.
/// @param orders Array of order specifications.
- /// @param takerTokenFillAmounts Array of desired amounts of takerToken to sell in orders.
+ /// @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell in orders.
/// @param signatures Proofs that orders have been created by makers.
function batchFillOrdersNoThrow(
Order[] memory orders,
- uint256[] memory takerTokenFillAmounts,
+ uint256[] memory takerAssetFillAmounts,
bytes[] memory signatures)
public
{
for (uint256 i = 0; i < orders.length; i++) {
fillOrderNoThrow(
orders[i],
- takerTokenFillAmounts[i],
+ takerAssetFillAmounts[i],
signatures[i]
);
}
}
- /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerToken is sold by taker.
+ /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.
/// @param orders Array of order specifications.
- /// @param takerTokenFillAmount Desired amount of takerToken to sell.
+ /// @param takerAssetFillAmount Desired amount of takerAsset to sell.
/// @param signatures Proofs that orders have been created by makers.
/// @return Amounts filled and fees paid by makers and taker.
function marketSellOrders(
Order[] memory orders,
- uint256 takerTokenFillAmount,
+ uint256 takerAssetFillAmount,
bytes[] memory signatures)
public
returns (FillResults memory totalFillResults)
@@ -325,10 +325,10 @@ contract MixinWrapperFunctions is
// Token being sold by taker must be the same for each order
require(areBytesEqual(orders[i].takerAssetData, orders[0].takerAssetData));
- // Calculate the remaining amount of takerToken to sell
- uint256 remainingTakerTokenFillAmount = safeSub(takerTokenFillAmount, totalFillResults.takerTokenFilledAmount);
+ // Calculate the remaining amount of takerAsset to sell
+ uint256 remainingTakerTokenFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);
- // Attempt to sell the remaining amount of takerToken
+ // Attempt to sell the remaining amount of takerAsset
FillResults memory singleFillResults = fillOrder(
orders[i],
remainingTakerTokenFillAmount,
@@ -338,23 +338,23 @@ contract MixinWrapperFunctions is
// Update amounts filled and fees paid by maker and taker
addFillResults(totalFillResults, singleFillResults);
- // Stop execution if the entire amount of takerToken has been sold
- if (totalFillResults.takerTokenFilledAmount == takerTokenFillAmount) {
+ // Stop execution if the entire amount of takerAsset has been sold
+ if (totalFillResults.takerAssetFilledAmount == takerAssetFillAmount) {
break;
}
}
return totalFillResults;
}
- /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerToken is sold by taker.
+ /// @dev Synchronously executes multiple calls of fillOrder until total amount of takerAsset is sold by taker.
/// Returns false if the transaction would otherwise revert.
/// @param orders Array of order specifications.
- /// @param takerTokenFillAmount Desired amount of takerToken to sell.
+ /// @param takerAssetFillAmount Desired amount of takerAsset to sell.
/// @param signatures Proofs that orders have been signed by makers.
/// @return Amounts filled and fees paid by makers and taker.
function marketSellOrdersNoThrow(
Order[] memory orders,
- uint256 takerTokenFillAmount,
+ uint256 takerAssetFillAmount,
bytes[] memory signatures)
public
returns (FillResults memory totalFillResults)
@@ -364,10 +364,10 @@ contract MixinWrapperFunctions is
// Token being sold by taker must be the same for each order
require(areBytesEqual(orders[i].takerAssetData, orders[0].takerAssetData));
- // Calculate the remaining amount of takerToken to sell
- uint256 remainingTakerTokenFillAmount = safeSub(takerTokenFillAmount, totalFillResults.takerTokenFilledAmount);
+ // Calculate the remaining amount of takerAsset to sell
+ uint256 remainingTakerTokenFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount);
- // Attempt to sell the remaining amount of takerToken
+ // Attempt to sell the remaining amount of takerAsset
FillResults memory singleFillResults = fillOrderNoThrow(
orders[i],
remainingTakerTokenFillAmount,
@@ -377,22 +377,22 @@ contract MixinWrapperFunctions is
// Update amounts filled and fees paid by maker and taker
addFillResults(totalFillResults, singleFillResults);
- // Stop execution if the entire amount of takerToken has been sold
- if (totalFillResults.takerTokenFilledAmount == takerTokenFillAmount) {
+ // Stop execution if the entire amount of takerAsset has been sold
+ if (totalFillResults.takerAssetFilledAmount == takerAssetFillAmount) {
break;
}
}
return totalFillResults;
}
- /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerToken is bought by taker.
+ /// @dev Synchronously executes multiple calls of fillOrder until total amount of makerAsset is bought by taker.
/// @param orders Array of order specifications.
- /// @param makerTokenFillAmount Desired amount of makerToken to buy.
+ /// @param makerAssetFillAmount Desired amount of makerAsset to buy.
/// @param signatures Proofs that orders have been signed by makers.
/// @return Amounts filled and fees paid by makers and taker.
function marketBuyOrders(
Order[] memory orders,
- uint256 makerTokenFillAmount,
+ uint256 makerAssetFillAmount,
bytes[] memory signatures)
public
returns (FillResults memory totalFillResults)
@@ -402,18 +402,18 @@ contract MixinWrapperFunctions is
// Token being bought by taker must be the same for each order
require(areBytesEqual(orders[i].makerAssetData, orders[0].makerAssetData));
- // Calculate the remaining amount of makerToken to buy
- uint256 remainingMakerTokenFillAmount = safeSub(makerTokenFillAmount, totalFillResults.makerTokenFilledAmount);
+ // Calculate the remaining amount of makerAsset to buy
+ uint256 remainingMakerTokenFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);
- // Convert the remaining amount of makerToken to buy into remaining amount
- // of takerToken to sell, assuming entire amount can be sold in the current order
+ // Convert the remaining amount of makerAsset to buy into remaining amount
+ // of takerAsset to sell, assuming entire amount can be sold in the current order
uint256 remainingTakerTokenFillAmount = getPartialAmount(
- orders[i].takerTokenAmount,
- orders[i].makerTokenAmount,
+ orders[i].takerAssetAmount,
+ orders[i].makerAssetAmount,
remainingMakerTokenFillAmount
);
- // Attempt to sell the remaining amount of takerToken
+ // Attempt to sell the remaining amount of takerAsset
FillResults memory singleFillResults = fillOrder(
orders[i],
remainingTakerTokenFillAmount,
@@ -423,8 +423,8 @@ contract MixinWrapperFunctions is
// Update amounts filled and fees paid by maker and taker
addFillResults(totalFillResults, singleFillResults);
- // Stop execution if the entire amount of makerToken has been bought
- if (totalFillResults.makerTokenFilledAmount == makerTokenFillAmount) {
+ // Stop execution if the entire amount of makerAsset has been bought
+ if (totalFillResults.makerAssetFilledAmount == makerAssetFillAmount) {
break;
}
}
@@ -434,12 +434,12 @@ contract MixinWrapperFunctions is
/// @dev Synchronously executes multiple fill orders in a single transaction until total amount is bought by taker.
/// Returns false if the transaction would otherwise revert.
/// @param orders Array of order specifications.
- /// @param makerTokenFillAmount Desired amount of makerToken to buy.
+ /// @param makerAssetFillAmount Desired amount of makerAsset to buy.
/// @param signatures Proofs that orders have been signed by makers.
/// @return Amounts filled and fees paid by makers and taker.
function marketBuyOrdersNoThrow(
Order[] memory orders,
- uint256 makerTokenFillAmount,
+ uint256 makerAssetFillAmount,
bytes[] memory signatures)
public
returns (FillResults memory totalFillResults)
@@ -449,18 +449,18 @@ contract MixinWrapperFunctions is
// Token being bought by taker must be the same for each order
require(areBytesEqual(orders[i].makerAssetData, orders[0].makerAssetData));
- // Calculate the remaining amount of makerToken to buy
- uint256 remainingMakerTokenFillAmount = safeSub(makerTokenFillAmount, totalFillResults.makerTokenFilledAmount);
+ // Calculate the remaining amount of makerAsset to buy
+ uint256 remainingMakerTokenFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount);
- // Convert the remaining amount of makerToken to buy into remaining amount
- // of takerToken to sell, assuming entire amount can be sold in the current order
+ // Convert the remaining amount of makerAsset to buy into remaining amount
+ // of takerAsset to sell, assuming entire amount can be sold in the current order
uint256 remainingTakerTokenFillAmount = getPartialAmount(
- orders[i].takerTokenAmount,
- orders[i].makerTokenAmount,
+ orders[i].takerAssetAmount,
+ orders[i].makerAssetAmount,
remainingMakerTokenFillAmount
);
- // Attempt to sell the remaining amount of takerToken
+ // Attempt to sell the remaining amount of takerAsset
FillResults memory singleFillResults = fillOrderNoThrow(
orders[i],
remainingTakerTokenFillAmount,
@@ -470,8 +470,8 @@ contract MixinWrapperFunctions is
// Update amounts filled and fees paid by maker and taker
addFillResults(totalFillResults, singleFillResults);
- // Stop execution if the entire amount of makerToken has been bought
- if (totalFillResults.makerTokenFilledAmount == makerTokenFillAmount) {
+ // Stop execution if the entire amount of makerAsset has been bought
+ if (totalFillResults.makerAssetFilledAmount == makerAssetFillAmount) {
break;
}
}
@@ -496,8 +496,8 @@ contract MixinWrapperFunctions is
internal
pure
{
- totalFillResults.makerTokenFilledAmount = safeAdd(totalFillResults.makerTokenFilledAmount, singleFillResults.makerTokenFilledAmount);
- totalFillResults.takerTokenFilledAmount = safeAdd(totalFillResults.takerTokenFilledAmount, singleFillResults.takerTokenFilledAmount);
+ totalFillResults.makerAssetFilledAmount = safeAdd(totalFillResults.makerAssetFilledAmount, singleFillResults.makerAssetFilledAmount);
+ totalFillResults.takerAssetFilledAmount = safeAdd(totalFillResults.takerAssetFilledAmount, singleFillResults.takerAssetFilledAmount);
totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid);
totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid);
}
diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/mixins/MExchangeCore.sol b/packages/contracts/src/contracts/current/protocol/Exchange/mixins/MExchangeCore.sol
index d2ec4da04..9a7f80109 100644
--- a/packages/contracts/src/contracts/current/protocol/Exchange/mixins/MExchangeCore.sol
+++ b/packages/contracts/src/contracts/current/protocol/Exchange/mixins/MExchangeCore.sol
@@ -24,15 +24,15 @@ import "../LibOrder.sol";
contract MExchangeCore is LibOrder {
struct FillResults {
- uint256 makerTokenFilledAmount;
- uint256 takerTokenFilledAmount;
+ uint256 makerAssetFilledAmount;
+ uint256 takerAssetFilledAmount;
uint256 makerFeePaid;
uint256 takerFeePaid;
}
function fillOrder(
Order memory order,
- uint256 takerTokenFillAmount,
+ uint256 takerAssetFillAmount,
bytes memory signature)
public
returns (FillResults memory fillResults);
diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/mixins/MSettlement.sol b/packages/contracts/src/contracts/current/protocol/Exchange/mixins/MSettlement.sol
index a9911c8ce..172138f2d 100644
--- a/packages/contracts/src/contracts/current/protocol/Exchange/mixins/MSettlement.sol
+++ b/packages/contracts/src/contracts/current/protocol/Exchange/mixins/MSettlement.sol
@@ -26,10 +26,10 @@ contract MSettlement is LibOrder {
function settleOrder(
Order memory order,
address takerAddress,
- uint256 takerTokenFilledAmount)
+ uint256 takerAssetFilledAmount)
internal
returns (
- uint256 makerTokenFilledAmount,
+ uint256 makerAssetFilledAmount,
uint256 makerFeePaid,
uint256 takerFeePaid
);
diff --git a/packages/contracts/src/utils/exchange_wrapper.ts b/packages/contracts/src/utils/exchange_wrapper.ts
index cda012aa9..927513fe3 100644
--- a/packages/contracts/src/utils/exchange_wrapper.ts
+++ b/packages/contracts/src/utils/exchange_wrapper.ts
@@ -22,12 +22,12 @@ export class ExchangeWrapper {
public async fillOrderAsync(
signedOrder: SignedOrder,
from: string,
- opts: { takerTokenFillAmount?: BigNumber } = {},
+ opts: { takerAssetFillAmount?: BigNumber } = {},
): Promise<TransactionReceiptWithDecodedLogs> {
- const params = orderUtils.createFill(signedOrder, opts.takerTokenFillAmount);
+ const params = orderUtils.createFill(signedOrder, opts.takerAssetFillAmount);
const txHash = await this._exchange.fillOrder.sendTransactionAsync(
params.order,
- params.takerTokenFillAmount,
+ params.takerAssetFillAmount,
params.signature,
{ from },
);
@@ -43,12 +43,12 @@ export class ExchangeWrapper {
public async fillOrKillOrderAsync(
signedOrder: SignedOrder,
from: string,
- opts: { takerTokenFillAmount?: BigNumber } = {},
+ opts: { takerAssetFillAmount?: BigNumber } = {},
): Promise<TransactionReceiptWithDecodedLogs> {
- const params = orderUtils.createFill(signedOrder, opts.takerTokenFillAmount);
+ const params = orderUtils.createFill(signedOrder, opts.takerAssetFillAmount);
const txHash = await this._exchange.fillOrKillOrder.sendTransactionAsync(
params.order,
- params.takerTokenFillAmount,
+ params.takerAssetFillAmount,
params.signature,
{ from },
);
@@ -58,12 +58,12 @@ export class ExchangeWrapper {
public async fillOrderNoThrowAsync(
signedOrder: SignedOrder,
from: string,
- opts: { takerTokenFillAmount?: BigNumber } = {},
+ opts: { takerAssetFillAmount?: BigNumber } = {},
): Promise<TransactionReceiptWithDecodedLogs> {
- const params = orderUtils.createFill(signedOrder, opts.takerTokenFillAmount);
+ const params = orderUtils.createFill(signedOrder, opts.takerAssetFillAmount);
const txHash = await this._exchange.fillOrderNoThrow.sendTransactionAsync(
params.order,
- params.takerTokenFillAmount,
+ params.takerAssetFillAmount,
params.signature,
{ from },
);
@@ -73,12 +73,12 @@ export class ExchangeWrapper {
public async batchFillOrdersAsync(
orders: SignedOrder[],
from: string,
- opts: { takerTokenFillAmounts?: BigNumber[] } = {},
+ opts: { takerAssetFillAmounts?: BigNumber[] } = {},
): Promise<TransactionReceiptWithDecodedLogs> {
- const params = formatters.createBatchFill(orders, opts.takerTokenFillAmounts);
+ const params = formatters.createBatchFill(orders, opts.takerAssetFillAmounts);
const txHash = await this._exchange.batchFillOrders.sendTransactionAsync(
params.orders,
- params.takerTokenFillAmounts,
+ params.takerAssetFillAmounts,
params.signatures,
{ from },
);
@@ -88,12 +88,12 @@ export class ExchangeWrapper {
public async batchFillOrKillOrdersAsync(
orders: SignedOrder[],
from: string,
- opts: { takerTokenFillAmounts?: BigNumber[] } = {},
+ opts: { takerAssetFillAmounts?: BigNumber[] } = {},
): Promise<TransactionReceiptWithDecodedLogs> {
- const params = formatters.createBatchFill(orders, opts.takerTokenFillAmounts);
+ const params = formatters.createBatchFill(orders, opts.takerAssetFillAmounts);
const txHash = await this._exchange.batchFillOrKillOrders.sendTransactionAsync(
params.orders,
- params.takerTokenFillAmounts,
+ params.takerAssetFillAmounts,
params.signatures,
{ from },
);
@@ -103,12 +103,12 @@ export class ExchangeWrapper {
public async batchFillOrdersNoThrowAsync(
orders: SignedOrder[],
from: string,
- opts: { takerTokenFillAmounts?: BigNumber[] } = {},
+ opts: { takerAssetFillAmounts?: BigNumber[] } = {},
): Promise<TransactionReceiptWithDecodedLogs> {
- const params = formatters.createBatchFill(orders, opts.takerTokenFillAmounts);
+ const params = formatters.createBatchFill(orders, opts.takerAssetFillAmounts);
const txHash = await this._exchange.batchFillOrdersNoThrow.sendTransactionAsync(
params.orders,
- params.takerTokenFillAmounts,
+ params.takerAssetFillAmounts,
params.signatures,
{ from },
);
@@ -118,12 +118,12 @@ export class ExchangeWrapper {
public async marketSellOrdersAsync(
orders: SignedOrder[],
from: string,
- opts: { takerTokenFillAmount: BigNumber },
+ opts: { takerAssetFillAmount: BigNumber },
): Promise<TransactionReceiptWithDecodedLogs> {
- const params = formatters.createMarketSellOrders(orders, opts.takerTokenFillAmount);
+ const params = formatters.createMarketSellOrders(orders, opts.takerAssetFillAmount);
const txHash = await this._exchange.marketSellOrders.sendTransactionAsync(
params.orders,
- params.takerTokenFillAmount,
+ params.takerAssetFillAmount,
params.signatures,
{ from },
);
@@ -133,12 +133,12 @@ export class ExchangeWrapper {
public async marketSellOrdersNoThrowAsync(
orders: SignedOrder[],
from: string,
- opts: { takerTokenFillAmount: BigNumber },
+ opts: { takerAssetFillAmount: BigNumber },
): Promise<TransactionReceiptWithDecodedLogs> {
- const params = formatters.createMarketSellOrders(orders, opts.takerTokenFillAmount);
+ const params = formatters.createMarketSellOrders(orders, opts.takerAssetFillAmount);
const txHash = await this._exchange.marketSellOrdersNoThrow.sendTransactionAsync(
params.orders,
- params.takerTokenFillAmount,
+ params.takerAssetFillAmount,
params.signatures,
{ from },
);
@@ -148,12 +148,12 @@ export class ExchangeWrapper {
public async marketBuyOrdersAsync(
orders: SignedOrder[],
from: string,
- opts: { makerTokenFillAmount: BigNumber },
+ opts: { makerAssetFillAmount: BigNumber },
): Promise<TransactionReceiptWithDecodedLogs> {
- const params = formatters.createMarketBuyOrders(orders, opts.makerTokenFillAmount);
+ const params = formatters.createMarketBuyOrders(orders, opts.makerAssetFillAmount);
const txHash = await this._exchange.marketBuyOrders.sendTransactionAsync(
params.orders,
- params.makerTokenFillAmount,
+ params.makerAssetFillAmount,
params.signatures,
{ from },
);
@@ -163,12 +163,12 @@ export class ExchangeWrapper {
public async marketBuyOrdersNoThrowAsync(
orders: SignedOrder[],
from: string,
- opts: { makerTokenFillAmount: BigNumber },
+ opts: { makerAssetFillAmount: BigNumber },
): Promise<TransactionReceiptWithDecodedLogs> {
- const params = formatters.createMarketBuyOrders(orders, opts.makerTokenFillAmount);
+ const params = formatters.createMarketBuyOrders(orders, opts.makerAssetFillAmount);
const txHash = await this._exchange.marketBuyOrdersNoThrow.sendTransactionAsync(
params.orders,
- params.makerTokenFillAmount,
+ params.makerAssetFillAmount,
params.signatures,
{ from },
);
diff --git a/packages/contracts/src/utils/formatters.ts b/packages/contracts/src/utils/formatters.ts
index fce10c448..e706c15b5 100644
--- a/packages/contracts/src/utils/formatters.ts
+++ b/packages/contracts/src/utils/formatters.ts
@@ -5,27 +5,27 @@ import { orderUtils } from './order_utils';
import { BatchCancelOrders, BatchFillOrders, MarketBuyOrders, MarketSellOrders, SignedOrder } from './types';
export const formatters = {
- createBatchFill(signedOrders: SignedOrder[], takerTokenFillAmounts: BigNumber[] = []) {
+ createBatchFill(signedOrders: SignedOrder[], takerAssetFillAmounts: BigNumber[] = []) {
const batchFill: BatchFillOrders = {
orders: [],
signatures: [],
- takerTokenFillAmounts,
+ takerAssetFillAmounts,
};
_.forEach(signedOrders, signedOrder => {
const orderStruct = orderUtils.getOrderStruct(signedOrder);
batchFill.orders.push(orderStruct);
batchFill.signatures.push(signedOrder.signature);
- if (takerTokenFillAmounts.length < signedOrders.length) {
- batchFill.takerTokenFillAmounts.push(signedOrder.takerTokenAmount);
+ if (takerAssetFillAmounts.length < signedOrders.length) {
+ batchFill.takerAssetFillAmounts.push(signedOrder.takerAssetAmount);
}
});
return batchFill;
},
- createMarketSellOrders(signedOrders: SignedOrder[], takerTokenFillAmount: BigNumber) {
+ createMarketSellOrders(signedOrders: SignedOrder[], takerAssetFillAmount: BigNumber) {
const marketSellOrders: MarketSellOrders = {
orders: [],
signatures: [],
- takerTokenFillAmount,
+ takerAssetFillAmount,
};
_.forEach(signedOrders, signedOrder => {
const orderStruct = orderUtils.getOrderStruct(signedOrder);
@@ -34,11 +34,11 @@ export const formatters = {
});
return marketSellOrders;
},
- createMarketBuyOrders(signedOrders: SignedOrder[], makerTokenFillAmount: BigNumber) {
+ createMarketBuyOrders(signedOrders: SignedOrder[], makerAssetFillAmount: BigNumber) {
const marketBuyOrders: MarketBuyOrders = {
orders: [],
signatures: [],
- makerTokenFillAmount,
+ makerAssetFillAmount,
};
_.forEach(signedOrders, signedOrder => {
const orderStruct = orderUtils.getOrderStruct(signedOrder);
diff --git a/packages/contracts/src/utils/order_utils.ts b/packages/contracts/src/utils/order_utils.ts
index 18892b4d4..52eb44941 100644
--- a/packages/contracts/src/utils/order_utils.ts
+++ b/packages/contracts/src/utils/order_utils.ts
@@ -7,18 +7,18 @@ import { crypto } from './crypto';
import { OrderStruct, SignatureType, SignedOrder, UnsignedOrder } from './types';
export const orderUtils = {
- createFill: (signedOrder: SignedOrder, takerTokenFillAmount?: BigNumber) => {
+ createFill: (signedOrder: SignedOrder, takerAssetFillAmount?: BigNumber) => {
const fill = {
order: orderUtils.getOrderStruct(signedOrder),
- takerTokenFillAmount: takerTokenFillAmount || signedOrder.takerTokenAmount,
+ takerAssetFillAmount: takerAssetFillAmount || signedOrder.takerAssetAmount,
signature: signedOrder.signature,
};
return fill;
},
- createCancel(signedOrder: SignedOrder, takerTokenCancelAmount?: BigNumber) {
+ createCancel(signedOrder: SignedOrder, takerAssetCancelAmount?: BigNumber) {
const cancel = {
order: orderUtils.getOrderStruct(signedOrder),
- takerTokenCancelAmount: takerTokenCancelAmount || signedOrder.takerTokenAmount,
+ takerAssetCancelAmount: takerAssetCancelAmount || signedOrder.takerAssetAmount,
};
return cancel;
},
@@ -27,8 +27,8 @@ export const orderUtils = {
makerAddress: signedOrder.makerAddress,
takerAddress: signedOrder.takerAddress,
feeRecipientAddress: signedOrder.feeRecipientAddress,
- makerTokenAmount: signedOrder.makerTokenAmount,
- takerTokenAmount: signedOrder.takerTokenAmount,
+ makerAssetAmount: signedOrder.makerAssetAmount,
+ takerAssetAmount: signedOrder.takerAssetAmount,
makerFee: signedOrder.makerFee,
takerFee: signedOrder.takerFee,
expirationTimeSeconds: signedOrder.expirationTimeSeconds,
@@ -44,8 +44,8 @@ export const orderUtils = {
'address makerAddress',
'address takerAddress',
'address feeRecipientAddress',
- 'uint256 makerTokenAmount',
- 'uint256 takerTokenAmount',
+ 'uint256 makerAssetAmount',
+ 'uint256 takerAssetAmount',
'uint256 makerFee',
'uint256 takerFee',
'uint256 expirationTimeSeconds',
@@ -58,8 +58,8 @@ export const orderUtils = {
order.makerAddress,
order.takerAddress,
order.feeRecipientAddress,
- order.makerTokenAmount,
- order.takerTokenAmount,
+ order.makerAssetAmount,
+ order.takerAssetAmount,
order.makerFee,
order.takerFee,
order.expirationTimeSeconds,
diff --git a/packages/contracts/src/utils/types.ts b/packages/contracts/src/utils/types.ts
index 69792b846..8bc9641fc 100644
--- a/packages/contracts/src/utils/types.ts
+++ b/packages/contracts/src/utils/types.ts
@@ -14,19 +14,19 @@ export interface SubmissionContractEventArgs {
export interface BatchFillOrders {
orders: OrderStruct[];
signatures: string[];
- takerTokenFillAmounts: BigNumber[];
+ takerAssetFillAmounts: BigNumber[];
}
export interface MarketSellOrders {
orders: OrderStruct[];
signatures: string[];
- takerTokenFillAmount: BigNumber;
+ takerAssetFillAmount: BigNumber;
}
export interface MarketBuyOrders {
orders: OrderStruct[];
signatures: string[];
- makerTokenFillAmount: BigNumber;
+ makerAssetFillAmount: BigNumber;
}
export interface BatchCancelOrders {
@@ -47,10 +47,10 @@ export interface DefaultOrderParams {
exchangeAddress: string;
makerAddress: string;
feeRecipientAddress: string;
- makerTokenAddress: string;
- takerTokenAddress: string;
- makerTokenAmount: BigNumber;
- takerTokenAmount: BigNumber;
+ makerAssetAddress: string;
+ takerAssetAddress: string;
+ makerAssetAmount: BigNumber;
+ takerAssetAmount: BigNumber;
makerFee: BigNumber;
takerFee: BigNumber;
makerAssetData: string;
@@ -137,8 +137,8 @@ export interface OrderStruct {
makerAddress: string;
takerAddress: string;
feeRecipientAddress: string;
- makerTokenAmount: BigNumber;
- takerTokenAmount: BigNumber;
+ makerAssetAmount: BigNumber;
+ takerAssetAmount: BigNumber;
makerFee: BigNumber;
takerFee: BigNumber;
expirationTimeSeconds: BigNumber;