OrderValidationUtils: don't parse fee asset data when there are no fees specified (#2218)

* exhibit bug: empty fee asset data induces revert

* fix bug: don't parse fee asset data unless fee>0

* Update DevUtils Kovan contract address
This commit is contained in:
F. Eugene Aumson
2019-09-30 17:53:21 -04:00
committed by GitHub
parent d21f978def
commit c051e11a49
3 changed files with 26 additions and 4 deletions

View File

@@ -86,9 +86,6 @@ contract OrderValidationUtils is
takerAssetAmount
);
} else {
// Get the transferable amount of the `makerFeeAsset`
uint256 transferableMakerFeeAssetAmount = getTransferableAssetAmount(makerAddress, order.makerFeeAssetData);
// If `makerFee` is 0, the % that can be filled is (transferableMakerAssetAmount / makerAssetAmount)
if (makerFee == 0) {
transferableTakerAssetAmount = LibMath.getPartialAmountFloor(
@@ -100,6 +97,9 @@ contract OrderValidationUtils is
// If `makerAsset` does not equal `makerFeeAsset`, the % that can be filled is the lower of
// (transferableMakerAssetAmount / makerAssetAmount) and (transferableMakerAssetFeeAmount / makerFee)
} else {
// Get the transferable amount of the `makerFeeAsset`
uint256 transferableMakerFeeAssetAmount = getTransferableAssetAmount(makerAddress, order.makerFeeAssetData);
uint256 transferableMakerToTakerAmount = LibMath.getPartialAmountFloor(
transferableMakerAssetAmount,
order.makerAssetAmount,