diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-26 13:50:24 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-26 13:50:24 +0800 |
commit | fb03003b3a9e7beb1054a50bad4320e60ca52e04 (patch) | |
tree | 0523a089bd8b70b2484778f02c42664d6e31b9d3 /packages/order-utils/src | |
parent | 8064914bb7f226c98d62357e29581238f0f765e4 (diff) | |
download | dexon-0x-contracts-fb03003b3a9e7beb1054a50bad4320e60ca52e04.tar.gz dexon-0x-contracts-fb03003b3a9e7beb1054a50bad4320e60ca52e04.tar.zst dexon-0x-contracts-fb03003b3a9e7beb1054a50bad4320e60ca52e04.zip |
Fix inconsistency between contract and reference implementation of order validation logic
Diffstat (limited to 'packages/order-utils/src')
-rw-r--r-- | packages/order-utils/src/order_validation_utils.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/order-utils/src/order_validation_utils.ts b/packages/order-utils/src/order_validation_utils.ts index 778556d6a..fb5143d03 100644 --- a/packages/order-utils/src/order_validation_utils.ts +++ b/packages/order-utils/src/order_validation_utils.ts @@ -143,6 +143,9 @@ export class OrderValidationUtils { if (fillTakerAssetAmount.eq(0)) { throw new Error(RevertReasons.InvalidTakerAmount); } + if (signedOrder.makerAssetAmount.eq(0) || signedOrder.takerAssetAmount.eq(0)) { + throw new Error(RevertReasons.OrderUnfillable); + } const orderHash = orderHashUtils.getOrderHashHex(signedOrder); const isValid = await isValidSignatureAsync( provider, |