aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js/src
diff options
context:
space:
mode:
authorJacob Evans <jacob@dekz.net>2017-11-16 05:22:35 +0800
committerJacob Evans <jacob@dekz.net>2017-11-16 05:22:35 +0800
commit9133e764a504f07fd0059334abc5f31ee2c4c59c (patch)
tree60cba53f6f70b6cd7c458de8d87d7f366666ae5d /packages/0x.js/src
parentc32938fa43ef7ab538465e5eeade924b23776e6c (diff)
downloaddexon-sol-tools-9133e764a504f07fd0059334abc5f31ee2c4c59c.tar
dexon-sol-tools-9133e764a504f07fd0059334abc5f31ee2c4c59c.tar.gz
dexon-sol-tools-9133e764a504f07fd0059334abc5f31ee2c4c59c.tar.bz2
dexon-sol-tools-9133e764a504f07fd0059334abc5f31ee2c4c59c.tar.lz
dexon-sol-tools-9133e764a504f07fd0059334abc5f31ee2c4c59c.tar.xz
dexon-sol-tools-9133e764a504f07fd0059334abc5f31ee2c4c59c.tar.zst
dexon-sol-tools-9133e764a504f07fd0059334abc5f31ee2c4c59c.zip
Use 18 decimal place units
Diffstat (limited to 'packages/0x.js/src')
-rw-r--r--packages/0x.js/src/utils/order_state_utils.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/0x.js/src/utils/order_state_utils.ts b/packages/0x.js/src/utils/order_state_utils.ts
index d1b2feb43..c68eaf85d 100644
--- a/packages/0x.js/src/utils/order_state_utils.ts
+++ b/packages/0x.js/src/utils/order_state_utils.ts
@@ -116,12 +116,12 @@ export class OrderStateUtils {
return BigNumber.min(makerTransferrable, remainingMakerAmount);
}
const orderToFeeRatio = totalMakerAmount.dividedToIntegerBy(makerFee);
- console.log('order to fee ratio: ', orderToFeeRatio.toString());
let fillableTimesInMakerToken = makerTransferrable.dividedToIntegerBy(orderToFeeRatio);
const fillableTimesInFeeToken = BigNumber.min(makerFeeTransferrable, remainingMakerFee);
if (makerTokenAddress === zrxTokenAddress) {
fillableTimesInMakerToken = makerTransferrable.plus(makerFeeTransferrable)
- .dividedToIntegerBy(orderToFeeRatio.plus(new BigNumber(1)));
+ .dividedToIntegerBy(orderToFeeRatio.plus(
+ ZeroEx.toBaseUnitAmount(new BigNumber(1), 18)));
}
return BigNumber.min(fillableTimesInMakerToken.times(orderToFeeRatio),