aboutsummaryrefslogtreecommitdiffstats
path: root/packages/assert/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/assert/src')
-rw-r--r--packages/assert/src/index.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/packages/assert/src/index.ts b/packages/assert/src/index.ts
index 56f663780..7ad574ec7 100644
--- a/packages/assert/src/index.ts
+++ b/packages/assert/src/index.ts
@@ -12,6 +12,8 @@ export const assert = {
},
isValidBaseUnitAmount(variableName: string, value: BigNumber) {
assert.isBigNumber(variableName, value);
+ const isNegative = value.lessThan(0);
+ this.assert(!isNegative, `${variableName} cannot be a negative number, found value: ${value.toNumber()}`);
const hasDecimals = value.decimalPlaces() !== 0;
this.assert(
!hasDecimals,