From 08208acf5337c39ba7a864ad11655e24c1c1728c Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Sun, 22 Apr 2018 14:44:56 -0700 Subject: Rename missed variables --- .../current/protocol/Exchange/IExchange.sol | 8 ++++---- .../protocol/Exchange/MixinExchangeCore.sol | 6 +++--- .../protocol/Exchange/MixinWrapperFunctions.sol | 24 +++++++++++----------- packages/contracts/src/utils/exchange_wrapper.ts | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) (limited to 'packages/contracts/src') diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/IExchange.sol b/packages/contracts/src/contracts/current/protocol/Exchange/IExchange.sol index 0550d6c4b..ef2fb2a96 100644 --- a/packages/contracts/src/contracts/current/protocol/Exchange/IExchange.sol +++ b/packages/contracts/src/contracts/current/protocol/Exchange/IExchange.sol @@ -77,9 +77,9 @@ contract IExchange { /// @dev Calculates the sum of values already filled and cancelled for a given order. /// @param orderHash The Keccak-256 hash of the given order. /// @return Sum of values already filled and cancelled. - function getUnavailableTakerTokenAmount(bytes32 orderHash) + function getUnavailableTakerAssetAmount(bytes32 orderHash) public view - returns (uint256 unavailableTakerTokenAmount); + returns (uint256 unavailableTakerAssetAmount); /// @dev Calculates partial value given a numerator and denominator. /// @param numerator Numerator. @@ -257,7 +257,7 @@ contract IExchange { bytes32[] r, bytes32[] s) external - returns (uint256 totalTakerTokenFilledAmount); + returns (uint256 totalTakerAssetFilledAmount); /// @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. @@ -275,7 +275,7 @@ contract IExchange { bytes32[] r, bytes32[] s) external - returns (uint256 totalTakerTokenFilledAmount); + returns (uint256 totalTakerAssetFilledAmount); /// @dev Synchronously cancels multiple orders in a single transaction. /// @param orderAddresses Array of address arrays containing individual order addresses. diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol b/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol index d4801a8fd..710315515 100644 --- a/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol +++ b/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol @@ -127,14 +127,14 @@ contract MixinExchangeCore is } // Validate order availability - uint256 remainingTakerTokenFillAmount = safeSub(order.takerAssetAmount, filled[orderHash]); - if (remainingTakerTokenFillAmount == 0) { + uint256 remainingTakerAssetFillAmount = safeSub(order.takerAssetAmount, filled[orderHash]); + if (remainingTakerAssetFillAmount == 0) { emit ExchangeError(uint8(Errors.ORDER_FULLY_FILLED), orderHash); return fillResults; } // Validate fill order rounding - fillResults.takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerTokenFillAmount); + fillResults.takerAssetFilledAmount = min256(takerAssetFillAmount, remainingTakerAssetFillAmount); if (isRoundingError(fillResults.takerAssetFilledAmount, order.takerAssetAmount, order.makerAssetAmount)) { emit ExchangeError(uint8(Errors.ROUNDING_ERROR_TOO_LARGE), orderHash); fillResults.takerAssetFilledAmount = 0; diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/MixinWrapperFunctions.sol b/packages/contracts/src/contracts/current/protocol/Exchange/MixinWrapperFunctions.sol index caa391aed..2c0fd0751 100644 --- a/packages/contracts/src/contracts/current/protocol/Exchange/MixinWrapperFunctions.sol +++ b/packages/contracts/src/contracts/current/protocol/Exchange/MixinWrapperFunctions.sol @@ -326,12 +326,12 @@ contract MixinWrapperFunctions is require(areBytesEqual(orders[i].takerAssetData, orders[0].takerAssetData)); // Calculate the remaining amount of takerAsset to sell - uint256 remainingTakerTokenFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount); + uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount); // Attempt to sell the remaining amount of takerAsset FillResults memory singleFillResults = fillOrder( orders[i], - remainingTakerTokenFillAmount, + remainingTakerAssetFillAmount, signatures[i] ); @@ -365,12 +365,12 @@ contract MixinWrapperFunctions is require(areBytesEqual(orders[i].takerAssetData, orders[0].takerAssetData)); // Calculate the remaining amount of takerAsset to sell - uint256 remainingTakerTokenFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount); + uint256 remainingTakerAssetFillAmount = safeSub(takerAssetFillAmount, totalFillResults.takerAssetFilledAmount); // Attempt to sell the remaining amount of takerAsset FillResults memory singleFillResults = fillOrderNoThrow( orders[i], - remainingTakerTokenFillAmount, + remainingTakerAssetFillAmount, signatures[i] ); @@ -403,20 +403,20 @@ contract MixinWrapperFunctions is require(areBytesEqual(orders[i].makerAssetData, orders[0].makerAssetData)); // Calculate the remaining amount of makerAsset to buy - uint256 remainingMakerTokenFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount); + uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount); // 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( + uint256 remainingTakerAssetFillAmount = getPartialAmount( orders[i].takerAssetAmount, orders[i].makerAssetAmount, - remainingMakerTokenFillAmount + remainingMakerAssetFillAmount ); // Attempt to sell the remaining amount of takerAsset FillResults memory singleFillResults = fillOrder( orders[i], - remainingTakerTokenFillAmount, + remainingTakerAssetFillAmount, signatures[i] ); @@ -450,20 +450,20 @@ contract MixinWrapperFunctions is require(areBytesEqual(orders[i].makerAssetData, orders[0].makerAssetData)); // Calculate the remaining amount of makerAsset to buy - uint256 remainingMakerTokenFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount); + uint256 remainingMakerAssetFillAmount = safeSub(makerAssetFillAmount, totalFillResults.makerAssetFilledAmount); // 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( + uint256 remainingTakerAssetFillAmount = getPartialAmount( orders[i].takerAssetAmount, orders[i].makerAssetAmount, - remainingMakerTokenFillAmount + remainingMakerAssetFillAmount ); // Attempt to sell the remaining amount of takerAsset FillResults memory singleFillResults = fillOrderNoThrow( orders[i], - remainingTakerTokenFillAmount, + remainingTakerAssetFillAmount, signatures[i] ); diff --git a/packages/contracts/src/utils/exchange_wrapper.ts b/packages/contracts/src/utils/exchange_wrapper.ts index c4cfdc46c..26ce8b04e 100644 --- a/packages/contracts/src/utils/exchange_wrapper.ts +++ b/packages/contracts/src/utils/exchange_wrapper.ts @@ -221,7 +221,7 @@ export class ExchangeWrapper { ); return partialAmount; } - public async getTakerTokenFilledAmountAsync(orderHashHex: string): Promise { + public async getTakerAssetFilledAmountAsync(orderHashHex: string): Promise { const filledAmount = new BigNumber(await this._exchange.filled.callAsync(orderHashHex)); return filledAmount; } -- cgit