Addressed amir's review feedback

This commit is contained in:
Alex Towle 2020-02-13 15:47:40 -08:00
parent 79de188683
commit ae151df2eb
3 changed files with 19 additions and 20 deletions

View File

@ -120,12 +120,7 @@ contract OrderValidationUtils is
// Ensure that all of the asset data is valid. Fee asset data only needs
// to be valid if the fees are nonzero.
if (
!_isAssetDataValid(order.makerAssetData) ||
(order.makerFee != 0 && !_isAssetDataValid(order.makerFeeAssetData)) ||
!_isAssetDataValid(order.takerAssetData) ||
(order.takerFee != 0 && !_isAssetDataValid(order.takerFeeAssetData))
) {
if (!_areOrderAssetDatasValid(order)) {
fillableTakerAssetAmount = 0;
}
@ -207,6 +202,21 @@ contract OrderValidationUtils is
return transferableAssetAmount;
}
/// @dev Checks that the asset data contained in a ZeroEx is valid and returns
/// a boolean that indicates whether or not the asset data was found to be valid.
/// @param order A ZeroEx order to validate.
/// @return The validatity of the asset data.
function _areOrderAssetDatasValid(LibOrder.Order memory order)
internal
pure
returns (bool)
{
return _isAssetDataValid(order.makerAssetData) &&
(order.makerFee == 0 || _isAssetDataValid(order.makerFeeAssetData)) &&
_isAssetDataValid(order.takerAssetData) &&
(order.takerFee == 0 || _isAssetDataValid(order.takerFeeAssetData));
}
/// @dev This function handles the edge cases around taker validation. This function
/// currently attempts to find duplicate ERC721 token's in the taker
/// multiAssetData.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long