From c3afc13dd660348e99b727c2dd01930eec8d99c3 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 14 Jan 2019 15:50:32 +0100 Subject: [PATCH 01/18] Upgrade bignumber.js version --- .../extensions/balance_threshold_filter.ts | 120 ++++++++--------- .../test/utils/forwarder_wrapper.ts | 2 +- .../protocol/test/asset_proxy/proxies.ts | 24 ++-- contracts/protocol/test/exchange/core.ts | 16 +-- .../protocol/test/exchange/dispatcher.ts | 2 +- contracts/protocol/test/exchange/internal.ts | 54 ++++---- .../protocol/test/exchange/transactions.ts | 22 ++-- contracts/protocol/test/exchange/wrapper.ts | 122 +++++++++--------- .../utils/fill_order_combinatorial_utils.ts | 6 +- .../protocol/test/utils/match_order_tester.ts | 24 ++-- contracts/test-utils/src/order_factory.ts | 2 +- contracts/test-utils/src/order_utils.ts | 4 +- packages/assert/src/index.ts | 2 +- .../src/utils/buy_quote_calculator.ts | 10 +- .../order_provider_response_processor.ts | 7 +- packages/asset-buyer/src/utils/order_utils.ts | 28 ++-- .../test/buy_quote_calculator_test.ts | 6 +- .../contract_wrappers/erc20_token_wrapper.ts | 6 +- ...set_balance_and_proxy_allowance_fetcher.ts | 4 +- .../src/utils/exchange_transfer_simulator.ts | 4 +- packages/contract-wrappers/src/utils/utils.ts | 6 +- .../test/ether_token_wrapper_test.ts | 6 +- packages/ethereum-types/package.json | 2 +- .../instant/src/components/order_details.tsx | 4 +- packages/instant/src/constants.ts | 2 +- .../selected_erc20_asset_amount_input.ts | 2 +- packages/instant/src/redux/async_data.ts | 2 +- packages/instant/src/util/asset.ts | 11 +- packages/instant/src/util/format.ts | 8 +- .../instant/src/util/gas_price_estimator.ts | 2 +- packages/instant/src/util/maybe_big_number.ts | 2 +- .../src/exchange_transfer_simulator.ts | 4 +- packages/order-utils/src/market_utils.ts | 4 +- packages/order-utils/src/order_state_utils.ts | 12 +- .../order-utils/src/order_validation_utils.ts | 8 +- packages/order-utils/src/rate_utils.ts | 6 +- .../src/remaining_fillable_calculator.ts | 6 +- packages/order-utils/src/salt.ts | 2 +- packages/order-utils/src/utils.ts | 6 +- .../remaining_fillable_calculator_test.ts | 2 +- .../order-utils/test/signature_utils_test.ts | 4 +- .../src/order_watcher/expiration_watcher.ts | 2 +- packages/order-watcher/src/utils/utils.ts | 2 +- .../order-watcher/test/order_watcher_test.ts | 6 +- .../utils/transformers/number_to_bigint.ts | 2 +- .../src/ts/dispense_asset_tasks.ts | 4 +- packages/testnet-faucets/src/ts/handler.ts | 2 +- packages/types/package.json | 2 +- packages/typescript-typings/package.json | 2 +- packages/utils/package.json | 2 +- .../src/abi_encoder/evm_data_types/bool.ts | 4 +- .../src/abi_encoder/evm_data_types/int.ts | 4 +- .../src/abi_encoder/evm_data_types/uint.ts | 2 +- packages/utils/src/abi_encoder/utils/math.ts | 8 +- packages/web3-wrapper/src/utils.ts | 2 +- packages/website/ts/blockchain.ts | 2 +- packages/website/ts/components/fill_order.tsx | 4 +- packages/website/ts/utils/utils.ts | 2 +- yarn.lock | 4 + 59 files changed, 314 insertions(+), 308 deletions(-) diff --git a/contracts/extensions/test/extensions/balance_threshold_filter.ts b/contracts/extensions/test/extensions/balance_threshold_filter.ts index a1c322e086..adeb7c422e 100644 --- a/contracts/extensions/test/extensions/balance_threshold_filter.ts +++ b/contracts/extensions/test/extensions/balance_threshold_filter.ts @@ -269,7 +269,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validMakerAddress][defaultMakerAssetAddress].minus(makerAssetFillAmount), ); expect(newBalances[validMakerAddress][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validMakerAddress][defaultTakerAssetAddress].add(takerAssetFillAmount), + erc20Balances[validMakerAddress][defaultTakerAssetAddress].plus(takerAssetFillAmount), ); expect(newBalances[validMakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validMakerAddress][zrxToken.address].minus(makerFeePaid), @@ -278,13 +278,13 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validTakerAddress][defaultTakerAssetAddress].minus(takerAssetFillAmount), ); expect(newBalances[validTakerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validTakerAddress][defaultMakerAssetAddress].add(makerAssetFillAmount), + erc20Balances[validTakerAddress][defaultMakerAssetAddress].plus(makerAssetFillAmount), ); expect(newBalances[validTakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validTakerAddress][zrxToken.address].minus(takerFeePaid), ); expect(newBalances[feeRecipientAddress][zrxToken.address]).to.be.bignumber.equal( - erc20Balances[feeRecipientAddress][zrxToken.address].add(makerFeePaid.add(takerFeePaid)), + erc20Balances[feeRecipientAddress][zrxToken.address].plus(makerFeePaid.plus(takerFeePaid)), ); }); it('should revert if the Exchange transaction function is not supported', async () => { @@ -357,7 +357,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validMakerAddress][defaultMakerAssetAddress].minus(makerAssetFillAmount), ); expect(newBalances[validMakerAddress][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validMakerAddress][defaultTakerAssetAddress].add(takerAssetFillAmount), + erc20Balances[validMakerAddress][defaultTakerAssetAddress].plus(takerAssetFillAmount), ); expect(newBalances[validMakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validMakerAddress][zrxToken.address].minus(makerFeePaid), @@ -367,7 +367,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validMakerAddress2][defaultMakerAssetAddress].minus(makerAssetFillAmount), ); expect(newBalances[validMakerAddress2][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validMakerAddress2][defaultTakerAssetAddress].add(takerAssetFillAmount), + erc20Balances[validMakerAddress2][defaultTakerAssetAddress].plus(takerAssetFillAmount), ); expect(newBalances[validMakerAddress2][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validMakerAddress2][zrxToken.address].minus(makerFeePaid), @@ -378,14 +378,14 @@ describe(ContractName.BalanceThresholdFilter, () => { ); expect(newBalances[validTakerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validTakerAddress][defaultMakerAssetAddress].add(makerAssetFillAmount.times(2)), + erc20Balances[validTakerAddress][defaultMakerAssetAddress].plus(makerAssetFillAmount.times(2)), ); expect(newBalances[validTakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validTakerAddress][zrxToken.address].minus(takerFeePaid), ); // Fee recipient expect(newBalances[feeRecipientAddress][zrxToken.address]).to.be.bignumber.equal( - erc20Balances[feeRecipientAddress][zrxToken.address].add(makerFeePaid.times(2).add(takerFeePaid)), + erc20Balances[feeRecipientAddress][zrxToken.address].plus(makerFeePaid.times(2).plus(takerFeePaid)), ); }); it('should revert if one maker does not meet the balance threshold', async () => { @@ -461,7 +461,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validMakerAddress][defaultMakerAssetAddress].minus(makerAssetFillAmount), ); expect(newBalances[validMakerAddress][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validMakerAddress][defaultTakerAssetAddress].add(takerAssetFillAmount), + erc20Balances[validMakerAddress][defaultTakerAssetAddress].plus(takerAssetFillAmount), ); expect(newBalances[validMakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validMakerAddress][zrxToken.address].minus(makerFeePaid), @@ -471,7 +471,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validMakerAddress2][defaultMakerAssetAddress].minus(makerAssetFillAmount), ); expect(newBalances[validMakerAddress2][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validMakerAddress2][defaultTakerAssetAddress].add(takerAssetFillAmount), + erc20Balances[validMakerAddress2][defaultTakerAssetAddress].plus(takerAssetFillAmount), ); expect(newBalances[validMakerAddress2][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validMakerAddress2][zrxToken.address].minus(makerFeePaid), @@ -482,14 +482,14 @@ describe(ContractName.BalanceThresholdFilter, () => { ); expect(newBalances[validTakerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validTakerAddress][defaultMakerAssetAddress].add(makerAssetFillAmount.times(2)), + erc20Balances[validTakerAddress][defaultMakerAssetAddress].plus(makerAssetFillAmount.times(2)), ); expect(newBalances[validTakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validTakerAddress][zrxToken.address].minus(takerFeePaid), ); // Fee recipient expect(newBalances[feeRecipientAddress][zrxToken.address]).to.be.bignumber.equal( - erc20Balances[feeRecipientAddress][zrxToken.address].add(makerFeePaid.times(2).add(takerFeePaid)), + erc20Balances[feeRecipientAddress][zrxToken.address].plus(makerFeePaid.times(2).plus(takerFeePaid)), ); }); it('should revert if one maker does not meet the balance threshold', async () => { @@ -559,7 +559,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validMakerAddress][defaultMakerAssetAddress].minus(makerAssetFillAmount), ); expect(newBalances[validMakerAddress][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validMakerAddress][defaultTakerAssetAddress].add(takerAssetFillAmount), + erc20Balances[validMakerAddress][defaultTakerAssetAddress].plus(takerAssetFillAmount), ); expect(newBalances[validMakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validMakerAddress][zrxToken.address].minus(makerFeePaid), @@ -569,7 +569,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validMakerAddress2][defaultMakerAssetAddress].minus(makerAssetFillAmount), ); expect(newBalances[validMakerAddress2][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validMakerAddress2][defaultTakerAssetAddress].add(takerAssetFillAmount), + erc20Balances[validMakerAddress2][defaultTakerAssetAddress].plus(takerAssetFillAmount), ); expect(newBalances[validMakerAddress2][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validMakerAddress2][zrxToken.address].minus(makerFeePaid), @@ -580,14 +580,14 @@ describe(ContractName.BalanceThresholdFilter, () => { ); expect(newBalances[validTakerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validTakerAddress][defaultMakerAssetAddress].add(makerAssetFillAmount.times(2)), + erc20Balances[validTakerAddress][defaultMakerAssetAddress].plus(makerAssetFillAmount.times(2)), ); expect(newBalances[validTakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validTakerAddress][zrxToken.address].minus(takerFeePaid), ); // Fee recipient expect(newBalances[feeRecipientAddress][zrxToken.address]).to.be.bignumber.equal( - erc20Balances[feeRecipientAddress][zrxToken.address].add(makerFeePaid.times(2).add(takerFeePaid)), + erc20Balances[feeRecipientAddress][zrxToken.address].plus(makerFeePaid.times(2).plus(takerFeePaid)), ); }); it('should revert if one maker does not meet the balance threshold', async () => { @@ -658,7 +658,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validMakerAddress][defaultMakerAssetAddress].minus(makerAssetFillAmount), ); expect(newBalances[validMakerAddress][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validMakerAddress][defaultTakerAssetAddress].add(takerAssetFillAmount), + erc20Balances[validMakerAddress][defaultTakerAssetAddress].plus(takerAssetFillAmount), ); expect(newBalances[validMakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validMakerAddress][zrxToken.address].minus(makerFeePaid), @@ -667,13 +667,13 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validTakerAddress][defaultTakerAssetAddress].minus(takerAssetFillAmount), ); expect(newBalances[validTakerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validTakerAddress][defaultMakerAssetAddress].add(makerAssetFillAmount), + erc20Balances[validTakerAddress][defaultMakerAssetAddress].plus(makerAssetFillAmount), ); expect(newBalances[validTakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validTakerAddress][zrxToken.address].minus(takerFeePaid), ); expect(newBalances[feeRecipientAddress][zrxToken.address]).to.be.bignumber.equal( - erc20Balances[feeRecipientAddress][zrxToken.address].add(makerFeePaid.add(takerFeePaid)), + erc20Balances[feeRecipientAddress][zrxToken.address].plus(makerFeePaid.plus(takerFeePaid)), ); }); it('should revert if maker does not meet the balance threshold', async () => { @@ -736,7 +736,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validMakerAddress][defaultMakerAssetAddress].minus(makerAssetFillAmount), ); expect(newBalances[validMakerAddress][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validMakerAddress][defaultTakerAssetAddress].add(takerAssetFillAmount), + erc20Balances[validMakerAddress][defaultTakerAssetAddress].plus(takerAssetFillAmount), ); expect(newBalances[validMakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validMakerAddress][zrxToken.address].minus(makerFeePaid), @@ -745,13 +745,13 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validTakerAddress][defaultTakerAssetAddress].minus(takerAssetFillAmount), ); expect(newBalances[validTakerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validTakerAddress][defaultMakerAssetAddress].add(makerAssetFillAmount), + erc20Balances[validTakerAddress][defaultMakerAssetAddress].plus(makerAssetFillAmount), ); expect(newBalances[validTakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validTakerAddress][zrxToken.address].minus(takerFeePaid), ); expect(newBalances[feeRecipientAddress][zrxToken.address]).to.be.bignumber.equal( - erc20Balances[feeRecipientAddress][zrxToken.address].add(makerFeePaid.add(takerFeePaid)), + erc20Balances[feeRecipientAddress][zrxToken.address].plus(makerFeePaid.plus(takerFeePaid)), ); }); it('should revert if maker does not meet the balance threshold', async () => { @@ -811,7 +811,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validMakerAddress][defaultMakerAssetAddress].minus(makerAssetFillAmount), ); expect(newBalances[validMakerAddress][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validMakerAddress][defaultTakerAssetAddress].add(takerAssetFillAmount_), + erc20Balances[validMakerAddress][defaultTakerAssetAddress].plus(takerAssetFillAmount_), ); expect(newBalances[validMakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validMakerAddress][zrxToken.address].minus(makerFeePaid), @@ -820,13 +820,13 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validTakerAddress][defaultTakerAssetAddress].minus(takerAssetFillAmount_), ); expect(newBalances[validTakerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validTakerAddress][defaultMakerAssetAddress].add(makerAssetFillAmount), + erc20Balances[validTakerAddress][defaultMakerAssetAddress].plus(makerAssetFillAmount), ); expect(newBalances[validTakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validTakerAddress][zrxToken.address].minus(takerFeePaid), ); expect(newBalances[feeRecipientAddress][zrxToken.address]).to.be.bignumber.equal( - erc20Balances[feeRecipientAddress][zrxToken.address].add(makerFeePaid.add(takerFeePaid)), + erc20Balances[feeRecipientAddress][zrxToken.address].plus(makerFeePaid.plus(takerFeePaid)), ); }); it('should revert if maker does not meet the balance threshold', async () => { @@ -904,7 +904,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validMakerAddress][defaultMakerAssetAddress].minus(validSignedOrder.makerAssetAmount), ); expect(newBalances[validMakerAddress][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validMakerAddress][defaultTakerAssetAddress].add(validSignedOrder.takerAssetAmount), + erc20Balances[validMakerAddress][defaultTakerAssetAddress].plus(validSignedOrder.takerAssetAmount), ); expect(newBalances[validMakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validMakerAddress][zrxToken.address].minus(validSignedOrder.makerFee), @@ -914,7 +914,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validMakerAddress2][defaultMakerAssetAddress].minus(makerAssetFillAmount2), ); expect(newBalances[validMakerAddress2][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validMakerAddress2][defaultTakerAssetAddress].add(takerAssetFillAmount), + erc20Balances[validMakerAddress2][defaultTakerAssetAddress].plus(takerAssetFillAmount), ); expect(newBalances[validMakerAddress2][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validMakerAddress2][zrxToken.address].minus(makerFeePaid2), @@ -924,7 +924,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validTakerAddress][defaultTakerAssetAddress].minus(cumulativeTakerAssetFillAmount), ); expect(newBalances[validTakerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validTakerAddress][defaultMakerAssetAddress].add(cumulativeMakerAssetFillAmount), + erc20Balances[validTakerAddress][defaultMakerAssetAddress].plus(cumulativeMakerAssetFillAmount), ); expect(newBalances[validTakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validTakerAddress][zrxToken.address].minus(takerFeePaid), @@ -932,9 +932,9 @@ describe(ContractName.BalanceThresholdFilter, () => { // Fee recipient expect(newBalances[feeRecipientAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[feeRecipientAddress][zrxToken.address] - .add(validSignedOrder.makerFee) - .add(makerFeePaid2) - .add(takerFeePaid), + .plus(validSignedOrder.makerFee) + .plus(makerFeePaid2) + .plus(takerFeePaid), ); }); it('should revert if one maker does not meet the balance threshold', async () => { @@ -1008,7 +1008,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validMakerAddress][defaultMakerAssetAddress].minus(validSignedOrder.makerAssetAmount), ); expect(newBalances[validMakerAddress][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validMakerAddress][defaultTakerAssetAddress].add(validSignedOrder.takerAssetAmount), + erc20Balances[validMakerAddress][defaultTakerAssetAddress].plus(validSignedOrder.takerAssetAmount), ); expect(newBalances[validMakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validMakerAddress][zrxToken.address].minus(validSignedOrder.makerFee), @@ -1018,7 +1018,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validMakerAddress2][defaultMakerAssetAddress].minus(makerAssetFillAmount2), ); expect(newBalances[validMakerAddress2][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validMakerAddress2][defaultTakerAssetAddress].add(takerAssetFillAmount), + erc20Balances[validMakerAddress2][defaultTakerAssetAddress].plus(takerAssetFillAmount), ); expect(newBalances[validMakerAddress2][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validMakerAddress2][zrxToken.address].minus(makerFeePaid2), @@ -1028,7 +1028,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validTakerAddress][defaultTakerAssetAddress].minus(cumulativeTakerAssetFillAmount), ); expect(newBalances[validTakerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validTakerAddress][defaultMakerAssetAddress].add(cumulativeMakerAssetFillAmount), + erc20Balances[validTakerAddress][defaultMakerAssetAddress].plus(cumulativeMakerAssetFillAmount), ); expect(newBalances[validTakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validTakerAddress][zrxToken.address].minus(takerFeePaid), @@ -1036,9 +1036,9 @@ describe(ContractName.BalanceThresholdFilter, () => { // Fee recipient expect(newBalances[feeRecipientAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[feeRecipientAddress][zrxToken.address] - .add(validSignedOrder.makerFee) - .add(makerFeePaid2) - .add(takerFeePaid), + .plus(validSignedOrder.makerFee) + .plus(makerFeePaid2) + .plus(takerFeePaid), ); }); it('should revert if one maker does not meet the balance threshold', async () => { @@ -1104,7 +1104,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validMakerAddress][defaultMakerAssetAddress].minus(validSignedOrder.makerAssetAmount), ); expect(newBalances[validMakerAddress][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validMakerAddress][defaultTakerAssetAddress].add(validSignedOrder.takerAssetAmount), + erc20Balances[validMakerAddress][defaultTakerAssetAddress].plus(validSignedOrder.takerAssetAmount), ); expect(newBalances[validMakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validMakerAddress][zrxToken.address].minus(validSignedOrder.makerFee), @@ -1114,7 +1114,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validMakerAddress2][defaultMakerAssetAddress].minus(makerAssetFillAmount2), ); expect(newBalances[validMakerAddress2][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validMakerAddress2][defaultTakerAssetAddress].add(takerAssetFillAmount), + erc20Balances[validMakerAddress2][defaultTakerAssetAddress].plus(takerAssetFillAmount), ); expect(newBalances[validMakerAddress2][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validMakerAddress2][zrxToken.address].minus(makerFeePaid2), @@ -1124,7 +1124,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validTakerAddress][defaultTakerAssetAddress].minus(cumulativeTakerAssetFillAmount), ); expect(newBalances[validTakerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validTakerAddress][defaultMakerAssetAddress].add(cumulativeMakerAssetFillAmount), + erc20Balances[validTakerAddress][defaultMakerAssetAddress].plus(cumulativeMakerAssetFillAmount), ); expect(newBalances[validTakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validTakerAddress][zrxToken.address].minus(takerFeePaid), @@ -1132,9 +1132,9 @@ describe(ContractName.BalanceThresholdFilter, () => { // Fee recipient expect(newBalances[feeRecipientAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[feeRecipientAddress][zrxToken.address] - .add(validSignedOrder.makerFee) - .add(makerFeePaid2) - .add(takerFeePaid), + .plus(validSignedOrder.makerFee) + .plus(makerFeePaid2) + .plus(takerFeePaid), ); }); it('should revert if one maker does not meet the balance threshold', async () => { @@ -1210,7 +1210,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validMakerAddress][defaultMakerAssetAddress].minus(validSignedOrder.makerAssetAmount), ); expect(newBalances[validMakerAddress][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validMakerAddress][defaultTakerAssetAddress].add(validSignedOrder.takerAssetAmount), + erc20Balances[validMakerAddress][defaultTakerAssetAddress].plus(validSignedOrder.takerAssetAmount), ); expect(newBalances[validMakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validMakerAddress][zrxToken.address].minus(validSignedOrder.makerFee), @@ -1220,7 +1220,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validMakerAddress2][defaultMakerAssetAddress].minus(makerAssetFillAmount2), ); expect(newBalances[validMakerAddress2][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validMakerAddress2][defaultTakerAssetAddress].add(takerAssetFillAmount), + erc20Balances[validMakerAddress2][defaultTakerAssetAddress].plus(takerAssetFillAmount), ); expect(newBalances[validMakerAddress2][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validMakerAddress2][zrxToken.address].minus(makerFeePaid2), @@ -1230,7 +1230,7 @@ describe(ContractName.BalanceThresholdFilter, () => { erc20Balances[validTakerAddress][defaultTakerAssetAddress].minus(cumulativeTakerAssetFillAmount), ); expect(newBalances[validTakerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[validTakerAddress][defaultMakerAssetAddress].add(cumulativeMakerAssetFillAmount), + erc20Balances[validTakerAddress][defaultMakerAssetAddress].plus(cumulativeMakerAssetFillAmount), ); expect(newBalances[validTakerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[validTakerAddress][zrxToken.address].minus(takerFeePaid), @@ -1238,9 +1238,9 @@ describe(ContractName.BalanceThresholdFilter, () => { // Fee recipient expect(newBalances[feeRecipientAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[feeRecipientAddress][zrxToken.address] - .add(validSignedOrder.makerFee) - .add(makerFeePaid2) - .add(takerFeePaid), + .plus(validSignedOrder.makerFee) + .plus(makerFeePaid2) + .plus(takerFeePaid), ); }); it('should revert if one maker does not meet the balance threshold', async () => { @@ -1329,7 +1329,7 @@ describe(ContractName.BalanceThresholdFilter, () => { newBalances[signedOrderLeft.makerAddress][defaultMakerAssetAddress], 'Checking left maker egress ERC20 account balance', ).to.be.bignumber.equal( - erc20Balances[signedOrderLeft.makerAddress][defaultMakerAssetAddress].sub( + erc20Balances[signedOrderLeft.makerAddress][defaultMakerAssetAddress].minus( expectedTransferAmounts.amountSoldByLeftMaker, ), ); @@ -1337,7 +1337,7 @@ describe(ContractName.BalanceThresholdFilter, () => { newBalances[signedOrderRight.makerAddress][defaultTakerAssetAddress], 'Checking right maker ingress ERC20 account balance', ).to.be.bignumber.equal( - erc20Balances[signedOrderRight.makerAddress][defaultTakerAssetAddress].sub( + erc20Balances[signedOrderRight.makerAddress][defaultTakerAssetAddress].minus( expectedTransferAmounts.amountSoldByRightMaker, ), ); @@ -1345,7 +1345,7 @@ describe(ContractName.BalanceThresholdFilter, () => { newBalances[validTakerAddress][defaultMakerAssetAddress], 'Checking taker ingress ERC20 account balance', ).to.be.bignumber.equal( - erc20Balances[validTakerAddress][defaultMakerAssetAddress].add( + erc20Balances[validTakerAddress][defaultMakerAssetAddress].plus( expectedTransferAmounts.amountReceivedByTaker, ), ); @@ -1353,7 +1353,7 @@ describe(ContractName.BalanceThresholdFilter, () => { newBalances[signedOrderLeft.makerAddress][defaultTakerAssetAddress], 'Checking left maker ingress ERC20 account balance', ).to.be.bignumber.equal( - erc20Balances[signedOrderLeft.makerAddress][defaultTakerAssetAddress].add( + erc20Balances[signedOrderLeft.makerAddress][defaultTakerAssetAddress].plus( expectedTransferAmounts.amountBoughtByLeftMaker, ), ); @@ -1361,7 +1361,7 @@ describe(ContractName.BalanceThresholdFilter, () => { newBalances[signedOrderRight.makerAddress][defaultMakerAssetAddress], 'Checking right maker egress ERC20 account balance', ).to.be.bignumber.equal( - erc20Balances[signedOrderRight.makerAddress][defaultMakerAssetAddress].add( + erc20Balances[signedOrderRight.makerAddress][defaultMakerAssetAddress].plus( expectedTransferAmounts.amountBoughtByRightMaker, ), ); @@ -1388,7 +1388,7 @@ describe(ContractName.BalanceThresholdFilter, () => { ).to.be.bignumber.equal( erc20Balances[validTakerAddress][zrxToken.address] .minus(expectedTransferAmounts.feePaidByTakerLeft) - .sub(expectedTransferAmounts.feePaidByTakerRight), + .minus(expectedTransferAmounts.feePaidByTakerRight), ); // Received fees expect( @@ -1396,10 +1396,10 @@ describe(ContractName.BalanceThresholdFilter, () => { 'Checking left fee recipient ingress ERC20 account fees', ).to.be.bignumber.equal( erc20Balances[feeRecipientAddress][zrxToken.address] - .add(expectedTransferAmounts.feePaidByLeftMaker) - .add(expectedTransferAmounts.feePaidByRightMaker) - .add(expectedTransferAmounts.feePaidByTakerLeft) - .add(expectedTransferAmounts.feePaidByTakerRight), + .plus(expectedTransferAmounts.feePaidByLeftMaker) + .plus(expectedTransferAmounts.feePaidByRightMaker) + .plus(expectedTransferAmounts.feePaidByTakerLeft) + .plus(expectedTransferAmounts.feePaidByTakerRight), ); }); it('should revert if left maker does not meet the balance threshold', async () => { @@ -1595,7 +1595,7 @@ describe(ContractName.BalanceThresholdFilter, () => { signedOrder, ); const saltAsBigNumber = new BigNumber(salt); - if (saltAsBigNumber.lessThanOrEqualTo(cancelOrdersUpToThisSalt)) { + if (saltAsBigNumber.isLessThanOrEqualTo(cancelOrdersUpToThisSalt)) { return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Cancelled); } else { return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Fillable); @@ -1631,7 +1631,7 @@ describe(ContractName.BalanceThresholdFilter, () => { signedOrder, ); const saltAsBigNumber = new BigNumber(salt); - if (saltAsBigNumber.lessThanOrEqualTo(cancelOrdersUpToThisSalt)) { + if (saltAsBigNumber.isLessThanOrEqualTo(cancelOrdersUpToThisSalt)) { return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Cancelled); } else { return expect(orderInfoAfterCancelling.orderStatus).to.be.equal(OrderStatus.Fillable); diff --git a/contracts/extensions/test/utils/forwarder_wrapper.ts b/contracts/extensions/test/utils/forwarder_wrapper.ts index 9e44ff6b90..4a43be04aa 100644 --- a/contracts/extensions/test/utils/forwarder_wrapper.ts +++ b/contracts/extensions/test/utils/forwarder_wrapper.ts @@ -29,7 +29,7 @@ export class ForwarderWrapper { feeOrder.takerAssetAmount .times(remainingFeeAmount) .dividedBy(feeAvailable) - .ceil(), + .integerValue(BigNumber.ROUND_CEIL), ); remainingFeeAmount = new BigNumber(0); } else if (!remainingFeeAmount.isZero()) { diff --git a/contracts/protocol/test/asset_proxy/proxies.ts b/contracts/protocol/test/asset_proxy/proxies.ts index bbb44f4021..c34be9c6a2 100644 --- a/contracts/protocol/test/asset_proxy/proxies.ts +++ b/contracts/protocol/test/asset_proxy/proxies.ts @@ -259,7 +259,7 @@ describe('Asset Transfer Proxies', () => { erc20Balances[fromAddress][erc20TokenA.address].minus(amount), ); expect(newBalances[toAddress][erc20TokenA.address]).to.be.bignumber.equal( - erc20Balances[toAddress][erc20TokenA.address].add(amount), + erc20Balances[toAddress][erc20TokenA.address].plus(amount), ); }); @@ -318,7 +318,7 @@ describe('Asset Transfer Proxies', () => { erc20Balances[fromAddress][erc20TokenA.address].minus(amount), ); expect(newBalances[toAddress][erc20TokenA.address]).to.be.bignumber.equal( - erc20Balances[toAddress][erc20TokenA.address].add(amount), + erc20Balances[toAddress][erc20TokenA.address].plus(amount), ); }); @@ -737,7 +737,7 @@ describe('Asset Transfer Proxies', () => { erc20Balances[fromAddress][erc20TokenA.address].minus(totalAmount), ); expect(newBalances[toAddress][erc20TokenA.address]).to.be.bignumber.equal( - erc20Balances[toAddress][erc20TokenA.address].add(totalAmount), + erc20Balances[toAddress][erc20TokenA.address].plus(totalAmount), ); }); it('should dispatch an ERC20 transfer when input amount is 0', async () => { @@ -800,7 +800,7 @@ describe('Asset Transfer Proxies', () => { erc20Balances[fromAddress][erc20TokenA.address].minus(totalAmount), ); expect(newBalances[toAddress][erc20TokenA.address]).to.be.bignumber.equal( - erc20Balances[toAddress][erc20TokenA.address].add(totalAmount), + erc20Balances[toAddress][erc20TokenA.address].plus(totalAmount), ); }); it('should successfully transfer multiple different ERC20 tokens', async () => { @@ -834,13 +834,13 @@ describe('Asset Transfer Proxies', () => { erc20Balances[fromAddress][erc20TokenA.address].minus(totalErc20AAmount), ); expect(newBalances[toAddress][erc20TokenA.address]).to.be.bignumber.equal( - erc20Balances[toAddress][erc20TokenA.address].add(totalErc20AAmount), + erc20Balances[toAddress][erc20TokenA.address].plus(totalErc20AAmount), ); expect(newBalances[fromAddress][erc20TokenB.address]).to.be.bignumber.equal( erc20Balances[fromAddress][erc20TokenB.address].minus(totalErc20BAmount), ); expect(newBalances[toAddress][erc20TokenB.address]).to.be.bignumber.equal( - erc20Balances[toAddress][erc20TokenB.address].add(totalErc20BAmount), + erc20Balances[toAddress][erc20TokenB.address].plus(totalErc20BAmount), ); }); it('should transfer a single ERC721 token', async () => { @@ -970,7 +970,7 @@ describe('Asset Transfer Proxies', () => { erc20Balances[fromAddress][erc20TokenA.address].minus(totalAmount), ); expect(newBalances[toAddress][erc20TokenA.address]).to.be.bignumber.equal( - erc20Balances[toAddress][erc20TokenA.address].add(totalAmount), + erc20Balances[toAddress][erc20TokenA.address].plus(totalAmount), ); const newOwnerFromAsset = await erc721TokenA.ownerOf.callAsync(erc721AFromTokenId); expect(newOwnerFromAsset).to.be.equal(toAddress); @@ -1008,7 +1008,7 @@ describe('Asset Transfer Proxies', () => { erc20Balances[fromAddress][erc20TokenA.address].minus(totalAmount), ); expect(newBalances[toAddress][erc20TokenA.address]).to.be.bignumber.equal( - erc20Balances[toAddress][erc20TokenA.address].add(totalAmount), + erc20Balances[toAddress][erc20TokenA.address].plus(totalAmount), ); const newOwnerFromAsset = await erc721TokenA.ownerOf.callAsync(erc721AFromTokenId); expect(newOwnerFromAsset).to.be.equal(toAddress); @@ -1044,13 +1044,13 @@ describe('Asset Transfer Proxies', () => { erc20Balances[fromAddress][erc20TokenA.address].minus(totalErc20AAmount), ); expect(newBalances[toAddress][erc20TokenA.address]).to.be.bignumber.equal( - erc20Balances[toAddress][erc20TokenA.address].add(totalErc20AAmount), + erc20Balances[toAddress][erc20TokenA.address].plus(totalErc20AAmount), ); expect(newBalances[fromAddress][erc20TokenB.address]).to.be.bignumber.equal( erc20Balances[fromAddress][erc20TokenB.address].minus(totalErc20BAmount), ); expect(newBalances[toAddress][erc20TokenB.address]).to.be.bignumber.equal( - erc20Balances[toAddress][erc20TokenB.address].add(totalErc20BAmount), + erc20Balances[toAddress][erc20TokenB.address].plus(totalErc20BAmount), ); }); it('should successfully transfer a large amount of tokens', async () => { @@ -1122,13 +1122,13 @@ describe('Asset Transfer Proxies', () => { erc20Balances[fromAddress][erc20TokenA.address].minus(totalErc20AAmount), ); expect(newBalances[toAddress][erc20TokenA.address]).to.be.bignumber.equal( - erc20Balances[toAddress][erc20TokenA.address].add(totalErc20AAmount), + erc20Balances[toAddress][erc20TokenA.address].plus(totalErc20AAmount), ); expect(newBalances[fromAddress][erc20TokenB.address]).to.be.bignumber.equal( erc20Balances[fromAddress][erc20TokenB.address].minus(totalErc20BAmount), ); expect(newBalances[toAddress][erc20TokenB.address]).to.be.bignumber.equal( - erc20Balances[toAddress][erc20TokenB.address].add(totalErc20BAmount), + erc20Balances[toAddress][erc20TokenB.address].plus(totalErc20BAmount), ); }); it('should revert if a single transfer fails', async () => { diff --git a/contracts/protocol/test/exchange/core.ts b/contracts/protocol/test/exchange/core.ts index 700643b797..f88be1c94a 100644 --- a/contracts/protocol/test/exchange/core.ts +++ b/contracts/protocol/test/exchange/core.ts @@ -538,7 +538,7 @@ describe('Exchange core', () => { it('should throw if order is expired', async () => { const currentTimestamp = await getLatestBlockTimestampAsync(); signedOrder = await orderFactory.newSignedOrderAsync({ - expirationTimeSeconds: new BigNumber(currentTimestamp).sub(10), + expirationTimeSeconds: new BigNumber(currentTimestamp).minus(10), }); return expectTransactionFailedAsync( exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress), @@ -625,15 +625,15 @@ describe('Exchange core', () => { }); const newBalances = await erc20Wrapper.getBalancesAsync(); - const fillMakerAssetAmount = signedOrders[2].makerAssetAmount.add(signedOrders[3].makerAssetAmount); - const fillTakerAssetAmount = signedOrders[2].takerAssetAmount.add(signedOrders[3].takerAssetAmount); - const makerFee = signedOrders[2].makerFee.add(signedOrders[3].makerFee); - const takerFee = signedOrders[2].takerFee.add(signedOrders[3].takerFee); + const fillMakerAssetAmount = signedOrders[2].makerAssetAmount.plus(signedOrders[3].makerAssetAmount); + const fillTakerAssetAmount = signedOrders[2].takerAssetAmount.plus(signedOrders[3].takerAssetAmount); + const makerFee = signedOrders[2].makerFee.plus(signedOrders[3].makerFee); + const takerFee = signedOrders[2].takerFee.plus(signedOrders[3].takerFee); expect(newBalances[makerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( erc20Balances[makerAddress][defaultMakerAssetAddress].minus(fillMakerAssetAmount), ); expect(newBalances[makerAddress][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[makerAddress][defaultTakerAssetAddress].add(fillTakerAssetAmount), + erc20Balances[makerAddress][defaultTakerAssetAddress].plus(fillTakerAssetAmount), ); expect(newBalances[makerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[makerAddress][zrxToken.address].minus(makerFee), @@ -642,13 +642,13 @@ describe('Exchange core', () => { erc20Balances[takerAddress][defaultTakerAssetAddress].minus(fillTakerAssetAmount), ); expect(newBalances[takerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[takerAddress][defaultMakerAssetAddress].add(fillMakerAssetAmount), + erc20Balances[takerAddress][defaultMakerAssetAddress].plus(fillMakerAssetAmount), ); expect(newBalances[takerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[takerAddress][zrxToken.address].minus(takerFee), ); expect(newBalances[feeRecipientAddress][zrxToken.address]).to.be.bignumber.equal( - erc20Balances[feeRecipientAddress][zrxToken.address].add(makerFee.add(takerFee)), + erc20Balances[feeRecipientAddress][zrxToken.address].plus(makerFee.plus(takerFee)), ); }); }); diff --git a/contracts/protocol/test/exchange/dispatcher.ts b/contracts/protocol/test/exchange/dispatcher.ts index 5b1ac1e200..eca1b38f18 100644 --- a/contracts/protocol/test/exchange/dispatcher.ts +++ b/contracts/protocol/test/exchange/dispatcher.ts @@ -205,7 +205,7 @@ describe('AssetProxyDispatcher', () => { erc20Balances[makerAddress][zrxToken.address].minus(amount), ); expect(newBalances[takerAddress][zrxToken.address]).to.be.bignumber.equal( - erc20Balances[takerAddress][zrxToken.address].add(amount), + erc20Balances[takerAddress][zrxToken.address].plus(amount), ); }); diff --git a/contracts/protocol/test/exchange/internal.ts b/contracts/protocol/test/exchange/internal.ts index 972f5efb66..6ff1fdc2f8 100644 --- a/contracts/protocol/test/exchange/internal.ts +++ b/contracts/protocol/test/exchange/internal.ts @@ -90,14 +90,14 @@ describe('Exchange core internal functions', () => { if (target.eq(0)) { return false; } - const product = numerator.mul(target); + const product = numerator.multipliedBy(target); const remainder = product.mod(denominator); - const remainderTimes1000 = remainder.mul('1000'); + const remainderTimes1000 = remainder.multipliedBy('1000'); const isError = remainderTimes1000.gte(product); - if (product.greaterThan(MAX_UINT256)) { + if (product.isGreaterThan(MAX_UINT256)) { throw overflowErrorForCall; } - if (remainderTimes1000.greaterThan(MAX_UINT256)) { + if (remainderTimes1000.isGreaterThan(MAX_UINT256)) { throw overflowErrorForCall; } return isError; @@ -117,15 +117,15 @@ describe('Exchange core internal functions', () => { if (target.eq(0)) { return false; } - const product = numerator.mul(target); + const product = numerator.multipliedBy(target); const remainder = product.mod(denominator); - const error = denominator.sub(remainder).mod(denominator); - const errorTimes1000 = error.mul('1000'); + const error = denominator.minus(remainder).mod(denominator); + const errorTimes1000 = error.multipliedBy('1000'); const isError = errorTimes1000.gte(product); - if (product.greaterThan(MAX_UINT256)) { + if (product.isGreaterThan(MAX_UINT256)) { throw overflowErrorForCall; } - if (errorTimes1000.greaterThan(MAX_UINT256)) { + if (errorTimes1000.isGreaterThan(MAX_UINT256)) { throw overflowErrorForCall; } return isError; @@ -143,8 +143,8 @@ describe('Exchange core internal functions', () => { if (isRoundingError) { throw roundingErrorForCall; } - const product = numerator.mul(target); - if (product.greaterThan(MAX_UINT256)) { + const product = numerator.multipliedBy(target); + if (product.isGreaterThan(MAX_UINT256)) { throw overflowErrorForCall; } return product.dividedToIntegerBy(denominator); @@ -177,8 +177,8 @@ describe('Exchange core internal functions', () => { _.cloneDeep(totalFillResults), singleFillResults, (totalVal: BigNumber, singleVal: BigNumber) => { - const newTotal = totalVal.add(singleVal); - if (newTotal.greaterThan(MAX_UINT256)) { + const newTotal = totalVal.plus(singleVal); + if (newTotal.isGreaterThan(MAX_UINT256)) { throw overflowErrorForCall; } return newTotal; @@ -271,8 +271,8 @@ describe('Exchange core internal functions', () => { if (denominator.eq(0)) { throw divisionByZeroErrorForCall; } - const product = numerator.mul(target); - if (product.greaterThan(MAX_UINT256)) { + const product = numerator.multipliedBy(target); + if (product.isGreaterThan(MAX_UINT256)) { throw overflowErrorForCall; } return product.dividedToIntegerBy(denominator); @@ -301,16 +301,16 @@ describe('Exchange core internal functions', () => { if (denominator.eq(0)) { throw divisionByZeroErrorForCall; } - const product = numerator.mul(target); - const offset = product.add(denominator.sub(1)); - if (offset.greaterThan(MAX_UINT256)) { + const product = numerator.multipliedBy(target); + const offset = product.plus(denominator.minus(1)); + if (offset.isGreaterThan(MAX_UINT256)) { throw overflowErrorForCall; } const result = offset.dividedToIntegerBy(denominator); if (product.mod(denominator).eq(0)) { - expect(result.mul(denominator)).to.be.bignumber.eq(product); + expect(result.multipliedBy(denominator)).to.be.bignumber.eq(product); } else { - expect(result.mul(denominator)).to.be.bignumber.gt(product); + expect(result.multipliedBy(denominator)).to.be.bignumber.gt(product); } return result; } @@ -358,16 +358,16 @@ describe('Exchange core internal functions', () => { if (isRoundingError) { throw roundingErrorForCall; } - const product = numerator.mul(target); - const offset = product.add(denominator.sub(1)); - if (offset.greaterThan(MAX_UINT256)) { + const product = numerator.multipliedBy(target); + const offset = product.plus(denominator.minus(1)); + if (offset.isGreaterThan(MAX_UINT256)) { throw overflowErrorForCall; } const result = offset.dividedToIntegerBy(denominator); if (product.mod(denominator).eq(0)) { - expect(result.mul(denominator)).to.be.bignumber.eq(product); + expect(result.multipliedBy(denominator)).to.be.bignumber.eq(product); } else { - expect(result.mul(denominator)).to.be.bignumber.gt(product); + expect(result.multipliedBy(denominator)).to.be.bignumber.gt(product); } return result; } @@ -433,8 +433,8 @@ describe('Exchange core internal functions', () => { // tslint:disable-next-line:no-unused-variable orderHash: string, ): Promise { - const totalFilledAmount = takerAssetFilledAmount.add(orderTakerAssetFilledAmount); - if (totalFilledAmount.greaterThan(MAX_UINT256)) { + const totalFilledAmount = takerAssetFilledAmount.plus(orderTakerAssetFilledAmount); + if (totalFilledAmount.isGreaterThan(MAX_UINT256)) { throw overflowErrorForSendTransaction; } return totalFilledAmount; diff --git a/contracts/protocol/test/exchange/transactions.ts b/contracts/protocol/test/exchange/transactions.ts index 746f3cb04e..e8c775f3e3 100644 --- a/contracts/protocol/test/exchange/transactions.ts +++ b/contracts/protocol/test/exchange/transactions.ts @@ -160,7 +160,7 @@ describe('Exchange transactions', () => { erc20Balances[makerAddress][defaultMakerTokenAddress].minus(makerAssetFillAmount), ); expect(newBalances[makerAddress][defaultTakerTokenAddress]).to.be.bignumber.equal( - erc20Balances[makerAddress][defaultTakerTokenAddress].add(takerAssetFillAmount), + erc20Balances[makerAddress][defaultTakerTokenAddress].plus(takerAssetFillAmount), ); expect(newBalances[makerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[makerAddress][zrxToken.address].minus(makerFeePaid), @@ -169,13 +169,13 @@ describe('Exchange transactions', () => { erc20Balances[takerAddress][defaultTakerTokenAddress].minus(takerAssetFillAmount), ); expect(newBalances[takerAddress][defaultMakerTokenAddress]).to.be.bignumber.equal( - erc20Balances[takerAddress][defaultMakerTokenAddress].add(makerAssetFillAmount), + erc20Balances[takerAddress][defaultMakerTokenAddress].plus(makerAssetFillAmount), ); expect(newBalances[takerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[takerAddress][zrxToken.address].minus(takerFeePaid), ); expect(newBalances[feeRecipientAddress][zrxToken.address]).to.be.bignumber.equal( - erc20Balances[feeRecipientAddress][zrxToken.address].add(makerFeePaid.add(takerFeePaid)), + erc20Balances[feeRecipientAddress][zrxToken.address].plus(makerFeePaid.plus(takerFeePaid)), ); }); @@ -234,7 +234,7 @@ describe('Exchange transactions', () => { senderAddress: exchangeWrapperContract.address, salt: orderSalt, }); - const targetOrderEpoch = orderSalt.add(1); + const targetOrderEpoch = orderSalt.plus(1); const cancelData = exchange.cancelOrdersUpTo.getABIEncodedTransactionData(targetOrderEpoch); const signedCancelTx = makerTransactionFactory.newSignedTransaction(cancelData); await exchangeWrapperContract.cancelOrdersUpTo.sendTransactionAsync( @@ -273,7 +273,7 @@ describe('Exchange transactions', () => { senderAddress: exchangeWrapperContract.address, salt: orderSalt, }); - const targetOrderEpoch = orderSalt.add(1); + const targetOrderEpoch = orderSalt.plus(1); await exchangeWrapper.cancelOrdersUpToAsync(targetOrderEpoch, makerAddress); erc20Balances = await erc20Wrapper.getBalancesAsync(); @@ -308,7 +308,7 @@ describe('Exchange transactions', () => { erc20Balances[makerAddress][defaultMakerTokenAddress].minus(makerAssetFillAmount), ); expect(newBalances[makerAddress][defaultTakerTokenAddress]).to.be.bignumber.equal( - erc20Balances[makerAddress][defaultTakerTokenAddress].add(takerAssetFillAmount), + erc20Balances[makerAddress][defaultTakerTokenAddress].plus(takerAssetFillAmount), ); expect(newBalances[makerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[makerAddress][zrxToken.address].minus(makerFeePaid), @@ -317,13 +317,13 @@ describe('Exchange transactions', () => { erc20Balances[takerAddress][defaultTakerTokenAddress].minus(takerAssetFillAmount), ); expect(newBalances[takerAddress][defaultMakerTokenAddress]).to.be.bignumber.equal( - erc20Balances[takerAddress][defaultMakerTokenAddress].add(makerAssetFillAmount), + erc20Balances[takerAddress][defaultMakerTokenAddress].plus(makerAssetFillAmount), ); expect(newBalances[takerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[takerAddress][zrxToken.address].minus(takerFeePaid), ); expect(newBalances[feeRecipientAddress][zrxToken.address]).to.be.bignumber.equal( - erc20Balances[feeRecipientAddress][zrxToken.address].add(makerFeePaid.add(takerFeePaid)), + erc20Balances[feeRecipientAddress][zrxToken.address].plus(makerFeePaid.plus(takerFeePaid)), ); }); }); @@ -444,7 +444,7 @@ describe('Exchange transactions', () => { erc20Balances[makerAddress][defaultMakerTokenAddress].minus(makerAssetFillAmount), ); expect(newBalances[makerAddress][defaultTakerTokenAddress]).to.be.bignumber.equal( - erc20Balances[makerAddress][defaultTakerTokenAddress].add(takerAssetFillAmount), + erc20Balances[makerAddress][defaultTakerTokenAddress].plus(takerAssetFillAmount), ); expect(newBalances[makerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[makerAddress][zrxToken.address].minus(makerFeePaid), @@ -453,13 +453,13 @@ describe('Exchange transactions', () => { erc20Balances[takerAddress][defaultTakerTokenAddress].minus(takerAssetFillAmount), ); expect(newBalances[takerAddress][defaultMakerTokenAddress]).to.be.bignumber.equal( - erc20Balances[takerAddress][defaultMakerTokenAddress].add(makerAssetFillAmount), + erc20Balances[takerAddress][defaultMakerTokenAddress].plus(makerAssetFillAmount), ); expect(newBalances[takerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[takerAddress][zrxToken.address].minus(takerFeePaid), ); expect(newBalances[feeRecipientAddress][zrxToken.address]).to.be.bignumber.equal( - erc20Balances[feeRecipientAddress][zrxToken.address].add(makerFeePaid.add(takerFeePaid)), + erc20Balances[feeRecipientAddress][zrxToken.address].plus(makerFeePaid.plus(takerFeePaid)), ); }); }); diff --git a/contracts/protocol/test/exchange/wrapper.ts b/contracts/protocol/test/exchange/wrapper.ts index 4c45069453..32ec647166 100644 --- a/contracts/protocol/test/exchange/wrapper.ts +++ b/contracts/protocol/test/exchange/wrapper.ts @@ -189,7 +189,7 @@ describe('Exchange wrappers', () => { erc20Balances[makerAddress][defaultMakerAssetAddress].minus(makerAssetFilledAmount), ); expect(newBalances[makerAddress][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[makerAddress][defaultTakerAssetAddress].add(takerAssetFillAmount), + erc20Balances[makerAddress][defaultTakerAssetAddress].plus(takerAssetFillAmount), ); expect(newBalances[makerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[makerAddress][zrxToken.address].minus(makerFee), @@ -198,20 +198,20 @@ describe('Exchange wrappers', () => { erc20Balances[takerAddress][defaultTakerAssetAddress].minus(takerAssetFillAmount), ); expect(newBalances[takerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[takerAddress][defaultMakerAssetAddress].add(makerAssetFilledAmount), + erc20Balances[takerAddress][defaultMakerAssetAddress].plus(makerAssetFilledAmount), ); expect(newBalances[takerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[takerAddress][zrxToken.address].minus(takerFee), ); expect(newBalances[feeRecipientAddress][zrxToken.address]).to.be.bignumber.equal( - erc20Balances[feeRecipientAddress][zrxToken.address].add(makerFee.add(takerFee)), + erc20Balances[feeRecipientAddress][zrxToken.address].plus(makerFee.plus(takerFee)), ); }); it('should throw if a signedOrder is expired', async () => { const currentTimestamp = await getLatestBlockTimestampAsync(); const signedOrder = await orderFactory.newSignedOrderAsync({ - expirationTimeSeconds: new BigNumber(currentTimestamp).sub(10), + expirationTimeSeconds: new BigNumber(currentTimestamp).minus(10), }); return expectTransactionFailedAsync( @@ -284,7 +284,7 @@ describe('Exchange wrappers', () => { erc20Balances[makerAddress][defaultMakerAssetAddress].minus(makerAssetFilledAmount), ); expect(newBalances[makerAddress][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[makerAddress][defaultTakerAssetAddress].add(takerAssetFillAmount), + erc20Balances[makerAddress][defaultTakerAssetAddress].plus(takerAssetFillAmount), ); expect(newBalances[makerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[makerAddress][zrxToken.address].minus(makerFee), @@ -293,13 +293,13 @@ describe('Exchange wrappers', () => { erc20Balances[takerAddress][defaultTakerAssetAddress].minus(takerAssetFillAmount), ); expect(newBalances[takerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[takerAddress][defaultMakerAssetAddress].add(makerAssetFilledAmount), + erc20Balances[takerAddress][defaultMakerAssetAddress].plus(makerAssetFilledAmount), ); expect(newBalances[takerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[takerAddress][zrxToken.address].minus(takerFee), ); expect(newBalances[feeRecipientAddress][zrxToken.address]).to.be.bignumber.equal( - erc20Balances[feeRecipientAddress][zrxToken.address].add(makerFee.add(takerFee)), + erc20Balances[feeRecipientAddress][zrxToken.address].plus(makerFee.plus(takerFee)), ); }); @@ -493,13 +493,13 @@ describe('Exchange wrappers', () => { erc20Balances[makerAddress][makerAssetAddress] = erc20Balances[makerAddress][ makerAssetAddress ].minus(makerAssetFilledAmount); - erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][takerAssetAddress].add( + erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][takerAssetAddress].plus( takerAssetFillAmount, ); erc20Balances[makerAddress][zrxToken.address] = erc20Balances[makerAddress][zrxToken.address].minus( makerFee, ); - erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][makerAssetAddress].add( + erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][makerAssetAddress].plus( makerAssetFilledAmount, ); erc20Balances[takerAddress][takerAssetAddress] = erc20Balances[takerAddress][ @@ -510,7 +510,7 @@ describe('Exchange wrappers', () => { ); erc20Balances[feeRecipientAddress][zrxToken.address] = erc20Balances[feeRecipientAddress][ zrxToken.address - ].add(makerFee.add(takerFee)); + ].plus(makerFee.plus(takerFee)); }); await exchangeWrapper.batchFillOrdersAsync(signedOrders, takerAddress, { @@ -562,13 +562,13 @@ describe('Exchange wrappers', () => { erc20Balances[makerAddress][makerAssetAddress] = erc20Balances[makerAddress][ makerAssetAddress ].minus(makerAssetFilledAmount); - erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][takerAssetAddress].add( + erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][takerAssetAddress].plus( takerAssetFillAmount, ); erc20Balances[makerAddress][zrxToken.address] = erc20Balances[makerAddress][zrxToken.address].minus( makerFee, ); - erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][makerAssetAddress].add( + erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][makerAssetAddress].plus( makerAssetFilledAmount, ); erc20Balances[takerAddress][takerAssetAddress] = erc20Balances[takerAddress][ @@ -579,7 +579,7 @@ describe('Exchange wrappers', () => { ); erc20Balances[feeRecipientAddress][zrxToken.address] = erc20Balances[feeRecipientAddress][ zrxToken.address - ].add(makerFee.add(takerFee)); + ].plus(makerFee.plus(takerFee)); }); await exchangeWrapper.batchFillOrKillOrdersAsync(signedOrders, takerAddress, { @@ -647,13 +647,13 @@ describe('Exchange wrappers', () => { erc20Balances[makerAddress][makerAssetAddress] = erc20Balances[makerAddress][ makerAssetAddress ].minus(makerAssetFilledAmount); - erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][takerAssetAddress].add( + erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][takerAssetAddress].plus( takerAssetFillAmount, ); erc20Balances[makerAddress][zrxToken.address] = erc20Balances[makerAddress][zrxToken.address].minus( makerFee, ); - erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][makerAssetAddress].add( + erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][makerAssetAddress].plus( makerAssetFilledAmount, ); erc20Balances[takerAddress][takerAssetAddress] = erc20Balances[takerAddress][ @@ -664,7 +664,7 @@ describe('Exchange wrappers', () => { ); erc20Balances[feeRecipientAddress][zrxToken.address] = erc20Balances[feeRecipientAddress][ zrxToken.address - ].add(makerFee.add(takerFee)); + ].plus(makerFee.plus(takerFee)); }); await exchangeWrapper.batchFillOrdersNoThrowAsync(signedOrders, takerAddress, { @@ -706,13 +706,13 @@ describe('Exchange wrappers', () => { erc20Balances[makerAddress][makerAssetAddress] = erc20Balances[makerAddress][ makerAssetAddress ].minus(makerAssetFilledAmount); - erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][takerAssetAddress].add( + erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][takerAssetAddress].plus( takerAssetFillAmount, ); erc20Balances[makerAddress][zrxToken.address] = erc20Balances[makerAddress][zrxToken.address].minus( makerFee, ); - erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][makerAssetAddress].add( + erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][makerAssetAddress].plus( makerAssetFilledAmount, ); erc20Balances[takerAddress][takerAssetAddress] = erc20Balances[takerAddress][ @@ -723,7 +723,7 @@ describe('Exchange wrappers', () => { ); erc20Balances[feeRecipientAddress][zrxToken.address] = erc20Balances[feeRecipientAddress][ zrxToken.address - ].add(makerFee.add(takerFee)); + ].plus(makerFee.plus(takerFee)); }); const newOrders = [invalidOrder, ...validOrders]; @@ -773,16 +773,16 @@ describe('Exchange wrappers', () => { const newBalances = await erc20Wrapper.getBalancesAsync(); - const makerAssetFilledAmount = signedOrders[0].makerAssetAmount.add( + const makerAssetFilledAmount = signedOrders[0].makerAssetAmount.plus( signedOrders[1].makerAssetAmount.dividedToIntegerBy(2), ); - const makerFee = signedOrders[0].makerFee.add(signedOrders[1].makerFee.dividedToIntegerBy(2)); - const takerFee = signedOrders[0].takerFee.add(signedOrders[1].takerFee.dividedToIntegerBy(2)); + const makerFee = signedOrders[0].makerFee.plus(signedOrders[1].makerFee.dividedToIntegerBy(2)); + const takerFee = signedOrders[0].takerFee.plus(signedOrders[1].takerFee.dividedToIntegerBy(2)); expect(newBalances[makerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( erc20Balances[makerAddress][defaultMakerAssetAddress].minus(makerAssetFilledAmount), ); expect(newBalances[makerAddress][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[makerAddress][defaultTakerAssetAddress].add(takerAssetFillAmount), + erc20Balances[makerAddress][defaultTakerAssetAddress].plus(takerAssetFillAmount), ); expect(newBalances[makerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[makerAddress][zrxToken.address].minus(makerFee), @@ -791,13 +791,13 @@ describe('Exchange wrappers', () => { erc20Balances[takerAddress][defaultTakerAssetAddress].minus(takerAssetFillAmount), ); expect(newBalances[takerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[takerAddress][defaultMakerAssetAddress].add(makerAssetFilledAmount), + erc20Balances[takerAddress][defaultMakerAssetAddress].plus(makerAssetFilledAmount), ); expect(newBalances[takerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[takerAddress][zrxToken.address].minus(takerFee), ); expect(newBalances[feeRecipientAddress][zrxToken.address]).to.be.bignumber.equal( - erc20Balances[feeRecipientAddress][zrxToken.address].add(makerFee.add(takerFee)), + erc20Balances[feeRecipientAddress][zrxToken.address].plus(makerFee.plus(takerFee)), ); }); @@ -809,13 +809,13 @@ describe('Exchange wrappers', () => { ].minus(signedOrder.makerAssetAmount); erc20Balances[makerAddress][defaultTakerAssetAddress] = erc20Balances[makerAddress][ defaultTakerAssetAddress - ].add(signedOrder.takerAssetAmount); + ].plus(signedOrder.takerAssetAmount); erc20Balances[makerAddress][zrxToken.address] = erc20Balances[makerAddress][zrxToken.address].minus( signedOrder.makerFee, ); erc20Balances[takerAddress][defaultMakerAssetAddress] = erc20Balances[takerAddress][ defaultMakerAssetAddress - ].add(signedOrder.makerAssetAmount); + ].plus(signedOrder.makerAssetAmount); erc20Balances[takerAddress][defaultTakerAssetAddress] = erc20Balances[takerAddress][ defaultTakerAssetAddress ].minus(signedOrder.takerAssetAmount); @@ -824,7 +824,7 @@ describe('Exchange wrappers', () => { ); erc20Balances[feeRecipientAddress][zrxToken.address] = erc20Balances[feeRecipientAddress][ zrxToken.address - ].add(signedOrder.makerFee.add(signedOrder.takerFee)); + ].plus(signedOrder.makerFee.plus(signedOrder.takerFee)); }); await exchangeWrapper.marketSellOrdersAsync(signedOrders, takerAddress, { takerAssetFillAmount, @@ -890,16 +890,16 @@ describe('Exchange wrappers', () => { const newBalances = await erc20Wrapper.getBalancesAsync(); - const makerAssetFilledAmount = signedOrders[0].makerAssetAmount.add( + const makerAssetFilledAmount = signedOrders[0].makerAssetAmount.plus( signedOrders[1].makerAssetAmount.dividedToIntegerBy(2), ); - const makerFee = signedOrders[0].makerFee.add(signedOrders[1].makerFee.dividedToIntegerBy(2)); - const takerFee = signedOrders[0].takerFee.add(signedOrders[1].takerFee.dividedToIntegerBy(2)); + const makerFee = signedOrders[0].makerFee.plus(signedOrders[1].makerFee.dividedToIntegerBy(2)); + const takerFee = signedOrders[0].takerFee.plus(signedOrders[1].takerFee.dividedToIntegerBy(2)); expect(newBalances[makerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( erc20Balances[makerAddress][defaultMakerAssetAddress].minus(makerAssetFilledAmount), ); expect(newBalances[makerAddress][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[makerAddress][defaultTakerAssetAddress].add(takerAssetFillAmount), + erc20Balances[makerAddress][defaultTakerAssetAddress].plus(takerAssetFillAmount), ); expect(newBalances[makerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[makerAddress][zrxToken.address].minus(makerFee), @@ -908,13 +908,13 @@ describe('Exchange wrappers', () => { erc20Balances[takerAddress][defaultTakerAssetAddress].minus(takerAssetFillAmount), ); expect(newBalances[takerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[takerAddress][defaultMakerAssetAddress].add(makerAssetFilledAmount), + erc20Balances[takerAddress][defaultMakerAssetAddress].plus(makerAssetFilledAmount), ); expect(newBalances[takerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[takerAddress][zrxToken.address].minus(takerFee), ); expect(newBalances[feeRecipientAddress][zrxToken.address]).to.be.bignumber.equal( - erc20Balances[feeRecipientAddress][zrxToken.address].add(makerFee.add(takerFee)), + erc20Balances[feeRecipientAddress][zrxToken.address].plus(makerFee.plus(takerFee)), ); }); @@ -926,13 +926,13 @@ describe('Exchange wrappers', () => { ].minus(signedOrder.makerAssetAmount); erc20Balances[makerAddress][defaultTakerAssetAddress] = erc20Balances[makerAddress][ defaultTakerAssetAddress - ].add(signedOrder.takerAssetAmount); + ].plus(signedOrder.takerAssetAmount); erc20Balances[makerAddress][zrxToken.address] = erc20Balances[makerAddress][zrxToken.address].minus( signedOrder.makerFee, ); erc20Balances[takerAddress][defaultMakerAssetAddress] = erc20Balances[takerAddress][ defaultMakerAssetAddress - ].add(signedOrder.makerAssetAmount); + ].plus(signedOrder.makerAssetAmount); erc20Balances[takerAddress][defaultTakerAssetAddress] = erc20Balances[takerAddress][ defaultTakerAssetAddress ].minus(signedOrder.takerAssetAmount); @@ -941,7 +941,7 @@ describe('Exchange wrappers', () => { ); erc20Balances[feeRecipientAddress][zrxToken.address] = erc20Balances[feeRecipientAddress][ zrxToken.address - ].add(signedOrder.makerFee.add(signedOrder.takerFee)); + ].plus(signedOrder.makerFee.plus(signedOrder.takerFee)); }); await exchangeWrapper.marketSellOrdersNoThrowAsync(signedOrders, takerAddress, { takerAssetFillAmount, @@ -971,13 +971,13 @@ describe('Exchange wrappers', () => { ].minus(signedOrder.makerAssetAmount); erc20Balances[makerAddress][defaultTakerAssetAddress] = erc20Balances[makerAddress][ defaultTakerAssetAddress - ].add(signedOrder.takerAssetAmount); + ].plus(signedOrder.takerAssetAmount); erc20Balances[makerAddress][zrxToken.address] = erc20Balances[makerAddress][zrxToken.address].minus( signedOrder.makerFee, ); erc20Balances[takerAddress][defaultMakerAssetAddress] = erc20Balances[takerAddress][ defaultMakerAssetAddress - ].add(signedOrder.makerAssetAmount); + ].plus(signedOrder.makerAssetAmount); erc20Balances[takerAddress][defaultTakerAssetAddress] = erc20Balances[takerAddress][ defaultTakerAssetAddress ].minus(signedOrder.takerAssetAmount); @@ -986,7 +986,7 @@ describe('Exchange wrappers', () => { ); erc20Balances[feeRecipientAddress][zrxToken.address] = erc20Balances[feeRecipientAddress][ zrxToken.address - ].add(signedOrder.makerFee.add(signedOrder.takerFee)); + ].plus(signedOrder.makerFee.plus(signedOrder.takerFee)); }); await exchangeWrapper.marketSellOrdersNoThrowAsync(signedOrders, takerAddress, { takerAssetFillAmount, @@ -1034,16 +1034,16 @@ describe('Exchange wrappers', () => { const newBalances = await erc20Wrapper.getBalancesAsync(); - const makerAmountBought = signedOrders[0].takerAssetAmount.add( + const makerAmountBought = signedOrders[0].takerAssetAmount.plus( signedOrders[1].takerAssetAmount.dividedToIntegerBy(2), ); - const makerFee = signedOrders[0].makerFee.add(signedOrders[1].makerFee.dividedToIntegerBy(2)); - const takerFee = signedOrders[0].takerFee.add(signedOrders[1].takerFee.dividedToIntegerBy(2)); + const makerFee = signedOrders[0].makerFee.plus(signedOrders[1].makerFee.dividedToIntegerBy(2)); + const takerFee = signedOrders[0].takerFee.plus(signedOrders[1].takerFee.dividedToIntegerBy(2)); expect(newBalances[makerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( erc20Balances[makerAddress][defaultMakerAssetAddress].minus(makerAssetFillAmount), ); expect(newBalances[makerAddress][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[makerAddress][defaultTakerAssetAddress].add(makerAmountBought), + erc20Balances[makerAddress][defaultTakerAssetAddress].plus(makerAmountBought), ); expect(newBalances[makerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[makerAddress][zrxToken.address].minus(makerFee), @@ -1052,13 +1052,13 @@ describe('Exchange wrappers', () => { erc20Balances[takerAddress][defaultTakerAssetAddress].minus(makerAmountBought), ); expect(newBalances[takerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[takerAddress][defaultMakerAssetAddress].add(makerAssetFillAmount), + erc20Balances[takerAddress][defaultMakerAssetAddress].plus(makerAssetFillAmount), ); expect(newBalances[takerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[takerAddress][zrxToken.address].minus(takerFee), ); expect(newBalances[feeRecipientAddress][zrxToken.address]).to.be.bignumber.equal( - erc20Balances[feeRecipientAddress][zrxToken.address].add(makerFee.add(takerFee)), + erc20Balances[feeRecipientAddress][zrxToken.address].plus(makerFee.plus(takerFee)), ); }); @@ -1070,13 +1070,13 @@ describe('Exchange wrappers', () => { ].minus(signedOrder.makerAssetAmount); erc20Balances[makerAddress][defaultTakerAssetAddress] = erc20Balances[makerAddress][ defaultTakerAssetAddress - ].add(signedOrder.takerAssetAmount); + ].plus(signedOrder.takerAssetAmount); erc20Balances[makerAddress][zrxToken.address] = erc20Balances[makerAddress][zrxToken.address].minus( signedOrder.makerFee, ); erc20Balances[takerAddress][defaultMakerAssetAddress] = erc20Balances[takerAddress][ defaultMakerAssetAddress - ].add(signedOrder.makerAssetAmount); + ].plus(signedOrder.makerAssetAmount); erc20Balances[takerAddress][defaultTakerAssetAddress] = erc20Balances[takerAddress][ defaultTakerAssetAddress ].minus(signedOrder.takerAssetAmount); @@ -1085,7 +1085,7 @@ describe('Exchange wrappers', () => { ); erc20Balances[feeRecipientAddress][zrxToken.address] = erc20Balances[feeRecipientAddress][ zrxToken.address - ].add(signedOrder.makerFee.add(signedOrder.takerFee)); + ].plus(signedOrder.makerFee.plus(signedOrder.takerFee)); }); await exchangeWrapper.marketBuyOrdersAsync(signedOrders, takerAddress, { makerAssetFillAmount, @@ -1149,16 +1149,16 @@ describe('Exchange wrappers', () => { const newBalances = await erc20Wrapper.getBalancesAsync(); - const makerAmountBought = signedOrders[0].takerAssetAmount.add( + const makerAmountBought = signedOrders[0].takerAssetAmount.plus( signedOrders[1].takerAssetAmount.dividedToIntegerBy(2), ); - const makerFee = signedOrders[0].makerFee.add(signedOrders[1].makerFee.dividedToIntegerBy(2)); - const takerFee = signedOrders[0].takerFee.add(signedOrders[1].takerFee.dividedToIntegerBy(2)); + const makerFee = signedOrders[0].makerFee.plus(signedOrders[1].makerFee.dividedToIntegerBy(2)); + const takerFee = signedOrders[0].takerFee.plus(signedOrders[1].takerFee.dividedToIntegerBy(2)); expect(newBalances[makerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( erc20Balances[makerAddress][defaultMakerAssetAddress].minus(makerAssetFillAmount), ); expect(newBalances[makerAddress][defaultTakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[makerAddress][defaultTakerAssetAddress].add(makerAmountBought), + erc20Balances[makerAddress][defaultTakerAssetAddress].plus(makerAmountBought), ); expect(newBalances[makerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[makerAddress][zrxToken.address].minus(makerFee), @@ -1167,13 +1167,13 @@ describe('Exchange wrappers', () => { erc20Balances[takerAddress][defaultTakerAssetAddress].minus(makerAmountBought), ); expect(newBalances[takerAddress][defaultMakerAssetAddress]).to.be.bignumber.equal( - erc20Balances[takerAddress][defaultMakerAssetAddress].add(makerAssetFillAmount), + erc20Balances[takerAddress][defaultMakerAssetAddress].plus(makerAssetFillAmount), ); expect(newBalances[takerAddress][zrxToken.address]).to.be.bignumber.equal( erc20Balances[takerAddress][zrxToken.address].minus(takerFee), ); expect(newBalances[feeRecipientAddress][zrxToken.address]).to.be.bignumber.equal( - erc20Balances[feeRecipientAddress][zrxToken.address].add(makerFee.add(takerFee)), + erc20Balances[feeRecipientAddress][zrxToken.address].plus(makerFee.plus(takerFee)), ); }); @@ -1185,13 +1185,13 @@ describe('Exchange wrappers', () => { ].minus(signedOrder.makerAssetAmount); erc20Balances[makerAddress][defaultTakerAssetAddress] = erc20Balances[makerAddress][ defaultTakerAssetAddress - ].add(signedOrder.takerAssetAmount); + ].plus(signedOrder.takerAssetAmount); erc20Balances[makerAddress][zrxToken.address] = erc20Balances[makerAddress][zrxToken.address].minus( signedOrder.makerFee, ); erc20Balances[takerAddress][defaultMakerAssetAddress] = erc20Balances[takerAddress][ defaultMakerAssetAddress - ].add(signedOrder.makerAssetAmount); + ].plus(signedOrder.makerAssetAmount); erc20Balances[takerAddress][defaultTakerAssetAddress] = erc20Balances[takerAddress][ defaultTakerAssetAddress ].minus(signedOrder.takerAssetAmount); @@ -1200,7 +1200,7 @@ describe('Exchange wrappers', () => { ); erc20Balances[feeRecipientAddress][zrxToken.address] = erc20Balances[feeRecipientAddress][ zrxToken.address - ].add(signedOrder.makerFee.add(signedOrder.takerFee)); + ].plus(signedOrder.makerFee.plus(signedOrder.takerFee)); }); await exchangeWrapper.marketBuyOrdersNoThrowAsync(signedOrders, takerAddress, { makerAssetFillAmount, @@ -1231,13 +1231,13 @@ describe('Exchange wrappers', () => { ].minus(signedOrder.makerAssetAmount); erc20Balances[makerAddress][defaultTakerAssetAddress] = erc20Balances[makerAddress][ defaultTakerAssetAddress - ].add(signedOrder.takerAssetAmount); + ].plus(signedOrder.takerAssetAmount); erc20Balances[makerAddress][zrxToken.address] = erc20Balances[makerAddress][zrxToken.address].minus( signedOrder.makerFee, ); erc20Balances[takerAddress][defaultMakerAssetAddress] = erc20Balances[takerAddress][ defaultMakerAssetAddress - ].add(signedOrder.makerAssetAmount); + ].plus(signedOrder.makerAssetAmount); erc20Balances[takerAddress][defaultTakerAssetAddress] = erc20Balances[takerAddress][ defaultTakerAssetAddress ].minus(signedOrder.takerAssetAmount); @@ -1246,7 +1246,7 @@ describe('Exchange wrappers', () => { ); erc20Balances[feeRecipientAddress][zrxToken.address] = erc20Balances[feeRecipientAddress][ zrxToken.address - ].add(signedOrder.makerFee.add(signedOrder.takerFee)); + ].plus(signedOrder.makerFee.plus(signedOrder.takerFee)); }); await exchangeWrapper.marketBuyOrdersNoThrowAsync(signedOrders, takerAddress, { makerAssetFillAmount, diff --git a/contracts/protocol/test/utils/fill_order_combinatorial_utils.ts b/contracts/protocol/test/utils/fill_order_combinatorial_utils.ts index 2fd33bebdd..c2f530e5b2 100644 --- a/contracts/protocol/test/utils/fill_order_combinatorial_utils.ts +++ b/contracts/protocol/test/utils/fill_order_combinatorial_utils.ts @@ -469,7 +469,7 @@ export class FillOrderCombinatorialUtils { const remainingTakerAmountToFill = signedOrder.takerAssetAmount.minus(alreadyFilledTakerAmount); const expFilledTakerAmount = takerAssetFillAmount.gt(remainingTakerAmountToFill) ? remainingTakerAmountToFill - : alreadyFilledTakerAmount.add(takerAssetFillAmount); + : alreadyFilledTakerAmount.plus(takerAssetFillAmount); const expFilledMakerAmount = orderUtils.getPartialAmountFloor( expFilledTakerAmount, @@ -644,7 +644,7 @@ export class FillOrderCombinatorialUtils { break; case TakerAssetFillAmountScenario.GreaterThanRemainingFillableTakerAssetAmount: - takerAssetFillAmount = fillableTakerAssetAmount.add(1); + takerAssetFillAmount = fillableTakerAssetAmount.plus(1); break; case TakerAssetFillAmountScenario.LessThanRemainingFillableTakerAssetAmount: @@ -657,7 +657,7 @@ export class FillOrderCombinatorialUtils { 'Cannot test `TakerAssetFillAmountScenario.LessThanRemainingFillableTakerAssetAmount` together with ERC721 assets since orders involving ERC721 must always be filled exactly.', ); } - takerAssetFillAmount = fillableTakerAssetAmount.div(2).floor(); + takerAssetFillAmount = fillableTakerAssetAmount.div(2).integerValue(BigNumber.ROUND_FLOOR); break; default: diff --git a/contracts/protocol/test/utils/match_order_tester.ts b/contracts/protocol/test/utils/match_order_tester.ts index 31864820f4..0ba8017c50 100644 --- a/contracts/protocol/test/utils/match_order_tester.ts +++ b/contracts/protocol/test/utils/match_order_tester.ts @@ -66,7 +66,7 @@ export class MatchOrderTester { const feePaidByRightMaker = new BigNumber(rightLog.makerFeePaid); const feePaidByTakerRight = new BigNumber(rightLog.takerFeePaid); // Derive amount received by taker - const amountReceivedByTaker = amountSoldByLeftMaker.sub(amountBoughtByRightMaker); + const amountReceivedByTaker = amountSoldByLeftMaker.minus(amountBoughtByRightMaker); // Assert log values - left order expect(amountBoughtByLeftMaker, 'Checking logged amount bought by left maker').to.be.bignumber.equal( expectedTransferAmounts.amountBoughtByLeftMaker, @@ -267,14 +267,16 @@ export class MatchOrderTester { // Assert left order status const maxAmountBoughtByLeftMaker = signedOrderLeft.takerAssetAmount.minus(initialLeftOrderFilledAmount); const leftOrderInfo: OrderInfo = await this._exchangeWrapper.getOrderInfoAsync(signedOrderLeft); - const leftExpectedStatus = expectedTransferAmounts.amountBoughtByLeftMaker.equals(maxAmountBoughtByLeftMaker) + const leftExpectedStatus = expectedTransferAmounts.amountBoughtByLeftMaker.isEqualTo(maxAmountBoughtByLeftMaker) ? OrderStatus.FullyFilled : OrderStatus.Fillable; expect(leftOrderInfo.orderStatus, 'Checking exchange status for left order').to.be.equal(leftExpectedStatus); // Assert right order status const maxAmountBoughtByRightMaker = signedOrderRight.takerAssetAmount.minus(initialRightOrderFilledAmount); const rightOrderInfo: OrderInfo = await this._exchangeWrapper.getOrderInfoAsync(signedOrderRight); - const rightExpectedStatus = expectedTransferAmounts.amountBoughtByRightMaker.equals(maxAmountBoughtByRightMaker) + const rightExpectedStatus = expectedTransferAmounts.amountBoughtByRightMaker.isEqualTo( + maxAmountBoughtByRightMaker, + ) ? OrderStatus.FullyFilled : OrderStatus.Fillable; expect(rightOrderInfo.orderStatus, 'Checking exchange status for right order').to.be.equal(rightExpectedStatus); @@ -364,13 +366,13 @@ export class MatchOrderTester { // Right Maker expectedNewERC20BalancesByOwner[makerAddressRight][ takerAssetAddressRight - ] = expectedNewERC20BalancesByOwner[makerAddressRight][takerAssetAddressRight].add( + ] = expectedNewERC20BalancesByOwner[makerAddressRight][takerAssetAddressRight].plus( expectedTransferAmounts.amountBoughtByRightMaker, ); // Taker expectedNewERC20BalancesByOwner[takerAddress][makerAssetAddressLeft] = expectedNewERC20BalancesByOwner[ takerAddress - ][makerAssetAddressLeft].add(expectedTransferAmounts.amountReceivedByTaker); + ][makerAssetAddressLeft].plus(expectedTransferAmounts.amountReceivedByTaker); } else if (makerAssetProxyIdLeft === AssetProxyId.ERC721) { // Decode asset data const erc721AssetData = assetDataUtils.decodeERC721AssetData(signedOrderLeft.makerAssetData); @@ -395,7 +397,7 @@ export class MatchOrderTester { // Left Maker expectedNewERC20BalancesByOwner[makerAddressLeft][takerAssetAddressLeft] = expectedNewERC20BalancesByOwner[ makerAddressLeft - ][takerAssetAddressLeft].add(expectedTransferAmounts.amountBoughtByLeftMaker); + ][takerAssetAddressLeft].plus(expectedTransferAmounts.amountBoughtByLeftMaker); // Right Maker expectedNewERC20BalancesByOwner[makerAddressRight][ makerAssetAddressRight @@ -426,19 +428,19 @@ export class MatchOrderTester { expectedNewERC20BalancesByOwner[takerAddress][this._feeTokenAddress] = expectedNewERC20BalancesByOwner[ takerAddress ][this._feeTokenAddress].minus( - expectedTransferAmounts.feePaidByTakerLeft.add(expectedTransferAmounts.feePaidByTakerRight), + expectedTransferAmounts.feePaidByTakerLeft.plus(expectedTransferAmounts.feePaidByTakerRight), ); // Left Fee Recipient Fees expectedNewERC20BalancesByOwner[feeRecipientAddressLeft][ this._feeTokenAddress - ] = expectedNewERC20BalancesByOwner[feeRecipientAddressLeft][this._feeTokenAddress].add( - expectedTransferAmounts.feePaidByLeftMaker.add(expectedTransferAmounts.feePaidByTakerLeft), + ] = expectedNewERC20BalancesByOwner[feeRecipientAddressLeft][this._feeTokenAddress].plus( + expectedTransferAmounts.feePaidByLeftMaker.plus(expectedTransferAmounts.feePaidByTakerLeft), ); // Right Fee Recipient Fees expectedNewERC20BalancesByOwner[feeRecipientAddressRight][ this._feeTokenAddress - ] = expectedNewERC20BalancesByOwner[feeRecipientAddressRight][this._feeTokenAddress].add( - expectedTransferAmounts.feePaidByRightMaker.add(expectedTransferAmounts.feePaidByTakerRight), + ] = expectedNewERC20BalancesByOwner[feeRecipientAddressRight][this._feeTokenAddress].plus( + expectedTransferAmounts.feePaidByRightMaker.plus(expectedTransferAmounts.feePaidByTakerRight), ); return [expectedNewERC20BalancesByOwner, expectedNewERC721TokenIdsByOwner]; diff --git a/contracts/test-utils/src/order_factory.ts b/contracts/test-utils/src/order_factory.ts index 2449d1a8ab..b0f435ff2f 100644 --- a/contracts/test-utils/src/order_factory.ts +++ b/contracts/test-utils/src/order_factory.ts @@ -21,7 +21,7 @@ export class OrderFactory { const currentBlockTimestamp = await getLatestBlockTimestampAsync(); const order = ({ senderAddress: constants.NULL_ADDRESS, - expirationTimeSeconds: new BigNumber(currentBlockTimestamp).add(tenMinutesInSeconds), + expirationTimeSeconds: new BigNumber(currentBlockTimestamp).plus(tenMinutesInSeconds), salt: generatePseudoRandomSalt(), takerAddress: constants.NULL_ADDRESS, ...this._defaultOrderParams, diff --git a/contracts/test-utils/src/order_utils.ts b/contracts/test-utils/src/order_utils.ts index 4f7a340110..fd336bb472 100644 --- a/contracts/test-utils/src/order_utils.ts +++ b/contracts/test-utils/src/order_utils.ts @@ -7,9 +7,9 @@ import { CancelOrder, MatchOrder } from './types'; export const orderUtils = { getPartialAmountFloor(numerator: BigNumber, denominator: BigNumber, target: BigNumber): BigNumber { const partialAmount = numerator - .mul(target) + .multipliedBy(target) .div(denominator) - .floor(); + .integerValue(BigNumber.ROUND_FLOOR); return partialAmount; }, createFill: (signedOrder: SignedOrder, takerAssetFillAmount?: BigNumber) => { diff --git a/packages/assert/src/index.ts b/packages/assert/src/index.ts index 2d28d51e1d..b9a04686ac 100644 --- a/packages/assert/src/index.ts +++ b/packages/assert/src/index.ts @@ -12,7 +12,7 @@ export const assert = { }, isValidBaseUnitAmount(variableName: string, value: BigNumber): void { assert.isBigNumber(variableName, value); - const isNegative = value.lessThan(0); + const isNegative = value.isLessThan(0); assert.assert(!isNegative, `${variableName} cannot be a negative number, found value: ${value.toNumber()}`); const hasDecimals = value.decimalPlaces() !== 0; assert.assert( diff --git a/packages/asset-buyer/src/utils/buy_quote_calculator.ts b/packages/asset-buyer/src/utils/buy_quote_calculator.ts index fcded6ab12..9205678e70 100644 --- a/packages/asset-buyer/src/utils/buy_quote_calculator.ts +++ b/packages/asset-buyer/src/utils/buy_quote_calculator.ts @@ -22,7 +22,7 @@ export const buyQuoteCalculator = { const remainingFillableMakerAssetAmounts = ordersAndFillableAmounts.remainingFillableMakerAssetAmounts; const feeOrders = feeOrdersAndFillableAmounts.orders; const remainingFillableFeeAmounts = feeOrdersAndFillableAmounts.remainingFillableMakerAssetAmounts; - const slippageBufferAmount = assetBuyAmount.mul(slippagePercentage).round(); + const slippageBufferAmount = assetBuyAmount.multipliedBy(slippagePercentage).integerValue(); // find the orders that cover the desired assetBuyAmount (with slippage) const { resultOrders, @@ -43,7 +43,7 @@ export const buyQuoteCalculator = { const multiplierNeededWithSlippage = new BigNumber(1).plus(slippagePercentage); // Given amountAvailableToFillConsideringSlippage * multiplierNeededWithSlippage = amountAbleToFill // We divide amountUnableToFill by multiplierNeededWithSlippage to determine amountAvailableToFillConsideringSlippage - const amountAvailableToFillConsideringSlippage = amountAbleToFill.div(multiplierNeededWithSlippage).floor(); + const amountAvailableToFillConsideringSlippage = amountAbleToFill.div(multiplierNeededWithSlippage).integerValue(BigNumber.ROUND_FLOOR); throw new InsufficientAssetLiquidityError(amountAvailableToFillConsideringSlippage); } @@ -131,7 +131,7 @@ function calculateQuoteInfo( zrxEthAmount = findEthAmountNeededToBuyZrx(feeOrdersAndFillableAmounts, zrxAmountToBuyAsset); } // eth amount needed to buy the affiliate fee - const affiliateFeeEthAmount = assetEthAmount.mul(feePercentage).ceil(); + const affiliateFeeEthAmount = assetEthAmount.multipliedBy(feePercentage).integerValue(BigNumber.ROUND_CEIL); // eth amount needed for fees is the sum of affiliate fee and zrx fee const feeEthAmount = affiliateFeeEthAmount.plus(zrxEthAmount); // eth amount needed in total is the sum of the amount needed for the asset and the amount needed for fees @@ -168,9 +168,9 @@ function findEthAmountNeededToBuyZrx( order, makerFillAmount, ); - const extraFeeAmount = remainingFillableMakerAssetAmount.greaterThanOrEqualTo(adjustedMakerFillAmount) + const extraFeeAmount = remainingFillableMakerAssetAmount.isGreaterThanOrEqualTo(adjustedMakerFillAmount) ? constants.ZERO_AMOUNT - : adjustedMakerFillAmount.sub(makerFillAmount); + : adjustedMakerFillAmount.minus(makerFillAmount); return { totalEthAmount: totalEthAmount.plus(takerFillAmount), remainingZrxBuyAmount: BigNumber.max( diff --git a/packages/asset-buyer/src/utils/order_provider_response_processor.ts b/packages/asset-buyer/src/utils/order_provider_response_processor.ts index 4244d196cd..f08cd6150d 100644 --- a/packages/asset-buyer/src/utils/order_provider_response_processor.ts +++ b/packages/asset-buyer/src/utils/order_provider_response_processor.ts @@ -109,11 +109,8 @@ function getValidOrdersWithRemainingFillableMakerAssetAmountsFromOnChain( return accOrders; } // if the order IS fillable, add the order and calculate the remaining fillable amount - const transferrableAssetAmount = BigNumber.min([traderInfo.makerAllowance, traderInfo.makerBalance]); - const transferrableFeeAssetAmount = BigNumber.min([ - traderInfo.makerZrxAllowance, - traderInfo.makerZrxBalance, - ]); + const transferrableAssetAmount = BigNumber.min(traderInfo.makerAllowance, traderInfo.makerBalance); + const transferrableFeeAssetAmount = BigNumber.min(traderInfo.makerZrxAllowance, traderInfo.makerZrxBalance); const remainingTakerAssetAmount = order.takerAssetAmount.minus(orderInfo.orderTakerAssetFilledAmount); const remainingMakerAssetAmount = orderUtils.getRemainingMakerAmount(order, remainingTakerAssetAmount); const remainingFillableCalculator = new RemainingFillableCalculator( diff --git a/packages/asset-buyer/src/utils/order_utils.ts b/packages/asset-buyer/src/utils/order_utils.ts index 1cc2cf95f4..3ea3cafd33 100644 --- a/packages/asset-buyer/src/utils/order_utils.ts +++ b/packages/asset-buyer/src/utils/order_utils.ts @@ -9,8 +9,8 @@ export const orderUtils = { }, willOrderExpire(order: SignedOrder, secondsFromNow: number): boolean { const millisecondsInSecond = 1000; - const currentUnixTimestampSec = new BigNumber(Date.now() / millisecondsInSecond).round(); - return order.expirationTimeSeconds.lessThan(currentUnixTimestampSec.plus(secondsFromNow)); + const currentUnixTimestampSec = new BigNumber(Date.now() / millisecondsInSecond).integerValue(); + return order.expirationTimeSeconds.isLessThan(currentUnixTimestampSec.plus(secondsFromNow)); }, isOpenOrder(order: SignedOrder): boolean { return order.takerAddress === constants.NULL_ADDRESS; @@ -20,43 +20,43 @@ export const orderUtils = { const remainingMakerAmount = remainingTakerAmount .times(order.makerAssetAmount) .div(order.takerAssetAmount) - .floor(); + .integerValue(BigNumber.ROUND_FLOOR); return remainingMakerAmount; }, // given a desired amount of makerAsset, calculate how much takerAsset is required to fill that amount getTakerFillAmount(order: SignedOrder, makerFillAmount: BigNumber): BigNumber { // Round up because exchange rate favors Maker const takerFillAmount = makerFillAmount - .mul(order.takerAssetAmount) + .multipliedBy(order.takerAssetAmount) .div(order.makerAssetAmount) - .ceil(); + .integerValue(BigNumber.ROUND_CEIL); return takerFillAmount; }, // given a desired amount of takerAsset to fill, calculate how much fee is required by the taker to fill that amount getTakerFeeAmount(order: SignedOrder, takerFillAmount: BigNumber): BigNumber { // Round down because Taker fee rate favors Taker const takerFeeAmount = takerFillAmount - .mul(order.takerFee) + .multipliedBy(order.takerFee) .div(order.takerAssetAmount) - .floor(); + .integerValue(BigNumber.ROUND_FLOOR); return takerFeeAmount; }, // given a desired amount of takerAsset to fill, calculate how much makerAsset will be filled getMakerFillAmount(order: SignedOrder, takerFillAmount: BigNumber): BigNumber { // Round down because exchange rate favors Maker const makerFillAmount = takerFillAmount - .mul(order.makerAssetAmount) + .multipliedBy(order.makerAssetAmount) .div(order.takerAssetAmount) - .floor(); + .integerValue(BigNumber.ROUND_FLOOR); return makerFillAmount; }, // given a desired amount of makerAsset, calculate how much fee is required by the maker to fill that amount getMakerFeeAmount(order: SignedOrder, makerFillAmount: BigNumber): BigNumber { // Round down because Maker fee rate favors Maker const makerFeeAmount = makerFillAmount - .mul(order.makerFee) + .multipliedBy(order.makerFee) .div(order.makerAssetAmount) - .floor(); + .integerValue(BigNumber.ROUND_FLOOR); return makerFeeAmount; }, // given a desired amount of ZRX from a fee order, calculate how much takerAsset is required to fill that amount @@ -64,9 +64,9 @@ export const orderUtils = { getTakerFillAmountForFeeOrder(order: SignedOrder, makerFillAmount: BigNumber): [BigNumber, BigNumber] { // For each unit of TakerAsset we buy (MakerAsset - TakerFee) const adjustedTakerFillAmount = makerFillAmount - .mul(order.takerAssetAmount) - .div(order.makerAssetAmount.sub(order.takerFee)) - .ceil(); + .multipliedBy(order.takerAssetAmount) + .div(order.makerAssetAmount.minus(order.takerFee)) + .integerValue(BigNumber.ROUND_CEIL); // The amount that we buy will be greater than makerFillAmount, since we buy some amount for fees. const adjustedMakerFillAmount = orderUtils.getMakerFillAmount(order, adjustedTakerFillAmount); return [adjustedTakerFillAmount, adjustedMakerFillAmount]; diff --git a/packages/asset-buyer/test/buy_quote_calculator_test.ts b/packages/asset-buyer/test/buy_quote_calculator_test.ts index fdc17ef256..cf443bef36 100644 --- a/packages/asset-buyer/test/buy_quote_calculator_test.ts +++ b/packages/asset-buyer/test/buy_quote_calculator_test.ts @@ -234,7 +234,7 @@ describe('buyQuoteCalculator', () => { const expectedEthAmountForAsset = new BigNumber(50); const expectedEthAmountForZrxFees = new BigNumber(100); const expectedFillEthAmount = expectedEthAmountForAsset; - const expectedAffiliateFeeEthAmount = expectedEthAmountForAsset.mul(feePercentage); + const expectedAffiliateFeeEthAmount = expectedEthAmountForAsset.multipliedBy(feePercentage); const expectedFeeEthAmount = expectedAffiliateFeeEthAmount.plus(expectedEthAmountForZrxFees); const expectedTotalEthAmount = expectedFillEthAmount.plus(expectedFeeEthAmount); expect(buyQuote.bestCaseQuoteInfo.assetEthAmount).to.bignumber.equal(expectedFillEthAmount); @@ -272,7 +272,7 @@ describe('buyQuoteCalculator', () => { const expectedEthAmountForAsset = new BigNumber(50); const expectedEthAmountForZrxFees = new BigNumber(100); const expectedFillEthAmount = expectedEthAmountForAsset; - const expectedAffiliateFeeEthAmount = expectedEthAmountForAsset.mul(feePercentage); + const expectedAffiliateFeeEthAmount = expectedEthAmountForAsset.multipliedBy(feePercentage); const expectedFeeEthAmount = expectedAffiliateFeeEthAmount.plus(expectedEthAmountForZrxFees); const expectedTotalEthAmount = expectedFillEthAmount.plus(expectedFeeEthAmount); expect(buyQuote.bestCaseQuoteInfo.assetEthAmount).to.bignumber.equal(expectedFillEthAmount); @@ -282,7 +282,7 @@ describe('buyQuoteCalculator', () => { const expectedWorstEthAmountForAsset = new BigNumber(100); const expectedWorstEthAmountForZrxFees = new BigNumber(208); const expectedWorstFillEthAmount = expectedWorstEthAmountForAsset; - const expectedWorstAffiliateFeeEthAmount = expectedWorstEthAmountForAsset.mul(feePercentage); + const expectedWorstAffiliateFeeEthAmount = expectedWorstEthAmountForAsset.multipliedBy(feePercentage); const expectedWorstFeeEthAmount = expectedWorstAffiliateFeeEthAmount.plus(expectedWorstEthAmountForZrxFees); const expectedWorstTotalEthAmount = expectedWorstFillEthAmount.plus(expectedWorstFeeEthAmount); expect(buyQuote.worstCaseQuoteInfo.assetEthAmount).to.bignumber.equal(expectedWorstFillEthAmount); diff --git a/packages/contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts index ad42cfd4f5..cd79a0e5d3 100644 --- a/packages/contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts @@ -271,7 +271,7 @@ export class ERC20TokenWrapper extends ContractWrapper { const tokenContract = await this._getTokenContractAsync(normalizedTokenAddress); const fromAddressBalance = await this.getBalanceAsync(normalizedTokenAddress, normalizedFromAddress); - if (fromAddressBalance.lessThan(amountInBaseUnits)) { + if (fromAddressBalance.isLessThan(amountInBaseUnits)) { throw new Error(ContractWrappersError.InsufficientBalanceForTransfer); } @@ -327,12 +327,12 @@ export class ERC20TokenWrapper extends ContractWrapper { normalizedFromAddress, normalizedSenderAddress, ); - if (fromAddressAllowance.lessThan(amountInBaseUnits)) { + if (fromAddressAllowance.isLessThan(amountInBaseUnits)) { throw new Error(ContractWrappersError.InsufficientAllowanceForTransfer); } const fromAddressBalance = await this.getBalanceAsync(normalizedTokenAddress, normalizedFromAddress); - if (fromAddressBalance.lessThan(amountInBaseUnits)) { + if (fromAddressBalance.isLessThan(amountInBaseUnits)) { throw new Error(ContractWrappersError.InsufficientBalanceForTransfer); } diff --git a/packages/contract-wrappers/src/fetchers/asset_balance_and_proxy_allowance_fetcher.ts b/packages/contract-wrappers/src/fetchers/asset_balance_and_proxy_allowance_fetcher.ts index 1ff130a482..c35b246641 100644 --- a/packages/contract-wrappers/src/fetchers/asset_balance_and_proxy_allowance_fetcher.ts +++ b/packages/contract-wrappers/src/fetchers/asset_balance_and_proxy_allowance_fetcher.ts @@ -39,7 +39,7 @@ export class AssetBalanceAndProxyAllowanceFetcher implements AbstractBalanceAndP nestedAssetDataElement, userAddress, )).dividedToIntegerBy(nestedAmountElement); - if (_.isUndefined(balance) || nestedAssetBalance.lessThan(balance)) { + if (_.isUndefined(balance) || nestedAssetBalance.isLessThan(balance)) { balance = nestedAssetBalance; } } @@ -81,7 +81,7 @@ export class AssetBalanceAndProxyAllowanceFetcher implements AbstractBalanceAndP nestedAssetDataElement, userAddress, )).dividedToIntegerBy(nestedAmountElement); - if (_.isUndefined(proxyAllowance) || nestedAssetAllowance.lessThan(proxyAllowance)) { + if (_.isUndefined(proxyAllowance) || nestedAssetAllowance.isLessThan(proxyAllowance)) { proxyAllowance = nestedAssetAllowance; } } diff --git a/packages/contract-wrappers/src/utils/exchange_transfer_simulator.ts b/packages/contract-wrappers/src/utils/exchange_transfer_simulator.ts index f374d509b5..4b75ea3860 100644 --- a/packages/contract-wrappers/src/utils/exchange_transfer_simulator.ts +++ b/packages/contract-wrappers/src/utils/exchange_transfer_simulator.ts @@ -72,10 +72,10 @@ export class ExchangeTransferSimulator { } const balance = await this._store.getBalanceAsync(tokenAddress, from); const proxyAllowance = await this._store.getProxyAllowanceAsync(tokenAddress, from); - if (proxyAllowance.lessThan(amountInBaseUnits)) { + if (proxyAllowance.isLessThan(amountInBaseUnits)) { ExchangeTransferSimulator._throwValidationError(FailureReason.ProxyAllowance, tradeSide, transferType); } - if (balance.lessThan(amountInBaseUnits)) { + if (balance.isLessThan(amountInBaseUnits)) { ExchangeTransferSimulator._throwValidationError(FailureReason.Balance, tradeSide, transferType); } await this._decreaseProxyAllowanceAsync(tokenAddress, from, amountInBaseUnits); diff --git a/packages/contract-wrappers/src/utils/utils.ts b/packages/contract-wrappers/src/utils/utils.ts index 0b3270e787..ab69385e7a 100644 --- a/packages/contract-wrappers/src/utils/utils.ts +++ b/packages/contract-wrappers/src/utils/utils.ts @@ -7,13 +7,15 @@ import { constants } from './constants'; export const utils = { getCurrentUnixTimestampSec(): BigNumber { const milisecondsInSecond = 1000; - return new BigNumber(Date.now() / milisecondsInSecond).round(); + return new BigNumber(Date.now() / milisecondsInSecond).integerValue(); }, getCurrentUnixTimestampMs(): BigNumber { return new BigNumber(Date.now()); }, numberPercentageToEtherTokenAmountPercentage(percentage: number): BigNumber { - return Web3Wrapper.toBaseUnitAmount(constants.ONE_AMOUNT, constants.ETHER_TOKEN_DECIMALS).mul(percentage); + return Web3Wrapper.toBaseUnitAmount(constants.ONE_AMOUNT, constants.ETHER_TOKEN_DECIMALS).multipliedBy( + percentage, + ); }, removeUndefinedProperties(obj: T): Partial { return _.pickBy(obj); diff --git a/packages/contract-wrappers/test/ether_token_wrapper_test.ts b/packages/contract-wrappers/test/ether_token_wrapper_test.ts index e3efef19db..cc2419aa25 100644 --- a/packages/contract-wrappers/test/ether_token_wrapper_test.ts +++ b/packages/contract-wrappers/test/ether_token_wrapper_test.ts @@ -116,7 +116,7 @@ describe('EtherTokenWrapper', () => { const preETHBalance = await web3Wrapper.getBalanceInWeiAsync(addressWithETH); const extraETHBalance = Web3Wrapper.toWei(new BigNumber(5)); - const overETHBalanceinWei = preETHBalance.add(extraETHBalance); + const overETHBalanceinWei = preETHBalance.plus(extraETHBalance); return expect( contractWrappers.etherToken.depositAsync(wethContractAddress, overETHBalanceinWei, addressWithETH), @@ -153,7 +153,7 @@ describe('EtherTokenWrapper', () => { ); expect(postWETHBalanceInBaseUnits).to.be.bignumber.equal(0); - const expectedETHBalance = preETHBalance.add(depositWeiAmount).round(decimalPlaces); + const expectedETHBalance = preETHBalance.plus(depositWeiAmount).integerValue(decimalPlaces); gasCost = expectedETHBalance.minus(postETHBalance); expect(gasCost).to.be.bignumber.lte(MAX_REASONABLE_GAS_COST_IN_WEI); }); @@ -165,7 +165,7 @@ describe('EtherTokenWrapper', () => { expect(preWETHBalance).to.be.bignumber.equal(0); // tslint:disable-next-line:custom-no-magic-numbers - const overWETHBalance = preWETHBalance.add(999999999); + const overWETHBalance = preWETHBalance.plus(999999999); return expect( contractWrappers.etherToken.withdrawAsync(wethContractAddress, overWETHBalance, addressWithETH), diff --git a/packages/ethereum-types/package.json b/packages/ethereum-types/package.json index 953b323c6b..bd37480586 100644 --- a/packages/ethereum-types/package.json +++ b/packages/ethereum-types/package.json @@ -37,7 +37,7 @@ }, "dependencies": { "@types/node": "*", - "bignumber.js": "~4.1.0" + "bignumber.js": "~8.0.2" }, "publishConfig": { "access": "public" diff --git a/packages/instant/src/components/order_details.tsx b/packages/instant/src/components/order_details.tsx index 4db20b13e1..3ded50652a 100644 --- a/packages/instant/src/components/order_details.tsx +++ b/packages/instant/src/components/order_details.tsx @@ -77,7 +77,7 @@ export class OrderDetails extends React.PureComponent { } private _hadErrorFetchingUsdPrice(): boolean { - return this.props.ethUsdPrice ? this.props.ethUsdPrice.equals(BIG_NUMBER_ZERO) : false; + return this.props.ethUsdPrice ? this.props.ethUsdPrice.isEqualTo(BIG_NUMBER_ZERO) : false; } private _totalCostSecondaryValue(): React.ReactNode { @@ -156,7 +156,7 @@ export class OrderDetails extends React.PureComponent { return !_.isUndefined(assetTotalInWei) && !_.isUndefined(selectedAssetUnitAmount) && !selectedAssetUnitAmount.eq(BIG_NUMBER_ZERO) - ? assetTotalInWei.div(selectedAssetUnitAmount).ceil() + ? assetTotalInWei.div(selectedAssetUnitAmount).integerValue(BigNumber.ROUND_CEIL) : undefined; } diff --git a/packages/instant/src/constants.ts b/packages/instant/src/constants.ts index bfd9e90981..d407925a34 100644 --- a/packages/instant/src/constants.ts +++ b/packages/instant/src/constants.ts @@ -21,7 +21,7 @@ export const NPM_PACKAGE_VERSION = process.env.NPM_PACKAGE_VERSION; export const DEFAULT_UNKOWN_ASSET_NAME = '???'; export const ACCOUNT_UPDATE_INTERVAL_TIME_MS = ONE_SECOND_MS * 5; export const BUY_QUOTE_UPDATE_INTERVAL_TIME_MS = ONE_SECOND_MS * 15; -export const DEFAULT_GAS_PRICE = GWEI_IN_WEI.mul(6); +export const DEFAULT_GAS_PRICE = GWEI_IN_WEI.multipliedBy(6); export const DEFAULT_ESTIMATED_TRANSACTION_TIME_MS = ONE_MINUTE_MS * 2; export const MAGIC_TRIGGER_ERROR_INPUT = '0€'; export const MAGIC_TRIGGER_ERROR_MESSAGE = 'Triggered error'; diff --git a/packages/instant/src/containers/selected_erc20_asset_amount_input.ts b/packages/instant/src/containers/selected_erc20_asset_amount_input.ts index cb9df527eb..4b99933328 100644 --- a/packages/instant/src/containers/selected_erc20_asset_amount_input.ts +++ b/packages/instant/src/containers/selected_erc20_asset_amount_input.ts @@ -84,7 +84,7 @@ const mapDispatchToProps = ( // reset our buy state dispatch(actions.setBuyOrderStateNone()); - if (!_.isUndefined(value) && value.greaterThan(0) && !_.isUndefined(asset)) { + if (!_.isUndefined(value) && value.isGreaterThan(0) && !_.isUndefined(asset)) { // even if it's debounced, give them the illusion it's loading dispatch(actions.setQuoteRequestStatePending()); // tslint:disable-next-line:no-floating-promises diff --git a/packages/instant/src/redux/async_data.ts b/packages/instant/src/redux/async_data.ts index 884ab103dd..f20fe319fa 100644 --- a/packages/instant/src/redux/async_data.ts +++ b/packages/instant/src/redux/async_data.ts @@ -99,7 +99,7 @@ export const asyncData = { if ( !_.isUndefined(selectedAssetUnitAmount) && !_.isUndefined(selectedAsset) && - selectedAssetUnitAmount.greaterThan(BIG_NUMBER_ZERO) && + selectedAssetUnitAmount.isGreaterThan(BIG_NUMBER_ZERO) && buyOrderState.processState === OrderProcessState.None && selectedAsset.metaData.assetProxyId === AssetProxyId.ERC20 ) { diff --git a/packages/instant/src/util/asset.ts b/packages/instant/src/util/asset.ts index 709561dbc1..a6fd77d5a1 100644 --- a/packages/instant/src/util/asset.ts +++ b/packages/instant/src/util/asset.ts @@ -104,8 +104,9 @@ export const assetUtils = { return assetDataGroupIfExists[Network.Mainnet]; }, getERC20AssetsFromAssets: (assets: Asset[]): ERC20Asset[] => { - const erc20sOrUndefined = _.map(assets, asset => - asset.metaData.assetProxyId === AssetProxyId.ERC20 ? (asset as ERC20Asset) : undefined, + const erc20sOrUndefined = _.map( + assets, + asset => (asset.metaData.assetProxyId === AssetProxyId.ERC20 ? (asset as ERC20Asset) : undefined), ); return _.compact(erc20sOrUndefined); }, @@ -114,15 +115,15 @@ export const assetUtils = { const assetName = assetUtils.bestNameForAsset(asset, 'of this asset'); if ( error instanceof InsufficientAssetLiquidityError && - error.amountAvailableToFill.greaterThan(BIG_NUMBER_ZERO) + error.amountAvailableToFill.isGreaterThan(BIG_NUMBER_ZERO) ) { const unitAmountAvailableToFill = Web3Wrapper.toUnitAmount( error.amountAvailableToFill, asset.metaData.decimals, ); - const roundedUnitAmountAvailableToFill = unitAmountAvailableToFill.round(2, BigNumber.ROUND_DOWN); + const roundedUnitAmountAvailableToFill = unitAmountAvailableToFill.integerValue(2, BigNumber.ROUND_DOWN); - if (roundedUnitAmountAvailableToFill.greaterThan(BIG_NUMBER_ZERO)) { + if (roundedUnitAmountAvailableToFill.isGreaterThan(BIG_NUMBER_ZERO)) { return `There are only ${roundedUnitAmountAvailableToFill} ${assetName} available to buy`; } } diff --git a/packages/instant/src/util/format.ts b/packages/instant/src/util/format.ts index 4adb63e219..eef332d3ce 100644 --- a/packages/instant/src/util/format.ts +++ b/packages/instant/src/util/format.ts @@ -25,16 +25,16 @@ export const format = { if (_.isUndefined(ethUnitAmount)) { return defaultText; } - let roundedAmount = ethUnitAmount.round(decimalPlaces).toDigits(decimalPlaces); + let roundedAmount = ethUnitAmount.integerValue(decimalPlaces).toDigits(decimalPlaces); - if (roundedAmount.eq(BIG_NUMBER_ZERO) && ethUnitAmount.greaterThan(BIG_NUMBER_ZERO)) { + if (roundedAmount.eq(BIG_NUMBER_ZERO) && ethUnitAmount.isGreaterThan(BIG_NUMBER_ZERO)) { // Sometimes for small ETH amounts (i.e. 0.000045) the amount rounded to 4 decimalPlaces is 0 // If that is the case, show to 1 significant digit roundedAmount = new BigNumber(ethUnitAmount.toPrecision(1)); } const displayAmount = - roundedAmount.greaterThan(BIG_NUMBER_ZERO) && roundedAmount.lessThan(minUnitAmountToDisplay) + roundedAmount.isGreaterThan(BIG_NUMBER_ZERO) && roundedAmount.isLessThan(minUnitAmountToDisplay) ? `< ${minUnitAmountToDisplay.toString()}` : roundedAmount.toString(); @@ -62,7 +62,7 @@ export const format = { if (_.isUndefined(ethUnitAmount) || _.isUndefined(ethUsdPrice)) { return defaultText; } - const rawUsdPrice = ethUnitAmount.mul(ethUsdPrice); + const rawUsdPrice = ethUnitAmount.multipliedBy(ethUsdPrice); const roundedUsdPrice = rawUsdPrice.toFixed(decimalPlaces); if (roundedUsdPrice === '0.00' && rawUsdPrice.gt(BIG_NUMBER_ZERO)) { return '<$0.01'; diff --git a/packages/instant/src/util/gas_price_estimator.ts b/packages/instant/src/util/gas_price_estimator.ts index 332c8d00a5..9792b60bae 100644 --- a/packages/instant/src/util/gas_price_estimator.ts +++ b/packages/instant/src/util/gas_price_estimator.ts @@ -35,7 +35,7 @@ const fetchFastAmountInWeiAsync = async (): Promise => { const gasPriceInGwei = new BigNumber(gasInfo.fast / 10); // Time is in minutes const estimatedTimeMs = gasInfo.fastWait * 60 * 1000; // Minutes to MS - return { gasPriceInWei: gasPriceInGwei.mul(GWEI_IN_WEI), estimatedTimeMs }; + return { gasPriceInWei: gasPriceInGwei.multipliedBy(GWEI_IN_WEI), estimatedTimeMs }; }; export class GasPriceEstimator { diff --git a/packages/instant/src/util/maybe_big_number.ts b/packages/instant/src/util/maybe_big_number.ts index 9d3746e10b..f48473389d 100644 --- a/packages/instant/src/util/maybe_big_number.ts +++ b/packages/instant/src/util/maybe_big_number.ts @@ -18,7 +18,7 @@ export const maybeBigNumberUtil = { }, areMaybeBigNumbersEqual: (val1: Maybe, val2: Maybe): boolean => { if (!_.isUndefined(val1) && !_.isUndefined(val2)) { - return val1.equals(val2); + return val1.isEqualTo(val2); } return _.isUndefined(val1) && _.isUndefined(val2); }, diff --git a/packages/order-utils/src/exchange_transfer_simulator.ts b/packages/order-utils/src/exchange_transfer_simulator.ts index 06621fd9ec..922ae8e171 100644 --- a/packages/order-utils/src/exchange_transfer_simulator.ts +++ b/packages/order-utils/src/exchange_transfer_simulator.ts @@ -88,14 +88,14 @@ export class ExchangeTransferSimulator { } const balance = await this._store.getBalanceAsync(assetData, from); const proxyAllowance = await this._store.getProxyAllowanceAsync(assetData, from); - if (proxyAllowance.lessThan(amountInBaseUnits)) { + if (proxyAllowance.isLessThan(amountInBaseUnits)) { ExchangeTransferSimulator._throwValidationError( FailureReason.ProxyAllowance, tradeSide, transferType, ); } - if (balance.lessThan(amountInBaseUnits)) { + if (balance.isLessThan(amountInBaseUnits)) { ExchangeTransferSimulator._throwValidationError(FailureReason.Balance, tradeSide, transferType); } await this._decreaseProxyAllowanceAsync(assetData, from, amountInBaseUnits); diff --git a/packages/order-utils/src/market_utils.ts b/packages/order-utils/src/market_utils.ts index fa32f14133..9042551fab 100644 --- a/packages/order-utils/src/market_utils.ts +++ b/packages/order-utils/src/market_utils.ts @@ -52,7 +52,7 @@ export const marketUtils = { const result = _.reduce( orders, ({ resultOrders, remainingFillAmount, ordersRemainingFillableMakerAssetAmounts }, order, index) => { - if (remainingFillAmount.lessThanOrEqualTo(constants.ZERO_AMOUNT)) { + if (remainingFillAmount.isLessThanOrEqualTo(constants.ZERO_AMOUNT)) { return { resultOrders, remainingFillAmount: constants.ZERO_AMOUNT, @@ -137,7 +137,7 @@ export const marketUtils = { (accFees, order, index) => { const makerAssetAmountAvailable = remainingFillableMakerAssetAmounts[index]; const feeToFillMakerAssetAmountAvailable = makerAssetAmountAvailable - .mul(order.takerFee) + .multipliedBy(order.takerFee) .dividedToIntegerBy(order.makerAssetAmount); return accFees.plus(feeToFillMakerAssetAmountAvailable); }, diff --git a/packages/order-utils/src/order_state_utils.ts b/packages/order-utils/src/order_state_utils.ts index 389419587f..430178b5d8 100644 --- a/packages/order-utils/src/order_state_utils.ts +++ b/packages/order-utils/src/order_state_utils.ts @@ -214,10 +214,10 @@ export class OrderStateUtils { const remainingFillableTakerAssetAmountGivenTakersStatus = orderRelevantTakerState.remainingFillableAssetAmount; // The min of these two in the actualy max fillable by either party - const fillableTakerAssetAmount = BigNumber.min([ + const fillableTakerAssetAmount = BigNumber.min( remainingFillableTakerAssetAmountGivenMakersStatus, remainingFillableTakerAssetAmountGivenTakersStatus, - ]); + ); return fillableTakerAssetAmount; } @@ -260,8 +260,8 @@ export class OrderStateUtils { traderAddress, ); - const transferrableTraderAssetAmount = BigNumber.min([traderProxyAllowance, traderBalance]); - const transferrableFeeAssetAmount = BigNumber.min([traderFeeProxyAllowance, traderFeeBalance]); + const transferrableTraderAssetAmount = BigNumber.min(traderProxyAllowance, traderBalance); + const transferrableFeeAssetAmount = BigNumber.min(traderFeeProxyAllowance, traderFeeBalance); const orderHash = orderHashUtils.getOrderHashHex(signedOrder); const filledTakerAssetAmount = await this._orderFilledCancelledFetcher.getFilledTakerAmountAsync(orderHash); @@ -312,7 +312,7 @@ export class OrderStateUtils { const tokenAddress = decodedAssetData.tokenAddress; balances[tokenAddress] = _.isUndefined(initialBalances[tokenAddress]) ? balance - : balances[tokenAddress].add(balance); + : balances[tokenAddress].plus(balance); } else if (assetDataUtils.isMultiAssetData(decodedAssetData)) { for (const assetDataElement of decodedAssetData.nestedAssetData) { balances = await this._getAssetBalancesAsync(assetDataElement, traderAddress, balances); @@ -335,7 +335,7 @@ export class OrderStateUtils { const tokenAddress = decodedAssetData.tokenAddress; allowances[tokenAddress] = _.isUndefined(initialAllowances[tokenAddress]) ? allowance - : allowances[tokenAddress].add(allowance); + : allowances[tokenAddress].plus(allowance); } else if (assetDataUtils.isMultiAssetData(decodedAssetData)) { for (const assetDataElement of decodedAssetData.nestedAssetData) { allowances = await this._getAssetBalancesAsync(assetDataElement, traderAddress, allowances); diff --git a/packages/order-utils/src/order_validation_utils.ts b/packages/order-utils/src/order_validation_utils.ts index ae4291ea86..95215d9188 100644 --- a/packages/order-utils/src/order_validation_utils.ts +++ b/packages/order-utils/src/order_validation_utils.ts @@ -31,13 +31,13 @@ export class OrderValidationUtils { if (denominator.eq(0)) { throw new Error('denominator cannot be 0'); } - const remainder = target.mul(numerator).mod(denominator); + const remainder = target.multipliedBy(numerator).mod(denominator); if (remainder.eq(0)) { return false; // no rounding error } // tslint:disable-next-line:custom-no-magic-numbers - const errPercentageTimes1000000 = remainder.mul(1000000).div(numerator.mul(target)); + const errPercentageTimes1000000 = remainder.multipliedBy(1000000).div(numerator.multipliedBy(target)); // tslint:disable-next-line:custom-no-magic-numbers const isError = errPercentageTimes1000000.gt(1000); return isError; @@ -108,7 +108,7 @@ export class OrderValidationUtils { } private static _validateOrderNotExpiredOrThrow(expirationTimeSeconds: BigNumber): void { const currentUnixTimestampSec = utils.getCurrentUnixTimestampSec(); - if (expirationTimeSeconds.lessThan(currentUnixTimestampSec)) { + if (expirationTimeSeconds.isLessThan(currentUnixTimestampSec)) { throw new Error(RevertReason.OrderUnfillable); } } @@ -216,7 +216,7 @@ export class OrderValidationUtils { } OrderValidationUtils._validateOrderNotExpiredOrThrow(signedOrder.expirationTimeSeconds); const remainingTakerTokenAmount = signedOrder.takerAssetAmount.minus(filledTakerTokenAmount); - const desiredFillTakerTokenAmount = remainingTakerTokenAmount.lessThan(fillTakerAssetAmount) + const desiredFillTakerTokenAmount = remainingTakerTokenAmount.isLessThan(fillTakerAssetAmount) ? remainingTakerTokenAmount : fillTakerAssetAmount; try { diff --git a/packages/order-utils/src/rate_utils.ts b/packages/order-utils/src/rate_utils.ts index 416e00c67b..dacdbd5a29 100644 --- a/packages/order-utils/src/rate_utils.ts +++ b/packages/order-utils/src/rate_utils.ts @@ -22,7 +22,7 @@ export const rateUtils = { feeRate.gte(constants.ZERO_AMOUNT), `Expected feeRate: ${feeRate} to be greater than or equal to 0`, ); - const takerAssetAmountNeededToPayForFees = order.takerFee.mul(feeRate); + const takerAssetAmountNeededToPayForFees = order.takerFee.multipliedBy(feeRate); const totalTakerAssetAmount = takerAssetAmountNeededToPayForFees.plus(order.takerAssetAmount); const rate = totalTakerAssetAmount.div(order.makerAssetAmount); return rate; @@ -35,9 +35,9 @@ export const rateUtils = { */ getFeeAdjustedRateOfFeeOrder(feeOrder: Order): BigNumber { assert.doesConformToSchema('feeOrder', feeOrder, schemas.orderSchema); - const zrxAmountAfterFees = feeOrder.makerAssetAmount.sub(feeOrder.takerFee); + const zrxAmountAfterFees = feeOrder.makerAssetAmount.minus(feeOrder.takerFee); assert.assert( - zrxAmountAfterFees.greaterThan(constants.ZERO_AMOUNT), + zrxAmountAfterFees.isGreaterThan(constants.ZERO_AMOUNT), `Expected takerFee: ${JSON.stringify(feeOrder.takerFee)} to be less than makerAssetAmount: ${JSON.stringify( feeOrder.makerAssetAmount, )}`, diff --git a/packages/order-utils/src/remaining_fillable_calculator.ts b/packages/order-utils/src/remaining_fillable_calculator.ts index 052eafa1d5..92ffc8e80b 100644 --- a/packages/order-utils/src/remaining_fillable_calculator.ts +++ b/packages/order-utils/src/remaining_fillable_calculator.ts @@ -39,15 +39,15 @@ export class RemainingFillableCalculator { private _hasSufficientFundsForFeeAndTransferAmount(): boolean { if (this._isTraderAssetZRX) { const totalZRXTransferAmountRequired = this._remainingOrderAssetAmount.plus(this._remainingOrderFeeAmount); - const hasSufficientFunds = this._transferrableAssetAmount.greaterThanOrEqualTo( + const hasSufficientFunds = this._transferrableAssetAmount.isGreaterThanOrEqualTo( totalZRXTransferAmountRequired, ); return hasSufficientFunds; } else { - const hasSufficientFundsForTransferAmount = this._transferrableAssetAmount.greaterThanOrEqualTo( + const hasSufficientFundsForTransferAmount = this._transferrableAssetAmount.isGreaterThanOrEqualTo( this._remainingOrderAssetAmount, ); - const hasSufficientFundsForFeeAmount = this._transferrableFeeAmount.greaterThanOrEqualTo( + const hasSufficientFundsForFeeAmount = this._transferrableFeeAmount.isGreaterThanOrEqualTo( this._remainingOrderFeeAmount, ); const hasSufficientFunds = hasSufficientFundsForTransferAmount && hasSufficientFundsForFeeAmount; diff --git a/packages/order-utils/src/salt.ts b/packages/order-utils/src/salt.ts index ff47ab5d28..95df66c995 100644 --- a/packages/order-utils/src/salt.ts +++ b/packages/order-utils/src/salt.ts @@ -13,6 +13,6 @@ export function generatePseudoRandomSalt(): BigNumber { // Source: https://mikemcl.github.io/bignumber.js/#random const randomNumber = BigNumber.random(MAX_DIGITS_IN_UNSIGNED_256_INT); const factor = new BigNumber(10).pow(MAX_DIGITS_IN_UNSIGNED_256_INT - 1); - const salt = randomNumber.times(factor).round(); + const salt = randomNumber.times(factor).integerValue(); return salt; } diff --git a/packages/order-utils/src/utils.ts b/packages/order-utils/src/utils.ts index 6b22610015..64195dbedb 100644 --- a/packages/order-utils/src/utils.ts +++ b/packages/order-utils/src/utils.ts @@ -10,13 +10,13 @@ export const utils = { }, getCurrentUnixTimestampSec(): BigNumber { const milisecondsInSecond = 1000; - return new BigNumber(Date.now() / milisecondsInSecond).round(); + return new BigNumber(Date.now() / milisecondsInSecond).integerValue(); }, getPartialAmountFloor(numerator: BigNumber, denominator: BigNumber, target: BigNumber): BigNumber { const fillMakerTokenAmount = numerator - .mul(target) + .multipliedBy(target) .div(denominator) - .round(0); + .integerValue(0); return fillMakerTokenAmount; }, }; diff --git a/packages/order-utils/test/remaining_fillable_calculator_test.ts b/packages/order-utils/test/remaining_fillable_calculator_test.ts index c55a76defe..affad8f1cb 100644 --- a/packages/order-utils/test/remaining_fillable_calculator_test.ts +++ b/packages/order-utils/test/remaining_fillable_calculator_test.ts @@ -162,7 +162,7 @@ describe('RemainingFillableCalculator', () => { remainingMakeAssetAmount, ); const calculatedFillableAmount = calculator.computeRemainingFillable(); - expect(calculatedFillableAmount.lessThanOrEqualTo(transferrableMakeAssetAmount)).to.be.true(); + expect(calculatedFillableAmount.isLessThanOrEqualTo(transferrableMakeAssetAmount)).to.be.true(); expect(calculatedFillableAmount).to.be.bignumber.greaterThan(new BigNumber(0)); const orderToFeeRatio = signedOrder.makerAssetAmount.dividedBy(signedOrder.makerFee); const calculatedFeeAmount = calculatedFillableAmount.dividedBy(orderToFeeRatio); diff --git a/packages/order-utils/test/signature_utils_test.ts b/packages/order-utils/test/signature_utils_test.ts index 84e5559a9b..9373820566 100644 --- a/packages/order-utils/test/signature_utils_test.ts +++ b/packages/order-utils/test/signature_utils_test.ts @@ -132,10 +132,10 @@ describe('Signature utils', () => { }); it('generates salt in range [0..2^256)', () => { const salt = generatePseudoRandomSalt(); - expect(salt.greaterThanOrEqualTo(0)).to.be.true(); + expect(salt.isGreaterThanOrEqualTo(0)).to.be.true(); // tslint:disable-next-line:custom-no-magic-numbers const twoPow256 = new BigNumber(2).pow(256); - expect(salt.lessThan(twoPow256)).to.be.true(); + expect(salt.isLessThan(twoPow256)).to.be.true(); }); }); describe('#ecSignOrderAsync', () => { diff --git a/packages/order-watcher/src/order_watcher/expiration_watcher.ts b/packages/order-watcher/src/order_watcher/expiration_watcher.ts index ad20a6e3f0..82590efdec 100644 --- a/packages/order-watcher/src/order_watcher/expiration_watcher.ts +++ b/packages/order-watcher/src/order_watcher/expiration_watcher.ts @@ -73,7 +73,7 @@ export class ExpirationWatcher { break; } const nextOrderHashToExpire = this._orderHashByExpirationRBTree.min(); - const hasNoExpiredOrders = this._expiration[nextOrderHashToExpire].greaterThan( + const hasNoExpiredOrders = this._expiration[nextOrderHashToExpire].isGreaterThan( currentUnixTimestampMs.plus(this._expirationMarginMs), ); const isSubscriptionActive = _.isUndefined(this._orderExpirationCheckingIntervalIdIfExists); diff --git a/packages/order-watcher/src/utils/utils.ts b/packages/order-watcher/src/utils/utils.ts index a7d10aaf9a..9c3849ff19 100644 --- a/packages/order-watcher/src/utils/utils.ts +++ b/packages/order-watcher/src/utils/utils.ts @@ -3,7 +3,7 @@ import { BigNumber } from '@0x/utils'; export const utils = { getCurrentUnixTimestampSec(): BigNumber { const milisecondsInASecond = 1000; - return new BigNumber(Date.now() / milisecondsInASecond).round(); + return new BigNumber(Date.now() / milisecondsInASecond).integerValue(); }, getCurrentUnixTimestampMs(): BigNumber { return new BigNumber(Date.now()); diff --git a/packages/order-watcher/test/order_watcher_test.ts b/packages/order-watcher/test/order_watcher_test.ts index 41dc884d51..28b564b325 100644 --- a/packages/order-watcher/test/order_watcher_test.ts +++ b/packages/order-watcher/test/order_watcher_test.ts @@ -317,7 +317,7 @@ describe('OrderWatcher', () => { const validOrderState = orderState as OrderStateValid; expect(validOrderState.orderHash).to.be.equal(orderHash); const orderRelevantState = validOrderState.orderRelevantState; - const remainingMakerBalance = makerBalance.sub(fillAmountInBaseUnits); + const remainingMakerBalance = makerBalance.minus(fillAmountInBaseUnits); const remainingFillable = fillableAmount.minus(fillAmountInBaseUnits); expect(orderRelevantState.remainingFillableMakerAssetAmount).to.be.bignumber.equal( remainingFillable, @@ -434,7 +434,7 @@ describe('OrderWatcher', () => { ); const remainingAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(1), decimals); - const transferAmount = makerBalance.sub(remainingAmount); + const transferAmount = makerBalance.minus(remainingAmount); await orderWatcher.addOrderAsync(signedOrder); const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { @@ -475,7 +475,7 @@ describe('OrderWatcher', () => { const remainingFeeAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(3), decimals); const remainingTokenAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(4), decimals); - const transferTokenAmount = makerFee.sub(remainingTokenAmount); + const transferTokenAmount = makerFee.minus(remainingTokenAmount); await orderWatcher.addOrderAsync(signedOrder); const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { diff --git a/packages/pipeline/src/utils/transformers/number_to_bigint.ts b/packages/pipeline/src/utils/transformers/number_to_bigint.ts index 9736d7c185..8fbd520933 100644 --- a/packages/pipeline/src/utils/transformers/number_to_bigint.ts +++ b/packages/pipeline/src/utils/transformers/number_to_bigint.ts @@ -19,7 +19,7 @@ export class NumberToBigIntTransformer implements ValueTransformer { // tslint:disable-next-line:prefer-function-over-method public from(value: string): number { - if (new BigNumber(value).greaterThan(Number.MAX_SAFE_INTEGER)) { + if (new BigNumber(value).isGreaterThan(Number.MAX_SAFE_INTEGER)) { throw new Error( `Attempted to convert PostgreSQL bigint value (${value}) to JavaScript number type but it is too big to safely convert`, ); diff --git a/packages/testnet-faucets/src/ts/dispense_asset_tasks.ts b/packages/testnet-faucets/src/ts/dispense_asset_tasks.ts index 32f5cb6236..58caeeeaac 100644 --- a/packages/testnet-faucets/src/ts/dispense_asset_tasks.ts +++ b/packages/testnet-faucets/src/ts/dispense_asset_tasks.ts @@ -19,7 +19,7 @@ export const dispenseAssetTasks = { logUtils.log(`Processing ETH ${recipientAddress}`); const userBalance = await web3Wrapper.getBalanceInWeiAsync(recipientAddress); const maxAmountInWei = Web3Wrapper.toWei(new BigNumber(DISPENSE_MAX_AMOUNT_ETHER)); - if (userBalance.greaterThanOrEqualTo(maxAmountInWei)) { + if (userBalance.isGreaterThanOrEqualTo(maxAmountInWei)) { logUtils.log( `User exceeded ETH balance maximum (${maxAmountInWei}) ${recipientAddress} ${userBalance} `, ); @@ -55,7 +55,7 @@ export const dispenseAssetTasks = { new BigNumber(DISPENSE_MAX_AMOUNT_TOKEN), tokenIfExists.decimals, ); - if (userBalanceBaseUnits.greaterThanOrEqualTo(maxAmountBaseUnits)) { + if (userBalanceBaseUnits.isGreaterThanOrEqualTo(maxAmountBaseUnits)) { logUtils.log( `User exceeded token balance maximum (${maxAmountBaseUnits}) ${recipientAddress} ${userBalanceBaseUnits} `, ); diff --git a/packages/testnet-faucets/src/ts/handler.ts b/packages/testnet-faucets/src/ts/handler.ts index 8f642d4b00..54387749f4 100644 --- a/packages/testnet-faucets/src/ts/handler.ts +++ b/packages/testnet-faucets/src/ts/handler.ts @@ -179,7 +179,7 @@ export class Handler { feeRecipientAddress: NULL_ADDRESS, senderAddress: NULL_ADDRESS, // tslint:disable-next-line:custom-no-magic-numbers - expirationTimeSeconds: new BigNumber(Date.now() + FIVE_DAYS_IN_MS).div(1000).floor(), + expirationTimeSeconds: new BigNumber(Date.now() + FIVE_DAYS_IN_MS).div(1000).integerValue(BigNumber.ROUND_FLOOR), }; const orderHash = orderHashUtils.getOrderHashHex(order); const signature = await signatureUtils.ecSignHashAsync( diff --git a/packages/types/package.json b/packages/types/package.json index 2fea809bc9..440f054231 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -31,7 +31,7 @@ }, "dependencies": { "@types/node": "*", - "bignumber.js": "~4.1.0", + "bignumber.js": "~8.0.2", "ethereum-types": "^1.1.6" }, "publishConfig": { diff --git a/packages/typescript-typings/package.json b/packages/typescript-typings/package.json index 6640760e48..01cab8c639 100644 --- a/packages/typescript-typings/package.json +++ b/packages/typescript-typings/package.json @@ -26,7 +26,7 @@ "dependencies": { "@types/bn.js": "^4.11.0", "@types/react": "*", - "bignumber.js": "~4.1.0", + "bignumber.js": "~8.0.2", "ethereum-types": "^1.1.6", "popper.js": "1.14.3" }, diff --git a/packages/utils/package.json b/packages/utils/package.json index 315f5a08f1..3b16550a5c 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -48,7 +48,7 @@ "@0x/typescript-typings": "^3.0.8", "@types/node": "*", "abortcontroller-polyfill": "^1.1.9", - "bignumber.js": "~4.1.0", + "bignumber.js": "~8.0.2", "chalk": "^2.4.1", "detect-node": "2.0.3", "ethereum-types": "^1.1.6", diff --git a/packages/utils/src/abi_encoder/evm_data_types/bool.ts b/packages/utils/src/abi_encoder/evm_data_types/bool.ts index 7f91f34e6e..23298bc88d 100644 --- a/packages/utils/src/abi_encoder/evm_data_types/bool.ts +++ b/packages/utils/src/abi_encoder/evm_data_types/bool.ts @@ -37,11 +37,11 @@ export class BoolDataType extends AbstractBlobDataType { const valueBuf = calldata.popWord(); const valueHex = ethUtil.bufferToHex(valueBuf); const valueNumber = new BigNumber(valueHex, constants.HEX_BASE); - if (!(valueNumber.equals(0) || valueNumber.equals(1))) { + if (!(valueNumber.isEqualTo(0) || valueNumber.isEqualTo(1))) { throw new Error(`Failed to decode boolean. Expected 0x0 or 0x1, got ${valueHex}`); } /* tslint:disable boolean-naming */ - const value: boolean = !valueNumber.equals(0); + const value: boolean = !valueNumber.isEqualTo(0); /* tslint:enable boolean-naming */ return value; } diff --git a/packages/utils/src/abi_encoder/evm_data_types/int.ts b/packages/utils/src/abi_encoder/evm_data_types/int.ts index 8d98e195b2..b7e0d9f4e5 100644 --- a/packages/utils/src/abi_encoder/evm_data_types/int.ts +++ b/packages/utils/src/abi_encoder/evm_data_types/int.ts @@ -38,8 +38,8 @@ export class IntDataType extends AbstractBlobDataType { throw new Error(`Tried to instantiate Int with bad input: ${dataItem}`); } this._width = IntDataType._decodeWidthFromType(dataItem.type); - this._minValue = new BigNumber(2).toPower(this._width - 1).times(-1); - this._maxValue = new BigNumber(2).toPower(this._width - 1).sub(1); + this._minValue = new BigNumber(2).exponentiatedBy(this._width - 1).times(-1); + this._maxValue = new BigNumber(2).exponentiatedBy(this._width - 1).minus(1); } public encodeValue(value: BigNumber | string | number): Buffer { diff --git a/packages/utils/src/abi_encoder/evm_data_types/uint.ts b/packages/utils/src/abi_encoder/evm_data_types/uint.ts index 8e382e8dc0..a82aa789ea 100644 --- a/packages/utils/src/abi_encoder/evm_data_types/uint.ts +++ b/packages/utils/src/abi_encoder/evm_data_types/uint.ts @@ -38,7 +38,7 @@ export class UIntDataType extends AbstractBlobDataType { throw new Error(`Tried to instantiate UInt with bad input: ${dataItem}`); } this._width = UIntDataType._decodeWidthFromType(dataItem.type); - this._maxValue = new BigNumber(2).toPower(this._width).sub(1); + this._maxValue = new BigNumber(2).exponentiatedBy(this._width).minus(1); } public encodeValue(value: BigNumber | string | number): Buffer { diff --git a/packages/utils/src/abi_encoder/utils/math.ts b/packages/utils/src/abi_encoder/utils/math.ts index d84983c5b9..b2fa5fe7d6 100644 --- a/packages/utils/src/abi_encoder/utils/math.ts +++ b/packages/utils/src/abi_encoder/utils/math.ts @@ -10,9 +10,9 @@ function sanityCheckBigNumberRange( maxValue: BigNumber, ): void { const value = new BigNumber(value_, 10); - if (value.greaterThan(maxValue)) { + if (value.isGreaterThan(maxValue)) { throw new Error(`Tried to assign value of ${value}, which exceeds max value of ${maxValue}`); - } else if (value.lessThan(minValue)) { + } else if (value.isLessThan(minValue)) { throw new Error(`Tried to assign value of ${value}, which exceeds min value of ${minValue}`); } } @@ -30,7 +30,7 @@ function bigNumberToPaddedBuffer(value: BigNumber): Buffer { export function encodeNumericValue(value_: BigNumber | string | number): Buffer { const value = new BigNumber(value_, 10); // Case 1/2: value is non-negative - if (value.greaterThanOrEqualTo(0)) { + if (value.isGreaterThanOrEqualTo(0)) { const encodedPositiveValue = bigNumberToPaddedBuffer(value); return encodedPositiveValue; } @@ -74,7 +74,7 @@ export function decodeNumericValue(encodedValue: Buffer, minValue: BigNumber): B const valueHex = ethUtil.bufferToHex(encodedValue); // Case 1/3: value is definitely non-negative because of numeric boundaries const value = new BigNumber(valueHex, constants.HEX_BASE); - if (!minValue.lessThan(0)) { + if (!minValue.isLessThan(0)) { return value; } // Case 2/3: value is non-negative because there is no leading 1 (encoded as two's-complement) diff --git a/packages/web3-wrapper/src/utils.ts b/packages/web3-wrapper/src/utils.ts index c685876323..1b67518b19 100644 --- a/packages/web3-wrapper/src/utils.ts +++ b/packages/web3-wrapper/src/utils.ts @@ -37,7 +37,7 @@ export const utils = { const hexBase = 16; const valueHex = valueBigNumber.toString(hexBase); - return valueBigNumber.lessThan(0) ? `-0x${valueHex.substr(1)}` : `0x${valueHex}`; + return valueBigNumber.isLessThan(0) ? `-0x${valueHex.substr(1)}` : `0x${valueHex}`; }, numberToHex(value: number): string { if (!isFinite(value) && !utils.isHexStrict(value)) { diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts index 37f746f7ca..ea5a593400 100644 --- a/packages/website/ts/blockchain.ts +++ b/packages/website/ts/blockchain.ts @@ -944,7 +944,7 @@ export class Blockchain { try { const gasInfo = await backendClient.getGasInfoAsync(); const gasPriceInGwei = new BigNumber(gasInfo.fast / 10); - const gasPriceInWei = gasPriceInGwei.mul(1000000000); + const gasPriceInWei = gasPriceInGwei.multipliedBy(1000000000); this._defaultGasPrice = gasPriceInWei; } catch (err) { return; diff --git a/packages/website/ts/components/fill_order.tsx b/packages/website/ts/components/fill_order.tsx index 7fee8c4dfd..95a3671c42 100644 --- a/packages/website/ts/components/fill_order.tsx +++ b/packages/website/ts/components/fill_order.tsx @@ -205,7 +205,7 @@ export class FillOrder extends React.Component { amount: orderMakerAmount .times(takerAssetToken.amount) .div(orderTakerAmount) - .floor(), + .integerValue(BigNumber.ROUND_FLOOR), symbol: makerToken.symbol, }; const fillAssetToken = { @@ -219,7 +219,7 @@ export class FillOrder extends React.Component { const orderReceiveAmountBigNumber = orderMakerAmount .times(this.props.orderFillAmount) .dividedBy(orderTakerAmount) - .floor(); + .integerValue(BigNumber.ROUND_FLOOR); orderReceiveAmount = this._formatCurrencyAmount(orderReceiveAmountBigNumber, makerToken.decimals); } const isUserMaker = diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index 890f1553ad..e84f9d0cce 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -394,7 +394,7 @@ export const utils = { }, getUsdValueFormattedAmount(amount: BigNumber, decimals: number, price: BigNumber): string { const unitAmount = Web3Wrapper.toUnitAmount(amount, decimals); - const value = unitAmount.mul(price); + const value = unitAmount.multipliedBy(price); return utils.format(value, constants.NUMERAL_USD_FORMAT); }, openUrl(url: string): void { diff --git a/yarn.lock b/yarn.lock index f08d8b853b..066129bbdf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3391,6 +3391,10 @@ bignumber.js@~4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-4.1.0.tgz#db6f14067c140bd46624815a7916c92d9b6c24b1" +bignumber.js@~8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-8.0.2.tgz#d8c4e1874359573b1ef03011a2d861214aeef137" + binary-extensions@^1.0.0: version "1.11.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" From eb393f0a6643183c784914bf3e039d1f4299247d Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 14 Jan 2019 15:53:43 +0100 Subject: [PATCH 02/18] Upgrade chai-bignumber --- contracts/examples/package.json | 2 +- contracts/extensions/package.json | 2 +- contracts/libs/package.json | 2 +- contracts/multisig/package.json | 2 +- contracts/protocol/package.json | 2 +- contracts/test-utils/package.json | 2 +- contracts/tokens/package.json | 2 +- contracts/utils/package.json | 2 +- packages/0x.js/package.json | 2 +- packages/asset-buyer/package.json | 2 +- packages/contract-wrappers/package.json | 2 +- packages/instant/src/util/asset.ts | 5 ++++- packages/instant/src/util/format.ts | 2 +- packages/metacoin/package.json | 2 +- packages/order-utils/package.json | 2 +- packages/order-watcher/package.json | 2 +- packages/utils/package.json | 2 +- packages/web3-wrapper/package.json | 2 +- 18 files changed, 21 insertions(+), 18 deletions(-) diff --git a/contracts/examples/package.json b/contracts/examples/package.json index 286d0f5080..c932a1ad17 100644 --- a/contracts/examples/package.json +++ b/contracts/examples/package.json @@ -45,7 +45,7 @@ "@types/yargs": "^10.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.1", + "chai-bignumber": "^2.0.2", "dirty-chai": "^2.0.1", "ethereumjs-abi": "0.6.5", "make-promises-safe": "^1.1.0", diff --git a/contracts/extensions/package.json b/contracts/extensions/package.json index a7a8b1b936..25220d607c 100644 --- a/contracts/extensions/package.json +++ b/contracts/extensions/package.json @@ -57,7 +57,7 @@ "@types/yargs": "^10.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.1", + "chai-bignumber": "^2.0.2", "dirty-chai": "^2.0.1", "ethereumjs-abi": "0.6.5", "make-promises-safe": "^1.1.0", diff --git a/contracts/libs/package.json b/contracts/libs/package.json index abbdfdb97f..0c7f3de914 100644 --- a/contracts/libs/package.json +++ b/contracts/libs/package.json @@ -56,7 +56,7 @@ "@types/yargs": "^10.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.1", + "chai-bignumber": "^2.0.2", "dirty-chai": "^2.0.1", "ethereumjs-abi": "0.6.5", "make-promises-safe": "^1.1.0", diff --git a/contracts/multisig/package.json b/contracts/multisig/package.json index f819c59f86..7740280667 100644 --- a/contracts/multisig/package.json +++ b/contracts/multisig/package.json @@ -57,7 +57,7 @@ "@types/yargs": "^10.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.1", + "chai-bignumber": "^2.0.2", "dirty-chai": "^2.0.1", "make-promises-safe": "^1.1.0", "mocha": "^4.1.0", diff --git a/contracts/protocol/package.json b/contracts/protocol/package.json index 420ca4e3db..7e52807a35 100644 --- a/contracts/protocol/package.json +++ b/contracts/protocol/package.json @@ -55,7 +55,7 @@ "@types/yargs": "^10.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.1", + "chai-bignumber": "^2.0.2", "dirty-chai": "^2.0.1", "ethereumjs-abi": "0.6.5", "make-promises-safe": "^1.1.0", diff --git a/contracts/test-utils/package.json b/contracts/test-utils/package.json index 92fd6a7caa..93334bfe5a 100644 --- a/contracts/test-utils/package.json +++ b/contracts/test-utils/package.json @@ -61,7 +61,7 @@ "bn.js": "^4.11.8", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.1", + "chai-bignumber": "^2.0.2", "dirty-chai": "^2.0.1", "ethereum-types": "^1.1.6", "ethereumjs-abi": "0.6.5", diff --git a/contracts/tokens/package.json b/contracts/tokens/package.json index c896d122d0..cf9e459cda 100644 --- a/contracts/tokens/package.json +++ b/contracts/tokens/package.json @@ -56,7 +56,7 @@ "@types/yargs": "^10.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.1", + "chai-bignumber": "^2.0.2", "dirty-chai": "^2.0.1", "ethereumjs-abi": "0.6.5", "make-promises-safe": "^1.1.0", diff --git a/contracts/utils/package.json b/contracts/utils/package.json index a19519897d..0e206a3e3b 100644 --- a/contracts/utils/package.json +++ b/contracts/utils/package.json @@ -57,7 +57,7 @@ "bn.js": "^4.11.8", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.1", + "chai-bignumber": "^2.0.2", "dirty-chai": "^2.0.1", "ethereumjs-abi": "0.6.5", "make-promises-safe": "^1.1.0", diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index ca990c0a7b..29b7fa6bda 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -54,7 +54,7 @@ "awesome-typescript-loader": "^5.2.1", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.1", + "chai-bignumber": "^2.0.2", "copyfiles": "^2.0.0", "dirty-chai": "^2.0.1", "make-promises-safe": "^1.1.0", diff --git a/packages/asset-buyer/package.json b/packages/asset-buyer/package.json index 3fca316647..fcc99608a4 100644 --- a/packages/asset-buyer/package.json +++ b/packages/asset-buyer/package.json @@ -56,7 +56,7 @@ "@types/node": "*", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.1", + "chai-bignumber": "^2.0.2", "dirty-chai": "^2.0.1", "make-promises-safe": "^1.1.0", "mocha": "^4.1.0", diff --git a/packages/contract-wrappers/package.json b/packages/contract-wrappers/package.json index c4f75a5a49..45b34ab104 100644 --- a/packages/contract-wrappers/package.json +++ b/packages/contract-wrappers/package.json @@ -49,7 +49,7 @@ "@types/web3-provider-engine": "^14.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.1", + "chai-bignumber": "^2.0.2", "dirty-chai": "^2.0.1", "make-promises-safe": "^1.1.0", "mocha": "^4.1.0", diff --git a/packages/instant/src/util/asset.ts b/packages/instant/src/util/asset.ts index a6fd77d5a1..9e509edf9c 100644 --- a/packages/instant/src/util/asset.ts +++ b/packages/instant/src/util/asset.ts @@ -121,7 +121,10 @@ export const assetUtils = { error.amountAvailableToFill, asset.metaData.decimals, ); - const roundedUnitAmountAvailableToFill = unitAmountAvailableToFill.integerValue(2, BigNumber.ROUND_DOWN); + const roundedUnitAmountAvailableToFill = unitAmountAvailableToFill.decimalPlaces( + 2, + BigNumber.ROUND_DOWN, + ); if (roundedUnitAmountAvailableToFill.isGreaterThan(BIG_NUMBER_ZERO)) { return `There are only ${roundedUnitAmountAvailableToFill} ${assetName} available to buy`; diff --git a/packages/instant/src/util/format.ts b/packages/instant/src/util/format.ts index eef332d3ce..61aeb839fc 100644 --- a/packages/instant/src/util/format.ts +++ b/packages/instant/src/util/format.ts @@ -25,7 +25,7 @@ export const format = { if (_.isUndefined(ethUnitAmount)) { return defaultText; } - let roundedAmount = ethUnitAmount.integerValue(decimalPlaces).toDigits(decimalPlaces); + let roundedAmount = ethUnitAmount.decimalPlaces(decimalPlaces).precision(decimalPlaces); if (roundedAmount.eq(BIG_NUMBER_ZERO) && ethUnitAmount.isGreaterThan(BIG_NUMBER_ZERO)) { // Sometimes for small ETH amounts (i.e. 0.000045) the amount rounded to 4 decimalPlaces is 0 diff --git a/packages/metacoin/package.json b/packages/metacoin/package.json index accdd2949c..1334fd0428 100644 --- a/packages/metacoin/package.json +++ b/packages/metacoin/package.json @@ -53,7 +53,7 @@ "@0x/sol-compiler": "^2.0.2", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.1", + "chai-bignumber": "^2.0.2", "dirty-chai": "^2.0.1", "make-promises-safe": "^1.1.0", "npm-run-all": "^4.1.2", diff --git a/packages/order-utils/package.json b/packages/order-utils/package.json index bdcbd2dfca..5bd459f802 100644 --- a/packages/order-utils/package.json +++ b/packages/order-utils/package.json @@ -41,7 +41,7 @@ "@types/lodash": "4.14.104", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.1", + "chai-bignumber": "^2.0.2", "dirty-chai": "^2.0.1", "make-promises-safe": "^1.1.0", "mocha": "^4.1.0", diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json index 4cae456042..2b87b3c32b 100644 --- a/packages/order-watcher/package.json +++ b/packages/order-watcher/package.json @@ -44,7 +44,7 @@ "@types/sinon": "^2.2.2", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.1", + "chai-bignumber": "^2.0.2", "dirty-chai": "^2.0.1", "make-promises-safe": "^1.1.0", "mocha": "^4.1.0", diff --git a/packages/utils/package.json b/packages/utils/package.json index 3b16550a5c..4cbbfceddb 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -34,7 +34,7 @@ "@types/mocha": "^2.2.42", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.1", + "chai-bignumber": "^2.0.2", "dirty-chai": "^2.0.1", "make-promises-safe": "^1.1.0", "mocha": "^4.1.0", diff --git a/packages/web3-wrapper/package.json b/packages/web3-wrapper/package.json index ce9c41ae75..ddbc68c6c7 100644 --- a/packages/web3-wrapper/package.json +++ b/packages/web3-wrapper/package.json @@ -41,7 +41,7 @@ "@types/lodash": "4.14.104", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.1", + "chai-bignumber": "^2.0.2", "dirty-chai": "^2.0.1", "ganache-core": "0xProject/ganache-core#monorepo-dep", "make-promises-safe": "^1.1.0", From a084bbbed833caf8318ae68c9c71edcb543676f1 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 14 Jan 2019 19:24:21 +0100 Subject: [PATCH 03/18] Rename cmp to comparedTo --- contracts/tokens/test/unlimited_allowance_token.ts | 2 +- contracts/tokens/test/zrx_token.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/tokens/test/unlimited_allowance_token.ts b/contracts/tokens/test/unlimited_allowance_token.ts index 6d5a29b23f..f0b8e53a46 100644 --- a/contracts/tokens/test/unlimited_allowance_token.ts +++ b/contracts/tokens/test/unlimited_allowance_token.ts @@ -109,7 +109,7 @@ describe('UnlimitedAllowanceToken', () => { const amountToTransfer = ownerBalance; const spenderAllowance = await token.allowance.callAsync(owner, spender); - const isSpenderAllowanceInsufficient = spenderAllowance.cmp(amountToTransfer) < 0; + const isSpenderAllowanceInsufficient = spenderAllowance.comparedTo(amountToTransfer) < 0; expect(isSpenderAllowanceInsufficient).to.be.true(); return expectContractCallFailedAsync( diff --git a/contracts/tokens/test/zrx_token.ts b/contracts/tokens/test/zrx_token.ts index 5dc8447f69..820b054e6b 100644 --- a/contracts/tokens/test/zrx_token.ts +++ b/contracts/tokens/test/zrx_token.ts @@ -117,7 +117,7 @@ describe('ZRXToken', () => { const amountToTransfer = ownerBalance; const spenderAllowance = await zrxToken.allowance.callAsync(owner, spender); - const isSpenderAllowanceInsufficient = spenderAllowance.cmp(amountToTransfer) < 0; + const isSpenderAllowanceInsufficient = spenderAllowance.comparedTo(amountToTransfer) < 0; expect(isSpenderAllowanceInsufficient).to.be.true(); const didReturnTrue = await zrxToken.transferFrom.callAsync(owner, spender, amountToTransfer, { From 61c88455f49c86041263e48e99ca80ab4f2a9a6e Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 14 Jan 2019 20:30:18 +0100 Subject: [PATCH 04/18] Apply prettier --- contracts/protocol/test/exchange/wrapper.ts | 48 +++++++++---------- .../src/utils/buy_quote_calculator.ts | 4 +- packages/instant/src/util/asset.ts | 5 +- packages/testnet-faucets/src/ts/handler.ts | 4 +- 4 files changed, 32 insertions(+), 29 deletions(-) diff --git a/contracts/protocol/test/exchange/wrapper.ts b/contracts/protocol/test/exchange/wrapper.ts index 32ec647166..49ba5a2e57 100644 --- a/contracts/protocol/test/exchange/wrapper.ts +++ b/contracts/protocol/test/exchange/wrapper.ts @@ -493,15 +493,15 @@ describe('Exchange wrappers', () => { erc20Balances[makerAddress][makerAssetAddress] = erc20Balances[makerAddress][ makerAssetAddress ].minus(makerAssetFilledAmount); - erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][takerAssetAddress].plus( - takerAssetFillAmount, - ); + erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][ + takerAssetAddress + ].plus(takerAssetFillAmount); erc20Balances[makerAddress][zrxToken.address] = erc20Balances[makerAddress][zrxToken.address].minus( makerFee, ); - erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][makerAssetAddress].plus( - makerAssetFilledAmount, - ); + erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][ + makerAssetAddress + ].plus(makerAssetFilledAmount); erc20Balances[takerAddress][takerAssetAddress] = erc20Balances[takerAddress][ takerAssetAddress ].minus(takerAssetFillAmount); @@ -562,15 +562,15 @@ describe('Exchange wrappers', () => { erc20Balances[makerAddress][makerAssetAddress] = erc20Balances[makerAddress][ makerAssetAddress ].minus(makerAssetFilledAmount); - erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][takerAssetAddress].plus( - takerAssetFillAmount, - ); + erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][ + takerAssetAddress + ].plus(takerAssetFillAmount); erc20Balances[makerAddress][zrxToken.address] = erc20Balances[makerAddress][zrxToken.address].minus( makerFee, ); - erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][makerAssetAddress].plus( - makerAssetFilledAmount, - ); + erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][ + makerAssetAddress + ].plus(makerAssetFilledAmount); erc20Balances[takerAddress][takerAssetAddress] = erc20Balances[takerAddress][ takerAssetAddress ].minus(takerAssetFillAmount); @@ -647,15 +647,15 @@ describe('Exchange wrappers', () => { erc20Balances[makerAddress][makerAssetAddress] = erc20Balances[makerAddress][ makerAssetAddress ].minus(makerAssetFilledAmount); - erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][takerAssetAddress].plus( - takerAssetFillAmount, - ); + erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][ + takerAssetAddress + ].plus(takerAssetFillAmount); erc20Balances[makerAddress][zrxToken.address] = erc20Balances[makerAddress][zrxToken.address].minus( makerFee, ); - erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][makerAssetAddress].plus( - makerAssetFilledAmount, - ); + erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][ + makerAssetAddress + ].plus(makerAssetFilledAmount); erc20Balances[takerAddress][takerAssetAddress] = erc20Balances[takerAddress][ takerAssetAddress ].minus(takerAssetFillAmount); @@ -706,15 +706,15 @@ describe('Exchange wrappers', () => { erc20Balances[makerAddress][makerAssetAddress] = erc20Balances[makerAddress][ makerAssetAddress ].minus(makerAssetFilledAmount); - erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][takerAssetAddress].plus( - takerAssetFillAmount, - ); + erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][ + takerAssetAddress + ].plus(takerAssetFillAmount); erc20Balances[makerAddress][zrxToken.address] = erc20Balances[makerAddress][zrxToken.address].minus( makerFee, ); - erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][makerAssetAddress].plus( - makerAssetFilledAmount, - ); + erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][ + makerAssetAddress + ].plus(makerAssetFilledAmount); erc20Balances[takerAddress][takerAssetAddress] = erc20Balances[takerAddress][ takerAssetAddress ].minus(takerAssetFillAmount); diff --git a/packages/asset-buyer/src/utils/buy_quote_calculator.ts b/packages/asset-buyer/src/utils/buy_quote_calculator.ts index 9205678e70..1258410945 100644 --- a/packages/asset-buyer/src/utils/buy_quote_calculator.ts +++ b/packages/asset-buyer/src/utils/buy_quote_calculator.ts @@ -43,7 +43,9 @@ export const buyQuoteCalculator = { const multiplierNeededWithSlippage = new BigNumber(1).plus(slippagePercentage); // Given amountAvailableToFillConsideringSlippage * multiplierNeededWithSlippage = amountAbleToFill // We divide amountUnableToFill by multiplierNeededWithSlippage to determine amountAvailableToFillConsideringSlippage - const amountAvailableToFillConsideringSlippage = amountAbleToFill.div(multiplierNeededWithSlippage).integerValue(BigNumber.ROUND_FLOOR); + const amountAvailableToFillConsideringSlippage = amountAbleToFill + .div(multiplierNeededWithSlippage) + .integerValue(BigNumber.ROUND_FLOOR); throw new InsufficientAssetLiquidityError(amountAvailableToFillConsideringSlippage); } diff --git a/packages/instant/src/util/asset.ts b/packages/instant/src/util/asset.ts index 9e509edf9c..b5c97913db 100644 --- a/packages/instant/src/util/asset.ts +++ b/packages/instant/src/util/asset.ts @@ -104,9 +104,8 @@ export const assetUtils = { return assetDataGroupIfExists[Network.Mainnet]; }, getERC20AssetsFromAssets: (assets: Asset[]): ERC20Asset[] => { - const erc20sOrUndefined = _.map( - assets, - asset => (asset.metaData.assetProxyId === AssetProxyId.ERC20 ? (asset as ERC20Asset) : undefined), + const erc20sOrUndefined = _.map(assets, asset => + asset.metaData.assetProxyId === AssetProxyId.ERC20 ? (asset as ERC20Asset) : undefined, ); return _.compact(erc20sOrUndefined); }, diff --git a/packages/testnet-faucets/src/ts/handler.ts b/packages/testnet-faucets/src/ts/handler.ts index 54387749f4..d4166ae91a 100644 --- a/packages/testnet-faucets/src/ts/handler.ts +++ b/packages/testnet-faucets/src/ts/handler.ts @@ -179,7 +179,9 @@ export class Handler { feeRecipientAddress: NULL_ADDRESS, senderAddress: NULL_ADDRESS, // tslint:disable-next-line:custom-no-magic-numbers - expirationTimeSeconds: new BigNumber(Date.now() + FIVE_DAYS_IN_MS).div(1000).integerValue(BigNumber.ROUND_FLOOR), + expirationTimeSeconds: new BigNumber(Date.now() + FIVE_DAYS_IN_MS) + .div(1000) + .integerValue(BigNumber.ROUND_FLOOR), }; const orderHash = orderHashUtils.getOrderHashHex(order); const signature = await signatureUtils.ecSignHashAsync( From a085654aba41d869c617f9f0151e7c230fcca573 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 Jan 2019 11:12:35 +0100 Subject: [PATCH 05/18] Fix linting error --- packages/testnet-faucets/src/ts/handler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/testnet-faucets/src/ts/handler.ts b/packages/testnet-faucets/src/ts/handler.ts index d4166ae91a..533e1f8b38 100644 --- a/packages/testnet-faucets/src/ts/handler.ts +++ b/packages/testnet-faucets/src/ts/handler.ts @@ -178,8 +178,8 @@ export class Handler { exchangeAddress: networkConfig.contractWrappers.exchange.address, feeRecipientAddress: NULL_ADDRESS, senderAddress: NULL_ADDRESS, - // tslint:disable-next-line:custom-no-magic-numbers expirationTimeSeconds: new BigNumber(Date.now() + FIVE_DAYS_IN_MS) + // tslint:disable-next-line:custom-no-magic-numbers .div(1000) .integerValue(BigNumber.ROUND_FLOOR), }; From de78d6a8ad6104a044e5b56251c47a41b63bf013 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 Jan 2019 11:14:18 +0100 Subject: [PATCH 06/18] Fix isBigNumber check for the new version --- packages/assert/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/assert/src/index.ts b/packages/assert/src/index.ts index b9a04686ac..741bd78e16 100644 --- a/packages/assert/src/index.ts +++ b/packages/assert/src/index.ts @@ -7,7 +7,7 @@ const HEX_REGEX = /^0x[0-9A-F]*$/i; export const assert = { isBigNumber(variableName: string, value: BigNumber): void { - const isBigNumber = _.isObject(value) && (value as any).isBigNumber; + const isBigNumber = BigNumber.isBigNumber(value); assert.assert(isBigNumber, assert.typeAssertionMessage(variableName, 'BigNumber', value)); }, isValidBaseUnitAmount(variableName: string, value: BigNumber): void { From e84232cce8b1a1b1e3607d341baa688613dcefde Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 Jan 2019 11:32:53 +0100 Subject: [PATCH 07/18] Use new check for isBigNumber --- packages/base-contract/src/index.ts | 2 +- packages/order-utils/src/crypto.ts | 3 ++- packages/utils/src/sign_typed_data_utils.ts | 5 +++-- packages/web3-wrapper/src/utils.ts | 6 +----- packages/web3-wrapper/test/web3_wrapper_test.ts | 5 +++-- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/packages/base-contract/src/index.ts b/packages/base-contract/src/index.ts index c2b7b943b0..101228c52c 100644 --- a/packages/base-contract/src/index.ts +++ b/packages/base-contract/src/index.ts @@ -43,7 +43,7 @@ export class BaseContract { return type === 'address' ? value.toLowerCase() : value; } protected static _bigNumberToString(_type: string, value: any): any { - return _.isObject(value) && value.isBigNumber ? value.toString() : value; + return BigNumber.isBigNumber(value) ? value.toString() : value; } protected static _lookupConstructorAbi(abi: ContractAbi): ConstructorAbi { const constructorAbiIfExists = _.find( diff --git a/packages/order-utils/src/crypto.ts b/packages/order-utils/src/crypto.ts index 0f1504a72d..8b835ff488 100644 --- a/packages/order-utils/src/crypto.ts +++ b/packages/order-utils/src/crypto.ts @@ -1,3 +1,4 @@ +import { BigNumber } from '@0x/utils'; import BN = require('bn.js'); import ABI = require('ethereumjs-abi'); import ethUtil = require('ethereumjs-util'); @@ -24,7 +25,7 @@ export const crypto = { const isNumber = _.isFinite(arg); if (isNumber) { argTypes.push('uint8'); - } else if (arg.isBigNumber) { + } else if (BigNumber.isBigNumber(arg)) { argTypes.push('uint256'); const base = 10; args[i] = new BN(arg.toString(base), base); diff --git a/packages/utils/src/sign_typed_data_utils.ts b/packages/utils/src/sign_typed_data_utils.ts index 6963b90846..adb66622d0 100644 --- a/packages/utils/src/sign_typed_data_utils.ts +++ b/packages/utils/src/sign_typed_data_utils.ts @@ -1,8 +1,9 @@ +import { EIP712Object, EIP712ObjectValue, EIP712TypedData, EIP712Types } from '@0x/types'; import * as ethUtil from 'ethereumjs-util'; import * as ethers from 'ethers'; import * as _ from 'lodash'; -import { EIP712Object, EIP712ObjectValue, EIP712TypedData, EIP712Types } from '@0x/types'; +import { BigNumber } from './configured_bignumber'; export const signTypedDataUtils = { /** @@ -70,7 +71,7 @@ export const signTypedDataUtils = { return ethers.utils.defaultAbiCoder.encode(encodedTypes, encodedValues); }, _normalizeValue(type: string, value: any): EIP712ObjectValue { - const normalizedValue = type === 'uint256' && _.isObject(value) && value.isBigNumber ? value.toString() : value; + const normalizedValue = type === 'uint256' && BigNumber.isBigNumber(value) ? value.toString() : value; return normalizedValue; }, _typeHash(primaryType: string, types: EIP712Types): Buffer { diff --git a/packages/web3-wrapper/src/utils.ts b/packages/web3-wrapper/src/utils.ts index 1b67518b19..1aba3c75a3 100644 --- a/packages/web3-wrapper/src/utils.ts +++ b/packages/web3-wrapper/src/utils.ts @@ -2,10 +2,6 @@ import { BigNumber } from '@0x/utils'; import * as _ from 'lodash'; export const utils = { - isBigNumber(value: any): boolean { - const isBigNumber = _.isObject(value) && value.isBigNumber; - return isBigNumber; - }, convertHexToNumber(value: string): number { const valueBigNumber = new BigNumber(value); const valueNumber = valueBigNumber.toNumber(); @@ -20,7 +16,7 @@ export const utils = { }, convertAmountToBigNumber(value: string | number | BigNumber): BigNumber { const num = value || 0; - const isBigNumber = utils.isBigNumber(num); + const isBigNumber = BigNumber.isBigNumber(num); if (isBigNumber) { return num as BigNumber; } diff --git a/packages/web3-wrapper/test/web3_wrapper_test.ts b/packages/web3-wrapper/test/web3_wrapper_test.ts index 935c676368..e8732bcbe4 100644 --- a/packages/web3-wrapper/test/web3_wrapper_test.ts +++ b/packages/web3-wrapper/test/web3_wrapper_test.ts @@ -1,3 +1,4 @@ +import { BigNumber } from '@0x/utils'; import * as chai from 'chai'; import { BlockParamLiteral, JSONRPCErrorCallback, JSONRPCRequestPayload, TransactionReceipt } from 'ethereum-types'; import * as Ganache from 'ganache-core'; @@ -118,7 +119,7 @@ describe('Web3Wrapper tests', () => { throw new Error('Expected block to exist'); } expect(blockIfExists.number).to.be.equal(0); - expect(utils.isBigNumber(blockIfExists.difficulty)).to.equal(true); + expect(BigNumber.isBigNumber(blockIfExists.difficulty)).to.equal(true); expect(_.isNumber(blockIfExists.gasLimit)).to.equal(true); }); it('gets block when supplied a block number', async () => { @@ -151,7 +152,7 @@ describe('Web3Wrapper tests', () => { const blockParamLiteral = BlockParamLiteral.Earliest; const block = await web3Wrapper.getBlockWithTransactionDataAsync(blockParamLiteral); expect(block.number).to.be.equal(0); - expect(utils.isBigNumber(block.difficulty)).to.equal(true); + expect(BigNumber.isBigNumber(block.difficulty)).to.equal(true); expect(_.isNumber(block.gasLimit)).to.equal(true); }); it('should throw if supplied invalid blockParam value', async () => { From 665dd0813e26d03684e76b323d722144ac6a6a10 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 Jan 2019 11:56:19 +0100 Subject: [PATCH 08/18] Remove unused imports --- packages/web3-wrapper/test/web3_wrapper_test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/web3-wrapper/test/web3_wrapper_test.ts b/packages/web3-wrapper/test/web3_wrapper_test.ts index e8732bcbe4..b6985c1555 100644 --- a/packages/web3-wrapper/test/web3_wrapper_test.ts +++ b/packages/web3-wrapper/test/web3_wrapper_test.ts @@ -5,7 +5,6 @@ import * as Ganache from 'ganache-core'; import * as _ from 'lodash'; import 'mocha'; -import { utils } from '../src/utils'; import { Web3Wrapper } from '../src/web3_wrapper'; import { chaiSetup } from './utils/chai_setup'; From 20eab4257a58c6783cf2313b160d6df342cdc7d2 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 Jan 2019 12:20:54 +0100 Subject: [PATCH 09/18] Upgrade chai-bignumber --- contracts/examples/package.json | 2 +- contracts/extensions/package.json | 2 +- contracts/libs/package.json | 2 +- contracts/multisig/package.json | 2 +- contracts/protocol/package.json | 2 +- contracts/test-utils/package.json | 2 +- contracts/tokens/package.json | 2 +- contracts/utils/package.json | 2 +- packages/0x.js/package.json | 2 +- packages/asset-buyer/package.json | 2 +- packages/contract-wrappers/package.json | 2 +- packages/metacoin/package.json | 2 +- packages/order-utils/package.json | 2 +- packages/order-watcher/package.json | 2 +- packages/pipeline/package.json | 2 +- packages/sol-compiler/package.json | 2 +- packages/sol-doc/package.json | 2 +- packages/utils/package.json | 2 +- packages/web3-wrapper/package.json | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/contracts/examples/package.json b/contracts/examples/package.json index c932a1ad17..562908126d 100644 --- a/contracts/examples/package.json +++ b/contracts/examples/package.json @@ -45,7 +45,7 @@ "@types/yargs": "^10.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.2", + "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", "ethereumjs-abi": "0.6.5", "make-promises-safe": "^1.1.0", diff --git a/contracts/extensions/package.json b/contracts/extensions/package.json index 25220d607c..ae5426def4 100644 --- a/contracts/extensions/package.json +++ b/contracts/extensions/package.json @@ -57,7 +57,7 @@ "@types/yargs": "^10.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.2", + "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", "ethereumjs-abi": "0.6.5", "make-promises-safe": "^1.1.0", diff --git a/contracts/libs/package.json b/contracts/libs/package.json index 0c7f3de914..75905b573b 100644 --- a/contracts/libs/package.json +++ b/contracts/libs/package.json @@ -56,7 +56,7 @@ "@types/yargs": "^10.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.2", + "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", "ethereumjs-abi": "0.6.5", "make-promises-safe": "^1.1.0", diff --git a/contracts/multisig/package.json b/contracts/multisig/package.json index 7740280667..b3860536bb 100644 --- a/contracts/multisig/package.json +++ b/contracts/multisig/package.json @@ -57,7 +57,7 @@ "@types/yargs": "^10.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.2", + "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", "make-promises-safe": "^1.1.0", "mocha": "^4.1.0", diff --git a/contracts/protocol/package.json b/contracts/protocol/package.json index 7e52807a35..e696d64cda 100644 --- a/contracts/protocol/package.json +++ b/contracts/protocol/package.json @@ -55,7 +55,7 @@ "@types/yargs": "^10.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.2", + "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", "ethereumjs-abi": "0.6.5", "make-promises-safe": "^1.1.0", diff --git a/contracts/test-utils/package.json b/contracts/test-utils/package.json index 93334bfe5a..2adfd491b8 100644 --- a/contracts/test-utils/package.json +++ b/contracts/test-utils/package.json @@ -61,7 +61,7 @@ "bn.js": "^4.11.8", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.2", + "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", "ethereum-types": "^1.1.6", "ethereumjs-abi": "0.6.5", diff --git a/contracts/tokens/package.json b/contracts/tokens/package.json index cf9e459cda..310cc8c717 100644 --- a/contracts/tokens/package.json +++ b/contracts/tokens/package.json @@ -56,7 +56,7 @@ "@types/yargs": "^10.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.2", + "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", "ethereumjs-abi": "0.6.5", "make-promises-safe": "^1.1.0", diff --git a/contracts/utils/package.json b/contracts/utils/package.json index 0e206a3e3b..c6a143b863 100644 --- a/contracts/utils/package.json +++ b/contracts/utils/package.json @@ -57,7 +57,7 @@ "bn.js": "^4.11.8", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.2", + "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", "ethereumjs-abi": "0.6.5", "make-promises-safe": "^1.1.0", diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 29b7fa6bda..2fd28e91ef 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -54,7 +54,7 @@ "awesome-typescript-loader": "^5.2.1", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.2", + "chai-bignumber": "^3.0.0", "copyfiles": "^2.0.0", "dirty-chai": "^2.0.1", "make-promises-safe": "^1.1.0", diff --git a/packages/asset-buyer/package.json b/packages/asset-buyer/package.json index fcc99608a4..c9ed9d02fb 100644 --- a/packages/asset-buyer/package.json +++ b/packages/asset-buyer/package.json @@ -56,7 +56,7 @@ "@types/node": "*", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.2", + "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", "make-promises-safe": "^1.1.0", "mocha": "^4.1.0", diff --git a/packages/contract-wrappers/package.json b/packages/contract-wrappers/package.json index 45b34ab104..8fefbd95c2 100644 --- a/packages/contract-wrappers/package.json +++ b/packages/contract-wrappers/package.json @@ -49,7 +49,7 @@ "@types/web3-provider-engine": "^14.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.2", + "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", "make-promises-safe": "^1.1.0", "mocha": "^4.1.0", diff --git a/packages/metacoin/package.json b/packages/metacoin/package.json index 1334fd0428..bd665632f6 100644 --- a/packages/metacoin/package.json +++ b/packages/metacoin/package.json @@ -53,7 +53,7 @@ "@0x/sol-compiler": "^2.0.2", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.2", + "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", "make-promises-safe": "^1.1.0", "npm-run-all": "^4.1.2", diff --git a/packages/order-utils/package.json b/packages/order-utils/package.json index 5bd459f802..7a4d4aa844 100644 --- a/packages/order-utils/package.json +++ b/packages/order-utils/package.json @@ -41,7 +41,7 @@ "@types/lodash": "4.14.104", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.2", + "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", "make-promises-safe": "^1.1.0", "mocha": "^4.1.0", diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json index 2b87b3c32b..ab95289113 100644 --- a/packages/order-watcher/package.json +++ b/packages/order-watcher/package.json @@ -44,7 +44,7 @@ "@types/sinon": "^2.2.2", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.2", + "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", "make-promises-safe": "^1.1.0", "mocha": "^4.1.0", diff --git a/packages/pipeline/package.json b/packages/pipeline/package.json index 988dd8b741..9087346877 100644 --- a/packages/pipeline/package.json +++ b/packages/pipeline/package.json @@ -32,7 +32,7 @@ "@types/ramda": "^0.25.38", "chai": "^4.1.2", "chai-as-promised": "^7.1.1", - "chai-bignumber": "^2.0.2", + "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", "mocha": "^5.2.0", "tslint": "5.11.0", diff --git a/packages/sol-compiler/package.json b/packages/sol-compiler/package.json index 26c8e88337..0b53cffd58 100644 --- a/packages/sol-compiler/package.json +++ b/packages/sol-compiler/package.json @@ -51,7 +51,7 @@ "@types/semver": "^5.5.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.2", + "chai-bignumber": "^3.0.0", "copyfiles": "^2.0.0", "dirty-chai": "^2.0.1", "make-promises-safe": "^1.1.0", diff --git a/packages/sol-doc/package.json b/packages/sol-doc/package.json index dee6ef2e51..179f45e815 100644 --- a/packages/sol-doc/package.json +++ b/packages/sol-doc/package.json @@ -37,7 +37,7 @@ "@0x/tslint-config": "^2.0.2", "chai": "^4.1.2", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.2", + "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", "make-promises-safe": "^1.1.0", "mocha": "^5.2.0", diff --git a/packages/utils/package.json b/packages/utils/package.json index 4cbbfceddb..b6be392102 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -34,7 +34,7 @@ "@types/mocha": "^2.2.42", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.2", + "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", "make-promises-safe": "^1.1.0", "mocha": "^4.1.0", diff --git a/packages/web3-wrapper/package.json b/packages/web3-wrapper/package.json index ddbc68c6c7..1ef7f91c64 100644 --- a/packages/web3-wrapper/package.json +++ b/packages/web3-wrapper/package.json @@ -41,7 +41,7 @@ "@types/lodash": "4.14.104", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.2", + "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", "ganache-core": "0xProject/ganache-core#monorepo-dep", "make-promises-safe": "^1.1.0", From 3eef888e25eb9d6d8b9444d109c1cf8e8cd6e781 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 Jan 2019 13:21:21 +0100 Subject: [PATCH 10/18] Update yarn.lock --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 066129bbdf..e0b4b2f7b3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4039,9 +4039,9 @@ chai-as-promised@^7.1.0, chai-as-promised@^7.1.1: dependencies: check-error "^1.0.2" -chai-bignumber@^2.0.1, chai-bignumber@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/chai-bignumber/-/chai-bignumber-2.0.2.tgz#de6c219c690b2d66b646ad6930096f9ba2199643" +chai-bignumber@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/chai-bignumber/-/chai-bignumber-3.0.0.tgz#e90cf1f468355bbb11a9acd051222586cd2648a9" chai@^3.5.0: version "3.5.0" From d304c062eb429d144c0f961864d185cde85a27e5 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 Jan 2019 13:22:06 +0100 Subject: [PATCH 11/18] Convert address strings to lower case before parsing them as BigNumbers --- packages/utils/src/abi_decoder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts index 2da46db350..28b6418d88 100644 --- a/packages/utils/src/abi_decoder.ts +++ b/packages/utils/src/abi_decoder.ts @@ -69,7 +69,7 @@ export class AbiDecoder { } if (param.type === SolidityTypes.Address) { const baseHex = 16; - value = addressUtils.padZeros(new BigNumber(value).toString(baseHex)); + value = addressUtils.padZeros(new BigNumber((value as string).toLowerCase()).toString(baseHex)); } else if (param.type === SolidityTypes.Uint256 || param.type === SolidityTypes.Uint) { value = new BigNumber(value); } else if (param.type === SolidityTypes.Uint8) { From 17f313658d308f9a0f1ea502f83313b34c62e28d Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 Jan 2019 13:22:52 +0100 Subject: [PATCH 12/18] Add a NAN check when parsing BigNumber candidate --- packages/utils/src/abi_encoder/utils/math.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/utils/src/abi_encoder/utils/math.ts b/packages/utils/src/abi_encoder/utils/math.ts index b2fa5fe7d6..dd45ea05ce 100644 --- a/packages/utils/src/abi_encoder/utils/math.ts +++ b/packages/utils/src/abi_encoder/utils/math.ts @@ -1,7 +1,7 @@ -import BigNumber from 'bignumber.js'; import * as ethUtil from 'ethereumjs-util'; import * as _ from 'lodash'; +import { BigNumber } from '../../configured_bignumber'; import { constants } from '../utils/constants'; function sanityCheckBigNumberRange( @@ -14,6 +14,8 @@ function sanityCheckBigNumberRange( throw new Error(`Tried to assign value of ${value}, which exceeds max value of ${maxValue}`); } else if (value.isLessThan(minValue)) { throw new Error(`Tried to assign value of ${value}, which exceeds min value of ${minValue}`); + } else if (value.isNaN) { + throw new Error(`Tried to assign NaN value`); } } function bigNumberToPaddedBuffer(value: BigNumber): Buffer { From 2cca2d70d742713747e6c8777b5b4af27115ae97 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 Jan 2019 13:23:02 +0100 Subject: [PATCH 13/18] Add a throw reason in tests --- packages/utils/test/abi_encoder/evm_data_types_test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/utils/test/abi_encoder/evm_data_types_test.ts b/packages/utils/test/abi_encoder/evm_data_types_test.ts index 54d536a7e7..4814ce28be 100644 --- a/packages/utils/test/abi_encoder/evm_data_types_test.ts +++ b/packages/utils/test/abi_encoder/evm_data_types_test.ts @@ -205,7 +205,7 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => { // Encode Args and validate result expect(() => { dataType.encode(args, encodingRules); - }).to.throw(); + }).to.throw('Tried to assign NaN value'); }); }); From a3cb722469e90a676ac00bcd7a9934dbb6e52468 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 Jan 2019 13:45:22 +0100 Subject: [PATCH 14/18] Fix a bug when we didn't call isNaN function and assumed it's a property --- packages/utils/src/abi_decoder.ts | 2 +- packages/utils/src/abi_encoder/utils/math.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts index 28b6418d88..2da46db350 100644 --- a/packages/utils/src/abi_decoder.ts +++ b/packages/utils/src/abi_decoder.ts @@ -69,7 +69,7 @@ export class AbiDecoder { } if (param.type === SolidityTypes.Address) { const baseHex = 16; - value = addressUtils.padZeros(new BigNumber((value as string).toLowerCase()).toString(baseHex)); + value = addressUtils.padZeros(new BigNumber(value).toString(baseHex)); } else if (param.type === SolidityTypes.Uint256 || param.type === SolidityTypes.Uint) { value = new BigNumber(value); } else if (param.type === SolidityTypes.Uint8) { diff --git a/packages/utils/src/abi_encoder/utils/math.ts b/packages/utils/src/abi_encoder/utils/math.ts index dd45ea05ce..a2a79e2a8d 100644 --- a/packages/utils/src/abi_encoder/utils/math.ts +++ b/packages/utils/src/abi_encoder/utils/math.ts @@ -14,7 +14,7 @@ function sanityCheckBigNumberRange( throw new Error(`Tried to assign value of ${value}, which exceeds max value of ${maxValue}`); } else if (value.isLessThan(minValue)) { throw new Error(`Tried to assign value of ${value}, which exceeds min value of ${minValue}`); - } else if (value.isNaN) { + } else if (value.isNaN()) { throw new Error(`Tried to assign NaN value`); } } From 0a279794642bde667a51401bd7cf2b2a1079c788 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 Jan 2019 14:01:11 +0100 Subject: [PATCH 15/18] Convert address strings to lower case before parsing them as BigNumbers --- packages/utils/src/abi_decoder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts index 2da46db350..28b6418d88 100644 --- a/packages/utils/src/abi_decoder.ts +++ b/packages/utils/src/abi_decoder.ts @@ -69,7 +69,7 @@ export class AbiDecoder { } if (param.type === SolidityTypes.Address) { const baseHex = 16; - value = addressUtils.padZeros(new BigNumber(value).toString(baseHex)); + value = addressUtils.padZeros(new BigNumber((value as string).toLowerCase()).toString(baseHex)); } else if (param.type === SolidityTypes.Uint256 || param.type === SolidityTypes.Uint) { value = new BigNumber(value); } else if (param.type === SolidityTypes.Uint8) { From 4404f92b3809a1edf538a1ebda6e0afe053b5e0c Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 Jan 2019 17:05:51 +0100 Subject: [PATCH 16/18] Add CHANGELOG entries --- contracts/examples/CHANGELOG.json | 9 ++ contracts/extensions/CHANGELOG.json | 9 ++ contracts/interfaces/CHANGELOG.json | 9 ++ contracts/libs/CHANGELOG.json | 9 ++ contracts/multisig/CHANGELOG.json | 9 ++ contracts/protocol/CHANGELOG.json | 9 ++ contracts/test-utils/CHANGELOG.json | 9 ++ contracts/tokens/CHANGELOG.json | 9 ++ contracts/utils/CHANGELOG.json | 9 ++ packages/0x.js/CHANGELOG.json | 129 ++++++++++++++------- packages/abi-gen-templates/CHANGELOG.json | 9 ++ packages/abi-gen-wrappers/CHANGELOG.json | 12 +- packages/abi-gen/CHANGELOG.json | 18 ++- packages/assert/CHANGELOG.json | 15 ++- packages/asset-buyer/CHANGELOG.json | 21 +++- packages/base-contract/CHANGELOG.json | 12 +- packages/connect/CHANGELOG.json | 12 +- packages/contract-wrappers/CHANGELOG.json | 57 ++++++--- packages/dev-utils/CHANGELOG.json | 9 ++ packages/ethereum-types/CHANGELOG.json | 9 ++ packages/fill-scenarios/CHANGELOG.json | 12 +- packages/instant/CHANGELOG.json | 9 ++ packages/json-schemas/CHANGELOG.json | 18 ++- packages/migrations/CHANGELOG.json | 15 ++- packages/monorepo-scripts/CHANGELOG.json | 9 ++ packages/order-utils/CHANGELOG.json | 57 ++++++--- packages/order-watcher/CHANGELOG.json | 33 ++++-- packages/react-docs/CHANGELOG.json | 21 +++- packages/react-shared/CHANGELOG.json | 12 +- packages/sol-compiler/CHANGELOG.json | 21 +++- packages/sol-coverage/CHANGELOG.json | 9 ++ packages/sol-doc/CHANGELOG.json | 12 +- packages/sol-profiler/CHANGELOG.json | 9 ++ packages/sol-resolver/CHANGELOG.json | 9 ++ packages/sol-trace/CHANGELOG.json | 9 ++ packages/sol-tracing-utils/CHANGELOG.json | 33 ++++-- packages/sra-spec/CHANGELOG.json | 12 +- packages/subproviders/CHANGELOG.json | 24 +++- packages/tslint-config/CHANGELOG.json | 18 ++- packages/types/CHANGELOG.json | 15 ++- packages/typescript-typings/CHANGELOG.json | 12 +- packages/utils/CHANGELOG.json | 21 +++- packages/web3-wrapper/CHANGELOG.json | 36 ++++-- 43 files changed, 669 insertions(+), 141 deletions(-) diff --git a/contracts/examples/CHANGELOG.json b/contracts/examples/CHANGELOG.json index ee239b3188..022b0f5dfa 100644 --- a/contracts/examples/CHANGELOG.json +++ b/contracts/examples/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.0.5", diff --git a/contracts/extensions/CHANGELOG.json b/contracts/extensions/CHANGELOG.json index 4f087d0b56..0b5d905b19 100644 --- a/contracts/extensions/CHANGELOG.json +++ b/contracts/extensions/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.2.2", diff --git a/contracts/interfaces/CHANGELOG.json b/contracts/interfaces/CHANGELOG.json index ee239b3188..022b0f5dfa 100644 --- a/contracts/interfaces/CHANGELOG.json +++ b/contracts/interfaces/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.0.5", diff --git a/contracts/libs/CHANGELOG.json b/contracts/libs/CHANGELOG.json index ee239b3188..022b0f5dfa 100644 --- a/contracts/libs/CHANGELOG.json +++ b/contracts/libs/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.0.5", diff --git a/contracts/multisig/CHANGELOG.json b/contracts/multisig/CHANGELOG.json index ee239b3188..022b0f5dfa 100644 --- a/contracts/multisig/CHANGELOG.json +++ b/contracts/multisig/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.0.5", diff --git a/contracts/protocol/CHANGELOG.json b/contracts/protocol/CHANGELOG.json index 96e2f8b701..2f6b691449 100644 --- a/contracts/protocol/CHANGELOG.json +++ b/contracts/protocol/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "3.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "2.2.2", diff --git a/contracts/test-utils/CHANGELOG.json b/contracts/test-utils/CHANGELOG.json index 53fc1fc3a0..aa1321cf32 100644 --- a/contracts/test-utils/CHANGELOG.json +++ b/contracts/test-utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "3.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "version": "2.0.0", "changes": [ diff --git a/contracts/tokens/CHANGELOG.json b/contracts/tokens/CHANGELOG.json index ee239b3188..022b0f5dfa 100644 --- a/contracts/tokens/CHANGELOG.json +++ b/contracts/tokens/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.0.5", diff --git a/contracts/utils/CHANGELOG.json b/contracts/utils/CHANGELOG.json index ee239b3188..022b0f5dfa 100644 --- a/contracts/utils/CHANGELOG.json +++ b/contracts/utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.0.5", diff --git a/packages/0x.js/CHANGELOG.json b/packages/0x.js/CHANGELOG.json index a849a35a27..aa02f4e259 100644 --- a/packages/0x.js/CHANGELOG.json +++ b/packages/0x.js/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "4.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "3.0.2", @@ -21,7 +30,8 @@ "version": "3.0.0", "changes": [ { - "note": "Export `MultiAssetData`, `MultiAssetDataWithRecursiveDecoding`, `ObjectMap`, and `SingleAssetData` from types. No longer export `AssetData`.", + "note": + "Export `MultiAssetData`, `MultiAssetDataWithRecursiveDecoding`, `ObjectMap`, and `SingleAssetData` from types. No longer export `AssetData`.", "pr": 1363 } ], @@ -107,15 +117,18 @@ "pr": 1102 }, { - "note": "Added `MetamaskSubprovider` to handle inconsistencies in Metamask's signing JSON RPC endpoints.", + "note": + "Added `MetamaskSubprovider` to handle inconsistencies in Metamask's signing JSON RPC endpoints.", "pr": 1102 }, { - "note": "Removed `SignerType` (including `SignerType.Metamask`). Please use the `MetamaskSubprovider` to wrap `web3.currentProvider`.", + "note": + "Removed `SignerType` (including `SignerType.Metamask`). Please use the `MetamaskSubprovider` to wrap `web3.currentProvider`.", "pr": 1102 }, { - "note": "Updated to use new modularized artifacts and the latest version of @0xproject/contract-wrappers", + "note": + "Updated to use new modularized artifacts and the latest version of @0xproject/contract-wrappers", "pr": 1105 }, { @@ -214,7 +227,8 @@ "version": "1.0.1-rc.5", "changes": [ { - "note": "Fix `main` and `types` package.json entries so that they point to the new location of index.d.ts and index.js" + "note": + "Fix `main` and `types` package.json entries so that they point to the new location of index.d.ts and index.js" } ] }, @@ -222,7 +236,8 @@ "version": "1.0.1-rc.4", "changes": [ { - "note": "Re-organize the exported interface of 0x.js. Remove the `ZeroEx` class, and instead export the same exports as `0x.js`'s sub-packages: `@0xproject/contract-wrappers`, `@0xproject/order-utils` and `@0xproject/order-watcher`", + "note": + "Re-organize the exported interface of 0x.js. Remove the `ZeroEx` class, and instead export the same exports as `0x.js`'s sub-packages: `@0xproject/contract-wrappers`, `@0xproject/order-utils` and `@0xproject/order-watcher`", "pr": 963 } ], @@ -294,15 +309,18 @@ "pr": 863 }, { - "note": "Refactored `ZeroEx.isValidSignature` to `zeroEx.isValidSignatureAsync`. It is now async so that it can verify contract-dependent signature types", + "note": + "Refactored `ZeroEx.isValidSignature` to `zeroEx.isValidSignatureAsync`. It is now async so that it can verify contract-dependent signature types", "pr": 863 }, { - "note": "Refactored `signOrderHashAsync` to `ecSignOrderHashAsync`. There are now many non-ECSignature ways to sign orders too.", + "note": + "Refactored `signOrderHashAsync` to `ecSignOrderHashAsync`. There are now many non-ECSignature ways to sign orders too.", "pr": 863 }, { - "note": "Removed `createOrderWatcherAsync` method. Will be added back once OrderWatcher is refactored for V2", + "note": + "Removed `createOrderWatcherAsync` method. Will be added back once OrderWatcher is refactored for V2", "pr": 863 }, { @@ -377,7 +395,8 @@ "pr": 579 }, { - "note": "Renamed ZeroExError to ContractWrappersErrors since they now lives in the @0xproject/contract-wrappers subpackage", + "note": + "Renamed ZeroExError to ContractWrappersErrors since they now lives in the @0xproject/contract-wrappers subpackage", "pr": 579 } ], @@ -462,7 +481,8 @@ "pr": 501 }, { - "note": "Add `zeroEx.exchange.getOrderStateAsync` to allow obtaining current OrderState for a signedOrder", + "note": + "Add `zeroEx.exchange.getOrderStateAsync` to allow obtaining current OrderState for a signedOrder", "pr": 510 } ], @@ -472,7 +492,8 @@ "version": "0.35.0", "changes": [ { - "note": "Removed `ZeroExError.TransactionMiningTimeout` and moved it to '@0xproject/web3-wrapper' `Web3WrapperErrors.TransactionMiningTimeout`", + "note": + "Removed `ZeroExError.TransactionMiningTimeout` and moved it to '@0xproject/web3-wrapper' `Web3WrapperErrors.TransactionMiningTimeout`", "pr": 485 } ], @@ -482,7 +503,8 @@ "version": "0.34.0", "changes": [ { - "note": "Fix the bug causing `zeroEx.exchange.fillOrdersUpToAsync` validation to fail if there were some extra orders passed", + "note": + "Fix the bug causing `zeroEx.exchange.fillOrdersUpToAsync` validation to fail if there were some extra orders passed", "pr": 470 }, { @@ -494,7 +516,8 @@ "pr": 488 }, { - "note": "Added `stateLayer` setting to `OrderStateWatcherConfig` so OrderStateWatcher can be set to monitor different blockchain state layers", + "note": + "Added `stateLayer` setting to `OrderStateWatcherConfig` so OrderStateWatcher can be set to monitor different blockchain state layers", "pr": 488 } ], @@ -581,7 +604,8 @@ "pr": 350 }, { - "note": "Fixed the bug causing order watcher to throw if there is an event with the same signature but different indexed fields", + "note": + "Fixed the bug causing order watcher to throw if there is an event with the same signature but different indexed fields", "pr": 366 } ], @@ -601,7 +625,8 @@ "version": "0.31.0", "changes": [ { - "note": "Add the `shouldAddPersonalMessagePrefix` parameter to `signOrderHashAsync` so that the caller can decide on whether to add the personalMessage prefix before relaying the request to the signer. Parity Signer, Ledger and TestRPC add the prefix themselves, Metamask expects it to have already been added.", + "note": + "Add the `shouldAddPersonalMessagePrefix` parameter to `signOrderHashAsync` so that the caller can decide on whether to add the personalMessage prefix before relaying the request to the signer. Parity Signer, Ledger and TestRPC add the prefix themselves, Metamask expects it to have already been added.", "pr": 349 } ], @@ -646,7 +671,8 @@ "pr": 312 }, { - "note": "Fix a bug in fillOrdersUpTo validation making it impossible to fill up to if user doesn't have enough balance to fully fill all the orders", + "note": + "Fix a bug in fillOrdersUpTo validation making it impossible to fill up to if user doesn't have enough balance to fully fill all the orders", "pr": 321 } ], @@ -680,11 +706,13 @@ "version": "0.28.0", "changes": [ { - "note": "Add `etherTokenAddress` arg to `depositAsync` and `withdrawAsync` methods on `zeroEx.etherToken`", + "note": + "Add `etherTokenAddress` arg to `depositAsync` and `withdrawAsync` methods on `zeroEx.etherToken`", "pr": 267 }, { - "note": "Removed accidentally included `unsubscribeAll` method from `zeroEx.proxy`, `zeroEx.etherToken` and `zeroEx.tokenRegistry`", + "note": + "Removed accidentally included `unsubscribeAll` method from `zeroEx.proxy`, `zeroEx.etherToken` and `zeroEx.tokenRegistry`", "pr": 267 }, { @@ -696,7 +724,8 @@ "pr": 272 }, { - "note": "Add `zeroEx.etherToken.subscribe`, `zeroEx.etherToken.unsubscribe`, `zeroEx.etherToken.unsubscribeAll`", + "note": + "Add `zeroEx.etherToken.subscribe`, `zeroEx.etherToken.unsubscribe`, `zeroEx.etherToken.unsubscribeAll`", "pr": 277 }, { @@ -704,7 +733,8 @@ "pr": 277 }, { - "note": "Add new public types `BlockParamLiteral`, `EtherTokenEvents`, `EtherTokenContractEventArgs`, `DepositContractEventArgs`, `WithdrawalContractEventArgs`", + "note": + "Add new public types `BlockParamLiteral`, `EtherTokenEvents`, `EtherTokenContractEventArgs`, `DepositContractEventArgs`, `WithdrawalContractEventArgs`", "pr": 277 }, { @@ -739,7 +769,8 @@ "pr": 233 }, { - "note": "Make all `getContractAddress` functions, `zeroEx.exchange.subscribe`, `zeroEx.exchange.getZRXTokenAddress` sync", + "note": + "Make all `getContractAddress` functions, `zeroEx.exchange.subscribe`, `zeroEx.exchange.getZRXTokenAddress` sync", "pr": 233 }, { @@ -747,7 +778,8 @@ "pr": 233 }, { - "note": "Make `DecodedLogEvent` contain `LogWithDecodedArgs` under log key instead of merging it in like web3 does", + "note": + "Make `DecodedLogEvent` contain `LogWithDecodedArgs` under log key instead of merging it in like web3 does", "pr": 234 }, { @@ -763,7 +795,8 @@ "pr": 235 }, { - "note": "Modify order validation methods to validate against the `latest` block, not against the `pending` block", + "note": + "Modify order validation methods to validate against the `latest` block, not against the `pending` block", "pr": 236 } ], @@ -773,7 +806,8 @@ "version": "0.26.0", "changes": [ { - "note": "Add post-formatter for logs converting `blockNumber`, `logIndex`, `transactionIndex` from hexes to numbers", + "note": + "Add post-formatter for logs converting `blockNumber`, `logIndex`, `transactionIndex` from hexes to numbers", "pr": 231 }, { @@ -781,7 +815,8 @@ "pr": 222 }, { - "note": "In OrderWatcher subscribe to ZRX Token Transfer and Approval events when maker token is different", + "note": + "In OrderWatcher subscribe to ZRX Token Transfer and Approval events when maker token is different", "pr": 225 } ], @@ -799,7 +834,8 @@ "pr": 205 }, { - "note": "Normalized the transactionReceipt status to be `null|0|1`, 1 meaning transaction execution successful, 0 unsuccessful and `null` if it is a pre-byzantinium transaction.", + "note": + "Normalized the transactionReceipt status to be `null|0|1`, 1 meaning transaction execution successful, 0 unsuccessful and `null` if it is a pre-byzantinium transaction.", "pr": 200 } ], @@ -870,7 +906,8 @@ "version": "0.22.0", "changes": [ { - "note": "Started using `OrderFillRequest` interface instead of `OrderFillOrKillRequest` interface for `zeroEx.exchange.batchFillOrKill`", + "note": + "Started using `OrderFillRequest` interface instead of `OrderFillOrKillRequest` interface for `zeroEx.exchange.batchFillOrKill`", "pr": 187 }, { @@ -884,7 +921,8 @@ "version": "0.21.4", "changes": [ { - "note": "Made 0x.js more type-safe by making `getLogsAsync` and `subscribe/subscribeAsync` generics parametrized with arg type", + "note": + "Made 0x.js more type-safe by making `getLogsAsync` and `subscribe/subscribeAsync` generics parametrized with arg type", "pr": 194 } ], @@ -931,7 +969,8 @@ "note": "Subscriptions no longer return historical logs. If you want them - use `getLogsAsync`" }, { - "note": "Subscriptions now use [ethereumjs-blockstream](https://github.com/ethereumjs/ethereumjs-blockstream) under the hood" + "note": + "Subscriptions now use [ethereumjs-blockstream](https://github.com/ethereumjs/ethereumjs-blockstream) under the hood" }, { "note": "Subscriptions correctly handle block re-orgs (forks)" @@ -940,7 +979,8 @@ "note": "Subscriptions correctly backfill logs (connection problems)" }, { - "note": "They no longer setup filters on the underlying nodes, so you can use them with infura without a filter Subprovider" + "note": + "They no longer setup filters on the underlying nodes, so you can use them with infura without a filter Subprovider" }, { "note": "Removed `ContractEventEmitter` and added `LogEvent`" @@ -1047,7 +1087,8 @@ "version": "0.15.0", "changes": [ { - "note": "Added the ability to specify a historical `blockNumber` at which to query the blockchain's state when calling a token or exchange method", + "note": + "Added the ability to specify a historical `blockNumber` at which to query the blockchain's state when calling a token or exchange method", "pr": 161 } ], @@ -1095,7 +1136,8 @@ "version": "0.13.0", "changes": [ { - "note": "Made all the functions submitting transactions to the network to immediately return transaction hash", + "note": + "Made all the functions submitting transactions to the network to immediately return transaction hash", "pr": 151 }, { @@ -1103,7 +1145,8 @@ "pr": 151 }, { - "note": "Added `TransactionReceiptWithDecodedLogs`, `LogWithDecodedArgs`, `DecodedLogArgs` to public types", + "note": + "Added `TransactionReceiptWithDecodedLogs`, `LogWithDecodedArgs`, `DecodedLogArgs` to public types", "pr": 151 }, { @@ -1276,7 +1319,8 @@ "pr": 104 }, { - "note": "Fixed an issue with incorrect balance/allowance validation when ZRX is one of the tokens traded", + "note": + "Fixed an issue with incorrect balance/allowance validation when ZRX is one of the tokens traded", "pr": 109 } ], @@ -1286,11 +1330,13 @@ "version": "0.8.0", "changes": [ { - "note": "Added the ability to call methods on different authorized versions of the Exchange smart contract", + "note": + "Added the ability to call methods on different authorized versions of the Exchange smart contract", "pr": 82 }, { - "note": "Updated contract artifacts to reflect latest changes to the smart contracts (0xproject/contracts#59)" + "note": + "Updated contract artifacts to reflect latest changes to the smart contracts (0xproject/contracts#59)" }, { "note": "Added `zeroEx.proxy.isAuthorizedAsync` and `zeroEx.proxy.getAuthorizedAddressesAsync`", @@ -1326,7 +1372,8 @@ "version": "0.7.1", "changes": [ { - "note": "Added the ability to convert Ether to wrapped Ether tokens and back via `zeroEx.etherToken.depostAsync` and `zeroEx.etherToken.withdrawAsync`", + "note": + "Added the ability to convert Ether to wrapped Ether tokens and back via `zeroEx.etherToken.depostAsync` and `zeroEx.etherToken.withdrawAsync`", "pr": 81 } ], @@ -1348,7 +1395,8 @@ "pr": 72 }, { - "note": "Renamed type `LogCancelArgs` to `LogCancelContractEventArgs` and `LogFillArgs` to `LogFillContractEventArgs`" + "note": + "Renamed type `LogCancelArgs` to `LogCancelContractEventArgs` and `LogFillArgs` to `LogFillContractEventArgs`" } ], "timestamp": 1498057200 @@ -1390,7 +1438,8 @@ "version": "0.5.2", "changes": [ { - "note": "Fixed the bug in `postpublish` script that caused that only unminified UMD bundle was uploaded to release page" + "note": + "Fixed the bug in `postpublish` script that caused that only unminified UMD bundle was uploaded to release page" } ], "timestamp": 1497452400 diff --git a/packages/abi-gen-templates/CHANGELOG.json b/packages/abi-gen-templates/CHANGELOG.json index b825c4f1f5..7d444d0ca8 100644 --- a/packages/abi-gen-templates/CHANGELOG.json +++ b/packages/abi-gen-templates/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.0.2", diff --git a/packages/abi-gen-wrappers/CHANGELOG.json b/packages/abi-gen-wrappers/CHANGELOG.json index 381b37cda7..a19d98f953 100644 --- a/packages/abi-gen-wrappers/CHANGELOG.json +++ b/packages/abi-gen-wrappers/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "3.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "version": "2.2.0", "changes": [ @@ -60,7 +69,8 @@ "version": "1.1.0", "changes": [ { - "note": "`deployFrom0xArtifactAsync` additionally accepts artifacts that conform to the `SimpleContractArtifact` interface", + "note": + "`deployFrom0xArtifactAsync` additionally accepts artifacts that conform to the `SimpleContractArtifact` interface", "pr": 1298 } ], diff --git a/packages/abi-gen/CHANGELOG.json b/packages/abi-gen/CHANGELOG.json index ab516e4c69..3c2c4aaf1b 100644 --- a/packages/abi-gen/CHANGELOG.json +++ b/packages/abi-gen/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.0.22", @@ -330,11 +339,13 @@ "version": "0.2.4", "changes": [ { - "note": "Add a `backend` parameter that allows you to specify the Ethereum library you use in your templates (`web3` or `ethers`). Ethers auto-converts small ints to numbers whereas Web3 doesn't. Defaults to `web3`", + "note": + "Add a `backend` parameter that allows you to specify the Ethereum library you use in your templates (`web3` or `ethers`). Ethers auto-converts small ints to numbers whereas Web3 doesn't. Defaults to `web3`", "pr": 413 }, { - "note": "Add support for [tuple types](https://solidity.readthedocs.io/en/develop/abi-spec.html#handling-tuple-types)", + "note": + "Add support for [tuple types](https://solidity.readthedocs.io/en/develop/abi-spec.html#handling-tuple-types)", "pr": 413 }, { @@ -362,7 +373,8 @@ "pr": 346 }, { - "note": "Added CLI option to specify networkId, adding support for the JSON artifact format found in @0xproject/contracts", + "note": + "Added CLI option to specify networkId, adding support for the JSON artifact format found in @0xproject/contracts", "pr": 388 } ], diff --git a/packages/assert/CHANGELOG.json b/packages/assert/CHANGELOG.json index 0210f9400a..a07d4f4bd1 100644 --- a/packages/assert/CHANGELOG.json +++ b/packages/assert/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.0.23", @@ -211,7 +220,8 @@ "version": "1.0.0", "changes": [ { - "note": "Fix bug in string enum assertion. We erroneously were checking against the enum keys, not values", + "note": + "Fix bug in string enum assertion. We erroneously were checking against the enum keys, not values", "pr": 821 } ] @@ -356,7 +366,8 @@ "note": "Re-publish Assert previously published under NPM package @0xproject/0x-assert" }, { - "note": "Added assertion isValidBaseUnitAmount which checks both that the value is a valid bigNumber and that it does not contain decimals." + "note": + "Added assertion isValidBaseUnitAmount which checks both that the value is a valid bigNumber and that it does not contain decimals." } ], "timestamp": 1510585200 diff --git a/packages/asset-buyer/CHANGELOG.json b/packages/asset-buyer/CHANGELOG.json index 0b717a8871..98c30ca093 100644 --- a/packages/asset-buyer/CHANGELOG.json +++ b/packages/asset-buyer/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "5.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "4.0.1", @@ -100,7 +109,8 @@ "pr": 1187 }, { - "note": "the `OrderProvider` now requires a new method `getAvailableMakerAssetDatasAsync` and the `StandardRelayerAPIOrderProvider` requires the network id at init.", + "note": + "the `OrderProvider` now requires a new method `getAvailableMakerAssetDatasAsync` and the `StandardRelayerAPIOrderProvider` requires the network id at init.", "pr": 1203 }, { @@ -108,11 +118,13 @@ "pr": 1197 }, { - "note": "Fix bug where `BuyQuoteInfo` objects could return `totalEthAmount` and `feeEthAmount` that were not whole numbers", + "note": + "Fix bug where `BuyQuoteInfo` objects could return `totalEthAmount` and `feeEthAmount` that were not whole numbers", "pr": 1207 }, { - "note": "Fix bug where default values for `AssetBuyer` public facing methods could get overriden by `undefined` values", + "note": + "Fix bug where default values for `AssetBuyer` public facing methods could get overriden by `undefined` values", "pr": 1207 }, { @@ -133,7 +145,8 @@ "pr": 1131 }, { - "note": "Updated to use new modularized artifacts and the latest version of @0xproject/contract-wrappers", + "note": + "Updated to use new modularized artifacts and the latest version of @0xproject/contract-wrappers", "pr": 1105 }, { diff --git a/packages/base-contract/CHANGELOG.json b/packages/base-contract/CHANGELOG.json index 68ebe8d9e6..4337c33add 100644 --- a/packages/base-contract/CHANGELOG.json +++ b/packages/base-contract/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "4.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "3.0.13", @@ -261,7 +270,8 @@ "version": "0.3.4", "changes": [ { - "note": "Update EthersJs to fix the `value.toLowerCase()` is not a function bug caused by `ethers.js` breaking patch version https://github.com/ethers-io/ethers.js/issues/201" + "note": + "Update EthersJs to fix the `value.toLowerCase()` is not a function bug caused by `ethers.js` breaking patch version https://github.com/ethers-io/ethers.js/issues/201" } ], "timestamp": 1529397769 diff --git a/packages/connect/CHANGELOG.json b/packages/connect/CHANGELOG.json index 8fe9c562fe..1e30424989 100644 --- a/packages/connect/CHANGELOG.json +++ b/packages/connect/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "4.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "3.0.13", @@ -246,7 +255,8 @@ "version": "1.0.0", "changes": [ { - "note": "Remove `WebSocketOrderbookChannel` from the public interface and replace with `orderbookChannelFactory`" + "note": + "Remove `WebSocketOrderbookChannel` from the public interface and replace with `orderbookChannelFactory`" } ] }, diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index bfba8454cd..5b5654067d 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "6.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "version": "5.0.0", "changes": [ @@ -75,7 +84,8 @@ "version": "4.1.0", "changes": [ { - "note": "Add a `nonce` field for `TxOpts` so that it's now possible to re-broadcast stuck transactions with a higher gas amount", + "note": + "Add a `nonce` field for `TxOpts` so that it's now possible to re-broadcast stuck transactions with a higher gas amount", "pr": 1292 } ], @@ -103,15 +113,18 @@ "version": "4.0.0", "changes": [ { - "note": "Add signature validation, regular cancellation and `cancelledUpTo` checks to `validateOrderFillableOrThrowAsync`", + "note": + "Add signature validation, regular cancellation and `cancelledUpTo` checks to `validateOrderFillableOrThrowAsync`", "pr": 1235 }, { - "note": "Improved the errors thrown by `validateOrderFillableOrThrowAsync` by making them more descriptive", + "note": + "Improved the errors thrown by `validateOrderFillableOrThrowAsync` by making them more descriptive", "pr": 1235 }, { - "note": "Throw previously swallowed network errors when calling `validateOrderFillableOrThrowAsync` (see issue: #1218)", + "note": + "Throw previously swallowed network errors when calling `validateOrderFillableOrThrowAsync` (see issue: #1218)", "pr": 1235 } ], @@ -142,23 +155,28 @@ "pr": 1105 }, { - "note": "Default contract addresses are no longer stored in artifacts and are instead loaded from the `@0xproject/contract-addresses` package.", + "note": + "Default contract addresses are no longer stored in artifacts and are instead loaded from the `@0xproject/contract-addresses` package.", "pr": 1105 }, { - "note": "Most contract addresses are now defined at instantiation time and are available as properties (e.g., `exchangeWrapper.address`) instead of methods (e.g., `exchangeWrapper.getContractAddress()`).", + "note": + "Most contract addresses are now defined at instantiation time and are available as properties (e.g., `exchangeWrapper.address`) instead of methods (e.g., `exchangeWrapper.getContractAddress()`).", "pr": 1105 }, { - "note": "Removed `setProvider` method in top-level `ContractWrapper` class and added new `unsubscribeAll` method.", + "note": + "Removed `setProvider` method in top-level `ContractWrapper` class and added new `unsubscribeAll` method.", "pr": 1105 }, { - "note": "Some properties and methods have been renamed. For example, some methods that previously could throw no longer can, and so their names have been updated accordingly.", + "note": + "Some properties and methods have been renamed. For example, some methods that previously could throw no longer can, and so their names have been updated accordingly.", "pr": 1105 }, { - "note": "Removed ContractNotFound errors. Checking for this error was somewhat ineffecient. Relevant methods/functions now return the default error from web3-wrapper, which we feel provides enough information.", + "note": + "Removed ContractNotFound errors. Checking for this error was somewhat ineffecient. Relevant methods/functions now return the default error from web3-wrapper, which we feel provides enough information.", "pr": 1105 }, { @@ -194,11 +212,13 @@ "version": "2.0.0", "changes": [ { - "note": "Fixes dropped events in subscriptions by fetching logs by blockHash instead of blockNumber. Support for fetching by blockHash was added in Geth > v1.8.13 and Parity > v2.1.0. Infura works too.", + "note": + "Fixes dropped events in subscriptions by fetching logs by blockHash instead of blockNumber. Support for fetching by blockHash was added in Geth > v1.8.13 and Parity > v2.1.0. Infura works too.", "pr": 1080 }, { - "note": "Fix misunderstanding about blockstream interface callbacks and pass the raw JSON RPC responses to it", + "note": + "Fix misunderstanding about blockstream interface callbacks and pass the raw JSON RPC responses to it", "pr": 1080 } ], @@ -247,15 +267,18 @@ "note": "Add `OrderValidatorWrapper`" }, { - "note": "Fix bug where contracts not deployed on a network showed an `EXCHANGE_CONTRACT_DOES_NOT_EXIST` error instead of `CONTRACT_NOT_DEPLOYED_ON_NETWORK`", + "note": + "Fix bug where contracts not deployed on a network showed an `EXCHANGE_CONTRACT_DOES_NOT_EXIST` error instead of `CONTRACT_NOT_DEPLOYED_ON_NETWORK`", "pr": 1044 }, { - "note": "Export `AssetBalanceAndProxyAllowanceFetcher` and `OrderFilledCancelledFetcher` implementations", + "note": + "Export `AssetBalanceAndProxyAllowanceFetcher` and `OrderFilledCancelledFetcher` implementations", "pr": 1054 }, { - "note": "Add `validateOrderFillableOrThrowAsync` and `validateFillOrderThrowIfInvalidAsync` to ExchangeWrapper", + "note": + "Add `validateOrderFillableOrThrowAsync` and `validateFillOrderThrowIfInvalidAsync` to ExchangeWrapper", "pr": 1054 } ], @@ -274,11 +297,13 @@ "version": "1.0.1-rc.4", "changes": [ { - "note": "Export missing types: `TransactionEncoder`, `ContractAbi`, `JSONRPCRequestPayload`, `JSONRPCResponsePayload`, `JSONRPCErrorCallback`, `AbiDefinition`, `FunctionAbi`, `EventAbi`, `EventParameter`, `DecodedLogArgs`, `MethodAbi`, `ConstructorAbi`, `FallbackAbi`, `DataItem`, `ConstructorStateMutability`, `StateMutability` & `ExchangeSignatureValidatorApprovalEventArgs`", + "note": + "Export missing types: `TransactionEncoder`, `ContractAbi`, `JSONRPCRequestPayload`, `JSONRPCResponsePayload`, `JSONRPCErrorCallback`, `AbiDefinition`, `FunctionAbi`, `EventAbi`, `EventParameter`, `DecodedLogArgs`, `MethodAbi`, `ConstructorAbi`, `FallbackAbi`, `DataItem`, `ConstructorStateMutability`, `StateMutability` & `ExchangeSignatureValidatorApprovalEventArgs`", "pr": 924 }, { - "note": "Remove superfluous exported types: `ContractEvent`, `Token`, `OrderFillRequest`, `ContractEventArgs`, `LogEvent`, `OnOrderStateChangeCallback`, `ECSignature`, `OrderStateValid`, `OrderStateInvalid`, `OrderState`, `FilterObject`, `TransactionReceipt` & `TransactionReceiptWithDecodedLogs`", + "note": + "Remove superfluous exported types: `ContractEvent`, `Token`, `OrderFillRequest`, `ContractEventArgs`, `LogEvent`, `OnOrderStateChangeCallback`, `ECSignature`, `OrderStateValid`, `OrderStateInvalid`, `OrderState`, `FilterObject`, `TransactionReceipt` & `TransactionReceiptWithDecodedLogs`", "pr": 924 }, { diff --git a/packages/dev-utils/CHANGELOG.json b/packages/dev-utils/CHANGELOG.json index 85189d70bc..d05e41d2db 100644 --- a/packages/dev-utils/CHANGELOG.json +++ b/packages/dev-utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.0.24", diff --git a/packages/ethereum-types/CHANGELOG.json b/packages/ethereum-types/CHANGELOG.json index 6265e01a1c..c106d43a9d 100644 --- a/packages/ethereum-types/CHANGELOG.json +++ b/packages/ethereum-types/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.1.6", diff --git a/packages/fill-scenarios/CHANGELOG.json b/packages/fill-scenarios/CHANGELOG.json index d8f2591a43..1941214170 100644 --- a/packages/fill-scenarios/CHANGELOG.json +++ b/packages/fill-scenarios/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.1.2", @@ -194,7 +203,8 @@ "version": "1.0.1-rc.3", "changes": [ { - "note": "Updated to use latest orderFactory interface, fixed `feeRecipient` spelling error in public interface", + "note": + "Updated to use latest orderFactory interface, fixed `feeRecipient` spelling error in public interface", "pr": 936 }, { diff --git a/packages/instant/CHANGELOG.json b/packages/instant/CHANGELOG.json index 537670584f..c7348c3c02 100644 --- a/packages/instant/CHANGELOG.json +++ b/packages/instant/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "3.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "version": "2.0.0", "changes": [ diff --git a/packages/json-schemas/CHANGELOG.json b/packages/json-schemas/CHANGELOG.json index 1388b4dca3..d1e34b9be5 100644 --- a/packages/json-schemas/CHANGELOG.json +++ b/packages/json-schemas/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "3.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "2.1.7", @@ -66,7 +75,8 @@ "version": "2.1.0", "changes": [ { - "note": "Improve schemas by enforcing that amounts that must be whole numbers (e.g Order asset amounts) no longer allow decimal amounts", + "note": + "Improve schemas by enforcing that amounts that must be whole numbers (e.g Order asset amounts) no longer allow decimal amounts", "pr": 1173 }, { @@ -80,7 +90,8 @@ "version": "2.0.0", "changes": [ { - "note": "Convert all schemas to JSON files so that they can be used with `json-schema` implemenations in other programming languages.", + "note": + "Convert all schemas to JSON files so that they can be used with `json-schema` implemenations in other programming languages.", "pr": 1145 } ], @@ -271,7 +282,8 @@ "version": "0.8.0", "changes": [ { - "note": "Update Order & SignedOrder schemas, remove ECSignature schema and add Hex schema as part of V2 upgrades", + "note": + "Update Order & SignedOrder schemas, remove ECSignature schema and add Hex schema as part of V2 upgrades", "pr": 615 } ], diff --git a/packages/migrations/CHANGELOG.json b/packages/migrations/CHANGELOG.json index 5962a98864..169439d090 100644 --- a/packages/migrations/CHANGELOG.json +++ b/packages/migrations/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "3.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "version": "2.4.0", "changes": [ @@ -68,7 +77,8 @@ "version": "2.1.0", "changes": [ { - "note": "Export all type declarations used by the public interface, as well as the `ContractAddresses` mapping", + "note": + "Export all type declarations used by the public interface, as well as the `ContractAddresses` mapping", "pr": 1301 } ], @@ -114,7 +124,8 @@ "version": "2.0.0", "changes": [ { - "note": "Contract artifacts have been moved to the new @0xproject/contract-artifacts package. v1 migrations have been removed. `runMigrationsAsync` returns the addresses of the contracts that were deployed.", + "note": + "Contract artifacts have been moved to the new @0xproject/contract-artifacts package. v1 migrations have been removed. `runMigrationsAsync` returns the addresses of the contracts that were deployed.", "pr": 1105 } ], diff --git a/packages/monorepo-scripts/CHANGELOG.json b/packages/monorepo-scripts/CHANGELOG.json index cebe7ec723..a71bfbd6d9 100644 --- a/packages/monorepo-scripts/CHANGELOG.json +++ b/packages/monorepo-scripts/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "version": "1.0.6", "changes": [ diff --git a/packages/order-utils/CHANGELOG.json b/packages/order-utils/CHANGELOG.json index ace3656c41..a63e9b436f 100644 --- a/packages/order-utils/CHANGELOG.json +++ b/packages/order-utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "4.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "3.1.2", @@ -21,7 +30,8 @@ "version": "3.1.0", "changes": [ { - "note": "Use new ABI encoder, add encoding/decoding logic for MultiAsset assetData, and add information to return values in orderStateUtils", + "note": + "Use new ABI encoder, add encoding/decoding logic for MultiAsset assetData, and add information to return values in orderStateUtils", "pr": 1363 } ], @@ -95,19 +105,23 @@ "version": "3.0.0", "changes": [ { - "note": "Add signature validation, regular cancellation and `cancelledUpTo` checks to `validateOrderFillableOrThrowAsync`", + "note": + "Add signature validation, regular cancellation and `cancelledUpTo` checks to `validateOrderFillableOrThrowAsync`", "pr": 1235 }, { - "note": "Improved the errors thrown by `validateOrderFillableOrThrowAsync` by making them more descriptive", + "note": + "Improved the errors thrown by `validateOrderFillableOrThrowAsync` by making them more descriptive", "pr": 1235 }, { - "note": "Throw previously swallowed network errors when calling `validateOrderFillableOrThrowAsync` (see issue: #1218)", + "note": + "Throw previously swallowed network errors when calling `validateOrderFillableOrThrowAsync` (see issue: #1218)", "pr": 1235 }, { - "note": "Modified the `AbstractOrderFilledCancelledFetcher` interface slightly such that `isOrderCancelledAsync` accepts a `signedOrder` instead of an `orderHash` param", + "note": + "Modified the `AbstractOrderFilledCancelledFetcher` interface slightly such that `isOrderCancelledAsync` accepts a `signedOrder` instead of an `orderHash` param", "pr": 1235 } ], @@ -126,7 +140,8 @@ "version": "2.0.0", "changes": [ { - "note": "Added `ecSignOrderAsync` to first sign an order using `eth_signTypedData` and fallback to `eth_sign`.", + "note": + "Added `ecSignOrderAsync` to first sign an order using `eth_signTypedData` and fallback to `eth_sign`.", "pr": 1102 }, { @@ -157,7 +172,8 @@ "version": "1.0.6", "changes": [ { - "note": "Add signerAddress normalization to `isValidECSignature` to avoid `invalid address recovery` error if caller supplies a checksummed address", + "note": + "Add signerAddress normalization to `isValidECSignature` to avoid `invalid address recovery` error if caller supplies a checksummed address", "pr": 1096 } ], @@ -239,19 +255,23 @@ "pr": 953 }, { - "note": "Update marketUtils api such that all optional parameters are bundled into one optional param and more defaults are provided", + "note": + "Update marketUtils api such that all optional parameters are bundled into one optional param and more defaults are provided", "pr": 954 }, { - "note": "Instead of exporting signature util methods individually, they are now exported as `signatureUtils`", + "note": + "Instead of exporting signature util methods individually, they are now exported as `signatureUtils`", "pr": 924 }, { - "note": "Export types: `SignedOrder`, `Order`, `OrderRelevantState`, `OrderState`, `ECSignature`, `ERC20AssetData`, `ERC721AssetData`, `AssetProxyId`, `SignerType`, `SignatureType`, `OrderStateValid`, `OrderStateInvalid`, `ExchangeContractErrs`, `TradeSide`, `TransferType`, `FindFeeOrdersThatCoverFeesForTargetOrdersOpts`, `FindOrdersThatCoverMakerAssetFillAmountOpts`, `FeeOrdersAndRemainingFeeAmount`, `OrdersAndRemainingFillAmount`, `Provider`, `JSONRPCRequestPayload`, `JSONRPCErrorCallback` and `JSONRPCResponsePayload`", + "note": + "Export types: `SignedOrder`, `Order`, `OrderRelevantState`, `OrderState`, `ECSignature`, `ERC20AssetData`, `ERC721AssetData`, `AssetProxyId`, `SignerType`, `SignatureType`, `OrderStateValid`, `OrderStateInvalid`, `ExchangeContractErrs`, `TradeSide`, `TransferType`, `FindFeeOrdersThatCoverFeesForTargetOrdersOpts`, `FindOrdersThatCoverMakerAssetFillAmountOpts`, `FeeOrdersAndRemainingFeeAmount`, `OrdersAndRemainingFillAmount`, `Provider`, `JSONRPCRequestPayload`, `JSONRPCErrorCallback` and `JSONRPCResponsePayload`", "pr": 924 }, { - "note": "Rename `resultOrders` to `resultFeeOrders` for object returned by `findFeeOrdersThatCoverFeesForTargetOrders` in `marketUtils` api", + "note": + "Rename `resultOrders` to `resultFeeOrders` for object returned by `findFeeOrdersThatCoverFeesForTargetOrders` in `marketUtils` api", "pr": 997 }, { @@ -259,7 +279,8 @@ "pr": 997 }, { - "note": "Update `findFeeOrdersThatCoverFeesForTargetOrders` to round the the nearest integer when calculating required fees", + "note": + "Update `findFeeOrdersThatCoverFeesForTargetOrders` to round the the nearest integer when calculating required fees", "pr": 997 } ], @@ -270,10 +291,12 @@ "changes": [ { "pr": 914, - "note": "Update ecSignOrderHashAsync to return signature string with signature type byte. Removes messagePrefixOpts." + "note": + "Update ecSignOrderHashAsync to return signature string with signature type byte. Removes messagePrefixOpts." }, { - "note": "Added a synchronous `createOrder` method in `orderFactory`, updated public interfaces to support some optional parameters", + "note": + "Added a synchronous `createOrder` method in `orderFactory`, updated public interfaces to support some optional parameters", "pr": 936 }, { @@ -317,7 +340,8 @@ "version": "1.0.0-rc.2", "changes": [ { - "note": "Upgrade ethereumjs-abi dep including a fix so that addresses starting with 0 are properly decoded by `decodeERC20AssetData`" + "note": + "Upgrade ethereumjs-abi dep including a fix so that addresses starting with 0 are properly decoded by `decodeERC20AssetData`" } ], "timestamp": 1532357734 @@ -380,7 +404,8 @@ "version": "0.0.5", "changes": [ { - "note": "Add orderStateUtils, a module for computing order state needed to decide if an order is still valid" + "note": + "Add orderStateUtils, a module for computing order state needed to decide if an order is still valid" } ], "timestamp": 1527008794 diff --git a/packages/order-watcher/CHANGELOG.json b/packages/order-watcher/CHANGELOG.json index bb77feee0e..706e749acb 100644 --- a/packages/order-watcher/CHANGELOG.json +++ b/packages/order-watcher/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "3.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "2.4.2", @@ -31,7 +40,8 @@ "version": "2.3.0", "changes": [ { - "note": "Added a WebSocket interface to OrderWatcher so that it can be used by a client written in any language", + "note": + "Added a WebSocket interface to OrderWatcher so that it can be used by a client written in any language", "pr": 1427 } ] @@ -76,7 +86,8 @@ "version": "2.2.4", "changes": [ { - "note": "Fix the bug when order watcher was throwing an error on order removal when maker token was ZRX", + "note": + "Fix the bug when order watcher was throwing an error on order removal when maker token was ZRX", "pr": 1259 } ], @@ -90,7 +101,8 @@ "pr": 1227 }, { - "note": "Fix the bug when order watcher was trying to convert undefined to an object in case of CancelUpTo event" + "note": + "Fix the bug when order watcher was trying to convert undefined to an object in case of CancelUpTo event" } ], "timestamp": 1542134075 @@ -121,7 +133,8 @@ "pr": 1118 }, { - "note": "Updated to use new modularized artifacts and the latest version of @0xproject/contract-wrappers. Constructor has a new optional `contractAddresses` parameter.", + "note": + "Updated to use new modularized artifacts and the latest version of @0xproject/contract-wrappers. Constructor has a new optional `contractAddresses` parameter.", "pr": 1105 } ], @@ -150,15 +163,18 @@ "version": "2.0.0", "changes": [ { - "note": "Fixes dropped events issue by fetching logs by blockHash instead of blockNumber. Support for fetching by blockHash was added in Geth > v1.8.13 and Parity > v2.1.0. Infura works too.", + "note": + "Fixes dropped events issue by fetching logs by blockHash instead of blockNumber. Support for fetching by blockHash was added in Geth > v1.8.13 and Parity > v2.1.0. Infura works too.", "pr": 1080 }, { - "note": "Fix misunderstanding about blockstream interface callbacks and pass the raw JSON RPC responses to it", + "note": + "Fix misunderstanding about blockstream interface callbacks and pass the raw JSON RPC responses to it", "pr": 1080 }, { - "note": "Add `transactionHash` to `OrderState` emitted by `OrderWatcher` subscriptions if the order's state change originated from a transaction.", + "note": + "Add `transactionHash` to `OrderState` emitted by `OrderWatcher` subscriptions if the order's state change originated from a transaction.", "pr": 1087 } ], @@ -222,7 +238,8 @@ "version": "1.0.1-rc.4", "changes": [ { - "note": "Export types: `ExchangeContractErrs`, `OrderRelevantState`, `JSONRPCRequestPayload`, `JSONRPCErrorCallback` and `JSONRPCResponsePayload`", + "note": + "Export types: `ExchangeContractErrs`, `OrderRelevantState`, `JSONRPCRequestPayload`, `JSONRPCErrorCallback` and `JSONRPCResponsePayload`", "pr": 924 }, { diff --git a/packages/react-docs/CHANGELOG.json b/packages/react-docs/CHANGELOG.json index 101da65c74..23cf6edf6d 100644 --- a/packages/react-docs/CHANGELOG.json +++ b/packages/react-docs/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.0.25", @@ -355,15 +364,18 @@ "version": "0.0.5", "changes": [ { - "note": "Handle `reflection` type rendering so that anonymous function type declarations render properly", + "note": + "Handle `reflection` type rendering so that anonymous function type declarations render properly", "pr": 465 }, { - "note": "Rename `MethodSignature` to `Signature` and change it's props so that it can be used to render method and function signatures.", + "note": + "Rename `MethodSignature` to `Signature` and change it's props so that it can be used to render method and function signatures.", "pr": 465 }, { - "note": "Rename `MethodBlock` to `SignatureBlock` since it is not used to render method and function signature blocks.", + "note": + "Rename `MethodBlock` to `SignatureBlock` since it is not used to render method and function signature blocks.", "pr": 465 }, { @@ -377,7 +389,8 @@ "version": "0.0.3", "changes": [ { - "note": "Move TS typings from devDependencies to dependencies since they are needed by the package user." + "note": + "Move TS typings from devDependencies to dependencies since they are needed by the package user." } ], "timestamp": 1521298800 diff --git a/packages/react-shared/CHANGELOG.json b/packages/react-shared/CHANGELOG.json index a6d2c4fa03..e45326ee65 100644 --- a/packages/react-shared/CHANGELOG.json +++ b/packages/react-shared/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.1.2", @@ -21,7 +30,8 @@ "version": "1.1.0", "changes": [ { - "note": "Change implementation to use react-router-dom NavLink instead of Link. Expose `activeStyle` prop.", + "note": + "Change implementation to use react-router-dom NavLink instead of Link. Expose `activeStyle` prop.", "pr": 1448 } ], diff --git a/packages/sol-compiler/CHANGELOG.json b/packages/sol-compiler/CHANGELOG.json index d7dd5a4545..1c71f7c24b 100644 --- a/packages/sol-compiler/CHANGELOG.json +++ b/packages/sol-compiler/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "3.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "2.0.2", @@ -184,7 +193,8 @@ "version": "1.1.0", "changes": [ { - "note": "Quicken compilation by sending multiple contracts to the same solcjs invocation, batching them together based on compiler version requirements.", + "note": + "Quicken compilation by sending multiple contracts to the same solcjs invocation, batching them together based on compiler version requirements.", "pr": 965 }, { @@ -398,7 +408,8 @@ "pr": 426 }, { - "note": "Add `bytecode`, `runtime_bytecode`, `source_map`, `source_map_runtime` and `sources` fields to artifacts", + "note": + "Add `bytecode`, `runtime_bytecode`, `source_map`, `source_map_runtime` and `sources` fields to artifacts", "pr": 426 }, { @@ -406,7 +417,8 @@ "pr": 426 }, { - "note": "Allow deployer to accept a provider instead of port and host. This makes it possible to run it with in-process ganache-core", + "note": + "Allow deployer to accept a provider instead of port and host. This makes it possible to run it with in-process ganache-core", "pr": 426 }, { @@ -427,7 +439,8 @@ "pr": 408 }, { - "note": "Improve an error message for when deployer is supplied with an incorrect number of constructor arguments", + "note": + "Improve an error message for when deployer is supplied with an incorrect number of constructor arguments", "pr": 419 } ], diff --git a/packages/sol-coverage/CHANGELOG.json b/packages/sol-coverage/CHANGELOG.json index 8157d441e2..1b7aef0f3b 100644 --- a/packages/sol-coverage/CHANGELOG.json +++ b/packages/sol-coverage/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.0.2", diff --git a/packages/sol-doc/CHANGELOG.json b/packages/sol-doc/CHANGELOG.json index f95702ee49..76eba96998 100644 --- a/packages/sol-doc/CHANGELOG.json +++ b/packages/sol-doc/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.0.14", @@ -129,7 +138,8 @@ "version": "1.0.0", "changes": [ { - "note": "Utility to generate documentation for Solidity smart contracts, outputting a format compliant with @0xproject/types.DocAgnosticFormat", + "note": + "Utility to generate documentation for Solidity smart contracts, outputting a format compliant with @0xproject/types.DocAgnosticFormat", "pr": 1004 } ] diff --git a/packages/sol-profiler/CHANGELOG.json b/packages/sol-profiler/CHANGELOG.json index 8157d441e2..1b7aef0f3b 100644 --- a/packages/sol-profiler/CHANGELOG.json +++ b/packages/sol-profiler/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.0.2", diff --git a/packages/sol-resolver/CHANGELOG.json b/packages/sol-resolver/CHANGELOG.json index e5f4a8ac12..f5a005fd41 100644 --- a/packages/sol-resolver/CHANGELOG.json +++ b/packages/sol-resolver/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.2.3", diff --git a/packages/sol-trace/CHANGELOG.json b/packages/sol-trace/CHANGELOG.json index 8157d441e2..1b7aef0f3b 100644 --- a/packages/sol-trace/CHANGELOG.json +++ b/packages/sol-trace/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.0.2", diff --git a/packages/sol-tracing-utils/CHANGELOG.json b/packages/sol-tracing-utils/CHANGELOG.json index b470d3e873..a9e4384aad 100644 --- a/packages/sol-tracing-utils/CHANGELOG.json +++ b/packages/sol-tracing-utils/CHANGELOG.json @@ -1,13 +1,24 @@ [ + { + "version": "5.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "version": "4.0.0", "changes": [ { - "note": "Fix a bug with incorrect parsing of `sourceMaps` due to sources being in an array instead of a map", + "note": + "Fix a bug with incorrect parsing of `sourceMaps` due to sources being in an array instead of a map", "pr": 1498 }, { - "note": "Change the types of `ContractData.sources` and `ContractData.sourceCodes` to be objects instead of arrays", + "note": + "Change the types of `ContractData.sources` and `ContractData.sourceCodes` to be objects instead of arrays", "pr": 1498 }, { @@ -193,7 +204,8 @@ "version": "2.1.0", "changes": [ { - "note": "Export types: `JSONRPCRequestPayload`, `Provider`, `JSONRPCErrorCallback`, `JSONRPCResponsePayload`, `JSONRPCRequestPayloadWithMethod`, `NextCallback`, `ErrorCallback`, `OnNextCompleted` and `Callback`", + "note": + "Export types: `JSONRPCRequestPayload`, `Provider`, `JSONRPCErrorCallback`, `JSONRPCResponsePayload`, `JSONRPCRequestPayloadWithMethod`, `NextCallback`, `ErrorCallback`, `OnNextCompleted` and `Callback`", "pr": 924 } ], @@ -203,7 +215,8 @@ "version": "2.0.0", "changes": [ { - "note": "Fix a bug when eth_call coverage was not computed because of silent schema validation failures", + "note": + "Fix a bug when eth_call coverage was not computed because of silent schema validation failures", "pr": 938 }, { @@ -211,11 +224,13 @@ "pr": 938 }, { - "note": "Change the first param of `TruffleArtifactAdapter` to be the `projectRoot` instead of `sourcesDir`", + "note": + "Change the first param of `TruffleArtifactAdapter` to be the `projectRoot` instead of `sourcesDir`", "pr": 938 }, { - "note": "Throw a helpful error message if truffle artifacts were generated with a different solc version than the one passed in", + "note": + "Throw a helpful error message if truffle artifacts were generated with a different solc version than the one passed in", "pr": 938 } ], @@ -253,7 +268,8 @@ "version": "1.0.0", "changes": [ { - "note": "Add artifact adapter as a parameter for `CoverageSubprovider`. Export `AbstractArtifactAdapter`", + "note": + "Add artifact adapter as a parameter for `CoverageSubprovider`. Export `AbstractArtifactAdapter`", "pr": 589 }, { @@ -309,7 +325,8 @@ "pr": 690 }, { - "note": "Fix a bug when in `TruffleArtifactsAdapter` causing it to throw if `compiler.json` is not there", + "note": + "Fix a bug when in `TruffleArtifactsAdapter` causing it to throw if `compiler.json` is not there", "pr": 690 }, { diff --git a/packages/sra-spec/CHANGELOG.json b/packages/sra-spec/CHANGELOG.json index 3f2a9fbc1a..d1aa755697 100644 --- a/packages/sra-spec/CHANGELOG.json +++ b/packages/sra-spec/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.0.16", @@ -148,7 +157,8 @@ "version": "1.0.1-rc.6", "changes": [ { - "note": "Fix `main` and `types` package.json entries so that they point to the new location of index.d.ts and index.js" + "note": + "Fix `main` and `types` package.json entries so that they point to the new location of index.d.ts and index.js" }, { "note": "Fix relative path to introduction MD file" diff --git a/packages/subproviders/CHANGELOG.json b/packages/subproviders/CHANGELOG.json index dd4dccf4e4..2765385777 100644 --- a/packages/subproviders/CHANGELOG.json +++ b/packages/subproviders/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "3.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "2.1.11", @@ -183,7 +192,8 @@ "version": "2.0.0", "changes": [ { - "note": "Export types: `PartialTxParams`, `JSONRPCRequestPayloadWithMethod`, `ECSignatureString`, `AccountFetchingConfigs`, `LedgerEthereumClientFactoryAsync`, `OnNextCompleted`, `MnemonicWalletSubproviderConfigs`, LedgerGetAddressResult, `JSONRPCRequestPayload`, `Provider`, `JSONRPCResponsePayload` and `JSONRPCErrorCallback`", + "note": + "Export types: `PartialTxParams`, `JSONRPCRequestPayloadWithMethod`, `ECSignatureString`, `AccountFetchingConfigs`, `LedgerEthereumClientFactoryAsync`, `OnNextCompleted`, `MnemonicWalletSubproviderConfigs`, LedgerGetAddressResult, `JSONRPCRequestPayload`, `Provider`, `JSONRPCResponsePayload` and `JSONRPCErrorCallback`", "pr": 924 } ], @@ -312,7 +322,8 @@ "version": "0.9.0", "changes": [ { - "note": "Refactor RedundantRPCSubprovider into RedundantSubprovider where it now accepts an array of subproviders rather then an array of RPC endpoints", + "note": + "Refactor RedundantRPCSubprovider into RedundantSubprovider where it now accepts an array of subproviders rather then an array of RPC endpoints", "pr": 500 }, { @@ -328,7 +339,8 @@ "pr": 507 }, { - "note": "Refactors LedgerSubprovider such that explicitly setting the `pathIndex` is no longer required. Simply set the request `from` address as desired", + "note": + "Refactors LedgerSubprovider such that explicitly setting the `pathIndex` is no longer required. Simply set the request `from` address as desired", "pr": 507 }, { @@ -386,7 +398,8 @@ "version": "0.7.0", "changes": [ { - "note": "Updated legerco packages. Removed node-hid package as a dependency and make it an optional dependency. It is still used in integration tests but is causing problems for users on Linux distros.", + "note": + "Updated legerco packages. Removed node-hid package as a dependency and make it an optional dependency. It is still used in integration tests but is causing problems for users on Linux distros.", "pr": 437 } ], @@ -434,7 +447,8 @@ "pr": 355 }, { - "note": "InjectedWeb3Subprovider accepts a Provider in the constructor, previously it was a Web3 object", + "note": + "InjectedWeb3Subprovider accepts a Provider in the constructor, previously it was a Web3 object", "pr": 363 } ], diff --git a/packages/tslint-config/CHANGELOG.json b/packages/tslint-config/CHANGELOG.json index fe34592fda..be52c5542f 100644 --- a/packages/tslint-config/CHANGELOG.json +++ b/packages/tslint-config/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "3.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "2.0.2", @@ -231,7 +240,8 @@ "version": "0.4.7", "changes": [ { - "note": "Modified custom 'underscore-privates' rule, changing it to 'underscore-private-and-protected' requiring underscores to be prepended to both private and protected variable names", + "note": + "Modified custom 'underscore-privates' rule, changing it to 'underscore-private-and-protected' requiring underscores to be prepended to both private and protected variable names", "pr": 354 } ], @@ -241,10 +251,12 @@ "version": "0.4.0", "changes": [ { - "note": "Added custom 'underscore-privates' rule, requiring underscores to be prepended to private variable names" + "note": + "Added custom 'underscore-privates' rule, requiring underscores to be prepended to private variable names" }, { - "note": "Because our tools can be used in both a TS and JS environment, we want to make the private methods of any public facing interface show up at the bottom of auto-complete lists. Additionally, we wanted to remain consistent with respect to our usage of underscores in order to enforce this rule with a linter rule, rather then manual code reviews." + "note": + "Because our tools can be used in both a TS and JS environment, we want to make the private methods of any public facing interface show up at the bottom of auto-complete lists. Additionally, we wanted to remain consistent with respect to our usage of underscores in order to enforce this rule with a linter rule, rather then manual code reviews." } ], "timestamp": 1514386800 diff --git a/packages/types/CHANGELOG.json b/packages/types/CHANGELOG.json index 40a46ac846..a88823de83 100644 --- a/packages/types/CHANGELOG.json +++ b/packages/types/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "1.5.2", @@ -58,7 +67,8 @@ "version": "1.3.0", "changes": [ { - "note": "Add the `SimpleContractArtifact` type, which describes the artifact format published in the `@0x/contract-artifacts` package", + "note": + "Add the `SimpleContractArtifact` type, which describes the artifact format published in the `@0x/contract-artifacts` package", "pr": 1298 } ], @@ -285,7 +295,8 @@ "pr": 589 }, { - "note": "Moved ExchangeContractErrs, DoneCallback, Token, OrderRelevantState, OrderStateValid, OrderStateInvalid, OrderState, OrderAddresses and OrderValues types from 0x.js", + "note": + "Moved ExchangeContractErrs, DoneCallback, Token, OrderRelevantState, OrderStateValid, OrderStateInvalid, OrderState, OrderAddresses and OrderValues types from 0x.js", "pr": 579 } ], diff --git a/packages/typescript-typings/CHANGELOG.json b/packages/typescript-typings/CHANGELOG.json index cc7ef7fa4b..2b193376dd 100644 --- a/packages/typescript-typings/CHANGELOG.json +++ b/packages/typescript-typings/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "4.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "3.0.8", @@ -206,7 +215,8 @@ "note": "Add types for `react-popper`, remove types for `react-joyride`" }, { - "note": "Remove types for blockies, bn.js, compare-versions, ethereumjs-abi, ethereumjs-tx, find-versions, hdkey, is-mobile, solidity-parser-antlr, xml-js as they were moved to DefinitelyTyped", + "note": + "Remove types for blockies, bn.js, compare-versions, ethereumjs-abi, ethereumjs-tx, find-versions, hdkey, is-mobile, solidity-parser-antlr, xml-js as they were moved to DefinitelyTyped", "pr": 641 } ] diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index 851c106d8a..e82b5a6da6 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "4.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "3.0.1", @@ -50,7 +59,8 @@ "version": "2.0.7", "changes": [ { - "note": "Optimized ABI Encoder/Decoder. Generates compressed calldata to save gas. Generates human-readable calldata to aid development." + "note": + "Optimized ABI Encoder/Decoder. Generates compressed calldata to save gas. Generates human-readable calldata to aid development." } ], "timestamp": 1544570656 @@ -181,7 +191,8 @@ "pr": 807 }, { - "note": "Store different ABIs for events with same function signature and different amount of indexed arguments", + "note": + "Store different ABIs for events with same function signature and different amount of indexed arguments", "pr": 933 } ], @@ -348,7 +359,8 @@ "version": "0.4.3", "changes": [ { - "note": "Add `@types/node` to dependencies since `intervalUtils` has the `NodeJS` type as part of its public interface." + "note": + "Add `@types/node` to dependencies since `intervalUtils` has the `NodeJS` type as part of its public interface." } ], "timestamp": 1521298800 @@ -391,7 +403,8 @@ "version": "0.3.0", "changes": [ { - "note": "Fix a bug related to event signature collisions (argument indexes aren't included in event signatures) in the abi_decoder. The decoder used to throw on unknown events with identical signatures as a known event (except indexes).", + "note": + "Fix a bug related to event signature collisions (argument indexes aren't included in event signatures) in the abi_decoder. The decoder used to throw on unknown events with identical signatures as a known event (except indexes).", "pr": 366 } ], diff --git a/packages/web3-wrapper/CHANGELOG.json b/packages/web3-wrapper/CHANGELOG.json index b9d5a37b1b..2769b02241 100644 --- a/packages/web3-wrapper/CHANGELOG.json +++ b/packages/web3-wrapper/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "4.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, { "timestamp": 1547561734, "version": "3.2.4", @@ -100,7 +109,8 @@ "version": "3.1.1", "changes": [ { - "note": "Fix bug in `getTransactionByHashAsync` which was causing the return value to have the wrong type (raw fields instead of unmarshalled fields).", + "note": + "Fix bug in `getTransactionByHashAsync` which was causing the return value to have the wrong type (raw fields instead of unmarshalled fields).", "pr": 1177 } ], @@ -114,7 +124,8 @@ "pr": 1102 }, { - "note": "Web3Wrapper now throws when an RPC request contains an error field in the response. Previously errors could be swallowed and undefined returned.", + "note": + "Web3Wrapper now throws when an RPC request contains an error field in the response. Previously errors could be swallowed and undefined returned.", "pr": 1102 } ], @@ -151,11 +162,13 @@ "version": "3.0.0", "changes": [ { - "note": "Rename `getBlockAsync` to `getBlockIfExistsAsync` and rather then throw if the requested block wasn't found, return undefined.", + "note": + "Rename `getBlockAsync` to `getBlockIfExistsAsync` and rather then throw if the requested block wasn't found, return undefined.", "pr": 1082 }, { - "note": "Expose `sendRawPayloadAsync` so one can easily extend `Web3Wrapper` with their own custom JSON RPC calls", + "note": + "Expose `sendRawPayloadAsync` so one can easily extend `Web3Wrapper` with their own custom JSON RPC calls", "pr": 1080 } ], @@ -165,7 +178,8 @@ "version": "2.0.3", "changes": [ { - "note": "Fixes issue #1076 where Parity now returns a placeholder transactionReceipt before the transaction is mined.", + "note": + "Fixes issue #1076 where Parity now returns a placeholder transactionReceipt before the transaction is mined.", "pr": 1079 } ], @@ -193,7 +207,8 @@ "version": "2.0.0", "changes": [ { - "note": "Export types: `BlockParam`, `TxData`, `Provider`, `TransactionReceipt`, `Transaction`, `TraceParams`, `TransactionTrace``, BlockWithoutTransactionDat`a, `LogEntry`, `FilterObject`, `CallData`, `TransactionReceiptWithDecodedLogs`, `BlockWithTransactionData``, LogTopi`c, `JSONRPCRequestPayload`, `TransactionReceiptStatus`, `DecodedLogArgs`, `StructLog`, `JSONRPCErrorCallback``, BlockParamLitera`l, `ContractEventArg`, `DecodedLogEntry`, `LogEntryEvent`, `OpCode`, `TxDataPayable`, `JSONRPCResponsePayload``, RawLogEntr`y, `DecodedLogEntryEvent`, `LogWithDecodedArgs`, `AbiDefinition`, `RawLog`, `FunctionAbi`, `EventAbi`, `EventParameter``, MethodAb`i, `ConstructorAbi`, `FallbackAbi`, `DataItem`, `ConstructorStateMutability` and `StateMutability`", + "note": + "Export types: `BlockParam`, `TxData`, `Provider`, `TransactionReceipt`, `Transaction`, `TraceParams`, `TransactionTrace``, BlockWithoutTransactionDat`a, `LogEntry`, `FilterObject`, `CallData`, `TransactionReceiptWithDecodedLogs`, `BlockWithTransactionData``, LogTopi`c, `JSONRPCRequestPayload`, `TransactionReceiptStatus`, `DecodedLogArgs`, `StructLog`, `JSONRPCErrorCallback``, BlockParamLitera`l, `ContractEventArg`, `DecodedLogEntry`, `LogEntryEvent`, `OpCode`, `TxDataPayable`, `JSONRPCResponsePayload``, RawLogEntr`y, `DecodedLogEntryEvent`, `LogWithDecodedArgs`, `AbiDefinition`, `RawLog`, `FunctionAbi`, `EventAbi`, `EventParameter``, MethodAb`i, `ConstructorAbi`, `FallbackAbi`, `DataItem`, `ConstructorStateMutability` and `StateMutability`", "pr": 924 }, { @@ -340,7 +355,8 @@ "pr": 622 }, { - "note": "Improve performance of awaitTransactionMinedAsync by immediately checking if the transaction was already mined instead of waiting for the first interval.", + "note": + "Improve performance of awaitTransactionMinedAsync by immediately checking if the transaction was already mined instead of waiting for the first interval.", "pr": 688 } ] @@ -403,7 +419,8 @@ "pr": 485 }, { - "note": "Add a public field `abiDecoder: AbiDecoder` which allows you to add your ABIs that are later used to decode logs", + "note": + "Add a public field `abiDecoder: AbiDecoder` which allows you to add your ABIs that are later used to decode logs", "pr": 485 }, { @@ -427,7 +444,8 @@ "version": "0.3.0", "changes": [ { - "note": "Add `web3Wrapper.takeSnapshotAsync`, `web3Wrapper.revertSnapshotAsync`, `web3Wrapper.mineBlockAsync`, `web3Wrapper.increaseTimeAsync`", + "note": + "Add `web3Wrapper.takeSnapshotAsync`, `web3Wrapper.revertSnapshotAsync`, `web3Wrapper.mineBlockAsync`, `web3Wrapper.increaseTimeAsync`", "pr": 426 }, { From 0720b8487cf40b1868a1971f50e732e5e19fc9f6 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 Jan 2019 17:13:20 +0100 Subject: [PATCH 17/18] Fix a build issue --- packages/base-contract/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/base-contract/src/index.ts b/packages/base-contract/src/index.ts index 101228c52c..0238106f32 100644 --- a/packages/base-contract/src/index.ts +++ b/packages/base-contract/src/index.ts @@ -1,4 +1,4 @@ -import { AbiEncoder, abiUtils } from '@0x/utils'; +import { AbiEncoder, abiUtils, BigNumber } from '@0x/utils'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { AbiDefinition, From 7d166dc7da23c30540fb554727a955015073286f Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 Jan 2019 17:34:44 +0100 Subject: [PATCH 18/18] Fix prettier --- packages/0x.js/CHANGELOG.json | 120 +++++++-------------- packages/abi-gen-wrappers/CHANGELOG.json | 3 +- packages/abi-gen/CHANGELOG.json | 9 +- packages/assert/CHANGELOG.json | 6 +- packages/asset-buyer/CHANGELOG.json | 12 +-- packages/base-contract/CHANGELOG.json | 3 +- packages/connect/CHANGELOG.json | 3 +- packages/contract-wrappers/CHANGELOG.json | 48 +++------ packages/fill-scenarios/CHANGELOG.json | 3 +- packages/json-schemas/CHANGELOG.json | 9 +- packages/migrations/CHANGELOG.json | 6 +- packages/order-utils/CHANGELOG.json | 48 +++------ packages/order-watcher/CHANGELOG.json | 24 ++--- packages/react-docs/CHANGELOG.json | 12 +-- packages/react-shared/CHANGELOG.json | 3 +- packages/sol-compiler/CHANGELOG.json | 12 +-- packages/sol-doc/CHANGELOG.json | 3 +- packages/sol-tracing-utils/CHANGELOG.json | 24 ++--- packages/sra-spec/CHANGELOG.json | 3 +- packages/subproviders/CHANGELOG.json | 15 +-- packages/tslint-config/CHANGELOG.json | 9 +- packages/types/CHANGELOG.json | 6 +- packages/typescript-typings/CHANGELOG.json | 3 +- packages/utils/CHANGELOG.json | 12 +-- packages/web3-wrapper/CHANGELOG.json | 27 ++--- 25 files changed, 141 insertions(+), 282 deletions(-) diff --git a/packages/0x.js/CHANGELOG.json b/packages/0x.js/CHANGELOG.json index aa02f4e259..c9c120fed9 100644 --- a/packages/0x.js/CHANGELOG.json +++ b/packages/0x.js/CHANGELOG.json @@ -30,8 +30,7 @@ "version": "3.0.0", "changes": [ { - "note": - "Export `MultiAssetData`, `MultiAssetDataWithRecursiveDecoding`, `ObjectMap`, and `SingleAssetData` from types. No longer export `AssetData`.", + "note": "Export `MultiAssetData`, `MultiAssetDataWithRecursiveDecoding`, `ObjectMap`, and `SingleAssetData` from types. No longer export `AssetData`.", "pr": 1363 } ], @@ -117,18 +116,15 @@ "pr": 1102 }, { - "note": - "Added `MetamaskSubprovider` to handle inconsistencies in Metamask's signing JSON RPC endpoints.", + "note": "Added `MetamaskSubprovider` to handle inconsistencies in Metamask's signing JSON RPC endpoints.", "pr": 1102 }, { - "note": - "Removed `SignerType` (including `SignerType.Metamask`). Please use the `MetamaskSubprovider` to wrap `web3.currentProvider`.", + "note": "Removed `SignerType` (including `SignerType.Metamask`). Please use the `MetamaskSubprovider` to wrap `web3.currentProvider`.", "pr": 1102 }, { - "note": - "Updated to use new modularized artifacts and the latest version of @0xproject/contract-wrappers", + "note": "Updated to use new modularized artifacts and the latest version of @0xproject/contract-wrappers", "pr": 1105 }, { @@ -227,8 +223,7 @@ "version": "1.0.1-rc.5", "changes": [ { - "note": - "Fix `main` and `types` package.json entries so that they point to the new location of index.d.ts and index.js" + "note": "Fix `main` and `types` package.json entries so that they point to the new location of index.d.ts and index.js" } ] }, @@ -236,8 +231,7 @@ "version": "1.0.1-rc.4", "changes": [ { - "note": - "Re-organize the exported interface of 0x.js. Remove the `ZeroEx` class, and instead export the same exports as `0x.js`'s sub-packages: `@0xproject/contract-wrappers`, `@0xproject/order-utils` and `@0xproject/order-watcher`", + "note": "Re-organize the exported interface of 0x.js. Remove the `ZeroEx` class, and instead export the same exports as `0x.js`'s sub-packages: `@0xproject/contract-wrappers`, `@0xproject/order-utils` and `@0xproject/order-watcher`", "pr": 963 } ], @@ -309,18 +303,15 @@ "pr": 863 }, { - "note": - "Refactored `ZeroEx.isValidSignature` to `zeroEx.isValidSignatureAsync`. It is now async so that it can verify contract-dependent signature types", + "note": "Refactored `ZeroEx.isValidSignature` to `zeroEx.isValidSignatureAsync`. It is now async so that it can verify contract-dependent signature types", "pr": 863 }, { - "note": - "Refactored `signOrderHashAsync` to `ecSignOrderHashAsync`. There are now many non-ECSignature ways to sign orders too.", + "note": "Refactored `signOrderHashAsync` to `ecSignOrderHashAsync`. There are now many non-ECSignature ways to sign orders too.", "pr": 863 }, { - "note": - "Removed `createOrderWatcherAsync` method. Will be added back once OrderWatcher is refactored for V2", + "note": "Removed `createOrderWatcherAsync` method. Will be added back once OrderWatcher is refactored for V2", "pr": 863 }, { @@ -395,8 +386,7 @@ "pr": 579 }, { - "note": - "Renamed ZeroExError to ContractWrappersErrors since they now lives in the @0xproject/contract-wrappers subpackage", + "note": "Renamed ZeroExError to ContractWrappersErrors since they now lives in the @0xproject/contract-wrappers subpackage", "pr": 579 } ], @@ -481,8 +471,7 @@ "pr": 501 }, { - "note": - "Add `zeroEx.exchange.getOrderStateAsync` to allow obtaining current OrderState for a signedOrder", + "note": "Add `zeroEx.exchange.getOrderStateAsync` to allow obtaining current OrderState for a signedOrder", "pr": 510 } ], @@ -492,8 +481,7 @@ "version": "0.35.0", "changes": [ { - "note": - "Removed `ZeroExError.TransactionMiningTimeout` and moved it to '@0xproject/web3-wrapper' `Web3WrapperErrors.TransactionMiningTimeout`", + "note": "Removed `ZeroExError.TransactionMiningTimeout` and moved it to '@0xproject/web3-wrapper' `Web3WrapperErrors.TransactionMiningTimeout`", "pr": 485 } ], @@ -503,8 +491,7 @@ "version": "0.34.0", "changes": [ { - "note": - "Fix the bug causing `zeroEx.exchange.fillOrdersUpToAsync` validation to fail if there were some extra orders passed", + "note": "Fix the bug causing `zeroEx.exchange.fillOrdersUpToAsync` validation to fail if there were some extra orders passed", "pr": 470 }, { @@ -516,8 +503,7 @@ "pr": 488 }, { - "note": - "Added `stateLayer` setting to `OrderStateWatcherConfig` so OrderStateWatcher can be set to monitor different blockchain state layers", + "note": "Added `stateLayer` setting to `OrderStateWatcherConfig` so OrderStateWatcher can be set to monitor different blockchain state layers", "pr": 488 } ], @@ -604,8 +590,7 @@ "pr": 350 }, { - "note": - "Fixed the bug causing order watcher to throw if there is an event with the same signature but different indexed fields", + "note": "Fixed the bug causing order watcher to throw if there is an event with the same signature but different indexed fields", "pr": 366 } ], @@ -625,8 +610,7 @@ "version": "0.31.0", "changes": [ { - "note": - "Add the `shouldAddPersonalMessagePrefix` parameter to `signOrderHashAsync` so that the caller can decide on whether to add the personalMessage prefix before relaying the request to the signer. Parity Signer, Ledger and TestRPC add the prefix themselves, Metamask expects it to have already been added.", + "note": "Add the `shouldAddPersonalMessagePrefix` parameter to `signOrderHashAsync` so that the caller can decide on whether to add the personalMessage prefix before relaying the request to the signer. Parity Signer, Ledger and TestRPC add the prefix themselves, Metamask expects it to have already been added.", "pr": 349 } ], @@ -671,8 +655,7 @@ "pr": 312 }, { - "note": - "Fix a bug in fillOrdersUpTo validation making it impossible to fill up to if user doesn't have enough balance to fully fill all the orders", + "note": "Fix a bug in fillOrdersUpTo validation making it impossible to fill up to if user doesn't have enough balance to fully fill all the orders", "pr": 321 } ], @@ -706,13 +689,11 @@ "version": "0.28.0", "changes": [ { - "note": - "Add `etherTokenAddress` arg to `depositAsync` and `withdrawAsync` methods on `zeroEx.etherToken`", + "note": "Add `etherTokenAddress` arg to `depositAsync` and `withdrawAsync` methods on `zeroEx.etherToken`", "pr": 267 }, { - "note": - "Removed accidentally included `unsubscribeAll` method from `zeroEx.proxy`, `zeroEx.etherToken` and `zeroEx.tokenRegistry`", + "note": "Removed accidentally included `unsubscribeAll` method from `zeroEx.proxy`, `zeroEx.etherToken` and `zeroEx.tokenRegistry`", "pr": 267 }, { @@ -724,8 +705,7 @@ "pr": 272 }, { - "note": - "Add `zeroEx.etherToken.subscribe`, `zeroEx.etherToken.unsubscribe`, `zeroEx.etherToken.unsubscribeAll`", + "note": "Add `zeroEx.etherToken.subscribe`, `zeroEx.etherToken.unsubscribe`, `zeroEx.etherToken.unsubscribeAll`", "pr": 277 }, { @@ -733,8 +713,7 @@ "pr": 277 }, { - "note": - "Add new public types `BlockParamLiteral`, `EtherTokenEvents`, `EtherTokenContractEventArgs`, `DepositContractEventArgs`, `WithdrawalContractEventArgs`", + "note": "Add new public types `BlockParamLiteral`, `EtherTokenEvents`, `EtherTokenContractEventArgs`, `DepositContractEventArgs`, `WithdrawalContractEventArgs`", "pr": 277 }, { @@ -769,8 +748,7 @@ "pr": 233 }, { - "note": - "Make all `getContractAddress` functions, `zeroEx.exchange.subscribe`, `zeroEx.exchange.getZRXTokenAddress` sync", + "note": "Make all `getContractAddress` functions, `zeroEx.exchange.subscribe`, `zeroEx.exchange.getZRXTokenAddress` sync", "pr": 233 }, { @@ -778,8 +756,7 @@ "pr": 233 }, { - "note": - "Make `DecodedLogEvent` contain `LogWithDecodedArgs` under log key instead of merging it in like web3 does", + "note": "Make `DecodedLogEvent` contain `LogWithDecodedArgs` under log key instead of merging it in like web3 does", "pr": 234 }, { @@ -795,8 +772,7 @@ "pr": 235 }, { - "note": - "Modify order validation methods to validate against the `latest` block, not against the `pending` block", + "note": "Modify order validation methods to validate against the `latest` block, not against the `pending` block", "pr": 236 } ], @@ -806,8 +782,7 @@ "version": "0.26.0", "changes": [ { - "note": - "Add post-formatter for logs converting `blockNumber`, `logIndex`, `transactionIndex` from hexes to numbers", + "note": "Add post-formatter for logs converting `blockNumber`, `logIndex`, `transactionIndex` from hexes to numbers", "pr": 231 }, { @@ -815,8 +790,7 @@ "pr": 222 }, { - "note": - "In OrderWatcher subscribe to ZRX Token Transfer and Approval events when maker token is different", + "note": "In OrderWatcher subscribe to ZRX Token Transfer and Approval events when maker token is different", "pr": 225 } ], @@ -834,8 +808,7 @@ "pr": 205 }, { - "note": - "Normalized the transactionReceipt status to be `null|0|1`, 1 meaning transaction execution successful, 0 unsuccessful and `null` if it is a pre-byzantinium transaction.", + "note": "Normalized the transactionReceipt status to be `null|0|1`, 1 meaning transaction execution successful, 0 unsuccessful and `null` if it is a pre-byzantinium transaction.", "pr": 200 } ], @@ -906,8 +879,7 @@ "version": "0.22.0", "changes": [ { - "note": - "Started using `OrderFillRequest` interface instead of `OrderFillOrKillRequest` interface for `zeroEx.exchange.batchFillOrKill`", + "note": "Started using `OrderFillRequest` interface instead of `OrderFillOrKillRequest` interface for `zeroEx.exchange.batchFillOrKill`", "pr": 187 }, { @@ -921,8 +893,7 @@ "version": "0.21.4", "changes": [ { - "note": - "Made 0x.js more type-safe by making `getLogsAsync` and `subscribe/subscribeAsync` generics parametrized with arg type", + "note": "Made 0x.js more type-safe by making `getLogsAsync` and `subscribe/subscribeAsync` generics parametrized with arg type", "pr": 194 } ], @@ -969,8 +940,7 @@ "note": "Subscriptions no longer return historical logs. If you want them - use `getLogsAsync`" }, { - "note": - "Subscriptions now use [ethereumjs-blockstream](https://github.com/ethereumjs/ethereumjs-blockstream) under the hood" + "note": "Subscriptions now use [ethereumjs-blockstream](https://github.com/ethereumjs/ethereumjs-blockstream) under the hood" }, { "note": "Subscriptions correctly handle block re-orgs (forks)" @@ -979,8 +949,7 @@ "note": "Subscriptions correctly backfill logs (connection problems)" }, { - "note": - "They no longer setup filters on the underlying nodes, so you can use them with infura without a filter Subprovider" + "note": "They no longer setup filters on the underlying nodes, so you can use them with infura without a filter Subprovider" }, { "note": "Removed `ContractEventEmitter` and added `LogEvent`" @@ -1087,8 +1056,7 @@ "version": "0.15.0", "changes": [ { - "note": - "Added the ability to specify a historical `blockNumber` at which to query the blockchain's state when calling a token or exchange method", + "note": "Added the ability to specify a historical `blockNumber` at which to query the blockchain's state when calling a token or exchange method", "pr": 161 } ], @@ -1136,8 +1104,7 @@ "version": "0.13.0", "changes": [ { - "note": - "Made all the functions submitting transactions to the network to immediately return transaction hash", + "note": "Made all the functions submitting transactions to the network to immediately return transaction hash", "pr": 151 }, { @@ -1145,8 +1112,7 @@ "pr": 151 }, { - "note": - "Added `TransactionReceiptWithDecodedLogs`, `LogWithDecodedArgs`, `DecodedLogArgs` to public types", + "note": "Added `TransactionReceiptWithDecodedLogs`, `LogWithDecodedArgs`, `DecodedLogArgs` to public types", "pr": 151 }, { @@ -1319,8 +1285,7 @@ "pr": 104 }, { - "note": - "Fixed an issue with incorrect balance/allowance validation when ZRX is one of the tokens traded", + "note": "Fixed an issue with incorrect balance/allowance validation when ZRX is one of the tokens traded", "pr": 109 } ], @@ -1330,13 +1295,11 @@ "version": "0.8.0", "changes": [ { - "note": - "Added the ability to call methods on different authorized versions of the Exchange smart contract", + "note": "Added the ability to call methods on different authorized versions of the Exchange smart contract", "pr": 82 }, { - "note": - "Updated contract artifacts to reflect latest changes to the smart contracts (0xproject/contracts#59)" + "note": "Updated contract artifacts to reflect latest changes to the smart contracts (0xproject/contracts#59)" }, { "note": "Added `zeroEx.proxy.isAuthorizedAsync` and `zeroEx.proxy.getAuthorizedAddressesAsync`", @@ -1372,8 +1335,7 @@ "version": "0.7.1", "changes": [ { - "note": - "Added the ability to convert Ether to wrapped Ether tokens and back via `zeroEx.etherToken.depostAsync` and `zeroEx.etherToken.withdrawAsync`", + "note": "Added the ability to convert Ether to wrapped Ether tokens and back via `zeroEx.etherToken.depostAsync` and `zeroEx.etherToken.withdrawAsync`", "pr": 81 } ], @@ -1395,8 +1357,7 @@ "pr": 72 }, { - "note": - "Renamed type `LogCancelArgs` to `LogCancelContractEventArgs` and `LogFillArgs` to `LogFillContractEventArgs`" + "note": "Renamed type `LogCancelArgs` to `LogCancelContractEventArgs` and `LogFillArgs` to `LogFillContractEventArgs`" } ], "timestamp": 1498057200 @@ -1438,8 +1399,7 @@ "version": "0.5.2", "changes": [ { - "note": - "Fixed the bug in `postpublish` script that caused that only unminified UMD bundle was uploaded to release page" + "note": "Fixed the bug in `postpublish` script that caused that only unminified UMD bundle was uploaded to release page" } ], "timestamp": 1497452400 diff --git a/packages/abi-gen-wrappers/CHANGELOG.json b/packages/abi-gen-wrappers/CHANGELOG.json index a19d98f953..c604302b5b 100644 --- a/packages/abi-gen-wrappers/CHANGELOG.json +++ b/packages/abi-gen-wrappers/CHANGELOG.json @@ -69,8 +69,7 @@ "version": "1.1.0", "changes": [ { - "note": - "`deployFrom0xArtifactAsync` additionally accepts artifacts that conform to the `SimpleContractArtifact` interface", + "note": "`deployFrom0xArtifactAsync` additionally accepts artifacts that conform to the `SimpleContractArtifact` interface", "pr": 1298 } ], diff --git a/packages/abi-gen/CHANGELOG.json b/packages/abi-gen/CHANGELOG.json index 3c2c4aaf1b..173617b657 100644 --- a/packages/abi-gen/CHANGELOG.json +++ b/packages/abi-gen/CHANGELOG.json @@ -339,13 +339,11 @@ "version": "0.2.4", "changes": [ { - "note": - "Add a `backend` parameter that allows you to specify the Ethereum library you use in your templates (`web3` or `ethers`). Ethers auto-converts small ints to numbers whereas Web3 doesn't. Defaults to `web3`", + "note": "Add a `backend` parameter that allows you to specify the Ethereum library you use in your templates (`web3` or `ethers`). Ethers auto-converts small ints to numbers whereas Web3 doesn't. Defaults to `web3`", "pr": 413 }, { - "note": - "Add support for [tuple types](https://solidity.readthedocs.io/en/develop/abi-spec.html#handling-tuple-types)", + "note": "Add support for [tuple types](https://solidity.readthedocs.io/en/develop/abi-spec.html#handling-tuple-types)", "pr": 413 }, { @@ -373,8 +371,7 @@ "pr": 346 }, { - "note": - "Added CLI option to specify networkId, adding support for the JSON artifact format found in @0xproject/contracts", + "note": "Added CLI option to specify networkId, adding support for the JSON artifact format found in @0xproject/contracts", "pr": 388 } ], diff --git a/packages/assert/CHANGELOG.json b/packages/assert/CHANGELOG.json index a07d4f4bd1..278b7dfa11 100644 --- a/packages/assert/CHANGELOG.json +++ b/packages/assert/CHANGELOG.json @@ -220,8 +220,7 @@ "version": "1.0.0", "changes": [ { - "note": - "Fix bug in string enum assertion. We erroneously were checking against the enum keys, not values", + "note": "Fix bug in string enum assertion. We erroneously were checking against the enum keys, not values", "pr": 821 } ] @@ -366,8 +365,7 @@ "note": "Re-publish Assert previously published under NPM package @0xproject/0x-assert" }, { - "note": - "Added assertion isValidBaseUnitAmount which checks both that the value is a valid bigNumber and that it does not contain decimals." + "note": "Added assertion isValidBaseUnitAmount which checks both that the value is a valid bigNumber and that it does not contain decimals." } ], "timestamp": 1510585200 diff --git a/packages/asset-buyer/CHANGELOG.json b/packages/asset-buyer/CHANGELOG.json index 98c30ca093..4e670b642c 100644 --- a/packages/asset-buyer/CHANGELOG.json +++ b/packages/asset-buyer/CHANGELOG.json @@ -109,8 +109,7 @@ "pr": 1187 }, { - "note": - "the `OrderProvider` now requires a new method `getAvailableMakerAssetDatasAsync` and the `StandardRelayerAPIOrderProvider` requires the network id at init.", + "note": "the `OrderProvider` now requires a new method `getAvailableMakerAssetDatasAsync` and the `StandardRelayerAPIOrderProvider` requires the network id at init.", "pr": 1203 }, { @@ -118,13 +117,11 @@ "pr": 1197 }, { - "note": - "Fix bug where `BuyQuoteInfo` objects could return `totalEthAmount` and `feeEthAmount` that were not whole numbers", + "note": "Fix bug where `BuyQuoteInfo` objects could return `totalEthAmount` and `feeEthAmount` that were not whole numbers", "pr": 1207 }, { - "note": - "Fix bug where default values for `AssetBuyer` public facing methods could get overriden by `undefined` values", + "note": "Fix bug where default values for `AssetBuyer` public facing methods could get overriden by `undefined` values", "pr": 1207 }, { @@ -145,8 +142,7 @@ "pr": 1131 }, { - "note": - "Updated to use new modularized artifacts and the latest version of @0xproject/contract-wrappers", + "note": "Updated to use new modularized artifacts and the latest version of @0xproject/contract-wrappers", "pr": 1105 }, { diff --git a/packages/base-contract/CHANGELOG.json b/packages/base-contract/CHANGELOG.json index 4337c33add..63b1fe8f78 100644 --- a/packages/base-contract/CHANGELOG.json +++ b/packages/base-contract/CHANGELOG.json @@ -270,8 +270,7 @@ "version": "0.3.4", "changes": [ { - "note": - "Update EthersJs to fix the `value.toLowerCase()` is not a function bug caused by `ethers.js` breaking patch version https://github.com/ethers-io/ethers.js/issues/201" + "note": "Update EthersJs to fix the `value.toLowerCase()` is not a function bug caused by `ethers.js` breaking patch version https://github.com/ethers-io/ethers.js/issues/201" } ], "timestamp": 1529397769 diff --git a/packages/connect/CHANGELOG.json b/packages/connect/CHANGELOG.json index 1e30424989..c2f16d96a5 100644 --- a/packages/connect/CHANGELOG.json +++ b/packages/connect/CHANGELOG.json @@ -255,8 +255,7 @@ "version": "1.0.0", "changes": [ { - "note": - "Remove `WebSocketOrderbookChannel` from the public interface and replace with `orderbookChannelFactory`" + "note": "Remove `WebSocketOrderbookChannel` from the public interface and replace with `orderbookChannelFactory`" } ] }, diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index 5b5654067d..09c585cc5f 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -84,8 +84,7 @@ "version": "4.1.0", "changes": [ { - "note": - "Add a `nonce` field for `TxOpts` so that it's now possible to re-broadcast stuck transactions with a higher gas amount", + "note": "Add a `nonce` field for `TxOpts` so that it's now possible to re-broadcast stuck transactions with a higher gas amount", "pr": 1292 } ], @@ -113,18 +112,15 @@ "version": "4.0.0", "changes": [ { - "note": - "Add signature validation, regular cancellation and `cancelledUpTo` checks to `validateOrderFillableOrThrowAsync`", + "note": "Add signature validation, regular cancellation and `cancelledUpTo` checks to `validateOrderFillableOrThrowAsync`", "pr": 1235 }, { - "note": - "Improved the errors thrown by `validateOrderFillableOrThrowAsync` by making them more descriptive", + "note": "Improved the errors thrown by `validateOrderFillableOrThrowAsync` by making them more descriptive", "pr": 1235 }, { - "note": - "Throw previously swallowed network errors when calling `validateOrderFillableOrThrowAsync` (see issue: #1218)", + "note": "Throw previously swallowed network errors when calling `validateOrderFillableOrThrowAsync` (see issue: #1218)", "pr": 1235 } ], @@ -155,28 +151,23 @@ "pr": 1105 }, { - "note": - "Default contract addresses are no longer stored in artifacts and are instead loaded from the `@0xproject/contract-addresses` package.", + "note": "Default contract addresses are no longer stored in artifacts and are instead loaded from the `@0xproject/contract-addresses` package.", "pr": 1105 }, { - "note": - "Most contract addresses are now defined at instantiation time and are available as properties (e.g., `exchangeWrapper.address`) instead of methods (e.g., `exchangeWrapper.getContractAddress()`).", + "note": "Most contract addresses are now defined at instantiation time and are available as properties (e.g., `exchangeWrapper.address`) instead of methods (e.g., `exchangeWrapper.getContractAddress()`).", "pr": 1105 }, { - "note": - "Removed `setProvider` method in top-level `ContractWrapper` class and added new `unsubscribeAll` method.", + "note": "Removed `setProvider` method in top-level `ContractWrapper` class and added new `unsubscribeAll` method.", "pr": 1105 }, { - "note": - "Some properties and methods have been renamed. For example, some methods that previously could throw no longer can, and so their names have been updated accordingly.", + "note": "Some properties and methods have been renamed. For example, some methods that previously could throw no longer can, and so their names have been updated accordingly.", "pr": 1105 }, { - "note": - "Removed ContractNotFound errors. Checking for this error was somewhat ineffecient. Relevant methods/functions now return the default error from web3-wrapper, which we feel provides enough information.", + "note": "Removed ContractNotFound errors. Checking for this error was somewhat ineffecient. Relevant methods/functions now return the default error from web3-wrapper, which we feel provides enough information.", "pr": 1105 }, { @@ -212,13 +203,11 @@ "version": "2.0.0", "changes": [ { - "note": - "Fixes dropped events in subscriptions by fetching logs by blockHash instead of blockNumber. Support for fetching by blockHash was added in Geth > v1.8.13 and Parity > v2.1.0. Infura works too.", + "note": "Fixes dropped events in subscriptions by fetching logs by blockHash instead of blockNumber. Support for fetching by blockHash was added in Geth > v1.8.13 and Parity > v2.1.0. Infura works too.", "pr": 1080 }, { - "note": - "Fix misunderstanding about blockstream interface callbacks and pass the raw JSON RPC responses to it", + "note": "Fix misunderstanding about blockstream interface callbacks and pass the raw JSON RPC responses to it", "pr": 1080 } ], @@ -267,18 +256,15 @@ "note": "Add `OrderValidatorWrapper`" }, { - "note": - "Fix bug where contracts not deployed on a network showed an `EXCHANGE_CONTRACT_DOES_NOT_EXIST` error instead of `CONTRACT_NOT_DEPLOYED_ON_NETWORK`", + "note": "Fix bug where contracts not deployed on a network showed an `EXCHANGE_CONTRACT_DOES_NOT_EXIST` error instead of `CONTRACT_NOT_DEPLOYED_ON_NETWORK`", "pr": 1044 }, { - "note": - "Export `AssetBalanceAndProxyAllowanceFetcher` and `OrderFilledCancelledFetcher` implementations", + "note": "Export `AssetBalanceAndProxyAllowanceFetcher` and `OrderFilledCancelledFetcher` implementations", "pr": 1054 }, { - "note": - "Add `validateOrderFillableOrThrowAsync` and `validateFillOrderThrowIfInvalidAsync` to ExchangeWrapper", + "note": "Add `validateOrderFillableOrThrowAsync` and `validateFillOrderThrowIfInvalidAsync` to ExchangeWrapper", "pr": 1054 } ], @@ -297,13 +283,11 @@ "version": "1.0.1-rc.4", "changes": [ { - "note": - "Export missing types: `TransactionEncoder`, `ContractAbi`, `JSONRPCRequestPayload`, `JSONRPCResponsePayload`, `JSONRPCErrorCallback`, `AbiDefinition`, `FunctionAbi`, `EventAbi`, `EventParameter`, `DecodedLogArgs`, `MethodAbi`, `ConstructorAbi`, `FallbackAbi`, `DataItem`, `ConstructorStateMutability`, `StateMutability` & `ExchangeSignatureValidatorApprovalEventArgs`", + "note": "Export missing types: `TransactionEncoder`, `ContractAbi`, `JSONRPCRequestPayload`, `JSONRPCResponsePayload`, `JSONRPCErrorCallback`, `AbiDefinition`, `FunctionAbi`, `EventAbi`, `EventParameter`, `DecodedLogArgs`, `MethodAbi`, `ConstructorAbi`, `FallbackAbi`, `DataItem`, `ConstructorStateMutability`, `StateMutability` & `ExchangeSignatureValidatorApprovalEventArgs`", "pr": 924 }, { - "note": - "Remove superfluous exported types: `ContractEvent`, `Token`, `OrderFillRequest`, `ContractEventArgs`, `LogEvent`, `OnOrderStateChangeCallback`, `ECSignature`, `OrderStateValid`, `OrderStateInvalid`, `OrderState`, `FilterObject`, `TransactionReceipt` & `TransactionReceiptWithDecodedLogs`", + "note": "Remove superfluous exported types: `ContractEvent`, `Token`, `OrderFillRequest`, `ContractEventArgs`, `LogEvent`, `OnOrderStateChangeCallback`, `ECSignature`, `OrderStateValid`, `OrderStateInvalid`, `OrderState`, `FilterObject`, `TransactionReceipt` & `TransactionReceiptWithDecodedLogs`", "pr": 924 }, { diff --git a/packages/fill-scenarios/CHANGELOG.json b/packages/fill-scenarios/CHANGELOG.json index 1941214170..beffdd097a 100644 --- a/packages/fill-scenarios/CHANGELOG.json +++ b/packages/fill-scenarios/CHANGELOG.json @@ -203,8 +203,7 @@ "version": "1.0.1-rc.3", "changes": [ { - "note": - "Updated to use latest orderFactory interface, fixed `feeRecipient` spelling error in public interface", + "note": "Updated to use latest orderFactory interface, fixed `feeRecipient` spelling error in public interface", "pr": 936 }, { diff --git a/packages/json-schemas/CHANGELOG.json b/packages/json-schemas/CHANGELOG.json index d1e34b9be5..66de84299b 100644 --- a/packages/json-schemas/CHANGELOG.json +++ b/packages/json-schemas/CHANGELOG.json @@ -75,8 +75,7 @@ "version": "2.1.0", "changes": [ { - "note": - "Improve schemas by enforcing that amounts that must be whole numbers (e.g Order asset amounts) no longer allow decimal amounts", + "note": "Improve schemas by enforcing that amounts that must be whole numbers (e.g Order asset amounts) no longer allow decimal amounts", "pr": 1173 }, { @@ -90,8 +89,7 @@ "version": "2.0.0", "changes": [ { - "note": - "Convert all schemas to JSON files so that they can be used with `json-schema` implemenations in other programming languages.", + "note": "Convert all schemas to JSON files so that they can be used with `json-schema` implemenations in other programming languages.", "pr": 1145 } ], @@ -282,8 +280,7 @@ "version": "0.8.0", "changes": [ { - "note": - "Update Order & SignedOrder schemas, remove ECSignature schema and add Hex schema as part of V2 upgrades", + "note": "Update Order & SignedOrder schemas, remove ECSignature schema and add Hex schema as part of V2 upgrades", "pr": 615 } ], diff --git a/packages/migrations/CHANGELOG.json b/packages/migrations/CHANGELOG.json index 169439d090..64ae94b14c 100644 --- a/packages/migrations/CHANGELOG.json +++ b/packages/migrations/CHANGELOG.json @@ -77,8 +77,7 @@ "version": "2.1.0", "changes": [ { - "note": - "Export all type declarations used by the public interface, as well as the `ContractAddresses` mapping", + "note": "Export all type declarations used by the public interface, as well as the `ContractAddresses` mapping", "pr": 1301 } ], @@ -124,8 +123,7 @@ "version": "2.0.0", "changes": [ { - "note": - "Contract artifacts have been moved to the new @0xproject/contract-artifacts package. v1 migrations have been removed. `runMigrationsAsync` returns the addresses of the contracts that were deployed.", + "note": "Contract artifacts have been moved to the new @0xproject/contract-artifacts package. v1 migrations have been removed. `runMigrationsAsync` returns the addresses of the contracts that were deployed.", "pr": 1105 } ], diff --git a/packages/order-utils/CHANGELOG.json b/packages/order-utils/CHANGELOG.json index a63e9b436f..08d88da5ba 100644 --- a/packages/order-utils/CHANGELOG.json +++ b/packages/order-utils/CHANGELOG.json @@ -30,8 +30,7 @@ "version": "3.1.0", "changes": [ { - "note": - "Use new ABI encoder, add encoding/decoding logic for MultiAsset assetData, and add information to return values in orderStateUtils", + "note": "Use new ABI encoder, add encoding/decoding logic for MultiAsset assetData, and add information to return values in orderStateUtils", "pr": 1363 } ], @@ -105,23 +104,19 @@ "version": "3.0.0", "changes": [ { - "note": - "Add signature validation, regular cancellation and `cancelledUpTo` checks to `validateOrderFillableOrThrowAsync`", + "note": "Add signature validation, regular cancellation and `cancelledUpTo` checks to `validateOrderFillableOrThrowAsync`", "pr": 1235 }, { - "note": - "Improved the errors thrown by `validateOrderFillableOrThrowAsync` by making them more descriptive", + "note": "Improved the errors thrown by `validateOrderFillableOrThrowAsync` by making them more descriptive", "pr": 1235 }, { - "note": - "Throw previously swallowed network errors when calling `validateOrderFillableOrThrowAsync` (see issue: #1218)", + "note": "Throw previously swallowed network errors when calling `validateOrderFillableOrThrowAsync` (see issue: #1218)", "pr": 1235 }, { - "note": - "Modified the `AbstractOrderFilledCancelledFetcher` interface slightly such that `isOrderCancelledAsync` accepts a `signedOrder` instead of an `orderHash` param", + "note": "Modified the `AbstractOrderFilledCancelledFetcher` interface slightly such that `isOrderCancelledAsync` accepts a `signedOrder` instead of an `orderHash` param", "pr": 1235 } ], @@ -140,8 +135,7 @@ "version": "2.0.0", "changes": [ { - "note": - "Added `ecSignOrderAsync` to first sign an order using `eth_signTypedData` and fallback to `eth_sign`.", + "note": "Added `ecSignOrderAsync` to first sign an order using `eth_signTypedData` and fallback to `eth_sign`.", "pr": 1102 }, { @@ -172,8 +166,7 @@ "version": "1.0.6", "changes": [ { - "note": - "Add signerAddress normalization to `isValidECSignature` to avoid `invalid address recovery` error if caller supplies a checksummed address", + "note": "Add signerAddress normalization to `isValidECSignature` to avoid `invalid address recovery` error if caller supplies a checksummed address", "pr": 1096 } ], @@ -255,23 +248,19 @@ "pr": 953 }, { - "note": - "Update marketUtils api such that all optional parameters are bundled into one optional param and more defaults are provided", + "note": "Update marketUtils api such that all optional parameters are bundled into one optional param and more defaults are provided", "pr": 954 }, { - "note": - "Instead of exporting signature util methods individually, they are now exported as `signatureUtils`", + "note": "Instead of exporting signature util methods individually, they are now exported as `signatureUtils`", "pr": 924 }, { - "note": - "Export types: `SignedOrder`, `Order`, `OrderRelevantState`, `OrderState`, `ECSignature`, `ERC20AssetData`, `ERC721AssetData`, `AssetProxyId`, `SignerType`, `SignatureType`, `OrderStateValid`, `OrderStateInvalid`, `ExchangeContractErrs`, `TradeSide`, `TransferType`, `FindFeeOrdersThatCoverFeesForTargetOrdersOpts`, `FindOrdersThatCoverMakerAssetFillAmountOpts`, `FeeOrdersAndRemainingFeeAmount`, `OrdersAndRemainingFillAmount`, `Provider`, `JSONRPCRequestPayload`, `JSONRPCErrorCallback` and `JSONRPCResponsePayload`", + "note": "Export types: `SignedOrder`, `Order`, `OrderRelevantState`, `OrderState`, `ECSignature`, `ERC20AssetData`, `ERC721AssetData`, `AssetProxyId`, `SignerType`, `SignatureType`, `OrderStateValid`, `OrderStateInvalid`, `ExchangeContractErrs`, `TradeSide`, `TransferType`, `FindFeeOrdersThatCoverFeesForTargetOrdersOpts`, `FindOrdersThatCoverMakerAssetFillAmountOpts`, `FeeOrdersAndRemainingFeeAmount`, `OrdersAndRemainingFillAmount`, `Provider`, `JSONRPCRequestPayload`, `JSONRPCErrorCallback` and `JSONRPCResponsePayload`", "pr": 924 }, { - "note": - "Rename `resultOrders` to `resultFeeOrders` for object returned by `findFeeOrdersThatCoverFeesForTargetOrders` in `marketUtils` api", + "note": "Rename `resultOrders` to `resultFeeOrders` for object returned by `findFeeOrdersThatCoverFeesForTargetOrders` in `marketUtils` api", "pr": 997 }, { @@ -279,8 +268,7 @@ "pr": 997 }, { - "note": - "Update `findFeeOrdersThatCoverFeesForTargetOrders` to round the the nearest integer when calculating required fees", + "note": "Update `findFeeOrdersThatCoverFeesForTargetOrders` to round the the nearest integer when calculating required fees", "pr": 997 } ], @@ -291,12 +279,10 @@ "changes": [ { "pr": 914, - "note": - "Update ecSignOrderHashAsync to return signature string with signature type byte. Removes messagePrefixOpts." + "note": "Update ecSignOrderHashAsync to return signature string with signature type byte. Removes messagePrefixOpts." }, { - "note": - "Added a synchronous `createOrder` method in `orderFactory`, updated public interfaces to support some optional parameters", + "note": "Added a synchronous `createOrder` method in `orderFactory`, updated public interfaces to support some optional parameters", "pr": 936 }, { @@ -340,8 +326,7 @@ "version": "1.0.0-rc.2", "changes": [ { - "note": - "Upgrade ethereumjs-abi dep including a fix so that addresses starting with 0 are properly decoded by `decodeERC20AssetData`" + "note": "Upgrade ethereumjs-abi dep including a fix so that addresses starting with 0 are properly decoded by `decodeERC20AssetData`" } ], "timestamp": 1532357734 @@ -404,8 +389,7 @@ "version": "0.0.5", "changes": [ { - "note": - "Add orderStateUtils, a module for computing order state needed to decide if an order is still valid" + "note": "Add orderStateUtils, a module for computing order state needed to decide if an order is still valid" } ], "timestamp": 1527008794 diff --git a/packages/order-watcher/CHANGELOG.json b/packages/order-watcher/CHANGELOG.json index 706e749acb..4f96487ed0 100644 --- a/packages/order-watcher/CHANGELOG.json +++ b/packages/order-watcher/CHANGELOG.json @@ -40,8 +40,7 @@ "version": "2.3.0", "changes": [ { - "note": - "Added a WebSocket interface to OrderWatcher so that it can be used by a client written in any language", + "note": "Added a WebSocket interface to OrderWatcher so that it can be used by a client written in any language", "pr": 1427 } ] @@ -86,8 +85,7 @@ "version": "2.2.4", "changes": [ { - "note": - "Fix the bug when order watcher was throwing an error on order removal when maker token was ZRX", + "note": "Fix the bug when order watcher was throwing an error on order removal when maker token was ZRX", "pr": 1259 } ], @@ -101,8 +99,7 @@ "pr": 1227 }, { - "note": - "Fix the bug when order watcher was trying to convert undefined to an object in case of CancelUpTo event" + "note": "Fix the bug when order watcher was trying to convert undefined to an object in case of CancelUpTo event" } ], "timestamp": 1542134075 @@ -133,8 +130,7 @@ "pr": 1118 }, { - "note": - "Updated to use new modularized artifacts and the latest version of @0xproject/contract-wrappers. Constructor has a new optional `contractAddresses` parameter.", + "note": "Updated to use new modularized artifacts and the latest version of @0xproject/contract-wrappers. Constructor has a new optional `contractAddresses` parameter.", "pr": 1105 } ], @@ -163,18 +159,15 @@ "version": "2.0.0", "changes": [ { - "note": - "Fixes dropped events issue by fetching logs by blockHash instead of blockNumber. Support for fetching by blockHash was added in Geth > v1.8.13 and Parity > v2.1.0. Infura works too.", + "note": "Fixes dropped events issue by fetching logs by blockHash instead of blockNumber. Support for fetching by blockHash was added in Geth > v1.8.13 and Parity > v2.1.0. Infura works too.", "pr": 1080 }, { - "note": - "Fix misunderstanding about blockstream interface callbacks and pass the raw JSON RPC responses to it", + "note": "Fix misunderstanding about blockstream interface callbacks and pass the raw JSON RPC responses to it", "pr": 1080 }, { - "note": - "Add `transactionHash` to `OrderState` emitted by `OrderWatcher` subscriptions if the order's state change originated from a transaction.", + "note": "Add `transactionHash` to `OrderState` emitted by `OrderWatcher` subscriptions if the order's state change originated from a transaction.", "pr": 1087 } ], @@ -238,8 +231,7 @@ "version": "1.0.1-rc.4", "changes": [ { - "note": - "Export types: `ExchangeContractErrs`, `OrderRelevantState`, `JSONRPCRequestPayload`, `JSONRPCErrorCallback` and `JSONRPCResponsePayload`", + "note": "Export types: `ExchangeContractErrs`, `OrderRelevantState`, `JSONRPCRequestPayload`, `JSONRPCErrorCallback` and `JSONRPCResponsePayload`", "pr": 924 }, { diff --git a/packages/react-docs/CHANGELOG.json b/packages/react-docs/CHANGELOG.json index 23cf6edf6d..8b418fc11e 100644 --- a/packages/react-docs/CHANGELOG.json +++ b/packages/react-docs/CHANGELOG.json @@ -364,18 +364,15 @@ "version": "0.0.5", "changes": [ { - "note": - "Handle `reflection` type rendering so that anonymous function type declarations render properly", + "note": "Handle `reflection` type rendering so that anonymous function type declarations render properly", "pr": 465 }, { - "note": - "Rename `MethodSignature` to `Signature` and change it's props so that it can be used to render method and function signatures.", + "note": "Rename `MethodSignature` to `Signature` and change it's props so that it can be used to render method and function signatures.", "pr": 465 }, { - "note": - "Rename `MethodBlock` to `SignatureBlock` since it is not used to render method and function signature blocks.", + "note": "Rename `MethodBlock` to `SignatureBlock` since it is not used to render method and function signature blocks.", "pr": 465 }, { @@ -389,8 +386,7 @@ "version": "0.0.3", "changes": [ { - "note": - "Move TS typings from devDependencies to dependencies since they are needed by the package user." + "note": "Move TS typings from devDependencies to dependencies since they are needed by the package user." } ], "timestamp": 1521298800 diff --git a/packages/react-shared/CHANGELOG.json b/packages/react-shared/CHANGELOG.json index e45326ee65..99a8779ac7 100644 --- a/packages/react-shared/CHANGELOG.json +++ b/packages/react-shared/CHANGELOG.json @@ -30,8 +30,7 @@ "version": "1.1.0", "changes": [ { - "note": - "Change implementation to use react-router-dom NavLink instead of Link. Expose `activeStyle` prop.", + "note": "Change implementation to use react-router-dom NavLink instead of Link. Expose `activeStyle` prop.", "pr": 1448 } ], diff --git a/packages/sol-compiler/CHANGELOG.json b/packages/sol-compiler/CHANGELOG.json index 1c71f7c24b..672939a4a6 100644 --- a/packages/sol-compiler/CHANGELOG.json +++ b/packages/sol-compiler/CHANGELOG.json @@ -193,8 +193,7 @@ "version": "1.1.0", "changes": [ { - "note": - "Quicken compilation by sending multiple contracts to the same solcjs invocation, batching them together based on compiler version requirements.", + "note": "Quicken compilation by sending multiple contracts to the same solcjs invocation, batching them together based on compiler version requirements.", "pr": 965 }, { @@ -408,8 +407,7 @@ "pr": 426 }, { - "note": - "Add `bytecode`, `runtime_bytecode`, `source_map`, `source_map_runtime` and `sources` fields to artifacts", + "note": "Add `bytecode`, `runtime_bytecode`, `source_map`, `source_map_runtime` and `sources` fields to artifacts", "pr": 426 }, { @@ -417,8 +415,7 @@ "pr": 426 }, { - "note": - "Allow deployer to accept a provider instead of port and host. This makes it possible to run it with in-process ganache-core", + "note": "Allow deployer to accept a provider instead of port and host. This makes it possible to run it with in-process ganache-core", "pr": 426 }, { @@ -439,8 +436,7 @@ "pr": 408 }, { - "note": - "Improve an error message for when deployer is supplied with an incorrect number of constructor arguments", + "note": "Improve an error message for when deployer is supplied with an incorrect number of constructor arguments", "pr": 419 } ], diff --git a/packages/sol-doc/CHANGELOG.json b/packages/sol-doc/CHANGELOG.json index 76eba96998..662915faf7 100644 --- a/packages/sol-doc/CHANGELOG.json +++ b/packages/sol-doc/CHANGELOG.json @@ -138,8 +138,7 @@ "version": "1.0.0", "changes": [ { - "note": - "Utility to generate documentation for Solidity smart contracts, outputting a format compliant with @0xproject/types.DocAgnosticFormat", + "note": "Utility to generate documentation for Solidity smart contracts, outputting a format compliant with @0xproject/types.DocAgnosticFormat", "pr": 1004 } ] diff --git a/packages/sol-tracing-utils/CHANGELOG.json b/packages/sol-tracing-utils/CHANGELOG.json index a9e4384aad..f47baf65aa 100644 --- a/packages/sol-tracing-utils/CHANGELOG.json +++ b/packages/sol-tracing-utils/CHANGELOG.json @@ -12,13 +12,11 @@ "version": "4.0.0", "changes": [ { - "note": - "Fix a bug with incorrect parsing of `sourceMaps` due to sources being in an array instead of a map", + "note": "Fix a bug with incorrect parsing of `sourceMaps` due to sources being in an array instead of a map", "pr": 1498 }, { - "note": - "Change the types of `ContractData.sources` and `ContractData.sourceCodes` to be objects instead of arrays", + "note": "Change the types of `ContractData.sources` and `ContractData.sourceCodes` to be objects instead of arrays", "pr": 1498 }, { @@ -204,8 +202,7 @@ "version": "2.1.0", "changes": [ { - "note": - "Export types: `JSONRPCRequestPayload`, `Provider`, `JSONRPCErrorCallback`, `JSONRPCResponsePayload`, `JSONRPCRequestPayloadWithMethod`, `NextCallback`, `ErrorCallback`, `OnNextCompleted` and `Callback`", + "note": "Export types: `JSONRPCRequestPayload`, `Provider`, `JSONRPCErrorCallback`, `JSONRPCResponsePayload`, `JSONRPCRequestPayloadWithMethod`, `NextCallback`, `ErrorCallback`, `OnNextCompleted` and `Callback`", "pr": 924 } ], @@ -215,8 +212,7 @@ "version": "2.0.0", "changes": [ { - "note": - "Fix a bug when eth_call coverage was not computed because of silent schema validation failures", + "note": "Fix a bug when eth_call coverage was not computed because of silent schema validation failures", "pr": 938 }, { @@ -224,13 +220,11 @@ "pr": 938 }, { - "note": - "Change the first param of `TruffleArtifactAdapter` to be the `projectRoot` instead of `sourcesDir`", + "note": "Change the first param of `TruffleArtifactAdapter` to be the `projectRoot` instead of `sourcesDir`", "pr": 938 }, { - "note": - "Throw a helpful error message if truffle artifacts were generated with a different solc version than the one passed in", + "note": "Throw a helpful error message if truffle artifacts were generated with a different solc version than the one passed in", "pr": 938 } ], @@ -268,8 +262,7 @@ "version": "1.0.0", "changes": [ { - "note": - "Add artifact adapter as a parameter for `CoverageSubprovider`. Export `AbstractArtifactAdapter`", + "note": "Add artifact adapter as a parameter for `CoverageSubprovider`. Export `AbstractArtifactAdapter`", "pr": 589 }, { @@ -325,8 +318,7 @@ "pr": 690 }, { - "note": - "Fix a bug when in `TruffleArtifactsAdapter` causing it to throw if `compiler.json` is not there", + "note": "Fix a bug when in `TruffleArtifactsAdapter` causing it to throw if `compiler.json` is not there", "pr": 690 }, { diff --git a/packages/sra-spec/CHANGELOG.json b/packages/sra-spec/CHANGELOG.json index d1aa755697..e22a3b0e4c 100644 --- a/packages/sra-spec/CHANGELOG.json +++ b/packages/sra-spec/CHANGELOG.json @@ -157,8 +157,7 @@ "version": "1.0.1-rc.6", "changes": [ { - "note": - "Fix `main` and `types` package.json entries so that they point to the new location of index.d.ts and index.js" + "note": "Fix `main` and `types` package.json entries so that they point to the new location of index.d.ts and index.js" }, { "note": "Fix relative path to introduction MD file" diff --git a/packages/subproviders/CHANGELOG.json b/packages/subproviders/CHANGELOG.json index 2765385777..68f2e4110a 100644 --- a/packages/subproviders/CHANGELOG.json +++ b/packages/subproviders/CHANGELOG.json @@ -192,8 +192,7 @@ "version": "2.0.0", "changes": [ { - "note": - "Export types: `PartialTxParams`, `JSONRPCRequestPayloadWithMethod`, `ECSignatureString`, `AccountFetchingConfigs`, `LedgerEthereumClientFactoryAsync`, `OnNextCompleted`, `MnemonicWalletSubproviderConfigs`, LedgerGetAddressResult, `JSONRPCRequestPayload`, `Provider`, `JSONRPCResponsePayload` and `JSONRPCErrorCallback`", + "note": "Export types: `PartialTxParams`, `JSONRPCRequestPayloadWithMethod`, `ECSignatureString`, `AccountFetchingConfigs`, `LedgerEthereumClientFactoryAsync`, `OnNextCompleted`, `MnemonicWalletSubproviderConfigs`, LedgerGetAddressResult, `JSONRPCRequestPayload`, `Provider`, `JSONRPCResponsePayload` and `JSONRPCErrorCallback`", "pr": 924 } ], @@ -322,8 +321,7 @@ "version": "0.9.0", "changes": [ { - "note": - "Refactor RedundantRPCSubprovider into RedundantSubprovider where it now accepts an array of subproviders rather then an array of RPC endpoints", + "note": "Refactor RedundantRPCSubprovider into RedundantSubprovider where it now accepts an array of subproviders rather then an array of RPC endpoints", "pr": 500 }, { @@ -339,8 +337,7 @@ "pr": 507 }, { - "note": - "Refactors LedgerSubprovider such that explicitly setting the `pathIndex` is no longer required. Simply set the request `from` address as desired", + "note": "Refactors LedgerSubprovider such that explicitly setting the `pathIndex` is no longer required. Simply set the request `from` address as desired", "pr": 507 }, { @@ -398,8 +395,7 @@ "version": "0.7.0", "changes": [ { - "note": - "Updated legerco packages. Removed node-hid package as a dependency and make it an optional dependency. It is still used in integration tests but is causing problems for users on Linux distros.", + "note": "Updated legerco packages. Removed node-hid package as a dependency and make it an optional dependency. It is still used in integration tests but is causing problems for users on Linux distros.", "pr": 437 } ], @@ -447,8 +443,7 @@ "pr": 355 }, { - "note": - "InjectedWeb3Subprovider accepts a Provider in the constructor, previously it was a Web3 object", + "note": "InjectedWeb3Subprovider accepts a Provider in the constructor, previously it was a Web3 object", "pr": 363 } ], diff --git a/packages/tslint-config/CHANGELOG.json b/packages/tslint-config/CHANGELOG.json index be52c5542f..34ea6aa6bb 100644 --- a/packages/tslint-config/CHANGELOG.json +++ b/packages/tslint-config/CHANGELOG.json @@ -240,8 +240,7 @@ "version": "0.4.7", "changes": [ { - "note": - "Modified custom 'underscore-privates' rule, changing it to 'underscore-private-and-protected' requiring underscores to be prepended to both private and protected variable names", + "note": "Modified custom 'underscore-privates' rule, changing it to 'underscore-private-and-protected' requiring underscores to be prepended to both private and protected variable names", "pr": 354 } ], @@ -251,12 +250,10 @@ "version": "0.4.0", "changes": [ { - "note": - "Added custom 'underscore-privates' rule, requiring underscores to be prepended to private variable names" + "note": "Added custom 'underscore-privates' rule, requiring underscores to be prepended to private variable names" }, { - "note": - "Because our tools can be used in both a TS and JS environment, we want to make the private methods of any public facing interface show up at the bottom of auto-complete lists. Additionally, we wanted to remain consistent with respect to our usage of underscores in order to enforce this rule with a linter rule, rather then manual code reviews." + "note": "Because our tools can be used in both a TS and JS environment, we want to make the private methods of any public facing interface show up at the bottom of auto-complete lists. Additionally, we wanted to remain consistent with respect to our usage of underscores in order to enforce this rule with a linter rule, rather then manual code reviews." } ], "timestamp": 1514386800 diff --git a/packages/types/CHANGELOG.json b/packages/types/CHANGELOG.json index a88823de83..7a6d205eea 100644 --- a/packages/types/CHANGELOG.json +++ b/packages/types/CHANGELOG.json @@ -67,8 +67,7 @@ "version": "1.3.0", "changes": [ { - "note": - "Add the `SimpleContractArtifact` type, which describes the artifact format published in the `@0x/contract-artifacts` package", + "note": "Add the `SimpleContractArtifact` type, which describes the artifact format published in the `@0x/contract-artifacts` package", "pr": 1298 } ], @@ -295,8 +294,7 @@ "pr": 589 }, { - "note": - "Moved ExchangeContractErrs, DoneCallback, Token, OrderRelevantState, OrderStateValid, OrderStateInvalid, OrderState, OrderAddresses and OrderValues types from 0x.js", + "note": "Moved ExchangeContractErrs, DoneCallback, Token, OrderRelevantState, OrderStateValid, OrderStateInvalid, OrderState, OrderAddresses and OrderValues types from 0x.js", "pr": 579 } ], diff --git a/packages/typescript-typings/CHANGELOG.json b/packages/typescript-typings/CHANGELOG.json index 2b193376dd..e3ae60231c 100644 --- a/packages/typescript-typings/CHANGELOG.json +++ b/packages/typescript-typings/CHANGELOG.json @@ -215,8 +215,7 @@ "note": "Add types for `react-popper`, remove types for `react-joyride`" }, { - "note": - "Remove types for blockies, bn.js, compare-versions, ethereumjs-abi, ethereumjs-tx, find-versions, hdkey, is-mobile, solidity-parser-antlr, xml-js as they were moved to DefinitelyTyped", + "note": "Remove types for blockies, bn.js, compare-versions, ethereumjs-abi, ethereumjs-tx, find-versions, hdkey, is-mobile, solidity-parser-antlr, xml-js as they were moved to DefinitelyTyped", "pr": 641 } ] diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json index e82b5a6da6..0fb199e58a 100644 --- a/packages/utils/CHANGELOG.json +++ b/packages/utils/CHANGELOG.json @@ -59,8 +59,7 @@ "version": "2.0.7", "changes": [ { - "note": - "Optimized ABI Encoder/Decoder. Generates compressed calldata to save gas. Generates human-readable calldata to aid development." + "note": "Optimized ABI Encoder/Decoder. Generates compressed calldata to save gas. Generates human-readable calldata to aid development." } ], "timestamp": 1544570656 @@ -191,8 +190,7 @@ "pr": 807 }, { - "note": - "Store different ABIs for events with same function signature and different amount of indexed arguments", + "note": "Store different ABIs for events with same function signature and different amount of indexed arguments", "pr": 933 } ], @@ -359,8 +357,7 @@ "version": "0.4.3", "changes": [ { - "note": - "Add `@types/node` to dependencies since `intervalUtils` has the `NodeJS` type as part of its public interface." + "note": "Add `@types/node` to dependencies since `intervalUtils` has the `NodeJS` type as part of its public interface." } ], "timestamp": 1521298800 @@ -403,8 +400,7 @@ "version": "0.3.0", "changes": [ { - "note": - "Fix a bug related to event signature collisions (argument indexes aren't included in event signatures) in the abi_decoder. The decoder used to throw on unknown events with identical signatures as a known event (except indexes).", + "note": "Fix a bug related to event signature collisions (argument indexes aren't included in event signatures) in the abi_decoder. The decoder used to throw on unknown events with identical signatures as a known event (except indexes).", "pr": 366 } ], diff --git a/packages/web3-wrapper/CHANGELOG.json b/packages/web3-wrapper/CHANGELOG.json index 2769b02241..e05879ba84 100644 --- a/packages/web3-wrapper/CHANGELOG.json +++ b/packages/web3-wrapper/CHANGELOG.json @@ -109,8 +109,7 @@ "version": "3.1.1", "changes": [ { - "note": - "Fix bug in `getTransactionByHashAsync` which was causing the return value to have the wrong type (raw fields instead of unmarshalled fields).", + "note": "Fix bug in `getTransactionByHashAsync` which was causing the return value to have the wrong type (raw fields instead of unmarshalled fields).", "pr": 1177 } ], @@ -124,8 +123,7 @@ "pr": 1102 }, { - "note": - "Web3Wrapper now throws when an RPC request contains an error field in the response. Previously errors could be swallowed and undefined returned.", + "note": "Web3Wrapper now throws when an RPC request contains an error field in the response. Previously errors could be swallowed and undefined returned.", "pr": 1102 } ], @@ -162,13 +160,11 @@ "version": "3.0.0", "changes": [ { - "note": - "Rename `getBlockAsync` to `getBlockIfExistsAsync` and rather then throw if the requested block wasn't found, return undefined.", + "note": "Rename `getBlockAsync` to `getBlockIfExistsAsync` and rather then throw if the requested block wasn't found, return undefined.", "pr": 1082 }, { - "note": - "Expose `sendRawPayloadAsync` so one can easily extend `Web3Wrapper` with their own custom JSON RPC calls", + "note": "Expose `sendRawPayloadAsync` so one can easily extend `Web3Wrapper` with their own custom JSON RPC calls", "pr": 1080 } ], @@ -178,8 +174,7 @@ "version": "2.0.3", "changes": [ { - "note": - "Fixes issue #1076 where Parity now returns a placeholder transactionReceipt before the transaction is mined.", + "note": "Fixes issue #1076 where Parity now returns a placeholder transactionReceipt before the transaction is mined.", "pr": 1079 } ], @@ -207,8 +202,7 @@ "version": "2.0.0", "changes": [ { - "note": - "Export types: `BlockParam`, `TxData`, `Provider`, `TransactionReceipt`, `Transaction`, `TraceParams`, `TransactionTrace``, BlockWithoutTransactionDat`a, `LogEntry`, `FilterObject`, `CallData`, `TransactionReceiptWithDecodedLogs`, `BlockWithTransactionData``, LogTopi`c, `JSONRPCRequestPayload`, `TransactionReceiptStatus`, `DecodedLogArgs`, `StructLog`, `JSONRPCErrorCallback``, BlockParamLitera`l, `ContractEventArg`, `DecodedLogEntry`, `LogEntryEvent`, `OpCode`, `TxDataPayable`, `JSONRPCResponsePayload``, RawLogEntr`y, `DecodedLogEntryEvent`, `LogWithDecodedArgs`, `AbiDefinition`, `RawLog`, `FunctionAbi`, `EventAbi`, `EventParameter``, MethodAb`i, `ConstructorAbi`, `FallbackAbi`, `DataItem`, `ConstructorStateMutability` and `StateMutability`", + "note": "Export types: `BlockParam`, `TxData`, `Provider`, `TransactionReceipt`, `Transaction`, `TraceParams`, `TransactionTrace``, BlockWithoutTransactionDat`a, `LogEntry`, `FilterObject`, `CallData`, `TransactionReceiptWithDecodedLogs`, `BlockWithTransactionData``, LogTopi`c, `JSONRPCRequestPayload`, `TransactionReceiptStatus`, `DecodedLogArgs`, `StructLog`, `JSONRPCErrorCallback``, BlockParamLitera`l, `ContractEventArg`, `DecodedLogEntry`, `LogEntryEvent`, `OpCode`, `TxDataPayable`, `JSONRPCResponsePayload``, RawLogEntr`y, `DecodedLogEntryEvent`, `LogWithDecodedArgs`, `AbiDefinition`, `RawLog`, `FunctionAbi`, `EventAbi`, `EventParameter``, MethodAb`i, `ConstructorAbi`, `FallbackAbi`, `DataItem`, `ConstructorStateMutability` and `StateMutability`", "pr": 924 }, { @@ -355,8 +349,7 @@ "pr": 622 }, { - "note": - "Improve performance of awaitTransactionMinedAsync by immediately checking if the transaction was already mined instead of waiting for the first interval.", + "note": "Improve performance of awaitTransactionMinedAsync by immediately checking if the transaction was already mined instead of waiting for the first interval.", "pr": 688 } ] @@ -419,8 +412,7 @@ "pr": 485 }, { - "note": - "Add a public field `abiDecoder: AbiDecoder` which allows you to add your ABIs that are later used to decode logs", + "note": "Add a public field `abiDecoder: AbiDecoder` which allows you to add your ABIs that are later used to decode logs", "pr": 485 }, { @@ -444,8 +436,7 @@ "version": "0.3.0", "changes": [ { - "note": - "Add `web3Wrapper.takeSnapshotAsync`, `web3Wrapper.revertSnapshotAsync`, `web3Wrapper.mineBlockAsync`, `web3Wrapper.increaseTimeAsync`", + "note": "Add `web3Wrapper.takeSnapshotAsync`, `web3Wrapper.revertSnapshotAsync`, `web3Wrapper.mineBlockAsync`, `web3Wrapper.increaseTimeAsync`", "pr": 426 }, {