aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-utils/src
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-06-26 13:50:24 +0800
committerFabio Berger <me@fabioberger.com>2018-06-26 13:50:24 +0800
commitfb03003b3a9e7beb1054a50bad4320e60ca52e04 (patch)
tree0523a089bd8b70b2484778f02c42664d6e31b9d3 /packages/order-utils/src
parent8064914bb7f226c98d62357e29581238f0f765e4 (diff)
downloaddexon-sol-tools-fb03003b3a9e7beb1054a50bad4320e60ca52e04.tar
dexon-sol-tools-fb03003b3a9e7beb1054a50bad4320e60ca52e04.tar.gz
dexon-sol-tools-fb03003b3a9e7beb1054a50bad4320e60ca52e04.tar.bz2
dexon-sol-tools-fb03003b3a9e7beb1054a50bad4320e60ca52e04.tar.lz
dexon-sol-tools-fb03003b3a9e7beb1054a50bad4320e60ca52e04.tar.xz
dexon-sol-tools-fb03003b3a9e7beb1054a50bad4320e60ca52e04.tar.zst
dexon-sol-tools-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.ts3
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,