aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/0x.js/CHANGELOG.json156
-rw-r--r--packages/0x.js/CHANGELOG.md12
-rw-r--r--packages/0x.js/package.json36
-rw-r--r--packages/abi-gen-templates/CHANGELOG.json18
-rw-r--r--packages/abi-gen-templates/CHANGELOG.md4
-rw-r--r--packages/abi-gen-templates/README.md6
-rw-r--r--packages/abi-gen-templates/contract.handlebars2
-rw-r--r--packages/abi-gen-templates/package.json2
-rw-r--r--packages/abi-gen-templates/partials/callAsync.handlebars17
-rw-r--r--packages/abi-gen-templates/partials/tx.handlebars13
-rw-r--r--packages/abi-gen-wrappers/CHANGELOG.json31
-rw-r--r--packages/abi-gen-wrappers/CHANGELOG.md8
-rw-r--r--packages/abi-gen-wrappers/package.json20
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/asset_proxy_owner.ts829
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc20_token.ts451
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc721_token.ts581
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/dutch_auction.ts114
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/erc20_proxy.ts272
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts228
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/erc721_proxy.ts272
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/erc721_token.ts384
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts1407
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/forwarder.ts304
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/i_validator.ts29
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/i_wallet.ts26
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/multi_asset_proxy.ts669
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts170
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/weth9.ts354
-rw-r--r--packages/abi-gen-wrappers/src/generated-wrappers/zrx_token.ts282
-rw-r--r--packages/abi-gen-wrappers/src/index.ts1
-rw-r--r--packages/abi-gen/CHANGELOG.json36
-rw-r--r--packages/abi-gen/CHANGELOG.md8
-rw-r--r--packages/abi-gen/package.json10
-rw-r--r--packages/abi-gen/src/index.ts4
-rw-r--r--packages/assert/CHANGELOG.json33
-rw-r--r--packages/assert/CHANGELOG.md8
-rw-r--r--packages/assert/package.json10
-rw-r--r--packages/assert/src/index.ts4
-rw-r--r--packages/asset-buyer/CHANGELOG.json51
-rw-r--r--packages/asset-buyer/CHANGELOG.md12
-rw-r--r--packages/asset-buyer/package.json29
-rw-r--r--packages/asset-buyer/src/asset_buyer.ts47
-rw-r--r--packages/asset-buyer/src/index.ts3
-rw-r--r--packages/asset-buyer/src/types.ts19
-rw-r--r--packages/asset-buyer/src/utils/buy_quote_calculator.ts12
-rw-r--r--packages/asset-buyer/src/utils/calculate_liquidity.ts34
-rw-r--r--packages/asset-buyer/src/utils/order_provider_response_processor.ts9
-rw-r--r--packages/asset-buyer/src/utils/order_utils.ts28
-rw-r--r--packages/asset-buyer/test/asset_buyer_test.ts212
-rw-r--r--packages/asset-buyer/test/buy_quote_calculator_test.ts10
-rw-r--r--packages/asset-buyer/test/utils/mocks.ts68
-rw-r--r--packages/asset-buyer/test/utils/test_helpers.ts2
-rw-r--r--packages/base-contract/CHANGELOG.json30
-rw-r--r--packages/base-contract/CHANGELOG.md8
-rw-r--r--packages/base-contract/package.json12
-rw-r--r--packages/base-contract/src/index.ts57
-rw-r--r--packages/connect/CHANGELOG.json30
-rw-r--r--packages/connect/CHANGELOG.md8
-rw-r--r--packages/connect/README.md4
-rw-r--r--packages/connect/package.json16
-rw-r--r--packages/contract-addresses/CHANGELOG.json10
-rw-r--r--packages/contract-addresses/CHANGELOG.md4
-rw-r--r--packages/contract-addresses/package.json2
-rw-r--r--packages/contract-addresses/src/index.ts10
-rw-r--r--packages/contract-artifacts/CHANGELOG.json10
-rw-r--r--packages/contract-artifacts/CHANGELOG.md4
-rw-r--r--packages/contract-artifacts/artifacts/MultiAssetProxy.json263
-rw-r--r--packages/contract-artifacts/package.json2
-rw-r--r--packages/contract-artifacts/src/index.ts4
-rw-r--r--packages/contract-artifacts/tsconfig.json1
-rw-r--r--packages/contract-wrappers/CHANGELOG.json89
-rw-r--r--packages/contract-wrappers/CHANGELOG.md13
-rw-r--r--packages/contract-wrappers/package.json38
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts6
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts4
-rw-r--r--packages/contract-wrappers/src/fetchers/asset_balance_and_proxy_allowance_fetcher.ts4
-rw-r--r--packages/contract-wrappers/src/types.ts14
-rw-r--r--packages/contract-wrappers/src/utils/assert.ts2
-rw-r--r--packages/contract-wrappers/src/utils/exchange_transfer_simulator.ts4
-rw-r--r--packages/contract-wrappers/src/utils/utils.ts6
-rw-r--r--packages/contract-wrappers/test/ether_token_wrapper_test.ts6
-rw-r--r--packages/contract-wrappers/test/exchange_wrapper_test.ts10
-rw-r--r--packages/contract-wrappers/test/forwarder_wrapper_test.ts8
-rw-r--r--packages/contract-wrappers/test/order_validator_wrapper_test.ts4
-rw-r--r--packages/contract-wrappers/test/utils/token_utils.ts12
-rw-r--r--packages/dev-tools-pages/.gitignore4
-rw-r--r--packages/dev-tools-pages/README.md8
-rw-r--r--packages/dev-tools-pages/assets/crawl.html33
-rw-r--r--packages/dev-tools-pages/assets/fonts/MaisonNeue-Bold-subset.woff2bin0 -> 11248 bytes
-rw-r--r--packages/dev-tools-pages/assets/fonts/MaisonNeue-Book-subset.woff2bin0 -> 11232 bytes
-rw-r--r--packages/dev-tools-pages/package.json26
-rw-r--r--packages/dev-tools-pages/pages.js24
-rw-r--r--packages/dev-tools-pages/ts/components/animations/index.tsx5
-rw-r--r--packages/dev-tools-pages/ts/components/button.tsx49
-rw-r--r--packages/dev-tools-pages/ts/components/call_to_action.tsx40
-rw-r--r--packages/dev-tools-pages/ts/components/code.tsx15
-rw-r--r--packages/dev-tools-pages/ts/components/compiler.tsx12
-rw-r--r--packages/dev-tools-pages/ts/components/container.tsx5
-rw-r--r--packages/dev-tools-pages/ts/components/content.tsx5
-rw-r--r--packages/dev-tools-pages/ts/components/footer.tsx12
-rw-r--r--packages/dev-tools-pages/ts/components/header.tsx2
-rw-r--r--packages/dev-tools-pages/ts/components/hero.tsx6
-rw-r--r--packages/dev-tools-pages/ts/components/tabs.tsx4
-rw-r--r--packages/dev-tools-pages/ts/components/trace.tsx28
-rw-r--r--packages/dev-tools-pages/ts/context/compiler.tsx1
-rw-r--r--packages/dev-tools-pages/ts/context/coverage.tsx (renamed from packages/dev-tools-pages/ts/context/cov.tsx)5
-rw-r--r--packages/dev-tools-pages/ts/context/index.tsx1
-rw-r--r--packages/dev-tools-pages/ts/context/profiler.tsx1
-rw-r--r--packages/dev-tools-pages/ts/context/trace.tsx1
-rw-r--r--packages/dev-tools-pages/ts/globalStyles.tsx5
-rw-r--r--packages/dev-tools-pages/ts/pages/compiler.tsx30
-rw-r--r--packages/dev-tools-pages/ts/pages/coverage.tsx (renamed from packages/dev-tools-pages/ts/pages/cov.tsx)76
-rw-r--r--packages/dev-tools-pages/ts/pages/profiler.tsx62
-rw-r--r--packages/dev-tools-pages/ts/pages/trace.tsx59
-rw-r--r--packages/dev-tools-pages/webpack.config.js3
-rw-r--r--packages/dev-utils/CHANGELOG.json27
-rw-r--r--packages/dev-utils/CHANGELOG.md8
-rw-r--r--packages/dev-utils/package.json16
-rw-r--r--packages/devnet/docker-compose.yml8
-rw-r--r--packages/devnet/genesis.json3
-rwxr-xr-xpackages/devnet/run.sh1
-rw-r--r--packages/ethereum-types/CHANGELOG.json27
-rw-r--r--packages/ethereum-types/CHANGELOG.md8
-rw-r--r--packages/ethereum-types/package.json6
-rw-r--r--packages/ethereum-types/src/index.ts2
-rw-r--r--packages/fill-scenarios/CHANGELOG.json30
-rw-r--r--packages/fill-scenarios/CHANGELOG.md8
-rw-r--r--packages/fill-scenarios/package.json22
-rw-r--r--packages/instant/CHANGELOG.json18
-rw-r--r--packages/instant/README.md15
-rw-r--r--packages/instant/package.json24
-rw-r--r--packages/instant/src/components/animations/full_rotation.tsx5
-rw-r--r--packages/instant/src/components/animations/position_animation.tsx5
-rw-r--r--packages/instant/src/components/css_reset.tsx6
-rw-r--r--packages/instant/src/components/order_details.tsx4
-rw-r--r--packages/instant/src/components/timed_progress_bar.tsx5
-rw-r--r--packages/instant/src/components/ui/circle.tsx19
-rw-r--r--packages/instant/src/components/ui/container.tsx5
-rw-r--r--packages/instant/src/components/ui/flex.tsx5
-rw-r--r--packages/instant/src/components/ui/input.tsx10
-rw-r--r--packages/instant/src/components/ui/overlay.tsx5
-rw-r--r--packages/instant/src/components/ui/text.tsx5
-rw-r--r--packages/instant/src/constants.ts2
-rw-r--r--packages/instant/src/containers/latest_error.tsx5
-rw-r--r--packages/instant/src/containers/selected_erc20_asset_amount_input.ts2
-rw-r--r--packages/instant/src/index.umd.ts42
-rw-r--r--packages/instant/src/redux/actions.ts93
-rw-r--r--packages/instant/src/redux/analytics_middleware.ts16
-rw-r--r--packages/instant/src/redux/async_data.ts2
-rw-r--r--packages/instant/src/redux/reducer.ts46
-rw-r--r--packages/instant/src/style/theme.ts2
-rw-r--r--packages/instant/src/types.ts8
-rw-r--r--packages/instant/src/util/analytics.ts130
-rw-r--r--packages/instant/src/util/asset.ts14
-rw-r--r--packages/instant/src/util/format.ts8
-rw-r--r--packages/instant/src/util/gas_price_estimator.ts2
-rw-r--r--packages/instant/src/util/maybe_big_number.ts2
-rw-r--r--packages/json-schemas/CHANGELOG.json36
-rw-r--r--packages/json-schemas/CHANGELOG.md8
-rw-r--r--packages/json-schemas/package.json8
-rw-r--r--packages/metacoin/README.md12
-rw-r--r--packages/metacoin/package.json34
-rw-r--r--packages/migrations/CHANGELOG.json34
-rw-r--r--packages/migrations/CHANGELOG.md8
-rw-r--r--packages/migrations/package.json30
-rw-r--r--packages/migrations/src/migration.ts123
-rw-r--r--packages/monorepo-scripts/CHANGELOG.json9
-rw-r--r--packages/monorepo-scripts/package.json4
-rw-r--r--packages/monorepo-scripts/src/prepublish_checks.ts8
-rw-r--r--packages/monorepo-scripts/src/publish.ts45
-rw-r--r--packages/monorepo-scripts/src/types.ts6
-rw-r--r--packages/monorepo-scripts/src/utils/configs.ts1
-rw-r--r--packages/monorepo-scripts/src/utils/docker_hub_utils.ts65
-rw-r--r--packages/monorepo-scripts/src/utils/utils.ts2
-rw-r--r--packages/order-utils/CHANGELOG.json75
-rw-r--r--packages/order-utils/CHANGELOG.md8
-rw-r--r--packages/order-utils/package.json28
-rw-r--r--packages/order-utils/src/crypto.ts3
-rw-r--r--packages/order-utils/src/exchange_transfer_simulator.ts4
-rw-r--r--packages/order-utils/src/market_utils.ts4
-rw-r--r--packages/order-utils/src/order_state_utils.ts12
-rw-r--r--packages/order-utils/src/order_validation_utils.ts8
-rw-r--r--packages/order-utils/src/rate_utils.ts6
-rw-r--r--packages/order-utils/src/remaining_fillable_calculator.ts6
-rw-r--r--packages/order-utils/src/salt.ts2
-rw-r--r--packages/order-utils/src/utils.ts6
-rw-r--r--packages/order-utils/test/remaining_fillable_calculator_test.ts2
-rw-r--r--packages/order-utils/test/signature_utils_test.ts4
-rw-r--r--packages/order-watcher/CHANGELOG.json60
-rw-r--r--packages/order-watcher/CHANGELOG.md12
-rw-r--r--packages/order-watcher/README.md20
-rw-r--r--packages/order-watcher/package.json45
-rw-r--r--packages/order-watcher/src/order_watcher/expiration_watcher.ts2
-rw-r--r--packages/order-watcher/src/utils/utils.ts2
-rw-r--r--packages/order-watcher/test/order_watcher_test.ts6
-rw-r--r--packages/pipeline/README.md15
-rw-r--r--packages/pipeline/package.json26
-rw-r--r--packages/pipeline/src/parsers/copper/index.ts6
-rw-r--r--packages/pipeline/src/scripts/pull_competing_dex_trades.ts13
-rw-r--r--packages/pipeline/src/scripts/pull_copper.ts19
-rw-r--r--packages/pipeline/src/scripts/pull_exchange_events.ts32
-rw-r--r--packages/pipeline/src/scripts/pull_missing_blocks.ts17
-rw-r--r--packages/pipeline/src/scripts/pull_ohlcv_cryptocompare.ts13
-rw-r--r--packages/pipeline/src/scripts/pull_radar_relay_orders.ts40
-rw-r--r--packages/pipeline/src/scripts/pull_trusted_tokens.ts20
-rw-r--r--packages/pipeline/src/scripts/update_relayer_info.ts9
-rw-r--r--packages/pipeline/src/utils/transformers/number_to_bigint.ts2
-rw-r--r--packages/pipeline/test/fixtures/copper/api_v1_list_leads.json18
-rw-r--r--packages/react-docs/CHANGELOG.json39
-rw-r--r--packages/react-docs/CHANGELOG.md8
-rw-r--r--packages/react-docs/README.md24
-rw-r--r--packages/react-docs/package.json18
-rw-r--r--packages/react-docs/src/components/doc_reference.tsx24
-rw-r--r--packages/react-docs/src/components/interface.tsx3
-rw-r--r--packages/react-docs/src/components/signature_block.tsx18
-rw-r--r--packages/react-docs/src/components/type.tsx9
-rw-r--r--packages/react-shared/CHANGELOG.json30
-rw-r--r--packages/react-shared/CHANGELOG.md8
-rw-r--r--packages/react-shared/package.json16
-rw-r--r--packages/react-shared/src/components/anchor_title.tsx21
-rw-r--r--packages/sol-compiler/CHANGELOG.json39
-rw-r--r--packages/sol-compiler/CHANGELOG.md8
-rw-r--r--packages/sol-compiler/README.md10
-rw-r--r--packages/sol-compiler/package.json24
-rw-r--r--packages/sol-compiler/src/cli.ts4
-rw-r--r--packages/sol-coverage/CHANGELOG.json36
-rw-r--r--packages/sol-coverage/CHANGELOG.md22
-rw-r--r--packages/sol-coverage/package.json12
-rw-r--r--packages/sol-coverage/src/coverage_subprovider.ts10
-rw-r--r--packages/sol-coverage/src/index.ts2
-rw-r--r--packages/sol-doc/CHANGELOG.json30
-rw-r--r--packages/sol-doc/CHANGELOG.md8
-rw-r--r--packages/sol-doc/package.json14
-rw-r--r--packages/sol-profiler/CHANGELOG.json45
-rw-r--r--packages/sol-profiler/CHANGELOG.md22
-rw-r--r--packages/sol-profiler/package.json12
-rw-r--r--packages/sol-profiler/src/index.ts2
-rw-r--r--packages/sol-profiler/src/profiler_subprovider.ts6
-rw-r--r--packages/sol-resolver/CHANGELOG.json27
-rw-r--r--packages/sol-resolver/CHANGELOG.md8
-rw-r--r--packages/sol-resolver/package.json8
-rw-r--r--packages/sol-trace/CHANGELOG.json36
-rw-r--r--packages/sol-trace/CHANGELOG.md22
-rw-r--r--packages/sol-trace/package.json12
-rw-r--r--packages/sol-trace/src/index.ts2
-rw-r--r--packages/sol-trace/src/revert_trace_subprovider.ts20
-rw-r--r--packages/sol-tracing-utils/CHANGELOG.json95
-rw-r--r--packages/sol-tracing-utils/CHANGELOG.md18
-rw-r--r--packages/sol-tracing-utils/package.json19
-rw-r--r--packages/sol-tracing-utils/src/artifact_adapters/sol_compiler_artifact_adapter.ts24
-rw-r--r--packages/sol-tracing-utils/src/ast_visitor.ts45
-rw-r--r--packages/sol-tracing-utils/src/collect_coverage_entries.ts26
-rw-r--r--packages/sol-tracing-utils/src/get_source_range_snippet.ts175
-rw-r--r--packages/sol-tracing-utils/src/index.ts4
-rw-r--r--packages/sol-tracing-utils/src/source_maps.ts35
-rw-r--r--packages/sol-tracing-utils/src/trace.ts22
-rw-r--r--packages/sol-tracing-utils/src/trace_collection_subprovider.ts26
-rw-r--r--packages/sol-tracing-utils/src/trace_collector.ts8
-rw-r--r--packages/sol-tracing-utils/src/trace_info_subprovider.ts55
-rw-r--r--packages/sol-tracing-utils/src/types.ts17
-rw-r--r--packages/sol-tracing-utils/src/utils.ts56
-rw-r--r--packages/sol-tracing-utils/test/collect_coverage_entries_test.ts3
-rw-r--r--packages/sol-tracing-utils/test/source_maps_test.ts6
-rw-r--r--packages/sol-tracing-utils/test/trace_test.ts4
-rw-r--r--packages/sra-spec/CHANGELOG.json30
-rw-r--r--packages/sra-spec/CHANGELOG.md8
-rw-r--r--packages/sra-spec/package.json6
-rw-r--r--packages/sra-spec/src/md/introduction.md8
-rw-r--r--packages/subproviders/CHANGELOG.json46
-rw-r--r--packages/subproviders/CHANGELOG.md8
-rw-r--r--packages/subproviders/README.md12
-rw-r--r--packages/subproviders/package.json20
-rw-r--r--packages/testnet-faucets/package.json16
-rw-r--r--packages/testnet-faucets/src/ts/dispense_asset_tasks.ts4
-rw-r--r--packages/testnet-faucets/src/ts/handler.ts12
-rw-r--r--packages/tslint-config/CHANGELOG.json36
-rw-r--r--packages/tslint-config/CHANGELOG.md8
-rw-r--r--packages/tslint-config/package.json3
-rw-r--r--packages/tslint-config/rules/enumNamingRule.ts60
-rw-r--r--packages/tslint-config/test/enumNamingSpec.spec.ts88
-rw-r--r--packages/tslint-config/test/lintrunner.ts23
-rw-r--r--packages/tslint-config/tsconfig.json4
-rw-r--r--packages/tslint-config/tslint.json3
-rw-r--r--packages/types/CHANGELOG.json33
-rw-r--r--packages/types/CHANGELOG.md8
-rw-r--r--packages/types/package.json8
-rw-r--r--packages/typescript-typings/CHANGELOG.json30
-rw-r--r--packages/typescript-typings/CHANGELOG.md8
-rw-r--r--packages/typescript-typings/package.json6
-rw-r--r--packages/typescript-typings/types/chai-as-promised/index.d.ts4
-rw-r--r--packages/utils/CHANGELOG.json33
-rw-r--r--packages/utils/CHANGELOG.md8
-rw-r--r--packages/utils/package.json14
-rw-r--r--packages/utils/src/abi_decoder.ts2
-rw-r--r--packages/utils/src/abi_encoder/abstract_data_types/data_type.ts20
-rw-r--r--packages/utils/src/abi_encoder/abstract_data_types/types/set.ts34
-rw-r--r--packages/utils/src/abi_encoder/evm_data_type_factory.ts33
-rw-r--r--packages/utils/src/abi_encoder/evm_data_types/address.ts9
-rw-r--r--packages/utils/src/abi_encoder/evm_data_types/array.ts24
-rw-r--r--packages/utils/src/abi_encoder/evm_data_types/bool.ts6
-rw-r--r--packages/utils/src/abi_encoder/evm_data_types/dynamic_bytes.ts2
-rw-r--r--packages/utils/src/abi_encoder/evm_data_types/int.ts14
-rw-r--r--packages/utils/src/abi_encoder/evm_data_types/method.ts15
-rw-r--r--packages/utils/src/abi_encoder/evm_data_types/pointer.ts8
-rw-r--r--packages/utils/src/abi_encoder/evm_data_types/static_bytes.ts2
-rw-r--r--packages/utils/src/abi_encoder/evm_data_types/string.ts2
-rw-r--r--packages/utils/src/abi_encoder/evm_data_types/tuple.ts20
-rw-r--r--packages/utils/src/abi_encoder/evm_data_types/uint.ts10
-rw-r--r--packages/utils/src/abi_encoder/index.ts2
-rw-r--r--packages/utils/src/abi_encoder/utils/constants.ts2
-rw-r--r--packages/utils/src/abi_encoder/utils/math.ts12
-rw-r--r--packages/utils/src/abi_encoder/utils/signature_parser.ts101
-rw-r--r--packages/utils/src/sign_typed_data_utils.ts5
-rw-r--r--packages/utils/test/abi_encoder/evm_data_types_test.ts195
-rw-r--r--packages/utils/test/abi_encoder/methods_test.ts69
-rw-r--r--packages/utils/test/abi_encoder/optimizer_test.ts43
-rw-r--r--packages/utils/test/abi_encoder/return_values_test.ts22
-rw-r--r--packages/utils/test/abi_encoder/signature_tests.ts (renamed from packages/dev-tools-pages/assets/fonts/.gitkeep)0
-rw-r--r--packages/web3-wrapper/CHANGELOG.json58
-rw-r--r--packages/web3-wrapper/CHANGELOG.md8
-rw-r--r--packages/web3-wrapper/package.json20
-rw-r--r--packages/web3-wrapper/src/utils.ts8
-rw-r--r--packages/web3-wrapper/test/web3_wrapper_test.ts8
-rw-r--r--packages/website/README.md10
-rw-r--r--packages/website/contracts/Mintable.json3
-rw-r--r--packages/website/md/docs/json_schemas/1/schemas.md40
-rw-r--r--packages/website/md/docs/json_schemas/2/schemas.md58
-rw-r--r--packages/website/md/docs/json_schemas/3/schemas.md60
-rw-r--r--packages/website/md/docs/smart_contracts/2/introduction.md4
-rw-r--r--packages/website/md/docs/sol-compiler/1/introduction.md12
-rw-r--r--packages/website/md/docs/sol_coverage/installation.md2
-rw-r--r--packages/website/md/docs/sol_coverage/introduction.md2
-rw-r--r--packages/website/md/docs/sol_coverage/usage.md34
-rw-r--r--packages/website/md/docs/sol_profiler/installation.md2
-rw-r--r--packages/website/md/docs/sol_profiler/usage.md38
-rw-r--r--packages/website/md/docs/sol_trace/installation.md6
-rw-r--r--packages/website/md/docs/sol_trace/introduction.md2
-rw-r--r--packages/website/md/docs/sol_trace/usage.md44
-rw-r--r--packages/website/package.json34
-rw-r--r--packages/website/public/css/basscss.min.css1
-rw-r--r--packages/website/public/images/team/marcs.jpgbin0 -> 40348 bytes
-rw-r--r--packages/website/public/images/team/oshirob.pngbin0 -> 522249 bytes
-rw-r--r--packages/website/public/index.html1
-rw-r--r--packages/website/translations/chinese.json39
-rw-r--r--packages/website/translations/english.json51
-rw-r--r--packages/website/translations/korean.json39
-rw-r--r--packages/website/translations/russian.json39
-rw-r--r--packages/website/translations/spanish.json42
-rw-r--r--packages/website/ts/blockchain.ts2
-rw-r--r--packages/website/ts/components/aboutPageLayout.tsx23
-rw-r--r--packages/website/ts/components/animatedChatIcon.tsx5
-rw-r--r--packages/website/ts/components/banner.tsx5
-rw-r--r--packages/website/ts/components/button.tsx5
-rw-r--r--packages/website/ts/components/definition.tsx10
-rw-r--r--packages/website/ts/components/dialogs/blockchain_err_dialog.tsx8
-rw-r--r--packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx27
-rw-r--r--packages/website/ts/components/dialogs/ledger_config_dialog.tsx18
-rw-r--r--packages/website/ts/components/fill_order.tsx29
-rw-r--r--packages/website/ts/components/fill_warning_dialog.tsx3
-rw-r--r--packages/website/ts/components/generate_order/asset_picker.tsx42
-rw-r--r--packages/website/ts/components/generate_order/generate_order_form.tsx20
-rw-r--r--packages/website/ts/components/generate_order/new_token_form.tsx2
-rw-r--r--packages/website/ts/components/hamburger.tsx10
-rw-r--r--packages/website/ts/components/header.tsx49
-rw-r--r--packages/website/ts/components/hero.tsx15
-rw-r--r--packages/website/ts/components/icon.tsx10
-rw-r--r--packages/website/ts/components/image.tsx5
-rw-r--r--packages/website/ts/components/inputs/allowance_state_toggle.tsx2
-rw-r--r--packages/website/ts/components/link.tsx5
-rw-r--r--packages/website/ts/components/logo.tsx5
-rw-r--r--packages/website/ts/components/mobileNav.tsx15
-rw-r--r--packages/website/ts/components/modals/input.tsx5
-rw-r--r--packages/website/ts/components/modals/modal_contact.tsx16
-rw-r--r--packages/website/ts/components/nested_sidebar_menu.tsx4
-rw-r--r--packages/website/ts/components/newLayout.tsx30
-rw-r--r--packages/website/ts/components/newsletter_form.tsx26
-rw-r--r--packages/website/ts/components/portal/portal.tsx7
-rw-r--r--packages/website/ts/components/sections/landing/clients.tsx7
-rw-r--r--packages/website/ts/components/siteWrap.tsx5
-rw-r--r--packages/website/ts/components/text.tsx10
-rw-r--r--packages/website/ts/components/token_balances.tsx33
-rw-r--r--packages/website/ts/components/ui/alert.tsx2
-rw-r--r--packages/website/ts/components/ui/lifecycle_raised_button.tsx24
-rw-r--r--packages/website/ts/components/ui/party.tsx50
-rw-r--r--packages/website/ts/constants/globalStyle.tsx4
-rw-r--r--packages/website/ts/containers/asset_buyer_documentation.ts7
-rw-r--r--packages/website/ts/containers/connect_documentation.ts7
-rw-r--r--packages/website/ts/containers/contract_wrappers_documentation.ts7
-rw-r--r--packages/website/ts/containers/docs_home.ts7
-rw-r--r--packages/website/ts/containers/ethereum_types_documentation.ts7
-rw-r--r--packages/website/ts/containers/faq.ts5
-rw-r--r--packages/website/ts/containers/json_schemas_documentation.ts7
-rw-r--r--packages/website/ts/containers/migrations_documentation.ts7
-rw-r--r--packages/website/ts/containers/not_found.ts7
-rw-r--r--packages/website/ts/containers/order_utils_documentation.ts7
-rw-r--r--packages/website/ts/containers/order_watcher_documentation.ts7
-rw-r--r--packages/website/ts/containers/portal.ts7
-rw-r--r--packages/website/ts/containers/smart_contracts_documentation.ts7
-rw-r--r--packages/website/ts/containers/sol_compiler_documentation.ts7
-rw-r--r--packages/website/ts/containers/sol_coverage_documentation.ts7
-rw-r--r--packages/website/ts/containers/sol_profiler_documentation.ts7
-rw-r--r--packages/website/ts/containers/sol_trace_documentation.ts7
-rw-r--r--packages/website/ts/containers/subproviders_documentation.ts7
-rw-r--r--packages/website/ts/containers/web3_wrapper_documentation.ts7
-rw-r--r--packages/website/ts/containers/wiki.ts5
-rw-r--r--packages/website/ts/containers/zero_ex_js_documentation.ts7
-rw-r--r--packages/website/ts/index.tsx1
-rw-r--r--packages/website/ts/pages/about/jobs.tsx4
-rw-r--r--packages/website/ts/pages/about/team.tsx14
-rw-r--r--packages/website/ts/pages/documentation/developers_page.tsx10
-rw-r--r--packages/website/ts/pages/documentation/docs_home.tsx77
-rw-r--r--packages/website/ts/pages/faq/faq.tsx20
-rw-r--r--packages/website/ts/pages/instant.tsx50
-rw-r--r--packages/website/ts/pages/instant/config_generator.tsx7
-rw-r--r--packages/website/ts/pages/why.tsx11
-rw-r--r--packages/website/ts/types.ts41
-rw-r--r--packages/website/ts/utils/utils.ts12
417 files changed, 7306 insertions, 6996 deletions
diff --git a/packages/0x.js/CHANGELOG.json b/packages/0x.js/CHANGELOG.json
index 2f7320fea..20778f8bb 100644
--- a/packages/0x.js/CHANGELOG.json
+++ b/packages/0x.js/CHANGELOG.json
@@ -1,10 +1,45 @@
[
{
+ "version": "4.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547747677,
+ "version": "3.0.3",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "3.0.2",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "3.0.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"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
}
],
@@ -90,18 +125,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
},
{
@@ -200,8 +232,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"
}
]
},
@@ -209,8 +240,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
}
],
@@ -282,18 +312,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
},
{
@@ -368,8 +395,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
}
],
@@ -454,8 +480,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
}
],
@@ -465,8 +490,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
}
],
@@ -476,8 +500,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
},
{
@@ -489,8 +512,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
}
],
@@ -577,8 +599,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
}
],
@@ -598,8 +619,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
}
],
@@ -644,8 +664,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
}
],
@@ -679,13 +698,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
},
{
@@ -697,8 +714,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
},
{
@@ -706,8 +722,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
},
{
@@ -742,8 +757,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
},
{
@@ -751,8 +765,7 @@
"pr": 233
},
{
- "note":
- "Make `DecodedLogEvent<A>` contain `LogWithDecodedArgs<A>` under log key instead of merging it in like web3 does",
+ "note": "Make `DecodedLogEvent<A>` contain `LogWithDecodedArgs<A>` under log key instead of merging it in like web3 does",
"pr": 234
},
{
@@ -768,8 +781,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
}
],
@@ -779,8 +791,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
},
{
@@ -788,8 +799,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
}
],
@@ -807,8 +817,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
}
],
@@ -879,8 +888,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
},
{
@@ -894,8 +902,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
}
],
@@ -942,8 +949,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)"
@@ -952,8 +958,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`"
@@ -1060,8 +1065,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
}
],
@@ -1109,8 +1113,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
},
{
@@ -1118,8 +1121,7 @@
"pr": 151
},
{
- "note":
- "Added `TransactionReceiptWithDecodedLogs`, `LogWithDecodedArgs`, `DecodedLogArgs` to public types",
+ "note": "Added `TransactionReceiptWithDecodedLogs`, `LogWithDecodedArgs`, `DecodedLogArgs` to public types",
"pr": 151
},
{
@@ -1292,8 +1294,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
}
],
@@ -1303,13 +1304,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`",
@@ -1345,8 +1344,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
}
],
@@ -1368,8 +1366,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
@@ -1411,8 +1408,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/0x.js/CHANGELOG.md b/packages/0x.js/CHANGELOG.md
index 258dee66a..b0279f097 100644
--- a/packages/0x.js/CHANGELOG.md
+++ b/packages/0x.js/CHANGELOG.md
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v3.0.3 - _January 17, 2019_
+
+ * Dependencies updated
+
+## v3.0.2 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v3.0.1 - _January 11, 2019_
+
+ * Dependencies updated
+
## v3.0.0 - _January 9, 2019_
* Export `MultiAssetData`, `MultiAssetDataWithRecursiveDecoding`, `ObjectMap`, and `SingleAssetData` from types. No longer export `AssetData`. (#1363)
diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json
index 74522c784..64054d288 100644
--- a/packages/0x.js/package.json
+++ b/packages/0x.js/package.json
@@ -1,6 +1,6 @@
{
"name": "0x.js",
- "version": "3.0.0",
+ "version": "3.0.3",
"engines": {
"node": ">=6.12"
},
@@ -42,11 +42,11 @@
},
"license": "Apache-2.0",
"devDependencies": {
- "@0x/abi-gen-wrappers": "^2.1.0",
- "@0x/contract-addresses": "^2.1.0",
- "@0x/dev-utils": "^1.0.22",
- "@0x/migrations": "^2.3.0",
- "@0x/tslint-config": "^2.0.0",
+ "@0x/abi-gen-wrappers": "^2.2.0",
+ "@0x/contract-addresses": "^2.2.0",
+ "@0x/dev-utils": "^1.0.24",
+ "@0x/migrations": "^2.4.0",
+ "@0x/tslint-config": "^2.0.2",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"@types/node": "*",
@@ -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": "^3.0.0",
"copyfiles": "^2.0.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
@@ -72,18 +72,18 @@
"webpack": "^4.20.2"
},
"dependencies": {
- "@0x/assert": "^1.0.21",
- "@0x/base-contract": "^3.0.11",
- "@0x/contract-wrappers": "^4.2.0",
- "@0x/order-utils": "^3.1.0",
- "@0x/order-watcher": "^2.4.0",
- "@0x/subproviders": "^2.1.9",
- "@0x/types": "^1.5.0",
- "@0x/typescript-typings": "^3.0.6",
- "@0x/utils": "^2.1.1",
- "@0x/web3-wrapper": "^3.2.2",
+ "@0x/assert": "^1.0.23",
+ "@0x/base-contract": "^3.0.13",
+ "@0x/contract-wrappers": "^5.0.1",
+ "@0x/order-utils": "^3.1.2",
+ "@0x/order-watcher": "^2.4.3",
+ "@0x/subproviders": "^2.1.11",
+ "@0x/types": "^1.5.2",
+ "@0x/typescript-typings": "^3.0.8",
+ "@0x/utils": "^3.0.1",
+ "@0x/web3-wrapper": "^3.2.4",
"@types/web3-provider-engine": "^14.0.0",
- "ethereum-types": "^1.1.4",
+ "ethereum-types": "^1.1.6",
"ethers": "~4.0.4",
"lodash": "^4.17.5",
"web3-provider-engine": "14.0.6"
diff --git a/packages/abi-gen-templates/CHANGELOG.json b/packages/abi-gen-templates/CHANGELOG.json
index baf852ad5..7d444d0ca 100644
--- a/packages/abi-gen-templates/CHANGELOG.json
+++ b/packages/abi-gen-templates/CHANGELOG.json
@@ -1,5 +1,23 @@
[
{
+ "version": "2.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "1.0.2",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"timestamp": 1543401373,
"version": "1.0.1",
"changes": [
diff --git a/packages/abi-gen-templates/CHANGELOG.md b/packages/abi-gen-templates/CHANGELOG.md
index 1c3f21c6c..5dd6d03e0 100644
--- a/packages/abi-gen-templates/CHANGELOG.md
+++ b/packages/abi-gen-templates/CHANGELOG.md
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v1.0.2 - _January 15, 2019_
+
+ * Dependencies updated
+
## v1.0.1 - _November 28, 2018_
* Dependencies updated
diff --git a/packages/abi-gen-templates/README.md b/packages/abi-gen-templates/README.md
index c6cc3b1b3..06c2e19cd 100644
--- a/packages/abi-gen-templates/README.md
+++ b/packages/abi-gen-templates/README.md
@@ -2,9 +2,9 @@ These templates are used with [abi-gen](https://github.com/0xProject/0x-monorepo
To successfully compile the generated TypeScript contract wrappers, you must:
-* Install the packages on which the main contract template directly depends: `yarn add @0x/base-contract @0x/sol-compiler @0x/utils @0x/web3-wrapper ethereum-types ethers lodash`
-* Install the packages on which the main contract template *in*directly depends: `yarn add @types/lodash`
-* Ensure that your TypeScript configuration includes the following:
+- Install the packages on which the main contract template directly depends: `yarn add @0x/base-contract @0x/sol-compiler @0x/utils @0x/web3-wrapper ethereum-types ethers lodash`
+- Install the packages on which the main contract template *in*directly depends: `yarn add @types/lodash`
+- Ensure that your TypeScript configuration includes the following:
```
"compilerOptions": {
diff --git a/packages/abi-gen-templates/contract.handlebars b/packages/abi-gen-templates/contract.handlebars
index 9b2a2b336..7e7171c70 100644
--- a/packages/abi-gen-templates/contract.handlebars
+++ b/packages/abi-gen-templates/contract.handlebars
@@ -85,7 +85,7 @@ export class {{contractName}}Contract extends BaseContract {
}
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
super('{{contractName}}', abi, address, provider, txDefaults);
- classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
+ classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count
// tslint:enable:no-unbound-method
diff --git a/packages/abi-gen-templates/package.json b/packages/abi-gen-templates/package.json
index 09872ab49..af66aeba0 100644
--- a/packages/abi-gen-templates/package.json
+++ b/packages/abi-gen-templates/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/abi-gen-templates",
- "version": "1.0.1",
+ "version": "1.0.2",
"engines": {
"node": ">=6.12"
},
diff --git a/packages/abi-gen-templates/partials/callAsync.handlebars b/packages/abi-gen-templates/partials/callAsync.handlebars
index ddbbe7508..ab9f2c21c 100644
--- a/packages/abi-gen-templates/partials/callAsync.handlebars
+++ b/packages/abi-gen-templates/partials/callAsync.handlebars
@@ -4,12 +4,7 @@ async callAsync(
defaultBlock?: BlockParam,
): Promise<{{> return_type outputs=outputs}}> {
const self = this as any as {{contractName}}Contract;
- const functionSignature = '{{this.functionSignature}}';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [{{> params inputs=inputs}}]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.{{this.name}};
- const encodedData = ethersFunction.encode([{{> params inputs=inputs}}]);
+ const encodedData = self._strictEncodeArguments('{{this.functionSignature}}', [{{> params inputs=inputs}}]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -20,9 +15,9 @@ async callAsync(
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: '{{this.name}}'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray{{#singleReturnValue}}[0]{{/singleReturnValue}};
+ const abiEncoder = self._lookupAbiEncoder('{{this.functionSignature}}');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<{{> return_type outputs=outputs}}>(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
diff --git a/packages/abi-gen-templates/partials/tx.handlebars b/packages/abi-gen-templates/partials/tx.handlebars
index b39156583..0f1027fae 100644
--- a/packages/abi-gen-templates/partials/tx.handlebars
+++ b/packages/abi-gen-templates/partials/tx.handlebars
@@ -9,10 +9,7 @@ public {{this.tsName}} = {
{{/this.payable}}
): Promise<string> {
const self = this as any as {{contractName}}Contract;
- const inputAbi = self._lookupAbi('{{this.functionSignature}}').inputs;
- [{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [{{> params inputs=inputs}}]);
- const encodedData = self._lookupEthersInterface('{{this.functionSignature}}').functions.{{this.name}}.encode([{{> params inputs=inputs}}]);
+ const encodedData = self._strictEncodeArguments('{{this.functionSignature}}', [{{> params inputs=inputs}}]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -33,9 +30,7 @@ public {{this.tsName}} = {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as {{contractName}}Contract;
- const inputAbi = self._lookupAbi('{{this.functionSignature}}').inputs;
- [{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('{{this.functionSignature}}').functions.{{this.name}}.encode([{{> params inputs=inputs}}]);
+ const encodedData = self._strictEncodeArguments('{{this.functionSignature}}', [{{> params inputs=inputs}}]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -51,9 +46,7 @@ public {{this.tsName}} = {
{{> typed_params inputs=inputs}}
): string {
const self = this as any as {{contractName}}Contract;
- const inputAbi = self._lookupAbi('{{this.functionSignature}}').inputs;
- [{{> params inputs=inputs}}] = BaseContract._formatABIDataItemList(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('{{this.functionSignature}}').functions.{{this.name}}.encode([{{> params inputs=inputs}}]);
+ const abiEncodedTransactionData = self._strictEncodeArguments('{{this.functionSignature}}', [{{> params inputs=inputs}}]);
return abiEncodedTransactionData;
},
{{> callAsync}}
diff --git a/packages/abi-gen-wrappers/CHANGELOG.json b/packages/abi-gen-wrappers/CHANGELOG.json
index 404ba0f1b..c604302b5 100644
--- a/packages/abi-gen-wrappers/CHANGELOG.json
+++ b/packages/abi-gen-wrappers/CHANGELOG.json
@@ -1,5 +1,33 @@
[
{
+ "version": "3.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "version": "2.2.0",
+ "changes": [
+ {
+ "note": "Added `MultiAssetProxy`",
+ "pr": 1503
+ }
+ ],
+ "timestamp": 1547561734
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "2.1.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "2.1.0",
"changes": [
{
@@ -41,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-wrappers/CHANGELOG.md b/packages/abi-gen-wrappers/CHANGELOG.md
index 4090e045a..294f39439 100644
--- a/packages/abi-gen-wrappers/CHANGELOG.md
+++ b/packages/abi-gen-wrappers/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v2.2.0 - _January 15, 2019_
+
+ * Added `MultiAssetProxy` (#1503)
+
+## v2.1.1 - _January 11, 2019_
+
+ * Dependencies updated
+
## v2.1.0 - _January 9, 2019_
* Added Dutch Auction Wrapper (#1465)
diff --git a/packages/abi-gen-wrappers/package.json b/packages/abi-gen-wrappers/package.json
index f7d40d591..842ac024a 100644
--- a/packages/abi-gen-wrappers/package.json
+++ b/packages/abi-gen-wrappers/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/abi-gen-wrappers",
- "version": "2.1.0",
+ "version": "2.2.0",
"engines": {
"node": ">=6.12"
},
@@ -18,7 +18,7 @@
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output src/generated-wrappers --backend ethers"
},
"config": {
- "abis": "../contract-artifacts/artifacts/@(AssetProxyOwner|DutchAuction|DummyERC20Token|DummyERC721Token|ERC20Proxy|ERC20Token|ERC721Proxy|ERC721Token|Exchange|Forwarder|IValidator|IWallet|OrderValidator|WETH9|ZRXToken).json"
+ "abis": "../contract-artifacts/artifacts/@(AssetProxyOwner|DutchAuction|DummyERC20Token|DummyERC721Token|ERC20Proxy|ERC20Token|ERC721Proxy|ERC721Token|Exchange|Forwarder|IValidator|IWallet|MultiAssetProxy|OrderValidator|WETH9|ZRXToken).json"
},
"repository": {
"type": "git",
@@ -30,19 +30,19 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen-wrappers/README.md",
"devDependencies": {
- "@0x/abi-gen": "^1.0.20",
- "@0x/abi-gen-templates": "^1.0.1",
- "@0x/tslint-config": "^2.0.0",
- "@0x/types": "^1.5.0",
- "@0x/utils": "^2.1.1",
- "@0x/web3-wrapper": "^3.2.2",
- "ethereum-types": "^1.1.4",
+ "@0x/abi-gen": "^1.0.22",
+ "@0x/abi-gen-templates": "^1.0.2",
+ "@0x/tslint-config": "^2.0.2",
+ "@0x/types": "^1.5.2",
+ "@0x/utils": "^3.0.1",
+ "@0x/web3-wrapper": "^3.2.4",
+ "ethereum-types": "^1.1.6",
"ethers": "~4.0.4",
"lodash": "^4.17.5",
"shx": "^0.2.2"
},
"dependencies": {
- "@0x/base-contract": "^3.0.11"
+ "@0x/base-contract": "^3.0.13"
},
"publishConfig": {
"access": "public"
diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/asset_proxy_owner.ts b/packages/abi-gen-wrappers/src/generated-wrappers/asset_proxy_owner.ts
index 27f108ebc..cc42e7fb5 100644
--- a/packages/abi-gen-wrappers/src/generated-wrappers/asset_proxy_owner.ts
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/asset_proxy_owner.ts
@@ -105,15 +105,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<string
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'owners(uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [index_0
- ] = BaseContract._formatABIDataItemList(inputAbi, [index_0
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.owners;
- const encodedData = ethersFunction.encode([index_0
+ const encodedData = self._strictEncodeArguments('owners(uint256)', [index_0
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -125,11 +117,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'owners'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('owners(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public removeOwner = {
@@ -138,13 +131,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('removeOwner(address)').inputs;
- [owner
- ] = BaseContract._formatABIDataItemList(inputAbi, [owner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [owner
- ]);
- const encodedData = self._lookupEthersInterface('removeOwner(address)').functions.removeOwner.encode([owner
+ const encodedData = self._strictEncodeArguments('removeOwner(address)', [owner
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -166,11 +153,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('removeOwner(address)').inputs;
- [owner
- ] = BaseContract._formatABIDataItemList(inputAbi, [owner
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('removeOwner(address)').functions.removeOwner.encode([owner
+ const encodedData = self._strictEncodeArguments('removeOwner(address)', [owner
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -187,11 +170,7 @@ export class AssetProxyOwnerContract extends BaseContract {
owner: string,
): string {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('removeOwner(address)').inputs;
- [owner
- ] = BaseContract._formatABIDataItemList(inputAbi, [owner
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('removeOwner(address)').functions.removeOwner.encode([owner
+ const abiEncodedTransactionData = self._strictEncodeArguments('removeOwner(address)', [owner
]);
return abiEncodedTransactionData;
},
@@ -202,15 +181,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<void
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'removeOwner(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [owner
- ] = BaseContract._formatABIDataItemList(inputAbi, [owner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [owner
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.removeOwner;
- const encodedData = ethersFunction.encode([owner
+ const encodedData = self._strictEncodeArguments('removeOwner(address)', [owner
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -222,11 +193,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'removeOwner'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('removeOwner(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public revokeConfirmation = {
@@ -235,13 +207,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('revokeConfirmation(uint256)').inputs;
- [transactionId
- ] = BaseContract._formatABIDataItemList(inputAbi, [transactionId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [transactionId
- ]);
- const encodedData = self._lookupEthersInterface('revokeConfirmation(uint256)').functions.revokeConfirmation.encode([transactionId
+ const encodedData = self._strictEncodeArguments('revokeConfirmation(uint256)', [transactionId
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -263,11 +229,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('revokeConfirmation(uint256)').inputs;
- [transactionId
- ] = BaseContract._formatABIDataItemList(inputAbi, [transactionId
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('revokeConfirmation(uint256)').functions.revokeConfirmation.encode([transactionId
+ const encodedData = self._strictEncodeArguments('revokeConfirmation(uint256)', [transactionId
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -284,11 +246,7 @@ export class AssetProxyOwnerContract extends BaseContract {
transactionId: BigNumber,
): string {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('revokeConfirmation(uint256)').inputs;
- [transactionId
- ] = BaseContract._formatABIDataItemList(inputAbi, [transactionId
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('revokeConfirmation(uint256)').functions.revokeConfirmation.encode([transactionId
+ const abiEncodedTransactionData = self._strictEncodeArguments('revokeConfirmation(uint256)', [transactionId
]);
return abiEncodedTransactionData;
},
@@ -299,15 +257,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<void
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'revokeConfirmation(uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [transactionId
- ] = BaseContract._formatABIDataItemList(inputAbi, [transactionId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [transactionId
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.revokeConfirmation;
- const encodedData = ethersFunction.encode([transactionId
+ const encodedData = self._strictEncodeArguments('revokeConfirmation(uint256)', [transactionId
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -319,11 +269,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'revokeConfirmation'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('revokeConfirmation(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public isOwner = {
@@ -334,15 +285,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'isOwner(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [index_0
- ] = BaseContract._formatABIDataItemList(inputAbi, [index_0
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.isOwner;
- const encodedData = ethersFunction.encode([index_0
+ const encodedData = self._strictEncodeArguments('isOwner(address)', [index_0
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -354,11 +297,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'isOwner'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('isOwner(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public confirmations = {
@@ -370,18 +314,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'confirmations(uint256,address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [index_0,
- index_1
- ] = BaseContract._formatABIDataItemList(inputAbi, [index_0,
- index_1
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0,
- index_1
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.confirmations;
- const encodedData = ethersFunction.encode([index_0,
+ const encodedData = self._strictEncodeArguments('confirmations(uint256,address)', [index_0,
index_1
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -394,11 +327,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'confirmations'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('confirmations(uint256,address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public executeRemoveAuthorizedAddressAtIndex = {
@@ -407,13 +341,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('executeRemoveAuthorizedAddressAtIndex(uint256)').inputs;
- [transactionId
- ] = BaseContract._formatABIDataItemList(inputAbi, [transactionId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [transactionId
- ]);
- const encodedData = self._lookupEthersInterface('executeRemoveAuthorizedAddressAtIndex(uint256)').functions.executeRemoveAuthorizedAddressAtIndex.encode([transactionId
+ const encodedData = self._strictEncodeArguments('executeRemoveAuthorizedAddressAtIndex(uint256)', [transactionId
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -435,11 +363,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('executeRemoveAuthorizedAddressAtIndex(uint256)').inputs;
- [transactionId
- ] = BaseContract._formatABIDataItemList(inputAbi, [transactionId
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('executeRemoveAuthorizedAddressAtIndex(uint256)').functions.executeRemoveAuthorizedAddressAtIndex.encode([transactionId
+ const encodedData = self._strictEncodeArguments('executeRemoveAuthorizedAddressAtIndex(uint256)', [transactionId
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -456,11 +380,7 @@ export class AssetProxyOwnerContract extends BaseContract {
transactionId: BigNumber,
): string {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('executeRemoveAuthorizedAddressAtIndex(uint256)').inputs;
- [transactionId
- ] = BaseContract._formatABIDataItemList(inputAbi, [transactionId
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('executeRemoveAuthorizedAddressAtIndex(uint256)').functions.executeRemoveAuthorizedAddressAtIndex.encode([transactionId
+ const abiEncodedTransactionData = self._strictEncodeArguments('executeRemoveAuthorizedAddressAtIndex(uint256)', [transactionId
]);
return abiEncodedTransactionData;
},
@@ -471,15 +391,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<void
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'executeRemoveAuthorizedAddressAtIndex(uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [transactionId
- ] = BaseContract._formatABIDataItemList(inputAbi, [transactionId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [transactionId
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.executeRemoveAuthorizedAddressAtIndex;
- const encodedData = ethersFunction.encode([transactionId
+ const encodedData = self._strictEncodeArguments('executeRemoveAuthorizedAddressAtIndex(uint256)', [transactionId
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -491,11 +403,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'executeRemoveAuthorizedAddressAtIndex'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('executeRemoveAuthorizedAddressAtIndex(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public secondsTimeLocked = {
@@ -505,12 +418,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'secondsTimeLocked()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.secondsTimeLocked;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('secondsTimeLocked()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -521,11 +429,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'secondsTimeLocked'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('secondsTimeLocked()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public getTransactionCount = {
@@ -537,18 +446,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'getTransactionCount(bool,bool)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [pending,
- executed
- ] = BaseContract._formatABIDataItemList(inputAbi, [pending,
- executed
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [pending,
- executed
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getTransactionCount;
- const encodedData = ethersFunction.encode([pending,
+ const encodedData = self._strictEncodeArguments('getTransactionCount(bool,bool)', [pending,
executed
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -561,11 +459,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getTransactionCount'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('getTransactionCount(bool,bool)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public registerAssetProxy = {
@@ -575,16 +474,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('registerAssetProxy(address,bool)').inputs;
- [assetProxyContract,
- isRegistered
- ] = BaseContract._formatABIDataItemList(inputAbi, [assetProxyContract,
- isRegistered
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [assetProxyContract,
- isRegistered
- ]);
- const encodedData = self._lookupEthersInterface('registerAssetProxy(address,bool)').functions.registerAssetProxy.encode([assetProxyContract,
+ const encodedData = self._strictEncodeArguments('registerAssetProxy(address,bool)', [assetProxyContract,
isRegistered
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -609,13 +499,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('registerAssetProxy(address,bool)').inputs;
- [assetProxyContract,
- isRegistered
- ] = BaseContract._formatABIDataItemList(inputAbi, [assetProxyContract,
- isRegistered
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('registerAssetProxy(address,bool)').functions.registerAssetProxy.encode([assetProxyContract,
+ const encodedData = self._strictEncodeArguments('registerAssetProxy(address,bool)', [assetProxyContract,
isRegistered
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -634,13 +518,7 @@ export class AssetProxyOwnerContract extends BaseContract {
isRegistered: boolean,
): string {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('registerAssetProxy(address,bool)').inputs;
- [assetProxyContract,
- isRegistered
- ] = BaseContract._formatABIDataItemList(inputAbi, [assetProxyContract,
- isRegistered
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('registerAssetProxy(address,bool)').functions.registerAssetProxy.encode([assetProxyContract,
+ const abiEncodedTransactionData = self._strictEncodeArguments('registerAssetProxy(address,bool)', [assetProxyContract,
isRegistered
]);
return abiEncodedTransactionData;
@@ -653,18 +531,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<void
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'registerAssetProxy(address,bool)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [assetProxyContract,
- isRegistered
- ] = BaseContract._formatABIDataItemList(inputAbi, [assetProxyContract,
- isRegistered
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [assetProxyContract,
- isRegistered
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.registerAssetProxy;
- const encodedData = ethersFunction.encode([assetProxyContract,
+ const encodedData = self._strictEncodeArguments('registerAssetProxy(address,bool)', [assetProxyContract,
isRegistered
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -677,11 +544,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'registerAssetProxy'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('registerAssetProxy(address,bool)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public addOwner = {
@@ -690,13 +558,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('addOwner(address)').inputs;
- [owner
- ] = BaseContract._formatABIDataItemList(inputAbi, [owner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [owner
- ]);
- const encodedData = self._lookupEthersInterface('addOwner(address)').functions.addOwner.encode([owner
+ const encodedData = self._strictEncodeArguments('addOwner(address)', [owner
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -718,11 +580,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('addOwner(address)').inputs;
- [owner
- ] = BaseContract._formatABIDataItemList(inputAbi, [owner
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('addOwner(address)').functions.addOwner.encode([owner
+ const encodedData = self._strictEncodeArguments('addOwner(address)', [owner
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -739,11 +597,7 @@ export class AssetProxyOwnerContract extends BaseContract {
owner: string,
): string {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('addOwner(address)').inputs;
- [owner
- ] = BaseContract._formatABIDataItemList(inputAbi, [owner
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('addOwner(address)').functions.addOwner.encode([owner
+ const abiEncodedTransactionData = self._strictEncodeArguments('addOwner(address)', [owner
]);
return abiEncodedTransactionData;
},
@@ -754,15 +608,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<void
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'addOwner(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [owner
- ] = BaseContract._formatABIDataItemList(inputAbi, [owner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [owner
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.addOwner;
- const encodedData = ethersFunction.encode([owner
+ const encodedData = self._strictEncodeArguments('addOwner(address)', [owner
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -774,11 +620,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'addOwner'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('addOwner(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public isConfirmed = {
@@ -789,15 +636,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'isConfirmed(uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [transactionId
- ] = BaseContract._formatABIDataItemList(inputAbi, [transactionId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [transactionId
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.isConfirmed;
- const encodedData = ethersFunction.encode([transactionId
+ const encodedData = self._strictEncodeArguments('isConfirmed(uint256)', [transactionId
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -809,11 +648,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'isConfirmed'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('isConfirmed(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public changeTimeLock = {
@@ -822,13 +662,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('changeTimeLock(uint256)').inputs;
- [_secondsTimeLocked
- ] = BaseContract._formatABIDataItemList(inputAbi, [_secondsTimeLocked
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_secondsTimeLocked
- ]);
- const encodedData = self._lookupEthersInterface('changeTimeLock(uint256)').functions.changeTimeLock.encode([_secondsTimeLocked
+ const encodedData = self._strictEncodeArguments('changeTimeLock(uint256)', [_secondsTimeLocked
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -850,11 +684,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('changeTimeLock(uint256)').inputs;
- [_secondsTimeLocked
- ] = BaseContract._formatABIDataItemList(inputAbi, [_secondsTimeLocked
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('changeTimeLock(uint256)').functions.changeTimeLock.encode([_secondsTimeLocked
+ const encodedData = self._strictEncodeArguments('changeTimeLock(uint256)', [_secondsTimeLocked
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -871,11 +701,7 @@ export class AssetProxyOwnerContract extends BaseContract {
_secondsTimeLocked: BigNumber,
): string {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('changeTimeLock(uint256)').inputs;
- [_secondsTimeLocked
- ] = BaseContract._formatABIDataItemList(inputAbi, [_secondsTimeLocked
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('changeTimeLock(uint256)').functions.changeTimeLock.encode([_secondsTimeLocked
+ const abiEncodedTransactionData = self._strictEncodeArguments('changeTimeLock(uint256)', [_secondsTimeLocked
]);
return abiEncodedTransactionData;
},
@@ -886,15 +712,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<void
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'changeTimeLock(uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_secondsTimeLocked
- ] = BaseContract._formatABIDataItemList(inputAbi, [_secondsTimeLocked
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_secondsTimeLocked
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.changeTimeLock;
- const encodedData = ethersFunction.encode([_secondsTimeLocked
+ const encodedData = self._strictEncodeArguments('changeTimeLock(uint256)', [_secondsTimeLocked
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -906,11 +724,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'changeTimeLock'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('changeTimeLock(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public isAssetProxyRegistered = {
@@ -921,15 +740,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'isAssetProxyRegistered(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [index_0
- ] = BaseContract._formatABIDataItemList(inputAbi, [index_0
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.isAssetProxyRegistered;
- const encodedData = ethersFunction.encode([index_0
+ const encodedData = self._strictEncodeArguments('isAssetProxyRegistered(address)', [index_0
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -941,11 +752,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'isAssetProxyRegistered'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('isAssetProxyRegistered(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public getConfirmationCount = {
@@ -956,15 +768,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'getConfirmationCount(uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [transactionId
- ] = BaseContract._formatABIDataItemList(inputAbi, [transactionId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [transactionId
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getConfirmationCount;
- const encodedData = ethersFunction.encode([transactionId
+ const encodedData = self._strictEncodeArguments('getConfirmationCount(uint256)', [transactionId
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -976,11 +780,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getConfirmationCount'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('getConfirmationCount(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public transactions = {
@@ -991,15 +796,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<[string, BigNumber, string, boolean]
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'transactions(uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [index_0
- ] = BaseContract._formatABIDataItemList(inputAbi, [index_0
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transactions;
- const encodedData = ethersFunction.encode([index_0
+ const encodedData = self._strictEncodeArguments('transactions(uint256)', [index_0
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -1011,11 +808,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'transactions'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('transactions(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<[string, BigNumber, string, boolean]
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public getOwners = {
@@ -1025,12 +823,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<string[]
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'getOwners()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getOwners;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('getOwners()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -1041,11 +834,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getOwners'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('getOwners()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string[]
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public getTransactionIds = {
@@ -1059,24 +853,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<BigNumber[]
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'getTransactionIds(uint256,uint256,bool,bool)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [from,
- to,
- pending,
- executed
- ] = BaseContract._formatABIDataItemList(inputAbi, [from,
- to,
- pending,
- executed
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [from,
- to,
- pending,
- executed
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getTransactionIds;
- const encodedData = ethersFunction.encode([from,
+ const encodedData = self._strictEncodeArguments('getTransactionIds(uint256,uint256,bool,bool)', [from,
to,
pending,
executed
@@ -1091,11 +868,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getTransactionIds'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('getTransactionIds(uint256,uint256,bool,bool)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber[]
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public getConfirmations = {
@@ -1106,15 +884,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<string[]
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'getConfirmations(uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [transactionId
- ] = BaseContract._formatABIDataItemList(inputAbi, [transactionId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [transactionId
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getConfirmations;
- const encodedData = ethersFunction.encode([transactionId
+ const encodedData = self._strictEncodeArguments('getConfirmations(uint256)', [transactionId
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -1126,11 +896,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getConfirmations'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('getConfirmations(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string[]
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public transactionCount = {
@@ -1140,12 +911,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'transactionCount()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transactionCount;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('transactionCount()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -1156,11 +922,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'transactionCount'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('transactionCount()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public changeRequirement = {
@@ -1169,13 +936,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('changeRequirement(uint256)').inputs;
- [_required
- ] = BaseContract._formatABIDataItemList(inputAbi, [_required
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_required
- ]);
- const encodedData = self._lookupEthersInterface('changeRequirement(uint256)').functions.changeRequirement.encode([_required
+ const encodedData = self._strictEncodeArguments('changeRequirement(uint256)', [_required
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -1197,11 +958,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('changeRequirement(uint256)').inputs;
- [_required
- ] = BaseContract._formatABIDataItemList(inputAbi, [_required
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('changeRequirement(uint256)').functions.changeRequirement.encode([_required
+ const encodedData = self._strictEncodeArguments('changeRequirement(uint256)', [_required
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -1218,11 +975,7 @@ export class AssetProxyOwnerContract extends BaseContract {
_required: BigNumber,
): string {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('changeRequirement(uint256)').inputs;
- [_required
- ] = BaseContract._formatABIDataItemList(inputAbi, [_required
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('changeRequirement(uint256)').functions.changeRequirement.encode([_required
+ const abiEncodedTransactionData = self._strictEncodeArguments('changeRequirement(uint256)', [_required
]);
return abiEncodedTransactionData;
},
@@ -1233,15 +986,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<void
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'changeRequirement(uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_required
- ] = BaseContract._formatABIDataItemList(inputAbi, [_required
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_required
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.changeRequirement;
- const encodedData = ethersFunction.encode([_required
+ const encodedData = self._strictEncodeArguments('changeRequirement(uint256)', [_required
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -1253,11 +998,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'changeRequirement'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('changeRequirement(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public confirmTransaction = {
@@ -1266,13 +1012,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('confirmTransaction(uint256)').inputs;
- [transactionId
- ] = BaseContract._formatABIDataItemList(inputAbi, [transactionId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [transactionId
- ]);
- const encodedData = self._lookupEthersInterface('confirmTransaction(uint256)').functions.confirmTransaction.encode([transactionId
+ const encodedData = self._strictEncodeArguments('confirmTransaction(uint256)', [transactionId
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -1294,11 +1034,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('confirmTransaction(uint256)').inputs;
- [transactionId
- ] = BaseContract._formatABIDataItemList(inputAbi, [transactionId
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('confirmTransaction(uint256)').functions.confirmTransaction.encode([transactionId
+ const encodedData = self._strictEncodeArguments('confirmTransaction(uint256)', [transactionId
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -1315,11 +1051,7 @@ export class AssetProxyOwnerContract extends BaseContract {
transactionId: BigNumber,
): string {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('confirmTransaction(uint256)').inputs;
- [transactionId
- ] = BaseContract._formatABIDataItemList(inputAbi, [transactionId
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('confirmTransaction(uint256)').functions.confirmTransaction.encode([transactionId
+ const abiEncodedTransactionData = self._strictEncodeArguments('confirmTransaction(uint256)', [transactionId
]);
return abiEncodedTransactionData;
},
@@ -1330,15 +1062,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<void
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'confirmTransaction(uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [transactionId
- ] = BaseContract._formatABIDataItemList(inputAbi, [transactionId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [transactionId
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.confirmTransaction;
- const encodedData = ethersFunction.encode([transactionId
+ const encodedData = self._strictEncodeArguments('confirmTransaction(uint256)', [transactionId
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -1350,11 +1074,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'confirmTransaction'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('confirmTransaction(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public submitTransaction = {
@@ -1365,19 +1090,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('submitTransaction(address,uint256,bytes)').inputs;
- [destination,
- value,
- data
- ] = BaseContract._formatABIDataItemList(inputAbi, [destination,
- value,
- data
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [destination,
- value,
- data
- ]);
- const encodedData = self._lookupEthersInterface('submitTransaction(address,uint256,bytes)').functions.submitTransaction.encode([destination,
+ const encodedData = self._strictEncodeArguments('submitTransaction(address,uint256,bytes)', [destination,
value,
data
]);
@@ -1405,15 +1118,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('submitTransaction(address,uint256,bytes)').inputs;
- [destination,
- value,
- data
- ] = BaseContract._formatABIDataItemList(inputAbi, [destination,
- value,
- data
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('submitTransaction(address,uint256,bytes)').functions.submitTransaction.encode([destination,
+ const encodedData = self._strictEncodeArguments('submitTransaction(address,uint256,bytes)', [destination,
value,
data
]);
@@ -1434,15 +1139,7 @@ export class AssetProxyOwnerContract extends BaseContract {
data: string,
): string {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('submitTransaction(address,uint256,bytes)').inputs;
- [destination,
- value,
- data
- ] = BaseContract._formatABIDataItemList(inputAbi, [destination,
- value,
- data
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('submitTransaction(address,uint256,bytes)').functions.submitTransaction.encode([destination,
+ const abiEncodedTransactionData = self._strictEncodeArguments('submitTransaction(address,uint256,bytes)', [destination,
value,
data
]);
@@ -1457,21 +1154,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'submitTransaction(address,uint256,bytes)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [destination,
- value,
- data
- ] = BaseContract._formatABIDataItemList(inputAbi, [destination,
- value,
- data
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [destination,
- value,
- data
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.submitTransaction;
- const encodedData = ethersFunction.encode([destination,
+ const encodedData = self._strictEncodeArguments('submitTransaction(address,uint256,bytes)', [destination,
value,
data
]);
@@ -1485,11 +1168,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'submitTransaction'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('submitTransaction(address,uint256,bytes)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public confirmationTimes = {
@@ -1500,15 +1184,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'confirmationTimes(uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [index_0
- ] = BaseContract._formatABIDataItemList(inputAbi, [index_0
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.confirmationTimes;
- const encodedData = ethersFunction.encode([index_0
+ const encodedData = self._strictEncodeArguments('confirmationTimes(uint256)', [index_0
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -1520,11 +1196,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'confirmationTimes'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('confirmationTimes(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public MAX_OWNER_COUNT = {
@@ -1534,12 +1211,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'MAX_OWNER_COUNT()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.MAX_OWNER_COUNT;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('MAX_OWNER_COUNT()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -1550,11 +1222,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'MAX_OWNER_COUNT'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('MAX_OWNER_COUNT()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public required = {
@@ -1564,12 +1237,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'required()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.required;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('required()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -1580,11 +1248,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'required'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('required()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public replaceOwner = {
@@ -1594,16 +1263,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('replaceOwner(address,address)').inputs;
- [owner,
- newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [owner,
- newOwner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [owner,
- newOwner
- ]);
- const encodedData = self._lookupEthersInterface('replaceOwner(address,address)').functions.replaceOwner.encode([owner,
+ const encodedData = self._strictEncodeArguments('replaceOwner(address,address)', [owner,
newOwner
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -1628,13 +1288,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('replaceOwner(address,address)').inputs;
- [owner,
- newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [owner,
- newOwner
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('replaceOwner(address,address)').functions.replaceOwner.encode([owner,
+ const encodedData = self._strictEncodeArguments('replaceOwner(address,address)', [owner,
newOwner
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -1653,13 +1307,7 @@ export class AssetProxyOwnerContract extends BaseContract {
newOwner: string,
): string {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('replaceOwner(address,address)').inputs;
- [owner,
- newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [owner,
- newOwner
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('replaceOwner(address,address)').functions.replaceOwner.encode([owner,
+ const abiEncodedTransactionData = self._strictEncodeArguments('replaceOwner(address,address)', [owner,
newOwner
]);
return abiEncodedTransactionData;
@@ -1672,18 +1320,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<void
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'replaceOwner(address,address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [owner,
- newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [owner,
- newOwner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [owner,
- newOwner
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.replaceOwner;
- const encodedData = ethersFunction.encode([owner,
+ const encodedData = self._strictEncodeArguments('replaceOwner(address,address)', [owner,
newOwner
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -1696,11 +1333,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'replaceOwner'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('replaceOwner(address,address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public executeTransaction = {
@@ -1709,13 +1347,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('executeTransaction(uint256)').inputs;
- [transactionId
- ] = BaseContract._formatABIDataItemList(inputAbi, [transactionId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [transactionId
- ]);
- const encodedData = self._lookupEthersInterface('executeTransaction(uint256)').functions.executeTransaction.encode([transactionId
+ const encodedData = self._strictEncodeArguments('executeTransaction(uint256)', [transactionId
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -1737,11 +1369,7 @@ export class AssetProxyOwnerContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('executeTransaction(uint256)').inputs;
- [transactionId
- ] = BaseContract._formatABIDataItemList(inputAbi, [transactionId
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('executeTransaction(uint256)').functions.executeTransaction.encode([transactionId
+ const encodedData = self._strictEncodeArguments('executeTransaction(uint256)', [transactionId
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -1758,11 +1386,7 @@ export class AssetProxyOwnerContract extends BaseContract {
transactionId: BigNumber,
): string {
const self = this as any as AssetProxyOwnerContract;
- const inputAbi = self._lookupAbi('executeTransaction(uint256)').inputs;
- [transactionId
- ] = BaseContract._formatABIDataItemList(inputAbi, [transactionId
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('executeTransaction(uint256)').functions.executeTransaction.encode([transactionId
+ const abiEncodedTransactionData = self._strictEncodeArguments('executeTransaction(uint256)', [transactionId
]);
return abiEncodedTransactionData;
},
@@ -1773,15 +1397,7 @@ export class AssetProxyOwnerContract extends BaseContract {
): Promise<void
> {
const self = this as any as AssetProxyOwnerContract;
- const functionSignature = 'executeTransaction(uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [transactionId
- ] = BaseContract._formatABIDataItemList(inputAbi, [transactionId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [transactionId
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.executeTransaction;
- const encodedData = ethersFunction.encode([transactionId
+ const encodedData = self._strictEncodeArguments('executeTransaction(uint256)', [transactionId
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -1793,11 +1409,12 @@ export class AssetProxyOwnerContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'executeTransaction'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('executeTransaction(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public static async deployFrom0xArtifactAsync(
@@ -1871,7 +1488,7 @@ _secondsTimeLocked
}
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
super('AssetProxyOwner', abi, address, provider, txDefaults);
- classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
+ classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count
// tslint:enable:no-unbound-method
diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc20_token.ts b/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc20_token.ts
index 3995c6d87..cab09c4d2 100644
--- a/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc20_token.ts
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc20_token.ts
@@ -43,12 +43,7 @@ export class DummyERC20TokenContract extends BaseContract {
): Promise<string
> {
const self = this as any as DummyERC20TokenContract;
- const functionSignature = 'name()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.name;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('name()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -59,11 +54,12 @@ export class DummyERC20TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'name'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('name()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public approve = {
@@ -73,16 +69,7 @@ export class DummyERC20TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as DummyERC20TokenContract;
- const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
- [_spender,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
- _value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_spender,
- _value
- ]);
- const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_spender,
+ const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
_value
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -107,13 +94,7 @@ export class DummyERC20TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as DummyERC20TokenContract;
- const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
- [_spender,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
- _value
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_spender,
+ const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
_value
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -132,13 +113,7 @@ export class DummyERC20TokenContract extends BaseContract {
_value: BigNumber,
): string {
const self = this as any as DummyERC20TokenContract;
- const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
- [_spender,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
- _value
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_spender,
+ const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
_value
]);
return abiEncodedTransactionData;
@@ -151,18 +126,7 @@ export class DummyERC20TokenContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as DummyERC20TokenContract;
- const functionSignature = 'approve(address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_spender,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
- _value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_spender,
- _value
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.approve;
- const encodedData = ethersFunction.encode([_spender,
+ const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
_value
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -175,11 +139,12 @@ export class DummyERC20TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'approve'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public totalSupply = {
@@ -189,12 +154,7 @@ export class DummyERC20TokenContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as DummyERC20TokenContract;
- const functionSignature = 'totalSupply()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.totalSupply;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('totalSupply()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -205,11 +165,12 @@ export class DummyERC20TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'totalSupply'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('totalSupply()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public transferFrom = {
@@ -220,19 +181,7 @@ export class DummyERC20TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as DummyERC20TokenContract;
- const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
- [_from,
- _to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
- _to,
- _value
- ]);
- const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
+ const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
_to,
_value
]);
@@ -260,15 +209,7 @@ export class DummyERC20TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as DummyERC20TokenContract;
- const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
- [_from,
- _to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _value
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
+ const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
_to,
_value
]);
@@ -289,15 +230,7 @@ export class DummyERC20TokenContract extends BaseContract {
_value: BigNumber,
): string {
const self = this as any as DummyERC20TokenContract;
- const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
- [_from,
- _to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _value
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
+ const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
_to,
_value
]);
@@ -312,21 +245,7 @@ export class DummyERC20TokenContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as DummyERC20TokenContract;
- const functionSignature = 'transferFrom(address,address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_from,
- _to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
- _to,
- _value
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferFrom;
- const encodedData = ethersFunction.encode([_from,
+ const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
_to,
_value
]);
@@ -340,11 +259,12 @@ export class DummyERC20TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'transferFrom'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public decimals = {
@@ -354,12 +274,7 @@ export class DummyERC20TokenContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as DummyERC20TokenContract;
- const functionSignature = 'decimals()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.decimals;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('decimals()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -370,11 +285,12 @@ export class DummyERC20TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'decimals'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('decimals()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public balanceOf = {
@@ -385,15 +301,7 @@ export class DummyERC20TokenContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as DummyERC20TokenContract;
- const functionSignature = 'balanceOf(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_owner
- ] = BaseContract._formatABIDataItemList(inputAbi, [_owner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.balanceOf;
- const encodedData = ethersFunction.encode([_owner
+ const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -405,11 +313,12 @@ export class DummyERC20TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'balanceOf'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public owner = {
@@ -419,12 +328,7 @@ export class DummyERC20TokenContract extends BaseContract {
): Promise<string
> {
const self = this as any as DummyERC20TokenContract;
- const functionSignature = 'owner()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.owner;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('owner()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -435,11 +339,12 @@ export class DummyERC20TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'owner'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('owner()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public symbol = {
@@ -449,12 +354,7 @@ export class DummyERC20TokenContract extends BaseContract {
): Promise<string
> {
const self = this as any as DummyERC20TokenContract;
- const functionSignature = 'symbol()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.symbol;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('symbol()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -465,11 +365,12 @@ export class DummyERC20TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'symbol'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('symbol()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public mint = {
@@ -478,13 +379,7 @@ export class DummyERC20TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as DummyERC20TokenContract;
- const inputAbi = self._lookupAbi('mint(uint256)').inputs;
- [_value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_value
- ]);
- const encodedData = self._lookupEthersInterface('mint(uint256)').functions.mint.encode([_value
+ const encodedData = self._strictEncodeArguments('mint(uint256)', [_value
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -506,11 +401,7 @@ export class DummyERC20TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as DummyERC20TokenContract;
- const inputAbi = self._lookupAbi('mint(uint256)').inputs;
- [_value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_value
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('mint(uint256)').functions.mint.encode([_value
+ const encodedData = self._strictEncodeArguments('mint(uint256)', [_value
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -527,11 +418,7 @@ export class DummyERC20TokenContract extends BaseContract {
_value: BigNumber,
): string {
const self = this as any as DummyERC20TokenContract;
- const inputAbi = self._lookupAbi('mint(uint256)').inputs;
- [_value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_value
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('mint(uint256)').functions.mint.encode([_value
+ const abiEncodedTransactionData = self._strictEncodeArguments('mint(uint256)', [_value
]);
return abiEncodedTransactionData;
},
@@ -542,15 +429,7 @@ export class DummyERC20TokenContract extends BaseContract {
): Promise<void
> {
const self = this as any as DummyERC20TokenContract;
- const functionSignature = 'mint(uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_value
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.mint;
- const encodedData = ethersFunction.encode([_value
+ const encodedData = self._strictEncodeArguments('mint(uint256)', [_value
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -562,11 +441,12 @@ export class DummyERC20TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'mint'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('mint(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public transfer = {
@@ -576,16 +456,7 @@ export class DummyERC20TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as DummyERC20TokenContract;
- const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
- [_to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_to,
- _value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_to,
- _value
- ]);
- const encodedData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([_to,
+ const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
_value
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -610,13 +481,7 @@ export class DummyERC20TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as DummyERC20TokenContract;
- const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
- [_to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_to,
- _value
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([_to,
+ const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
_value
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -635,13 +500,7 @@ export class DummyERC20TokenContract extends BaseContract {
_value: BigNumber,
): string {
const self = this as any as DummyERC20TokenContract;
- const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
- [_to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_to,
- _value
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([_to,
+ const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
_value
]);
return abiEncodedTransactionData;
@@ -654,18 +513,7 @@ export class DummyERC20TokenContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as DummyERC20TokenContract;
- const functionSignature = 'transfer(address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_to,
- _value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_to,
- _value
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transfer;
- const encodedData = ethersFunction.encode([_to,
+ const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
_value
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -678,11 +526,12 @@ export class DummyERC20TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'transfer'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public allowance = {
@@ -694,18 +543,7 @@ export class DummyERC20TokenContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as DummyERC20TokenContract;
- const functionSignature = 'allowance(address,address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_owner,
- _spender
- ] = BaseContract._formatABIDataItemList(inputAbi, [_owner,
- _spender
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner,
- _spender
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.allowance;
- const encodedData = ethersFunction.encode([_owner,
+ const encodedData = self._strictEncodeArguments('allowance(address,address)', [_owner,
_spender
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -718,11 +556,12 @@ export class DummyERC20TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'allowance'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public setBalance = {
@@ -732,16 +571,7 @@ export class DummyERC20TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as DummyERC20TokenContract;
- const inputAbi = self._lookupAbi('setBalance(address,uint256)').inputs;
- [_target,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_target,
- _value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_target,
- _value
- ]);
- const encodedData = self._lookupEthersInterface('setBalance(address,uint256)').functions.setBalance.encode([_target,
+ const encodedData = self._strictEncodeArguments('setBalance(address,uint256)', [_target,
_value
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -766,13 +596,7 @@ export class DummyERC20TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as DummyERC20TokenContract;
- const inputAbi = self._lookupAbi('setBalance(address,uint256)').inputs;
- [_target,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_target,
- _value
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('setBalance(address,uint256)').functions.setBalance.encode([_target,
+ const encodedData = self._strictEncodeArguments('setBalance(address,uint256)', [_target,
_value
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -791,13 +615,7 @@ export class DummyERC20TokenContract extends BaseContract {
_value: BigNumber,
): string {
const self = this as any as DummyERC20TokenContract;
- const inputAbi = self._lookupAbi('setBalance(address,uint256)').inputs;
- [_target,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_target,
- _value
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('setBalance(address,uint256)').functions.setBalance.encode([_target,
+ const abiEncodedTransactionData = self._strictEncodeArguments('setBalance(address,uint256)', [_target,
_value
]);
return abiEncodedTransactionData;
@@ -810,18 +628,7 @@ export class DummyERC20TokenContract extends BaseContract {
): Promise<void
> {
const self = this as any as DummyERC20TokenContract;
- const functionSignature = 'setBalance(address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_target,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_target,
- _value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_target,
- _value
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.setBalance;
- const encodedData = ethersFunction.encode([_target,
+ const encodedData = self._strictEncodeArguments('setBalance(address,uint256)', [_target,
_value
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -834,11 +641,12 @@ export class DummyERC20TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'setBalance'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('setBalance(address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public transferOwnership = {
@@ -847,13 +655,7 @@ export class DummyERC20TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as DummyERC20TokenContract;
- const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
- ]);
- const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
+ const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -875,11 +677,7 @@ export class DummyERC20TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as DummyERC20TokenContract;
- const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
+ const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -896,11 +694,7 @@ export class DummyERC20TokenContract extends BaseContract {
newOwner: string,
): string {
const self = this as any as DummyERC20TokenContract;
- const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
+ const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
return abiEncodedTransactionData;
},
@@ -911,15 +705,7 @@ export class DummyERC20TokenContract extends BaseContract {
): Promise<void
> {
const self = this as any as DummyERC20TokenContract;
- const functionSignature = 'transferOwnership(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferOwnership;
- const encodedData = ethersFunction.encode([newOwner
+ const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -931,11 +717,12 @@ export class DummyERC20TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'transferOwnership'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public MAX_MINT_AMOUNT = {
@@ -945,12 +732,7 @@ export class DummyERC20TokenContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as DummyERC20TokenContract;
- const functionSignature = 'MAX_MINT_AMOUNT()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.MAX_MINT_AMOUNT;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('MAX_MINT_AMOUNT()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -961,11 +743,12 @@ export class DummyERC20TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'MAX_MINT_AMOUNT'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('MAX_MINT_AMOUNT()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public static async deployFrom0xArtifactAsync(
@@ -1039,7 +822,7 @@ _totalSupply
}
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
super('DummyERC20Token', abi, address, provider, txDefaults);
- classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
+ classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count
// tslint:enable:no-unbound-method
diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc721_token.ts b/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc721_token.ts
index a7af2d158..9cb54442b 100644
--- a/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc721_token.ts
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc721_token.ts
@@ -51,12 +51,7 @@ export class DummyERC721TokenContract extends BaseContract {
): Promise<string
> {
const self = this as any as DummyERC721TokenContract;
- const functionSignature = 'name()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.name;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('name()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -67,11 +62,12 @@ export class DummyERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'name'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('name()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public getApproved = {
@@ -82,15 +78,7 @@ export class DummyERC721TokenContract extends BaseContract {
): Promise<string
> {
const self = this as any as DummyERC721TokenContract;
- const functionSignature = 'getApproved(uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_tokenId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_tokenId
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getApproved;
- const encodedData = ethersFunction.encode([_tokenId
+ const encodedData = self._strictEncodeArguments('getApproved(uint256)', [_tokenId
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -102,11 +90,12 @@ export class DummyERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getApproved'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('getApproved(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public approve = {
@@ -116,16 +105,7 @@ export class DummyERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
- [_approved,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_approved,
- _tokenId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_approved,
- _tokenId
- ]);
- const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_approved,
+ const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_approved,
_tokenId
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -150,13 +130,7 @@ export class DummyERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
- [_approved,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_approved,
- _tokenId
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_approved,
+ const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_approved,
_tokenId
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -175,13 +149,7 @@ export class DummyERC721TokenContract extends BaseContract {
_tokenId: BigNumber,
): string {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
- [_approved,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_approved,
- _tokenId
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_approved,
+ const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [_approved,
_tokenId
]);
return abiEncodedTransactionData;
@@ -194,18 +162,7 @@ export class DummyERC721TokenContract extends BaseContract {
): Promise<void
> {
const self = this as any as DummyERC721TokenContract;
- const functionSignature = 'approve(address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_approved,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_approved,
- _tokenId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_approved,
- _tokenId
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.approve;
- const encodedData = ethersFunction.encode([_approved,
+ const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_approved,
_tokenId
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -218,11 +175,12 @@ export class DummyERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'approve'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public transferFrom = {
@@ -233,19 +191,7 @@ export class DummyERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
- [_from,
- _to,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
- _to,
- _tokenId
- ]);
- const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
+ const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
_to,
_tokenId
]);
@@ -273,15 +219,7 @@ export class DummyERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
- [_from,
- _to,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
+ const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
_to,
_tokenId
]);
@@ -302,15 +240,7 @@ export class DummyERC721TokenContract extends BaseContract {
_tokenId: BigNumber,
): string {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
- [_from,
- _to,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
+ const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
_to,
_tokenId
]);
@@ -325,21 +255,7 @@ export class DummyERC721TokenContract extends BaseContract {
): Promise<void
> {
const self = this as any as DummyERC721TokenContract;
- const functionSignature = 'transferFrom(address,address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_from,
- _to,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
- _to,
- _tokenId
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferFrom;
- const encodedData = ethersFunction.encode([_from,
+ const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
_to,
_tokenId
]);
@@ -353,11 +269,12 @@ export class DummyERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'transferFrom'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public mint = {
@@ -367,16 +284,7 @@ export class DummyERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('mint(address,uint256)').inputs;
- [_to,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_to,
- _tokenId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_to,
- _tokenId
- ]);
- const encodedData = self._lookupEthersInterface('mint(address,uint256)').functions.mint.encode([_to,
+ const encodedData = self._strictEncodeArguments('mint(address,uint256)', [_to,
_tokenId
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -401,13 +309,7 @@ export class DummyERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('mint(address,uint256)').inputs;
- [_to,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_to,
- _tokenId
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('mint(address,uint256)').functions.mint.encode([_to,
+ const encodedData = self._strictEncodeArguments('mint(address,uint256)', [_to,
_tokenId
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -426,13 +328,7 @@ export class DummyERC721TokenContract extends BaseContract {
_tokenId: BigNumber,
): string {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('mint(address,uint256)').inputs;
- [_to,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_to,
- _tokenId
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('mint(address,uint256)').functions.mint.encode([_to,
+ const abiEncodedTransactionData = self._strictEncodeArguments('mint(address,uint256)', [_to,
_tokenId
]);
return abiEncodedTransactionData;
@@ -445,18 +341,7 @@ export class DummyERC721TokenContract extends BaseContract {
): Promise<void
> {
const self = this as any as DummyERC721TokenContract;
- const functionSignature = 'mint(address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_to,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_to,
- _tokenId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_to,
- _tokenId
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.mint;
- const encodedData = ethersFunction.encode([_to,
+ const encodedData = self._strictEncodeArguments('mint(address,uint256)', [_to,
_tokenId
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -469,11 +354,12 @@ export class DummyERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'mint'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('mint(address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public safeTransferFrom1 = {
@@ -484,19 +370,7 @@ export class DummyERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256)').inputs;
- [_from,
- _to,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
- _to,
- _tokenId
- ]);
- const encodedData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256)').functions.safeTransferFrom.encode([_from,
+ const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [_from,
_to,
_tokenId
]);
@@ -524,15 +398,7 @@ export class DummyERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256)').inputs;
- [_from,
- _to,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256)').functions.safeTransferFrom.encode([_from,
+ const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [_from,
_to,
_tokenId
]);
@@ -553,15 +419,7 @@ export class DummyERC721TokenContract extends BaseContract {
_tokenId: BigNumber,
): string {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256)').inputs;
- [_from,
- _to,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256)').functions.safeTransferFrom.encode([_from,
+ const abiEncodedTransactionData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [_from,
_to,
_tokenId
]);
@@ -576,21 +434,7 @@ export class DummyERC721TokenContract extends BaseContract {
): Promise<void
> {
const self = this as any as DummyERC721TokenContract;
- const functionSignature = 'safeTransferFrom(address,address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_from,
- _to,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
- _to,
- _tokenId
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.safeTransferFrom;
- const encodedData = ethersFunction.encode([_from,
+ const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [_from,
_to,
_tokenId
]);
@@ -604,11 +448,12 @@ export class DummyERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'safeTransferFrom'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('safeTransferFrom(address,address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public ownerOf = {
@@ -619,15 +464,7 @@ export class DummyERC721TokenContract extends BaseContract {
): Promise<string
> {
const self = this as any as DummyERC721TokenContract;
- const functionSignature = 'ownerOf(uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_tokenId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_tokenId
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.ownerOf;
- const encodedData = ethersFunction.encode([_tokenId
+ const encodedData = self._strictEncodeArguments('ownerOf(uint256)', [_tokenId
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -639,11 +476,12 @@ export class DummyERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'ownerOf'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('ownerOf(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public balanceOf = {
@@ -654,15 +492,7 @@ export class DummyERC721TokenContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as DummyERC721TokenContract;
- const functionSignature = 'balanceOf(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_owner
- ] = BaseContract._formatABIDataItemList(inputAbi, [_owner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.balanceOf;
- const encodedData = ethersFunction.encode([_owner
+ const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -674,11 +504,12 @@ export class DummyERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'balanceOf'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public owner = {
@@ -688,12 +519,7 @@ export class DummyERC721TokenContract extends BaseContract {
): Promise<string
> {
const self = this as any as DummyERC721TokenContract;
- const functionSignature = 'owner()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.owner;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('owner()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -704,11 +530,12 @@ export class DummyERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'owner'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('owner()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public symbol = {
@@ -718,12 +545,7 @@ export class DummyERC721TokenContract extends BaseContract {
): Promise<string
> {
const self = this as any as DummyERC721TokenContract;
- const functionSignature = 'symbol()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.symbol;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('symbol()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -734,11 +556,12 @@ export class DummyERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'symbol'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('symbol()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public burn = {
@@ -748,16 +571,7 @@ export class DummyERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('burn(address,uint256)').inputs;
- [_owner,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_owner,
- _tokenId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner,
- _tokenId
- ]);
- const encodedData = self._lookupEthersInterface('burn(address,uint256)').functions.burn.encode([_owner,
+ const encodedData = self._strictEncodeArguments('burn(address,uint256)', [_owner,
_tokenId
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -782,13 +596,7 @@ export class DummyERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('burn(address,uint256)').inputs;
- [_owner,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_owner,
- _tokenId
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('burn(address,uint256)').functions.burn.encode([_owner,
+ const encodedData = self._strictEncodeArguments('burn(address,uint256)', [_owner,
_tokenId
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -807,13 +615,7 @@ export class DummyERC721TokenContract extends BaseContract {
_tokenId: BigNumber,
): string {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('burn(address,uint256)').inputs;
- [_owner,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_owner,
- _tokenId
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('burn(address,uint256)').functions.burn.encode([_owner,
+ const abiEncodedTransactionData = self._strictEncodeArguments('burn(address,uint256)', [_owner,
_tokenId
]);
return abiEncodedTransactionData;
@@ -826,18 +628,7 @@ export class DummyERC721TokenContract extends BaseContract {
): Promise<void
> {
const self = this as any as DummyERC721TokenContract;
- const functionSignature = 'burn(address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_owner,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_owner,
- _tokenId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner,
- _tokenId
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.burn;
- const encodedData = ethersFunction.encode([_owner,
+ const encodedData = self._strictEncodeArguments('burn(address,uint256)', [_owner,
_tokenId
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -850,11 +641,12 @@ export class DummyERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'burn'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('burn(address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public setApprovalForAll = {
@@ -864,16 +656,7 @@ export class DummyERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('setApprovalForAll(address,bool)').inputs;
- [_operator,
- _approved
- ] = BaseContract._formatABIDataItemList(inputAbi, [_operator,
- _approved
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_operator,
- _approved
- ]);
- const encodedData = self._lookupEthersInterface('setApprovalForAll(address,bool)').functions.setApprovalForAll.encode([_operator,
+ const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator,
_approved
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -898,13 +681,7 @@ export class DummyERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('setApprovalForAll(address,bool)').inputs;
- [_operator,
- _approved
- ] = BaseContract._formatABIDataItemList(inputAbi, [_operator,
- _approved
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('setApprovalForAll(address,bool)').functions.setApprovalForAll.encode([_operator,
+ const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator,
_approved
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -923,13 +700,7 @@ export class DummyERC721TokenContract extends BaseContract {
_approved: boolean,
): string {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('setApprovalForAll(address,bool)').inputs;
- [_operator,
- _approved
- ] = BaseContract._formatABIDataItemList(inputAbi, [_operator,
- _approved
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('setApprovalForAll(address,bool)').functions.setApprovalForAll.encode([_operator,
+ const abiEncodedTransactionData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator,
_approved
]);
return abiEncodedTransactionData;
@@ -942,18 +713,7 @@ export class DummyERC721TokenContract extends BaseContract {
): Promise<void
> {
const self = this as any as DummyERC721TokenContract;
- const functionSignature = 'setApprovalForAll(address,bool)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_operator,
- _approved
- ] = BaseContract._formatABIDataItemList(inputAbi, [_operator,
- _approved
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_operator,
- _approved
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.setApprovalForAll;
- const encodedData = ethersFunction.encode([_operator,
+ const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator,
_approved
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -966,11 +726,12 @@ export class DummyERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'setApprovalForAll'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('setApprovalForAll(address,bool)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public safeTransferFrom2 = {
@@ -982,22 +743,7 @@ export class DummyERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256,bytes)').inputs;
- [_from,
- _to,
- _tokenId,
- _data
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId,
- _data
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
- _to,
- _tokenId,
- _data
- ]);
- const encodedData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256,bytes)').functions.safeTransferFrom.encode([_from,
+ const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [_from,
_to,
_tokenId,
_data
@@ -1028,17 +774,7 @@ export class DummyERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256,bytes)').inputs;
- [_from,
- _to,
- _tokenId,
- _data
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId,
- _data
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256,bytes)').functions.safeTransferFrom.encode([_from,
+ const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [_from,
_to,
_tokenId,
_data
@@ -1061,17 +797,7 @@ export class DummyERC721TokenContract extends BaseContract {
_data: string,
): string {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256,bytes)').inputs;
- [_from,
- _to,
- _tokenId,
- _data
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId,
- _data
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256,bytes)').functions.safeTransferFrom.encode([_from,
+ const abiEncodedTransactionData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [_from,
_to,
_tokenId,
_data
@@ -1088,24 +814,7 @@ export class DummyERC721TokenContract extends BaseContract {
): Promise<void
> {
const self = this as any as DummyERC721TokenContract;
- const functionSignature = 'safeTransferFrom(address,address,uint256,bytes)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_from,
- _to,
- _tokenId,
- _data
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId,
- _data
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
- _to,
- _tokenId,
- _data
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.safeTransferFrom;
- const encodedData = ethersFunction.encode([_from,
+ const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [_from,
_to,
_tokenId,
_data
@@ -1120,11 +829,12 @@ export class DummyERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'safeTransferFrom'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('safeTransferFrom(address,address,uint256,bytes)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public isApprovedForAll = {
@@ -1136,18 +846,7 @@ export class DummyERC721TokenContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as DummyERC721TokenContract;
- const functionSignature = 'isApprovedForAll(address,address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_owner,
- _operator
- ] = BaseContract._formatABIDataItemList(inputAbi, [_owner,
- _operator
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner,
- _operator
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.isApprovedForAll;
- const encodedData = ethersFunction.encode([_owner,
+ const encodedData = self._strictEncodeArguments('isApprovedForAll(address,address)', [_owner,
_operator
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -1160,11 +859,12 @@ export class DummyERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'isApprovedForAll'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('isApprovedForAll(address,address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public transferOwnership = {
@@ -1173,13 +873,7 @@ export class DummyERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
- ]);
- const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
+ const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -1201,11 +895,7 @@ export class DummyERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
+ const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -1222,11 +912,7 @@ export class DummyERC721TokenContract extends BaseContract {
newOwner: string,
): string {
const self = this as any as DummyERC721TokenContract;
- const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
+ const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
return abiEncodedTransactionData;
},
@@ -1237,15 +923,7 @@ export class DummyERC721TokenContract extends BaseContract {
): Promise<void
> {
const self = this as any as DummyERC721TokenContract;
- const functionSignature = 'transferOwnership(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferOwnership;
- const encodedData = ethersFunction.encode([newOwner
+ const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -1257,11 +935,12 @@ export class DummyERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'transferOwnership'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public static async deployFrom0xArtifactAsync(
@@ -1321,7 +1000,7 @@ _symbol
}
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
super('DummyERC721Token', abi, address, provider, txDefaults);
- classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
+ classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count
// tslint:enable:no-unbound-method
diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/dutch_auction.ts b/packages/abi-gen-wrappers/src/generated-wrappers/dutch_auction.ts
index 90e233756..9be95af65 100644
--- a/packages/abi-gen-wrappers/src/generated-wrappers/dutch_auction.ts
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/dutch_auction.ts
@@ -21,13 +21,7 @@ export class DutchAuctionContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as DutchAuctionContract;
- const inputAbi = self._lookupAbi('getAuctionDetails({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})').inputs;
- [order
- ] = BaseContract._formatABIDataItemList(inputAbi, [order
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [order
- ]);
- const encodedData = self._lookupEthersInterface('getAuctionDetails({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})').functions.getAuctionDetails.encode([order
+ const encodedData = self._strictEncodeArguments('getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))', [order
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -49,11 +43,7 @@ export class DutchAuctionContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as DutchAuctionContract;
- const inputAbi = self._lookupAbi('getAuctionDetails({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})').inputs;
- [order
- ] = BaseContract._formatABIDataItemList(inputAbi, [order
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('getAuctionDetails({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})').functions.getAuctionDetails.encode([order
+ const encodedData = self._strictEncodeArguments('getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))', [order
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -70,11 +60,7 @@ export class DutchAuctionContract extends BaseContract {
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
): string {
const self = this as any as DutchAuctionContract;
- const inputAbi = self._lookupAbi('getAuctionDetails({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})').inputs;
- [order
- ] = BaseContract._formatABIDataItemList(inputAbi, [order
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('getAuctionDetails({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})').functions.getAuctionDetails.encode([order
+ const abiEncodedTransactionData = self._strictEncodeArguments('getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))', [order
]);
return abiEncodedTransactionData;
},
@@ -85,15 +71,7 @@ export class DutchAuctionContract extends BaseContract {
): Promise<{beginTimeSeconds: BigNumber;endTimeSeconds: BigNumber;beginAmount: BigNumber;endAmount: BigNumber;currentAmount: BigNumber;currentTimeSeconds: BigNumber}
> {
const self = this as any as DutchAuctionContract;
- const functionSignature = 'getAuctionDetails({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [order
- ] = BaseContract._formatABIDataItemList(inputAbi, [order
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [order
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getAuctionDetails;
- const encodedData = ethersFunction.encode([order
+ const encodedData = self._strictEncodeArguments('getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))', [order
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -105,11 +83,12 @@ export class DutchAuctionContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getAuctionDetails'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<{beginTimeSeconds: BigNumber;endTimeSeconds: BigNumber;beginAmount: BigNumber;endAmount: BigNumber;currentAmount: BigNumber;currentTimeSeconds: BigNumber}
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public matchOrders = {
@@ -121,22 +100,7 @@ export class DutchAuctionContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as DutchAuctionContract;
- const inputAbi = self._lookupAbi('matchOrders({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},{address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},bytes,bytes)').inputs;
- [buyOrder,
- sellOrder,
- buySignature,
- sellSignature
- ] = BaseContract._formatABIDataItemList(inputAbi, [buyOrder,
- sellOrder,
- buySignature,
- sellSignature
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [buyOrder,
- sellOrder,
- buySignature,
- sellSignature
- ]);
- const encodedData = self._lookupEthersInterface('matchOrders({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},{address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},bytes,bytes)').functions.matchOrders.encode([buyOrder,
+ const encodedData = self._strictEncodeArguments('matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)', [buyOrder,
sellOrder,
buySignature,
sellSignature
@@ -167,17 +131,7 @@ export class DutchAuctionContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as DutchAuctionContract;
- const inputAbi = self._lookupAbi('matchOrders({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},{address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},bytes,bytes)').inputs;
- [buyOrder,
- sellOrder,
- buySignature,
- sellSignature
- ] = BaseContract._formatABIDataItemList(inputAbi, [buyOrder,
- sellOrder,
- buySignature,
- sellSignature
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('matchOrders({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},{address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},bytes,bytes)').functions.matchOrders.encode([buyOrder,
+ const encodedData = self._strictEncodeArguments('matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)', [buyOrder,
sellOrder,
buySignature,
sellSignature
@@ -200,17 +154,7 @@ export class DutchAuctionContract extends BaseContract {
sellSignature: string,
): string {
const self = this as any as DutchAuctionContract;
- const inputAbi = self._lookupAbi('matchOrders({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},{address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},bytes,bytes)').inputs;
- [buyOrder,
- sellOrder,
- buySignature,
- sellSignature
- ] = BaseContract._formatABIDataItemList(inputAbi, [buyOrder,
- sellOrder,
- buySignature,
- sellSignature
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('matchOrders({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},{address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},bytes,bytes)').functions.matchOrders.encode([buyOrder,
+ const abiEncodedTransactionData = self._strictEncodeArguments('matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)', [buyOrder,
sellOrder,
buySignature,
sellSignature
@@ -227,24 +171,7 @@ export class DutchAuctionContract extends BaseContract {
): Promise<{left: {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber};right: {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber};leftMakerAssetSpreadAmount: BigNumber}
> {
const self = this as any as DutchAuctionContract;
- const functionSignature = 'matchOrders({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},{address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},bytes,bytes)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [buyOrder,
- sellOrder,
- buySignature,
- sellSignature
- ] = BaseContract._formatABIDataItemList(inputAbi, [buyOrder,
- sellOrder,
- buySignature,
- sellSignature
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [buyOrder,
- sellOrder,
- buySignature,
- sellSignature
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.matchOrders;
- const encodedData = ethersFunction.encode([buyOrder,
+ const encodedData = self._strictEncodeArguments('matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)', [buyOrder,
sellOrder,
buySignature,
sellSignature
@@ -259,11 +186,12 @@ export class DutchAuctionContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'matchOrders'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<{left: {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber};right: {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber};leftMakerAssetSpreadAmount: BigNumber}
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public static async deployFrom0xArtifactAsync(
@@ -316,7 +244,7 @@ export class DutchAuctionContract extends BaseContract {
}
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
super('DutchAuction', abi, address, provider, txDefaults);
- classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
+ classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count
// tslint:enable:no-unbound-method
diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/erc20_proxy.ts b/packages/abi-gen-wrappers/src/generated-wrappers/erc20_proxy.ts
index 474472e43..1d53df6b8 100644
--- a/packages/abi-gen-wrappers/src/generated-wrappers/erc20_proxy.ts
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/erc20_proxy.ts
@@ -40,13 +40,7 @@ export class ERC20ProxyContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ERC20ProxyContract;
- const inputAbi = self._lookupAbi('addAuthorizedAddress(address)').inputs;
- [target
- ] = BaseContract._formatABIDataItemList(inputAbi, [target
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [target
- ]);
- const encodedData = self._lookupEthersInterface('addAuthorizedAddress(address)').functions.addAuthorizedAddress.encode([target
+ const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -68,11 +62,7 @@ export class ERC20ProxyContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ERC20ProxyContract;
- const inputAbi = self._lookupAbi('addAuthorizedAddress(address)').inputs;
- [target
- ] = BaseContract._formatABIDataItemList(inputAbi, [target
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('addAuthorizedAddress(address)').functions.addAuthorizedAddress.encode([target
+ const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -89,11 +79,7 @@ export class ERC20ProxyContract extends BaseContract {
target: string,
): string {
const self = this as any as ERC20ProxyContract;
- const inputAbi = self._lookupAbi('addAuthorizedAddress(address)').inputs;
- [target
- ] = BaseContract._formatABIDataItemList(inputAbi, [target
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('addAuthorizedAddress(address)').functions.addAuthorizedAddress.encode([target
+ const abiEncodedTransactionData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
]);
return abiEncodedTransactionData;
},
@@ -104,15 +90,7 @@ export class ERC20ProxyContract extends BaseContract {
): Promise<void
> {
const self = this as any as ERC20ProxyContract;
- const functionSignature = 'addAuthorizedAddress(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [target
- ] = BaseContract._formatABIDataItemList(inputAbi, [target
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [target
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.addAuthorizedAddress;
- const encodedData = ethersFunction.encode([target
+ const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -124,11 +102,12 @@ export class ERC20ProxyContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'addAuthorizedAddress'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('addAuthorizedAddress(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public authorities = {
@@ -139,15 +118,7 @@ export class ERC20ProxyContract extends BaseContract {
): Promise<string
> {
const self = this as any as ERC20ProxyContract;
- const functionSignature = 'authorities(uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [index_0
- ] = BaseContract._formatABIDataItemList(inputAbi, [index_0
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.authorities;
- const encodedData = ethersFunction.encode([index_0
+ const encodedData = self._strictEncodeArguments('authorities(uint256)', [index_0
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -159,11 +130,12 @@ export class ERC20ProxyContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'authorities'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('authorities(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public removeAuthorizedAddress = {
@@ -172,13 +144,7 @@ export class ERC20ProxyContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ERC20ProxyContract;
- const inputAbi = self._lookupAbi('removeAuthorizedAddress(address)').inputs;
- [target
- ] = BaseContract._formatABIDataItemList(inputAbi, [target
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [target
- ]);
- const encodedData = self._lookupEthersInterface('removeAuthorizedAddress(address)').functions.removeAuthorizedAddress.encode([target
+ const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -200,11 +166,7 @@ export class ERC20ProxyContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ERC20ProxyContract;
- const inputAbi = self._lookupAbi('removeAuthorizedAddress(address)').inputs;
- [target
- ] = BaseContract._formatABIDataItemList(inputAbi, [target
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('removeAuthorizedAddress(address)').functions.removeAuthorizedAddress.encode([target
+ const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -221,11 +183,7 @@ export class ERC20ProxyContract extends BaseContract {
target: string,
): string {
const self = this as any as ERC20ProxyContract;
- const inputAbi = self._lookupAbi('removeAuthorizedAddress(address)').inputs;
- [target
- ] = BaseContract._formatABIDataItemList(inputAbi, [target
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('removeAuthorizedAddress(address)').functions.removeAuthorizedAddress.encode([target
+ const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
]);
return abiEncodedTransactionData;
},
@@ -236,15 +194,7 @@ export class ERC20ProxyContract extends BaseContract {
): Promise<void
> {
const self = this as any as ERC20ProxyContract;
- const functionSignature = 'removeAuthorizedAddress(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [target
- ] = BaseContract._formatABIDataItemList(inputAbi, [target
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [target
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.removeAuthorizedAddress;
- const encodedData = ethersFunction.encode([target
+ const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -256,11 +206,12 @@ export class ERC20ProxyContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'removeAuthorizedAddress'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddress(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public owner = {
@@ -270,12 +221,7 @@ export class ERC20ProxyContract extends BaseContract {
): Promise<string
> {
const self = this as any as ERC20ProxyContract;
- const functionSignature = 'owner()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.owner;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('owner()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -286,11 +232,12 @@ export class ERC20ProxyContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'owner'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('owner()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public removeAuthorizedAddressAtIndex = {
@@ -300,16 +247,7 @@ export class ERC20ProxyContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ERC20ProxyContract;
- const inputAbi = self._lookupAbi('removeAuthorizedAddressAtIndex(address,uint256)').inputs;
- [target,
- index
- ] = BaseContract._formatABIDataItemList(inputAbi, [target,
- index
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [target,
- index
- ]);
- const encodedData = self._lookupEthersInterface('removeAuthorizedAddressAtIndex(address,uint256)').functions.removeAuthorizedAddressAtIndex.encode([target,
+ const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
index
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -334,13 +272,7 @@ export class ERC20ProxyContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ERC20ProxyContract;
- const inputAbi = self._lookupAbi('removeAuthorizedAddressAtIndex(address,uint256)').inputs;
- [target,
- index
- ] = BaseContract._formatABIDataItemList(inputAbi, [target,
- index
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('removeAuthorizedAddressAtIndex(address,uint256)').functions.removeAuthorizedAddressAtIndex.encode([target,
+ const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
index
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -359,13 +291,7 @@ export class ERC20ProxyContract extends BaseContract {
index: BigNumber,
): string {
const self = this as any as ERC20ProxyContract;
- const inputAbi = self._lookupAbi('removeAuthorizedAddressAtIndex(address,uint256)').inputs;
- [target,
- index
- ] = BaseContract._formatABIDataItemList(inputAbi, [target,
- index
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('removeAuthorizedAddressAtIndex(address,uint256)').functions.removeAuthorizedAddressAtIndex.encode([target,
+ const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
index
]);
return abiEncodedTransactionData;
@@ -378,18 +304,7 @@ export class ERC20ProxyContract extends BaseContract {
): Promise<void
> {
const self = this as any as ERC20ProxyContract;
- const functionSignature = 'removeAuthorizedAddressAtIndex(address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [target,
- index
- ] = BaseContract._formatABIDataItemList(inputAbi, [target,
- index
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [target,
- index
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.removeAuthorizedAddressAtIndex;
- const encodedData = ethersFunction.encode([target,
+ const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
index
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -402,11 +317,12 @@ export class ERC20ProxyContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'removeAuthorizedAddressAtIndex'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddressAtIndex(address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public getProxyId = {
@@ -416,12 +332,7 @@ export class ERC20ProxyContract extends BaseContract {
): Promise<string
> {
const self = this as any as ERC20ProxyContract;
- const functionSignature = 'getProxyId()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getProxyId;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('getProxyId()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -432,11 +343,12 @@ export class ERC20ProxyContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getProxyId'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('getProxyId()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public authorized = {
@@ -447,15 +359,7 @@ export class ERC20ProxyContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as ERC20ProxyContract;
- const functionSignature = 'authorized(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [index_0
- ] = BaseContract._formatABIDataItemList(inputAbi, [index_0
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.authorized;
- const encodedData = ethersFunction.encode([index_0
+ const encodedData = self._strictEncodeArguments('authorized(address)', [index_0
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -467,11 +371,12 @@ export class ERC20ProxyContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'authorized'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('authorized(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public getAuthorizedAddresses = {
@@ -481,12 +386,7 @@ export class ERC20ProxyContract extends BaseContract {
): Promise<string[]
> {
const self = this as any as ERC20ProxyContract;
- const functionSignature = 'getAuthorizedAddresses()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getAuthorizedAddresses;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('getAuthorizedAddresses()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -497,11 +397,12 @@ export class ERC20ProxyContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getAuthorizedAddresses'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('getAuthorizedAddresses()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string[]
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public transferOwnership = {
@@ -510,13 +411,7 @@ export class ERC20ProxyContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ERC20ProxyContract;
- const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
- ]);
- const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
+ const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -538,11 +433,7 @@ export class ERC20ProxyContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ERC20ProxyContract;
- const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
+ const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -559,11 +450,7 @@ export class ERC20ProxyContract extends BaseContract {
newOwner: string,
): string {
const self = this as any as ERC20ProxyContract;
- const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
+ const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
return abiEncodedTransactionData;
},
@@ -574,15 +461,7 @@ export class ERC20ProxyContract extends BaseContract {
): Promise<void
> {
const self = this as any as ERC20ProxyContract;
- const functionSignature = 'transferOwnership(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferOwnership;
- const encodedData = ethersFunction.encode([newOwner
+ const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -594,11 +473,12 @@ export class ERC20ProxyContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'transferOwnership'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public static async deployFrom0xArtifactAsync(
@@ -644,7 +524,7 @@ export class ERC20ProxyContract extends BaseContract {
}
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
super('ERC20Proxy', abi, address, provider, txDefaults);
- classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
+ classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count
// tslint:enable:no-unbound-method
diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts b/packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts
index ab208cbf5..5070111e1 100644
--- a/packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts
@@ -43,16 +43,7 @@ export class ERC20TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ERC20TokenContract;
- const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
- [_spender,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
- _value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_spender,
- _value
- ]);
- const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_spender,
+ const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
_value
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -77,13 +68,7 @@ export class ERC20TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ERC20TokenContract;
- const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
- [_spender,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
- _value
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_spender,
+ const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
_value
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -102,13 +87,7 @@ export class ERC20TokenContract extends BaseContract {
_value: BigNumber,
): string {
const self = this as any as ERC20TokenContract;
- const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
- [_spender,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
- _value
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_spender,
+ const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
_value
]);
return abiEncodedTransactionData;
@@ -121,18 +100,7 @@ export class ERC20TokenContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as ERC20TokenContract;
- const functionSignature = 'approve(address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_spender,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
- _value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_spender,
- _value
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.approve;
- const encodedData = ethersFunction.encode([_spender,
+ const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
_value
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -145,11 +113,12 @@ export class ERC20TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'approve'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public totalSupply = {
@@ -159,12 +128,7 @@ export class ERC20TokenContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as ERC20TokenContract;
- const functionSignature = 'totalSupply()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.totalSupply;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('totalSupply()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -175,11 +139,12 @@ export class ERC20TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'totalSupply'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('totalSupply()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public transferFrom = {
@@ -190,19 +155,7 @@ export class ERC20TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ERC20TokenContract;
- const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
- [_from,
- _to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
- _to,
- _value
- ]);
- const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
+ const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
_to,
_value
]);
@@ -230,15 +183,7 @@ export class ERC20TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ERC20TokenContract;
- const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
- [_from,
- _to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _value
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
+ const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
_to,
_value
]);
@@ -259,15 +204,7 @@ export class ERC20TokenContract extends BaseContract {
_value: BigNumber,
): string {
const self = this as any as ERC20TokenContract;
- const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
- [_from,
- _to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _value
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
+ const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
_to,
_value
]);
@@ -282,21 +219,7 @@ export class ERC20TokenContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as ERC20TokenContract;
- const functionSignature = 'transferFrom(address,address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_from,
- _to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
- _to,
- _value
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferFrom;
- const encodedData = ethersFunction.encode([_from,
+ const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
_to,
_value
]);
@@ -310,11 +233,12 @@ export class ERC20TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'transferFrom'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public balanceOf = {
@@ -325,15 +249,7 @@ export class ERC20TokenContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as ERC20TokenContract;
- const functionSignature = 'balanceOf(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_owner
- ] = BaseContract._formatABIDataItemList(inputAbi, [_owner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.balanceOf;
- const encodedData = ethersFunction.encode([_owner
+ const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -345,11 +261,12 @@ export class ERC20TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'balanceOf'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public transfer = {
@@ -359,16 +276,7 @@ export class ERC20TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ERC20TokenContract;
- const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
- [_to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_to,
- _value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_to,
- _value
- ]);
- const encodedData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([_to,
+ const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
_value
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -393,13 +301,7 @@ export class ERC20TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ERC20TokenContract;
- const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
- [_to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_to,
- _value
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([_to,
+ const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
_value
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -418,13 +320,7 @@ export class ERC20TokenContract extends BaseContract {
_value: BigNumber,
): string {
const self = this as any as ERC20TokenContract;
- const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
- [_to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_to,
- _value
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([_to,
+ const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
_value
]);
return abiEncodedTransactionData;
@@ -437,18 +333,7 @@ export class ERC20TokenContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as ERC20TokenContract;
- const functionSignature = 'transfer(address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_to,
- _value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_to,
- _value
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transfer;
- const encodedData = ethersFunction.encode([_to,
+ const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
_value
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -461,11 +346,12 @@ export class ERC20TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'transfer'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public allowance = {
@@ -477,18 +363,7 @@ export class ERC20TokenContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as ERC20TokenContract;
- const functionSignature = 'allowance(address,address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_owner,
- _spender
- ] = BaseContract._formatABIDataItemList(inputAbi, [_owner,
- _spender
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner,
- _spender
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.allowance;
- const encodedData = ethersFunction.encode([_owner,
+ const encodedData = self._strictEncodeArguments('allowance(address,address)', [_owner,
_spender
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -501,11 +376,12 @@ export class ERC20TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'allowance'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public static async deployFrom0xArtifactAsync(
@@ -551,7 +427,7 @@ export class ERC20TokenContract extends BaseContract {
}
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
super('ERC20Token', abi, address, provider, txDefaults);
- classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
+ classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count
// tslint:enable:no-unbound-method
diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/erc721_proxy.ts b/packages/abi-gen-wrappers/src/generated-wrappers/erc721_proxy.ts
index f9730a072..5a9fcc7d1 100644
--- a/packages/abi-gen-wrappers/src/generated-wrappers/erc721_proxy.ts
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/erc721_proxy.ts
@@ -40,13 +40,7 @@ export class ERC721ProxyContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ERC721ProxyContract;
- const inputAbi = self._lookupAbi('addAuthorizedAddress(address)').inputs;
- [target
- ] = BaseContract._formatABIDataItemList(inputAbi, [target
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [target
- ]);
- const encodedData = self._lookupEthersInterface('addAuthorizedAddress(address)').functions.addAuthorizedAddress.encode([target
+ const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -68,11 +62,7 @@ export class ERC721ProxyContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ERC721ProxyContract;
- const inputAbi = self._lookupAbi('addAuthorizedAddress(address)').inputs;
- [target
- ] = BaseContract._formatABIDataItemList(inputAbi, [target
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('addAuthorizedAddress(address)').functions.addAuthorizedAddress.encode([target
+ const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -89,11 +79,7 @@ export class ERC721ProxyContract extends BaseContract {
target: string,
): string {
const self = this as any as ERC721ProxyContract;
- const inputAbi = self._lookupAbi('addAuthorizedAddress(address)').inputs;
- [target
- ] = BaseContract._formatABIDataItemList(inputAbi, [target
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('addAuthorizedAddress(address)').functions.addAuthorizedAddress.encode([target
+ const abiEncodedTransactionData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
]);
return abiEncodedTransactionData;
},
@@ -104,15 +90,7 @@ export class ERC721ProxyContract extends BaseContract {
): Promise<void
> {
const self = this as any as ERC721ProxyContract;
- const functionSignature = 'addAuthorizedAddress(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [target
- ] = BaseContract._formatABIDataItemList(inputAbi, [target
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [target
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.addAuthorizedAddress;
- const encodedData = ethersFunction.encode([target
+ const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -124,11 +102,12 @@ export class ERC721ProxyContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'addAuthorizedAddress'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('addAuthorizedAddress(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public authorities = {
@@ -139,15 +118,7 @@ export class ERC721ProxyContract extends BaseContract {
): Promise<string
> {
const self = this as any as ERC721ProxyContract;
- const functionSignature = 'authorities(uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [index_0
- ] = BaseContract._formatABIDataItemList(inputAbi, [index_0
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.authorities;
- const encodedData = ethersFunction.encode([index_0
+ const encodedData = self._strictEncodeArguments('authorities(uint256)', [index_0
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -159,11 +130,12 @@ export class ERC721ProxyContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'authorities'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('authorities(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public removeAuthorizedAddress = {
@@ -172,13 +144,7 @@ export class ERC721ProxyContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ERC721ProxyContract;
- const inputAbi = self._lookupAbi('removeAuthorizedAddress(address)').inputs;
- [target
- ] = BaseContract._formatABIDataItemList(inputAbi, [target
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [target
- ]);
- const encodedData = self._lookupEthersInterface('removeAuthorizedAddress(address)').functions.removeAuthorizedAddress.encode([target
+ const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -200,11 +166,7 @@ export class ERC721ProxyContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ERC721ProxyContract;
- const inputAbi = self._lookupAbi('removeAuthorizedAddress(address)').inputs;
- [target
- ] = BaseContract._formatABIDataItemList(inputAbi, [target
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('removeAuthorizedAddress(address)').functions.removeAuthorizedAddress.encode([target
+ const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -221,11 +183,7 @@ export class ERC721ProxyContract extends BaseContract {
target: string,
): string {
const self = this as any as ERC721ProxyContract;
- const inputAbi = self._lookupAbi('removeAuthorizedAddress(address)').inputs;
- [target
- ] = BaseContract._formatABIDataItemList(inputAbi, [target
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('removeAuthorizedAddress(address)').functions.removeAuthorizedAddress.encode([target
+ const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
]);
return abiEncodedTransactionData;
},
@@ -236,15 +194,7 @@ export class ERC721ProxyContract extends BaseContract {
): Promise<void
> {
const self = this as any as ERC721ProxyContract;
- const functionSignature = 'removeAuthorizedAddress(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [target
- ] = BaseContract._formatABIDataItemList(inputAbi, [target
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [target
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.removeAuthorizedAddress;
- const encodedData = ethersFunction.encode([target
+ const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -256,11 +206,12 @@ export class ERC721ProxyContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'removeAuthorizedAddress'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddress(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public owner = {
@@ -270,12 +221,7 @@ export class ERC721ProxyContract extends BaseContract {
): Promise<string
> {
const self = this as any as ERC721ProxyContract;
- const functionSignature = 'owner()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.owner;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('owner()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -286,11 +232,12 @@ export class ERC721ProxyContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'owner'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('owner()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public removeAuthorizedAddressAtIndex = {
@@ -300,16 +247,7 @@ export class ERC721ProxyContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ERC721ProxyContract;
- const inputAbi = self._lookupAbi('removeAuthorizedAddressAtIndex(address,uint256)').inputs;
- [target,
- index
- ] = BaseContract._formatABIDataItemList(inputAbi, [target,
- index
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [target,
- index
- ]);
- const encodedData = self._lookupEthersInterface('removeAuthorizedAddressAtIndex(address,uint256)').functions.removeAuthorizedAddressAtIndex.encode([target,
+ const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
index
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -334,13 +272,7 @@ export class ERC721ProxyContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ERC721ProxyContract;
- const inputAbi = self._lookupAbi('removeAuthorizedAddressAtIndex(address,uint256)').inputs;
- [target,
- index
- ] = BaseContract._formatABIDataItemList(inputAbi, [target,
- index
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('removeAuthorizedAddressAtIndex(address,uint256)').functions.removeAuthorizedAddressAtIndex.encode([target,
+ const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
index
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -359,13 +291,7 @@ export class ERC721ProxyContract extends BaseContract {
index: BigNumber,
): string {
const self = this as any as ERC721ProxyContract;
- const inputAbi = self._lookupAbi('removeAuthorizedAddressAtIndex(address,uint256)').inputs;
- [target,
- index
- ] = BaseContract._formatABIDataItemList(inputAbi, [target,
- index
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('removeAuthorizedAddressAtIndex(address,uint256)').functions.removeAuthorizedAddressAtIndex.encode([target,
+ const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
index
]);
return abiEncodedTransactionData;
@@ -378,18 +304,7 @@ export class ERC721ProxyContract extends BaseContract {
): Promise<void
> {
const self = this as any as ERC721ProxyContract;
- const functionSignature = 'removeAuthorizedAddressAtIndex(address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [target,
- index
- ] = BaseContract._formatABIDataItemList(inputAbi, [target,
- index
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [target,
- index
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.removeAuthorizedAddressAtIndex;
- const encodedData = ethersFunction.encode([target,
+ const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
index
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -402,11 +317,12 @@ export class ERC721ProxyContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'removeAuthorizedAddressAtIndex'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddressAtIndex(address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public getProxyId = {
@@ -416,12 +332,7 @@ export class ERC721ProxyContract extends BaseContract {
): Promise<string
> {
const self = this as any as ERC721ProxyContract;
- const functionSignature = 'getProxyId()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getProxyId;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('getProxyId()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -432,11 +343,12 @@ export class ERC721ProxyContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getProxyId'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('getProxyId()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public authorized = {
@@ -447,15 +359,7 @@ export class ERC721ProxyContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as ERC721ProxyContract;
- const functionSignature = 'authorized(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [index_0
- ] = BaseContract._formatABIDataItemList(inputAbi, [index_0
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.authorized;
- const encodedData = ethersFunction.encode([index_0
+ const encodedData = self._strictEncodeArguments('authorized(address)', [index_0
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -467,11 +371,12 @@ export class ERC721ProxyContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'authorized'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('authorized(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public getAuthorizedAddresses = {
@@ -481,12 +386,7 @@ export class ERC721ProxyContract extends BaseContract {
): Promise<string[]
> {
const self = this as any as ERC721ProxyContract;
- const functionSignature = 'getAuthorizedAddresses()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getAuthorizedAddresses;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('getAuthorizedAddresses()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -497,11 +397,12 @@ export class ERC721ProxyContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getAuthorizedAddresses'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('getAuthorizedAddresses()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string[]
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public transferOwnership = {
@@ -510,13 +411,7 @@ export class ERC721ProxyContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ERC721ProxyContract;
- const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
- ]);
- const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
+ const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -538,11 +433,7 @@ export class ERC721ProxyContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ERC721ProxyContract;
- const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
+ const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -559,11 +450,7 @@ export class ERC721ProxyContract extends BaseContract {
newOwner: string,
): string {
const self = this as any as ERC721ProxyContract;
- const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
+ const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
return abiEncodedTransactionData;
},
@@ -574,15 +461,7 @@ export class ERC721ProxyContract extends BaseContract {
): Promise<void
> {
const self = this as any as ERC721ProxyContract;
- const functionSignature = 'transferOwnership(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferOwnership;
- const encodedData = ethersFunction.encode([newOwner
+ const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -594,11 +473,12 @@ export class ERC721ProxyContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'transferOwnership'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public static async deployFrom0xArtifactAsync(
@@ -644,7 +524,7 @@ export class ERC721ProxyContract extends BaseContract {
}
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
super('ERC721Proxy', abi, address, provider, txDefaults);
- classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
+ classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count
// tslint:enable:no-unbound-method
diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/erc721_token.ts b/packages/abi-gen-wrappers/src/generated-wrappers/erc721_token.ts
index 251dfa5f9..aaae2ab76 100644
--- a/packages/abi-gen-wrappers/src/generated-wrappers/erc721_token.ts
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/erc721_token.ts
@@ -52,15 +52,7 @@ export class ERC721TokenContract extends BaseContract {
): Promise<string
> {
const self = this as any as ERC721TokenContract;
- const functionSignature = 'getApproved(uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_tokenId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_tokenId
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getApproved;
- const encodedData = ethersFunction.encode([_tokenId
+ const encodedData = self._strictEncodeArguments('getApproved(uint256)', [_tokenId
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -72,11 +64,12 @@ export class ERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getApproved'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('getApproved(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public approve = {
@@ -86,16 +79,7 @@ export class ERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ERC721TokenContract;
- const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
- [_approved,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_approved,
- _tokenId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_approved,
- _tokenId
- ]);
- const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_approved,
+ const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_approved,
_tokenId
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -120,13 +104,7 @@ export class ERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ERC721TokenContract;
- const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
- [_approved,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_approved,
- _tokenId
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_approved,
+ const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_approved,
_tokenId
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -145,13 +123,7 @@ export class ERC721TokenContract extends BaseContract {
_tokenId: BigNumber,
): string {
const self = this as any as ERC721TokenContract;
- const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
- [_approved,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_approved,
- _tokenId
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_approved,
+ const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [_approved,
_tokenId
]);
return abiEncodedTransactionData;
@@ -164,18 +136,7 @@ export class ERC721TokenContract extends BaseContract {
): Promise<void
> {
const self = this as any as ERC721TokenContract;
- const functionSignature = 'approve(address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_approved,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_approved,
- _tokenId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_approved,
- _tokenId
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.approve;
- const encodedData = ethersFunction.encode([_approved,
+ const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_approved,
_tokenId
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -188,11 +149,12 @@ export class ERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'approve'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public transferFrom = {
@@ -203,19 +165,7 @@ export class ERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ERC721TokenContract;
- const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
- [_from,
- _to,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
- _to,
- _tokenId
- ]);
- const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
+ const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
_to,
_tokenId
]);
@@ -243,15 +193,7 @@ export class ERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ERC721TokenContract;
- const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
- [_from,
- _to,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
+ const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
_to,
_tokenId
]);
@@ -272,15 +214,7 @@ export class ERC721TokenContract extends BaseContract {
_tokenId: BigNumber,
): string {
const self = this as any as ERC721TokenContract;
- const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
- [_from,
- _to,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
+ const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
_to,
_tokenId
]);
@@ -295,21 +229,7 @@ export class ERC721TokenContract extends BaseContract {
): Promise<void
> {
const self = this as any as ERC721TokenContract;
- const functionSignature = 'transferFrom(address,address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_from,
- _to,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
- _to,
- _tokenId
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferFrom;
- const encodedData = ethersFunction.encode([_from,
+ const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
_to,
_tokenId
]);
@@ -323,11 +243,12 @@ export class ERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'transferFrom'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public safeTransferFrom1 = {
@@ -338,19 +259,7 @@ export class ERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ERC721TokenContract;
- const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256)').inputs;
- [_from,
- _to,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
- _to,
- _tokenId
- ]);
- const encodedData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256)').functions.safeTransferFrom.encode([_from,
+ const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [_from,
_to,
_tokenId
]);
@@ -378,15 +287,7 @@ export class ERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ERC721TokenContract;
- const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256)').inputs;
- [_from,
- _to,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256)').functions.safeTransferFrom.encode([_from,
+ const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [_from,
_to,
_tokenId
]);
@@ -407,15 +308,7 @@ export class ERC721TokenContract extends BaseContract {
_tokenId: BigNumber,
): string {
const self = this as any as ERC721TokenContract;
- const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256)').inputs;
- [_from,
- _to,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256)').functions.safeTransferFrom.encode([_from,
+ const abiEncodedTransactionData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [_from,
_to,
_tokenId
]);
@@ -430,21 +323,7 @@ export class ERC721TokenContract extends BaseContract {
): Promise<void
> {
const self = this as any as ERC721TokenContract;
- const functionSignature = 'safeTransferFrom(address,address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_from,
- _to,
- _tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
- _to,
- _tokenId
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.safeTransferFrom;
- const encodedData = ethersFunction.encode([_from,
+ const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256)', [_from,
_to,
_tokenId
]);
@@ -458,11 +337,12 @@ export class ERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'safeTransferFrom'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('safeTransferFrom(address,address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public ownerOf = {
@@ -473,15 +353,7 @@ export class ERC721TokenContract extends BaseContract {
): Promise<string
> {
const self = this as any as ERC721TokenContract;
- const functionSignature = 'ownerOf(uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [_tokenId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_tokenId
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.ownerOf;
- const encodedData = ethersFunction.encode([_tokenId
+ const encodedData = self._strictEncodeArguments('ownerOf(uint256)', [_tokenId
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -493,11 +365,12 @@ export class ERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'ownerOf'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('ownerOf(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public balanceOf = {
@@ -508,15 +381,7 @@ export class ERC721TokenContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as ERC721TokenContract;
- const functionSignature = 'balanceOf(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_owner
- ] = BaseContract._formatABIDataItemList(inputAbi, [_owner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.balanceOf;
- const encodedData = ethersFunction.encode([_owner
+ const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -528,11 +393,12 @@ export class ERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'balanceOf'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public setApprovalForAll = {
@@ -542,16 +408,7 @@ export class ERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ERC721TokenContract;
- const inputAbi = self._lookupAbi('setApprovalForAll(address,bool)').inputs;
- [_operator,
- _approved
- ] = BaseContract._formatABIDataItemList(inputAbi, [_operator,
- _approved
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_operator,
- _approved
- ]);
- const encodedData = self._lookupEthersInterface('setApprovalForAll(address,bool)').functions.setApprovalForAll.encode([_operator,
+ const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator,
_approved
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -576,13 +433,7 @@ export class ERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ERC721TokenContract;
- const inputAbi = self._lookupAbi('setApprovalForAll(address,bool)').inputs;
- [_operator,
- _approved
- ] = BaseContract._formatABIDataItemList(inputAbi, [_operator,
- _approved
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('setApprovalForAll(address,bool)').functions.setApprovalForAll.encode([_operator,
+ const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator,
_approved
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -601,13 +452,7 @@ export class ERC721TokenContract extends BaseContract {
_approved: boolean,
): string {
const self = this as any as ERC721TokenContract;
- const inputAbi = self._lookupAbi('setApprovalForAll(address,bool)').inputs;
- [_operator,
- _approved
- ] = BaseContract._formatABIDataItemList(inputAbi, [_operator,
- _approved
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('setApprovalForAll(address,bool)').functions.setApprovalForAll.encode([_operator,
+ const abiEncodedTransactionData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator,
_approved
]);
return abiEncodedTransactionData;
@@ -620,18 +465,7 @@ export class ERC721TokenContract extends BaseContract {
): Promise<void
> {
const self = this as any as ERC721TokenContract;
- const functionSignature = 'setApprovalForAll(address,bool)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_operator,
- _approved
- ] = BaseContract._formatABIDataItemList(inputAbi, [_operator,
- _approved
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_operator,
- _approved
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.setApprovalForAll;
- const encodedData = ethersFunction.encode([_operator,
+ const encodedData = self._strictEncodeArguments('setApprovalForAll(address,bool)', [_operator,
_approved
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -644,11 +478,12 @@ export class ERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'setApprovalForAll'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('setApprovalForAll(address,bool)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public safeTransferFrom2 = {
@@ -660,22 +495,7 @@ export class ERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ERC721TokenContract;
- const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256,bytes)').inputs;
- [_from,
- _to,
- _tokenId,
- _data
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId,
- _data
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
- _to,
- _tokenId,
- _data
- ]);
- const encodedData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256,bytes)').functions.safeTransferFrom.encode([_from,
+ const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [_from,
_to,
_tokenId,
_data
@@ -706,17 +526,7 @@ export class ERC721TokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ERC721TokenContract;
- const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256,bytes)').inputs;
- [_from,
- _to,
- _tokenId,
- _data
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId,
- _data
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256,bytes)').functions.safeTransferFrom.encode([_from,
+ const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [_from,
_to,
_tokenId,
_data
@@ -739,17 +549,7 @@ export class ERC721TokenContract extends BaseContract {
_data: string,
): string {
const self = this as any as ERC721TokenContract;
- const inputAbi = self._lookupAbi('safeTransferFrom(address,address,uint256,bytes)').inputs;
- [_from,
- _to,
- _tokenId,
- _data
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId,
- _data
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('safeTransferFrom(address,address,uint256,bytes)').functions.safeTransferFrom.encode([_from,
+ const abiEncodedTransactionData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [_from,
_to,
_tokenId,
_data
@@ -766,24 +566,7 @@ export class ERC721TokenContract extends BaseContract {
): Promise<void
> {
const self = this as any as ERC721TokenContract;
- const functionSignature = 'safeTransferFrom(address,address,uint256,bytes)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_from,
- _to,
- _tokenId,
- _data
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _tokenId,
- _data
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
- _to,
- _tokenId,
- _data
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.safeTransferFrom;
- const encodedData = ethersFunction.encode([_from,
+ const encodedData = self._strictEncodeArguments('safeTransferFrom(address,address,uint256,bytes)', [_from,
_to,
_tokenId,
_data
@@ -798,11 +581,12 @@ export class ERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'safeTransferFrom'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('safeTransferFrom(address,address,uint256,bytes)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public isApprovedForAll = {
@@ -814,18 +598,7 @@ export class ERC721TokenContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as ERC721TokenContract;
- const functionSignature = 'isApprovedForAll(address,address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_owner,
- _operator
- ] = BaseContract._formatABIDataItemList(inputAbi, [_owner,
- _operator
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner,
- _operator
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.isApprovedForAll;
- const encodedData = ethersFunction.encode([_owner,
+ const encodedData = self._strictEncodeArguments('isApprovedForAll(address,address)', [_owner,
_operator
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -838,11 +611,12 @@ export class ERC721TokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'isApprovedForAll'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('isApprovedForAll(address,address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public static async deployFrom0xArtifactAsync(
@@ -888,7 +662,7 @@ export class ERC721TokenContract extends BaseContract {
}
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
super('ERC721Token', abi, address, provider, txDefaults);
- classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
+ classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count
// tslint:enable:no-unbound-method
diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts b/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts
index 11b5e7024..146fa7c2a 100644
--- a/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts
@@ -78,15 +78,7 @@ export class ExchangeContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'filled(bytes32)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [index_0
- ] = BaseContract._formatABIDataItemList(inputAbi, [index_0
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.filled;
- const encodedData = ethersFunction.encode([index_0
+ const encodedData = self._strictEncodeArguments('filled(bytes32)', [index_0
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -98,11 +90,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'filled'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('filled(bytes32)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public batchFillOrders = {
@@ -113,19 +106,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('batchFillOrders(tuple[],uint256[],bytes[])').inputs;
- [orders,
- takerAssetFillAmounts,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAssetFillAmounts,
- signatures
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
- takerAssetFillAmounts,
- signatures
- ]);
- const encodedData = self._lookupEthersInterface('batchFillOrders(tuple[],uint256[],bytes[])').functions.batchFillOrders.encode([orders,
+ const encodedData = self._strictEncodeArguments('batchFillOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256[],bytes[])', [orders,
takerAssetFillAmounts,
signatures
]);
@@ -153,15 +134,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('batchFillOrders(tuple[],uint256[],bytes[])').inputs;
- [orders,
- takerAssetFillAmounts,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAssetFillAmounts,
- signatures
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('batchFillOrders(tuple[],uint256[],bytes[])').functions.batchFillOrders.encode([orders,
+ const encodedData = self._strictEncodeArguments('batchFillOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256[],bytes[])', [orders,
takerAssetFillAmounts,
signatures
]);
@@ -182,15 +155,7 @@ export class ExchangeContract extends BaseContract {
signatures: string[],
): string {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('batchFillOrders(tuple[],uint256[],bytes[])').inputs;
- [orders,
- takerAssetFillAmounts,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAssetFillAmounts,
- signatures
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('batchFillOrders(tuple[],uint256[],bytes[])').functions.batchFillOrders.encode([orders,
+ const abiEncodedTransactionData = self._strictEncodeArguments('batchFillOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256[],bytes[])', [orders,
takerAssetFillAmounts,
signatures
]);
@@ -205,21 +170,7 @@ export class ExchangeContract extends BaseContract {
): Promise<{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'batchFillOrders(tuple[],uint256[],bytes[])';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [orders,
- takerAssetFillAmounts,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAssetFillAmounts,
- signatures
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
- takerAssetFillAmounts,
- signatures
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.batchFillOrders;
- const encodedData = ethersFunction.encode([orders,
+ const encodedData = self._strictEncodeArguments('batchFillOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256[],bytes[])', [orders,
takerAssetFillAmounts,
signatures
]);
@@ -233,11 +184,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'batchFillOrders'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('batchFillOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256[],bytes[])');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public cancelled = {
@@ -248,15 +200,7 @@ export class ExchangeContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'cancelled(bytes32)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [index_0
- ] = BaseContract._formatABIDataItemList(inputAbi, [index_0
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.cancelled;
- const encodedData = ethersFunction.encode([index_0
+ const encodedData = self._strictEncodeArguments('cancelled(bytes32)', [index_0
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -268,11 +212,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'cancelled'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('cancelled(bytes32)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public preSign = {
@@ -283,19 +228,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('preSign(bytes32,address,bytes)').inputs;
- [hash,
- signerAddress,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [hash,
- signerAddress,
- signature
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [hash,
- signerAddress,
- signature
- ]);
- const encodedData = self._lookupEthersInterface('preSign(bytes32,address,bytes)').functions.preSign.encode([hash,
+ const encodedData = self._strictEncodeArguments('preSign(bytes32,address,bytes)', [hash,
signerAddress,
signature
]);
@@ -323,15 +256,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('preSign(bytes32,address,bytes)').inputs;
- [hash,
- signerAddress,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [hash,
- signerAddress,
- signature
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('preSign(bytes32,address,bytes)').functions.preSign.encode([hash,
+ const encodedData = self._strictEncodeArguments('preSign(bytes32,address,bytes)', [hash,
signerAddress,
signature
]);
@@ -352,15 +277,7 @@ export class ExchangeContract extends BaseContract {
signature: string,
): string {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('preSign(bytes32,address,bytes)').inputs;
- [hash,
- signerAddress,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [hash,
- signerAddress,
- signature
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('preSign(bytes32,address,bytes)').functions.preSign.encode([hash,
+ const abiEncodedTransactionData = self._strictEncodeArguments('preSign(bytes32,address,bytes)', [hash,
signerAddress,
signature
]);
@@ -375,21 +292,7 @@ export class ExchangeContract extends BaseContract {
): Promise<void
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'preSign(bytes32,address,bytes)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [hash,
- signerAddress,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [hash,
- signerAddress,
- signature
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [hash,
- signerAddress,
- signature
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.preSign;
- const encodedData = ethersFunction.encode([hash,
+ const encodedData = self._strictEncodeArguments('preSign(bytes32,address,bytes)', [hash,
signerAddress,
signature
]);
@@ -403,11 +306,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'preSign'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('preSign(bytes32,address,bytes)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public matchOrders = {
@@ -419,22 +323,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('matchOrders({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},{address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},bytes,bytes)').inputs;
- [leftOrder,
- rightOrder,
- leftSignature,
- rightSignature
- ] = BaseContract._formatABIDataItemList(inputAbi, [leftOrder,
- rightOrder,
- leftSignature,
- rightSignature
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [leftOrder,
- rightOrder,
- leftSignature,
- rightSignature
- ]);
- const encodedData = self._lookupEthersInterface('matchOrders({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},{address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},bytes,bytes)').functions.matchOrders.encode([leftOrder,
+ const encodedData = self._strictEncodeArguments('matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)', [leftOrder,
rightOrder,
leftSignature,
rightSignature
@@ -465,17 +354,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('matchOrders({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},{address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},bytes,bytes)').inputs;
- [leftOrder,
- rightOrder,
- leftSignature,
- rightSignature
- ] = BaseContract._formatABIDataItemList(inputAbi, [leftOrder,
- rightOrder,
- leftSignature,
- rightSignature
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('matchOrders({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},{address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},bytes,bytes)').functions.matchOrders.encode([leftOrder,
+ const encodedData = self._strictEncodeArguments('matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)', [leftOrder,
rightOrder,
leftSignature,
rightSignature
@@ -498,17 +377,7 @@ export class ExchangeContract extends BaseContract {
rightSignature: string,
): string {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('matchOrders({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},{address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},bytes,bytes)').inputs;
- [leftOrder,
- rightOrder,
- leftSignature,
- rightSignature
- ] = BaseContract._formatABIDataItemList(inputAbi, [leftOrder,
- rightOrder,
- leftSignature,
- rightSignature
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('matchOrders({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},{address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},bytes,bytes)').functions.matchOrders.encode([leftOrder,
+ const abiEncodedTransactionData = self._strictEncodeArguments('matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)', [leftOrder,
rightOrder,
leftSignature,
rightSignature
@@ -525,24 +394,7 @@ export class ExchangeContract extends BaseContract {
): Promise<{left: {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber};right: {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber};leftMakerAssetSpreadAmount: BigNumber}
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'matchOrders({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},{address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},bytes,bytes)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [leftOrder,
- rightOrder,
- leftSignature,
- rightSignature
- ] = BaseContract._formatABIDataItemList(inputAbi, [leftOrder,
- rightOrder,
- leftSignature,
- rightSignature
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [leftOrder,
- rightOrder,
- leftSignature,
- rightSignature
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.matchOrders;
- const encodedData = ethersFunction.encode([leftOrder,
+ const encodedData = self._strictEncodeArguments('matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)', [leftOrder,
rightOrder,
leftSignature,
rightSignature
@@ -557,11 +409,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'matchOrders'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<{left: {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber};right: {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber};leftMakerAssetSpreadAmount: BigNumber}
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public fillOrderNoThrow = {
@@ -572,19 +425,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('fillOrderNoThrow({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},uint256,bytes)').inputs;
- [order,
- takerAssetFillAmount,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [order,
- takerAssetFillAmount,
- signature
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [order,
- takerAssetFillAmount,
- signature
- ]);
- const encodedData = self._lookupEthersInterface('fillOrderNoThrow({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},uint256,bytes)').functions.fillOrderNoThrow.encode([order,
+ const encodedData = self._strictEncodeArguments('fillOrderNoThrow((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)', [order,
takerAssetFillAmount,
signature
]);
@@ -612,15 +453,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('fillOrderNoThrow({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},uint256,bytes)').inputs;
- [order,
- takerAssetFillAmount,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [order,
- takerAssetFillAmount,
- signature
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('fillOrderNoThrow({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},uint256,bytes)').functions.fillOrderNoThrow.encode([order,
+ const encodedData = self._strictEncodeArguments('fillOrderNoThrow((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)', [order,
takerAssetFillAmount,
signature
]);
@@ -641,15 +474,7 @@ export class ExchangeContract extends BaseContract {
signature: string,
): string {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('fillOrderNoThrow({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},uint256,bytes)').inputs;
- [order,
- takerAssetFillAmount,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [order,
- takerAssetFillAmount,
- signature
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('fillOrderNoThrow({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},uint256,bytes)').functions.fillOrderNoThrow.encode([order,
+ const abiEncodedTransactionData = self._strictEncodeArguments('fillOrderNoThrow((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)', [order,
takerAssetFillAmount,
signature
]);
@@ -664,21 +489,7 @@ export class ExchangeContract extends BaseContract {
): Promise<{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'fillOrderNoThrow({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},uint256,bytes)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [order,
- takerAssetFillAmount,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [order,
- takerAssetFillAmount,
- signature
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [order,
- takerAssetFillAmount,
- signature
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.fillOrderNoThrow;
- const encodedData = ethersFunction.encode([order,
+ const encodedData = self._strictEncodeArguments('fillOrderNoThrow((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)', [order,
takerAssetFillAmount,
signature
]);
@@ -692,11 +503,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'fillOrderNoThrow'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('fillOrderNoThrow((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public assetProxies = {
@@ -707,15 +519,7 @@ export class ExchangeContract extends BaseContract {
): Promise<string
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'assetProxies(bytes4)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [index_0
- ] = BaseContract._formatABIDataItemList(inputAbi, [index_0
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.assetProxies;
- const encodedData = ethersFunction.encode([index_0
+ const encodedData = self._strictEncodeArguments('assetProxies(bytes4)', [index_0
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -727,11 +531,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'assetProxies'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('assetProxies(bytes4)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public batchCancelOrders = {
@@ -740,13 +545,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('batchCancelOrders(tuple[])').inputs;
- [orders
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders
- ]);
- const encodedData = self._lookupEthersInterface('batchCancelOrders(tuple[])').functions.batchCancelOrders.encode([orders
+ const encodedData = self._strictEncodeArguments('batchCancelOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[])', [orders
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -768,11 +567,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('batchCancelOrders(tuple[])').inputs;
- [orders
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('batchCancelOrders(tuple[])').functions.batchCancelOrders.encode([orders
+ const encodedData = self._strictEncodeArguments('batchCancelOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[])', [orders
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -789,11 +584,7 @@ export class ExchangeContract extends BaseContract {
orders: Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>,
): string {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('batchCancelOrders(tuple[])').inputs;
- [orders
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('batchCancelOrders(tuple[])').functions.batchCancelOrders.encode([orders
+ const abiEncodedTransactionData = self._strictEncodeArguments('batchCancelOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[])', [orders
]);
return abiEncodedTransactionData;
},
@@ -804,15 +595,7 @@ export class ExchangeContract extends BaseContract {
): Promise<void
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'batchCancelOrders(tuple[])';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [orders
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.batchCancelOrders;
- const encodedData = ethersFunction.encode([orders
+ const encodedData = self._strictEncodeArguments('batchCancelOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[])', [orders
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -824,11 +607,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'batchCancelOrders'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('batchCancelOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[])');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public batchFillOrKillOrders = {
@@ -839,19 +623,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('batchFillOrKillOrders(tuple[],uint256[],bytes[])').inputs;
- [orders,
- takerAssetFillAmounts,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAssetFillAmounts,
- signatures
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
- takerAssetFillAmounts,
- signatures
- ]);
- const encodedData = self._lookupEthersInterface('batchFillOrKillOrders(tuple[],uint256[],bytes[])').functions.batchFillOrKillOrders.encode([orders,
+ const encodedData = self._strictEncodeArguments('batchFillOrKillOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256[],bytes[])', [orders,
takerAssetFillAmounts,
signatures
]);
@@ -879,15 +651,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('batchFillOrKillOrders(tuple[],uint256[],bytes[])').inputs;
- [orders,
- takerAssetFillAmounts,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAssetFillAmounts,
- signatures
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('batchFillOrKillOrders(tuple[],uint256[],bytes[])').functions.batchFillOrKillOrders.encode([orders,
+ const encodedData = self._strictEncodeArguments('batchFillOrKillOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256[],bytes[])', [orders,
takerAssetFillAmounts,
signatures
]);
@@ -908,15 +672,7 @@ export class ExchangeContract extends BaseContract {
signatures: string[],
): string {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('batchFillOrKillOrders(tuple[],uint256[],bytes[])').inputs;
- [orders,
- takerAssetFillAmounts,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAssetFillAmounts,
- signatures
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('batchFillOrKillOrders(tuple[],uint256[],bytes[])').functions.batchFillOrKillOrders.encode([orders,
+ const abiEncodedTransactionData = self._strictEncodeArguments('batchFillOrKillOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256[],bytes[])', [orders,
takerAssetFillAmounts,
signatures
]);
@@ -931,21 +687,7 @@ export class ExchangeContract extends BaseContract {
): Promise<{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'batchFillOrKillOrders(tuple[],uint256[],bytes[])';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [orders,
- takerAssetFillAmounts,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAssetFillAmounts,
- signatures
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
- takerAssetFillAmounts,
- signatures
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.batchFillOrKillOrders;
- const encodedData = ethersFunction.encode([orders,
+ const encodedData = self._strictEncodeArguments('batchFillOrKillOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256[],bytes[])', [orders,
takerAssetFillAmounts,
signatures
]);
@@ -959,11 +701,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'batchFillOrKillOrders'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('batchFillOrKillOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256[],bytes[])');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public cancelOrdersUpTo = {
@@ -972,13 +715,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('cancelOrdersUpTo(uint256)').inputs;
- [targetOrderEpoch
- ] = BaseContract._formatABIDataItemList(inputAbi, [targetOrderEpoch
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [targetOrderEpoch
- ]);
- const encodedData = self._lookupEthersInterface('cancelOrdersUpTo(uint256)').functions.cancelOrdersUpTo.encode([targetOrderEpoch
+ const encodedData = self._strictEncodeArguments('cancelOrdersUpTo(uint256)', [targetOrderEpoch
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -1000,11 +737,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('cancelOrdersUpTo(uint256)').inputs;
- [targetOrderEpoch
- ] = BaseContract._formatABIDataItemList(inputAbi, [targetOrderEpoch
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('cancelOrdersUpTo(uint256)').functions.cancelOrdersUpTo.encode([targetOrderEpoch
+ const encodedData = self._strictEncodeArguments('cancelOrdersUpTo(uint256)', [targetOrderEpoch
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -1021,11 +754,7 @@ export class ExchangeContract extends BaseContract {
targetOrderEpoch: BigNumber,
): string {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('cancelOrdersUpTo(uint256)').inputs;
- [targetOrderEpoch
- ] = BaseContract._formatABIDataItemList(inputAbi, [targetOrderEpoch
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('cancelOrdersUpTo(uint256)').functions.cancelOrdersUpTo.encode([targetOrderEpoch
+ const abiEncodedTransactionData = self._strictEncodeArguments('cancelOrdersUpTo(uint256)', [targetOrderEpoch
]);
return abiEncodedTransactionData;
},
@@ -1036,15 +765,7 @@ export class ExchangeContract extends BaseContract {
): Promise<void
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'cancelOrdersUpTo(uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [targetOrderEpoch
- ] = BaseContract._formatABIDataItemList(inputAbi, [targetOrderEpoch
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [targetOrderEpoch
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.cancelOrdersUpTo;
- const encodedData = ethersFunction.encode([targetOrderEpoch
+ const encodedData = self._strictEncodeArguments('cancelOrdersUpTo(uint256)', [targetOrderEpoch
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -1056,11 +777,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'cancelOrdersUpTo'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('cancelOrdersUpTo(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public batchFillOrdersNoThrow = {
@@ -1071,19 +793,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('batchFillOrdersNoThrow(tuple[],uint256[],bytes[])').inputs;
- [orders,
- takerAssetFillAmounts,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAssetFillAmounts,
- signatures
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
- takerAssetFillAmounts,
- signatures
- ]);
- const encodedData = self._lookupEthersInterface('batchFillOrdersNoThrow(tuple[],uint256[],bytes[])').functions.batchFillOrdersNoThrow.encode([orders,
+ const encodedData = self._strictEncodeArguments('batchFillOrdersNoThrow((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256[],bytes[])', [orders,
takerAssetFillAmounts,
signatures
]);
@@ -1111,15 +821,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('batchFillOrdersNoThrow(tuple[],uint256[],bytes[])').inputs;
- [orders,
- takerAssetFillAmounts,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAssetFillAmounts,
- signatures
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('batchFillOrdersNoThrow(tuple[],uint256[],bytes[])').functions.batchFillOrdersNoThrow.encode([orders,
+ const encodedData = self._strictEncodeArguments('batchFillOrdersNoThrow((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256[],bytes[])', [orders,
takerAssetFillAmounts,
signatures
]);
@@ -1140,15 +842,7 @@ export class ExchangeContract extends BaseContract {
signatures: string[],
): string {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('batchFillOrdersNoThrow(tuple[],uint256[],bytes[])').inputs;
- [orders,
- takerAssetFillAmounts,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAssetFillAmounts,
- signatures
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('batchFillOrdersNoThrow(tuple[],uint256[],bytes[])').functions.batchFillOrdersNoThrow.encode([orders,
+ const abiEncodedTransactionData = self._strictEncodeArguments('batchFillOrdersNoThrow((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256[],bytes[])', [orders,
takerAssetFillAmounts,
signatures
]);
@@ -1163,21 +857,7 @@ export class ExchangeContract extends BaseContract {
): Promise<{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'batchFillOrdersNoThrow(tuple[],uint256[],bytes[])';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [orders,
- takerAssetFillAmounts,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAssetFillAmounts,
- signatures
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
- takerAssetFillAmounts,
- signatures
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.batchFillOrdersNoThrow;
- const encodedData = ethersFunction.encode([orders,
+ const encodedData = self._strictEncodeArguments('batchFillOrdersNoThrow((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256[],bytes[])', [orders,
takerAssetFillAmounts,
signatures
]);
@@ -1191,11 +871,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'batchFillOrdersNoThrow'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('batchFillOrdersNoThrow((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256[],bytes[])');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public getAssetProxy = {
@@ -1206,15 +887,7 @@ export class ExchangeContract extends BaseContract {
): Promise<string
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'getAssetProxy(bytes4)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [assetProxyId
- ] = BaseContract._formatABIDataItemList(inputAbi, [assetProxyId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [assetProxyId
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getAssetProxy;
- const encodedData = ethersFunction.encode([assetProxyId
+ const encodedData = self._strictEncodeArguments('getAssetProxy(bytes4)', [assetProxyId
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -1226,11 +899,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getAssetProxy'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('getAssetProxy(bytes4)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public transactions = {
@@ -1241,15 +915,7 @@ export class ExchangeContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'transactions(bytes32)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [index_0
- ] = BaseContract._formatABIDataItemList(inputAbi, [index_0
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transactions;
- const encodedData = ethersFunction.encode([index_0
+ const encodedData = self._strictEncodeArguments('transactions(bytes32)', [index_0
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -1261,11 +927,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'transactions'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('transactions(bytes32)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public fillOrKillOrder = {
@@ -1276,19 +943,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('fillOrKillOrder({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},uint256,bytes)').inputs;
- [order,
- takerAssetFillAmount,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [order,
- takerAssetFillAmount,
- signature
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [order,
- takerAssetFillAmount,
- signature
- ]);
- const encodedData = self._lookupEthersInterface('fillOrKillOrder({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},uint256,bytes)').functions.fillOrKillOrder.encode([order,
+ const encodedData = self._strictEncodeArguments('fillOrKillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)', [order,
takerAssetFillAmount,
signature
]);
@@ -1316,15 +971,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('fillOrKillOrder({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},uint256,bytes)').inputs;
- [order,
- takerAssetFillAmount,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [order,
- takerAssetFillAmount,
- signature
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('fillOrKillOrder({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},uint256,bytes)').functions.fillOrKillOrder.encode([order,
+ const encodedData = self._strictEncodeArguments('fillOrKillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)', [order,
takerAssetFillAmount,
signature
]);
@@ -1345,15 +992,7 @@ export class ExchangeContract extends BaseContract {
signature: string,
): string {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('fillOrKillOrder({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},uint256,bytes)').inputs;
- [order,
- takerAssetFillAmount,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [order,
- takerAssetFillAmount,
- signature
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('fillOrKillOrder({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},uint256,bytes)').functions.fillOrKillOrder.encode([order,
+ const abiEncodedTransactionData = self._strictEncodeArguments('fillOrKillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)', [order,
takerAssetFillAmount,
signature
]);
@@ -1368,21 +1007,7 @@ export class ExchangeContract extends BaseContract {
): Promise<{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'fillOrKillOrder({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},uint256,bytes)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [order,
- takerAssetFillAmount,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [order,
- takerAssetFillAmount,
- signature
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [order,
- takerAssetFillAmount,
- signature
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.fillOrKillOrder;
- const encodedData = ethersFunction.encode([order,
+ const encodedData = self._strictEncodeArguments('fillOrKillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)', [order,
takerAssetFillAmount,
signature
]);
@@ -1396,11 +1021,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'fillOrKillOrder'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('fillOrKillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public setSignatureValidatorApproval = {
@@ -1410,16 +1036,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('setSignatureValidatorApproval(address,bool)').inputs;
- [validatorAddress,
- approval
- ] = BaseContract._formatABIDataItemList(inputAbi, [validatorAddress,
- approval
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [validatorAddress,
- approval
- ]);
- const encodedData = self._lookupEthersInterface('setSignatureValidatorApproval(address,bool)').functions.setSignatureValidatorApproval.encode([validatorAddress,
+ const encodedData = self._strictEncodeArguments('setSignatureValidatorApproval(address,bool)', [validatorAddress,
approval
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -1444,13 +1061,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('setSignatureValidatorApproval(address,bool)').inputs;
- [validatorAddress,
- approval
- ] = BaseContract._formatABIDataItemList(inputAbi, [validatorAddress,
- approval
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('setSignatureValidatorApproval(address,bool)').functions.setSignatureValidatorApproval.encode([validatorAddress,
+ const encodedData = self._strictEncodeArguments('setSignatureValidatorApproval(address,bool)', [validatorAddress,
approval
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -1469,13 +1080,7 @@ export class ExchangeContract extends BaseContract {
approval: boolean,
): string {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('setSignatureValidatorApproval(address,bool)').inputs;
- [validatorAddress,
- approval
- ] = BaseContract._formatABIDataItemList(inputAbi, [validatorAddress,
- approval
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('setSignatureValidatorApproval(address,bool)').functions.setSignatureValidatorApproval.encode([validatorAddress,
+ const abiEncodedTransactionData = self._strictEncodeArguments('setSignatureValidatorApproval(address,bool)', [validatorAddress,
approval
]);
return abiEncodedTransactionData;
@@ -1488,18 +1093,7 @@ export class ExchangeContract extends BaseContract {
): Promise<void
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'setSignatureValidatorApproval(address,bool)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [validatorAddress,
- approval
- ] = BaseContract._formatABIDataItemList(inputAbi, [validatorAddress,
- approval
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [validatorAddress,
- approval
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.setSignatureValidatorApproval;
- const encodedData = ethersFunction.encode([validatorAddress,
+ const encodedData = self._strictEncodeArguments('setSignatureValidatorApproval(address,bool)', [validatorAddress,
approval
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -1512,11 +1106,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'setSignatureValidatorApproval'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('setSignatureValidatorApproval(address,bool)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public allowedValidators = {
@@ -1528,18 +1123,7 @@ export class ExchangeContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'allowedValidators(address,address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [index_0,
- index_1
- ] = BaseContract._formatABIDataItemList(inputAbi, [index_0,
- index_1
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0,
- index_1
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.allowedValidators;
- const encodedData = ethersFunction.encode([index_0,
+ const encodedData = self._strictEncodeArguments('allowedValidators(address,address)', [index_0,
index_1
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -1552,11 +1136,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'allowedValidators'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('allowedValidators(address,address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public marketSellOrders = {
@@ -1567,19 +1152,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('marketSellOrders(tuple[],uint256,bytes[])').inputs;
- [orders,
- takerAssetFillAmount,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAssetFillAmount,
- signatures
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
- takerAssetFillAmount,
- signatures
- ]);
- const encodedData = self._lookupEthersInterface('marketSellOrders(tuple[],uint256,bytes[])').functions.marketSellOrders.encode([orders,
+ const encodedData = self._strictEncodeArguments('marketSellOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[])', [orders,
takerAssetFillAmount,
signatures
]);
@@ -1607,15 +1180,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('marketSellOrders(tuple[],uint256,bytes[])').inputs;
- [orders,
- takerAssetFillAmount,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAssetFillAmount,
- signatures
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('marketSellOrders(tuple[],uint256,bytes[])').functions.marketSellOrders.encode([orders,
+ const encodedData = self._strictEncodeArguments('marketSellOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[])', [orders,
takerAssetFillAmount,
signatures
]);
@@ -1636,15 +1201,7 @@ export class ExchangeContract extends BaseContract {
signatures: string[],
): string {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('marketSellOrders(tuple[],uint256,bytes[])').inputs;
- [orders,
- takerAssetFillAmount,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAssetFillAmount,
- signatures
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('marketSellOrders(tuple[],uint256,bytes[])').functions.marketSellOrders.encode([orders,
+ const abiEncodedTransactionData = self._strictEncodeArguments('marketSellOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[])', [orders,
takerAssetFillAmount,
signatures
]);
@@ -1659,21 +1216,7 @@ export class ExchangeContract extends BaseContract {
): Promise<{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'marketSellOrders(tuple[],uint256,bytes[])';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [orders,
- takerAssetFillAmount,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAssetFillAmount,
- signatures
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
- takerAssetFillAmount,
- signatures
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.marketSellOrders;
- const encodedData = ethersFunction.encode([orders,
+ const encodedData = self._strictEncodeArguments('marketSellOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[])', [orders,
takerAssetFillAmount,
signatures
]);
@@ -1687,11 +1230,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'marketSellOrders'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('marketSellOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[])');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public getOrdersInfo = {
@@ -1702,15 +1246,7 @@ export class ExchangeContract extends BaseContract {
): Promise<Array<{orderStatus: number;orderHash: string;orderTakerAssetFilledAmount: BigNumber}>
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'getOrdersInfo(tuple[])';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [orders
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getOrdersInfo;
- const encodedData = ethersFunction.encode([orders
+ const encodedData = self._strictEncodeArguments('getOrdersInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[])', [orders
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -1722,11 +1258,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getOrdersInfo'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('getOrdersInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[])');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<Array<{orderStatus: number;orderHash: string;orderTakerAssetFilledAmount: BigNumber}>
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public preSigned = {
@@ -1738,18 +1275,7 @@ export class ExchangeContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'preSigned(bytes32,address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [index_0,
- index_1
- ] = BaseContract._formatABIDataItemList(inputAbi, [index_0,
- index_1
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0,
- index_1
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.preSigned;
- const encodedData = ethersFunction.encode([index_0,
+ const encodedData = self._strictEncodeArguments('preSigned(bytes32,address)', [index_0,
index_1
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -1762,11 +1288,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'preSigned'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('preSigned(bytes32,address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public owner = {
@@ -1776,12 +1303,7 @@ export class ExchangeContract extends BaseContract {
): Promise<string
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'owner()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.owner;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('owner()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -1792,11 +1314,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'owner'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('owner()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public isValidSignature = {
@@ -1809,21 +1332,7 @@ export class ExchangeContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'isValidSignature(bytes32,address,bytes)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [hash,
- signerAddress,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [hash,
- signerAddress,
- signature
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [hash,
- signerAddress,
- signature
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.isValidSignature;
- const encodedData = ethersFunction.encode([hash,
+ const encodedData = self._strictEncodeArguments('isValidSignature(bytes32,address,bytes)', [hash,
signerAddress,
signature
]);
@@ -1837,11 +1346,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'isValidSignature'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('isValidSignature(bytes32,address,bytes)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public marketBuyOrdersNoThrow = {
@@ -1852,19 +1362,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('marketBuyOrdersNoThrow(tuple[],uint256,bytes[])').inputs;
- [orders,
- makerAssetFillAmount,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- makerAssetFillAmount,
- signatures
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
- makerAssetFillAmount,
- signatures
- ]);
- const encodedData = self._lookupEthersInterface('marketBuyOrdersNoThrow(tuple[],uint256,bytes[])').functions.marketBuyOrdersNoThrow.encode([orders,
+ const encodedData = self._strictEncodeArguments('marketBuyOrdersNoThrow((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[])', [orders,
makerAssetFillAmount,
signatures
]);
@@ -1892,15 +1390,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('marketBuyOrdersNoThrow(tuple[],uint256,bytes[])').inputs;
- [orders,
- makerAssetFillAmount,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- makerAssetFillAmount,
- signatures
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('marketBuyOrdersNoThrow(tuple[],uint256,bytes[])').functions.marketBuyOrdersNoThrow.encode([orders,
+ const encodedData = self._strictEncodeArguments('marketBuyOrdersNoThrow((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[])', [orders,
makerAssetFillAmount,
signatures
]);
@@ -1921,15 +1411,7 @@ export class ExchangeContract extends BaseContract {
signatures: string[],
): string {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('marketBuyOrdersNoThrow(tuple[],uint256,bytes[])').inputs;
- [orders,
- makerAssetFillAmount,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- makerAssetFillAmount,
- signatures
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('marketBuyOrdersNoThrow(tuple[],uint256,bytes[])').functions.marketBuyOrdersNoThrow.encode([orders,
+ const abiEncodedTransactionData = self._strictEncodeArguments('marketBuyOrdersNoThrow((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[])', [orders,
makerAssetFillAmount,
signatures
]);
@@ -1944,21 +1426,7 @@ export class ExchangeContract extends BaseContract {
): Promise<{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'marketBuyOrdersNoThrow(tuple[],uint256,bytes[])';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [orders,
- makerAssetFillAmount,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- makerAssetFillAmount,
- signatures
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
- makerAssetFillAmount,
- signatures
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.marketBuyOrdersNoThrow;
- const encodedData = ethersFunction.encode([orders,
+ const encodedData = self._strictEncodeArguments('marketBuyOrdersNoThrow((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[])', [orders,
makerAssetFillAmount,
signatures
]);
@@ -1972,11 +1440,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'marketBuyOrdersNoThrow'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('marketBuyOrdersNoThrow((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[])');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public fillOrder = {
@@ -1987,19 +1456,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('fillOrder({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},uint256,bytes)').inputs;
- [order,
- takerAssetFillAmount,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [order,
- takerAssetFillAmount,
- signature
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [order,
- takerAssetFillAmount,
- signature
- ]);
- const encodedData = self._lookupEthersInterface('fillOrder({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},uint256,bytes)').functions.fillOrder.encode([order,
+ const encodedData = self._strictEncodeArguments('fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)', [order,
takerAssetFillAmount,
signature
]);
@@ -2027,15 +1484,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('fillOrder({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},uint256,bytes)').inputs;
- [order,
- takerAssetFillAmount,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [order,
- takerAssetFillAmount,
- signature
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('fillOrder({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},uint256,bytes)').functions.fillOrder.encode([order,
+ const encodedData = self._strictEncodeArguments('fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)', [order,
takerAssetFillAmount,
signature
]);
@@ -2056,15 +1505,7 @@ export class ExchangeContract extends BaseContract {
signature: string,
): string {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('fillOrder({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},uint256,bytes)').inputs;
- [order,
- takerAssetFillAmount,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [order,
- takerAssetFillAmount,
- signature
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('fillOrder({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},uint256,bytes)').functions.fillOrder.encode([order,
+ const abiEncodedTransactionData = self._strictEncodeArguments('fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)', [order,
takerAssetFillAmount,
signature
]);
@@ -2079,21 +1520,7 @@ export class ExchangeContract extends BaseContract {
): Promise<{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'fillOrder({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},uint256,bytes)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [order,
- takerAssetFillAmount,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [order,
- takerAssetFillAmount,
- signature
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [order,
- takerAssetFillAmount,
- signature
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.fillOrder;
- const encodedData = ethersFunction.encode([order,
+ const encodedData = self._strictEncodeArguments('fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)', [order,
takerAssetFillAmount,
signature
]);
@@ -2107,11 +1534,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'fillOrder'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('fillOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),uint256,bytes)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public executeTransaction = {
@@ -2123,22 +1551,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('executeTransaction(uint256,address,bytes,bytes)').inputs;
- [salt,
- signerAddress,
- data,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [salt,
- signerAddress,
- data,
- signature
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [salt,
- signerAddress,
- data,
- signature
- ]);
- const encodedData = self._lookupEthersInterface('executeTransaction(uint256,address,bytes,bytes)').functions.executeTransaction.encode([salt,
+ const encodedData = self._strictEncodeArguments('executeTransaction(uint256,address,bytes,bytes)', [salt,
signerAddress,
data,
signature
@@ -2169,17 +1582,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('executeTransaction(uint256,address,bytes,bytes)').inputs;
- [salt,
- signerAddress,
- data,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [salt,
- signerAddress,
- data,
- signature
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('executeTransaction(uint256,address,bytes,bytes)').functions.executeTransaction.encode([salt,
+ const encodedData = self._strictEncodeArguments('executeTransaction(uint256,address,bytes,bytes)', [salt,
signerAddress,
data,
signature
@@ -2202,17 +1605,7 @@ export class ExchangeContract extends BaseContract {
signature: string,
): string {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('executeTransaction(uint256,address,bytes,bytes)').inputs;
- [salt,
- signerAddress,
- data,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [salt,
- signerAddress,
- data,
- signature
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('executeTransaction(uint256,address,bytes,bytes)').functions.executeTransaction.encode([salt,
+ const abiEncodedTransactionData = self._strictEncodeArguments('executeTransaction(uint256,address,bytes,bytes)', [salt,
signerAddress,
data,
signature
@@ -2229,24 +1622,7 @@ export class ExchangeContract extends BaseContract {
): Promise<void
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'executeTransaction(uint256,address,bytes,bytes)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [salt,
- signerAddress,
- data,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [salt,
- signerAddress,
- data,
- signature
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [salt,
- signerAddress,
- data,
- signature
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.executeTransaction;
- const encodedData = ethersFunction.encode([salt,
+ const encodedData = self._strictEncodeArguments('executeTransaction(uint256,address,bytes,bytes)', [salt,
signerAddress,
data,
signature
@@ -2261,11 +1637,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'executeTransaction'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('executeTransaction(uint256,address,bytes,bytes)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public registerAssetProxy = {
@@ -2274,13 +1651,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('registerAssetProxy(address)').inputs;
- [assetProxy
- ] = BaseContract._formatABIDataItemList(inputAbi, [assetProxy
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [assetProxy
- ]);
- const encodedData = self._lookupEthersInterface('registerAssetProxy(address)').functions.registerAssetProxy.encode([assetProxy
+ const encodedData = self._strictEncodeArguments('registerAssetProxy(address)', [assetProxy
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -2302,11 +1673,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('registerAssetProxy(address)').inputs;
- [assetProxy
- ] = BaseContract._formatABIDataItemList(inputAbi, [assetProxy
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('registerAssetProxy(address)').functions.registerAssetProxy.encode([assetProxy
+ const encodedData = self._strictEncodeArguments('registerAssetProxy(address)', [assetProxy
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -2323,11 +1690,7 @@ export class ExchangeContract extends BaseContract {
assetProxy: string,
): string {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('registerAssetProxy(address)').inputs;
- [assetProxy
- ] = BaseContract._formatABIDataItemList(inputAbi, [assetProxy
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('registerAssetProxy(address)').functions.registerAssetProxy.encode([assetProxy
+ const abiEncodedTransactionData = self._strictEncodeArguments('registerAssetProxy(address)', [assetProxy
]);
return abiEncodedTransactionData;
},
@@ -2338,15 +1701,7 @@ export class ExchangeContract extends BaseContract {
): Promise<void
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'registerAssetProxy(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [assetProxy
- ] = BaseContract._formatABIDataItemList(inputAbi, [assetProxy
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [assetProxy
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.registerAssetProxy;
- const encodedData = ethersFunction.encode([assetProxy
+ const encodedData = self._strictEncodeArguments('registerAssetProxy(address)', [assetProxy
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -2358,11 +1713,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'registerAssetProxy'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('registerAssetProxy(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public getOrderInfo = {
@@ -2373,15 +1729,7 @@ export class ExchangeContract extends BaseContract {
): Promise<{orderStatus: number;orderHash: string;orderTakerAssetFilledAmount: BigNumber}
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'getOrderInfo({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [order
- ] = BaseContract._formatABIDataItemList(inputAbi, [order
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [order
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getOrderInfo;
- const encodedData = ethersFunction.encode([order
+ const encodedData = self._strictEncodeArguments('getOrderInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))', [order
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -2393,11 +1741,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getOrderInfo'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('getOrderInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<{orderStatus: number;orderHash: string;orderTakerAssetFilledAmount: BigNumber}
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public cancelOrder = {
@@ -2406,13 +1755,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('cancelOrder({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})').inputs;
- [order
- ] = BaseContract._formatABIDataItemList(inputAbi, [order
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [order
- ]);
- const encodedData = self._lookupEthersInterface('cancelOrder({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})').functions.cancelOrder.encode([order
+ const encodedData = self._strictEncodeArguments('cancelOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))', [order
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -2434,11 +1777,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('cancelOrder({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})').inputs;
- [order
- ] = BaseContract._formatABIDataItemList(inputAbi, [order
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('cancelOrder({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})').functions.cancelOrder.encode([order
+ const encodedData = self._strictEncodeArguments('cancelOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))', [order
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -2455,11 +1794,7 @@ export class ExchangeContract extends BaseContract {
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
): string {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('cancelOrder({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})').inputs;
- [order
- ] = BaseContract._formatABIDataItemList(inputAbi, [order
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('cancelOrder({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})').functions.cancelOrder.encode([order
+ const abiEncodedTransactionData = self._strictEncodeArguments('cancelOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))', [order
]);
return abiEncodedTransactionData;
},
@@ -2470,15 +1805,7 @@ export class ExchangeContract extends BaseContract {
): Promise<void
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'cancelOrder({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes})';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [order
- ] = BaseContract._formatABIDataItemList(inputAbi, [order
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [order
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.cancelOrder;
- const encodedData = ethersFunction.encode([order
+ const encodedData = self._strictEncodeArguments('cancelOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))', [order
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -2490,11 +1817,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'cancelOrder'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('cancelOrder((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public orderEpoch = {
@@ -2506,18 +1834,7 @@ export class ExchangeContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'orderEpoch(address,address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [index_0,
- index_1
- ] = BaseContract._formatABIDataItemList(inputAbi, [index_0,
- index_1
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0,
- index_1
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.orderEpoch;
- const encodedData = ethersFunction.encode([index_0,
+ const encodedData = self._strictEncodeArguments('orderEpoch(address,address)', [index_0,
index_1
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -2530,11 +1847,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'orderEpoch'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('orderEpoch(address,address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public ZRX_ASSET_DATA = {
@@ -2544,12 +1862,7 @@ export class ExchangeContract extends BaseContract {
): Promise<string
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'ZRX_ASSET_DATA()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.ZRX_ASSET_DATA;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('ZRX_ASSET_DATA()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -2560,11 +1873,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'ZRX_ASSET_DATA'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('ZRX_ASSET_DATA()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public marketSellOrdersNoThrow = {
@@ -2575,19 +1889,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('marketSellOrdersNoThrow(tuple[],uint256,bytes[])').inputs;
- [orders,
- takerAssetFillAmount,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAssetFillAmount,
- signatures
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
- takerAssetFillAmount,
- signatures
- ]);
- const encodedData = self._lookupEthersInterface('marketSellOrdersNoThrow(tuple[],uint256,bytes[])').functions.marketSellOrdersNoThrow.encode([orders,
+ const encodedData = self._strictEncodeArguments('marketSellOrdersNoThrow((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[])', [orders,
takerAssetFillAmount,
signatures
]);
@@ -2615,15 +1917,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('marketSellOrdersNoThrow(tuple[],uint256,bytes[])').inputs;
- [orders,
- takerAssetFillAmount,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAssetFillAmount,
- signatures
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('marketSellOrdersNoThrow(tuple[],uint256,bytes[])').functions.marketSellOrdersNoThrow.encode([orders,
+ const encodedData = self._strictEncodeArguments('marketSellOrdersNoThrow((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[])', [orders,
takerAssetFillAmount,
signatures
]);
@@ -2644,15 +1938,7 @@ export class ExchangeContract extends BaseContract {
signatures: string[],
): string {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('marketSellOrdersNoThrow(tuple[],uint256,bytes[])').inputs;
- [orders,
- takerAssetFillAmount,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAssetFillAmount,
- signatures
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('marketSellOrdersNoThrow(tuple[],uint256,bytes[])').functions.marketSellOrdersNoThrow.encode([orders,
+ const abiEncodedTransactionData = self._strictEncodeArguments('marketSellOrdersNoThrow((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[])', [orders,
takerAssetFillAmount,
signatures
]);
@@ -2667,21 +1953,7 @@ export class ExchangeContract extends BaseContract {
): Promise<{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'marketSellOrdersNoThrow(tuple[],uint256,bytes[])';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [orders,
- takerAssetFillAmount,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAssetFillAmount,
- signatures
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
- takerAssetFillAmount,
- signatures
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.marketSellOrdersNoThrow;
- const encodedData = ethersFunction.encode([orders,
+ const encodedData = self._strictEncodeArguments('marketSellOrdersNoThrow((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[])', [orders,
takerAssetFillAmount,
signatures
]);
@@ -2695,11 +1967,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'marketSellOrdersNoThrow'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('marketSellOrdersNoThrow((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[])');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public EIP712_DOMAIN_HASH = {
@@ -2709,12 +1982,7 @@ export class ExchangeContract extends BaseContract {
): Promise<string
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'EIP712_DOMAIN_HASH()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.EIP712_DOMAIN_HASH;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('EIP712_DOMAIN_HASH()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -2725,11 +1993,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'EIP712_DOMAIN_HASH'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('EIP712_DOMAIN_HASH()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public marketBuyOrders = {
@@ -2740,19 +2009,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('marketBuyOrders(tuple[],uint256,bytes[])').inputs;
- [orders,
- makerAssetFillAmount,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- makerAssetFillAmount,
- signatures
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
- makerAssetFillAmount,
- signatures
- ]);
- const encodedData = self._lookupEthersInterface('marketBuyOrders(tuple[],uint256,bytes[])').functions.marketBuyOrders.encode([orders,
+ const encodedData = self._strictEncodeArguments('marketBuyOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[])', [orders,
makerAssetFillAmount,
signatures
]);
@@ -2780,15 +2037,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('marketBuyOrders(tuple[],uint256,bytes[])').inputs;
- [orders,
- makerAssetFillAmount,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- makerAssetFillAmount,
- signatures
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('marketBuyOrders(tuple[],uint256,bytes[])').functions.marketBuyOrders.encode([orders,
+ const encodedData = self._strictEncodeArguments('marketBuyOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[])', [orders,
makerAssetFillAmount,
signatures
]);
@@ -2809,15 +2058,7 @@ export class ExchangeContract extends BaseContract {
signatures: string[],
): string {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('marketBuyOrders(tuple[],uint256,bytes[])').inputs;
- [orders,
- makerAssetFillAmount,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- makerAssetFillAmount,
- signatures
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('marketBuyOrders(tuple[],uint256,bytes[])').functions.marketBuyOrders.encode([orders,
+ const abiEncodedTransactionData = self._strictEncodeArguments('marketBuyOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[])', [orders,
makerAssetFillAmount,
signatures
]);
@@ -2832,21 +2073,7 @@ export class ExchangeContract extends BaseContract {
): Promise<{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'marketBuyOrders(tuple[],uint256,bytes[])';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [orders,
- makerAssetFillAmount,
- signatures
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- makerAssetFillAmount,
- signatures
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
- makerAssetFillAmount,
- signatures
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.marketBuyOrders;
- const encodedData = ethersFunction.encode([orders,
+ const encodedData = self._strictEncodeArguments('marketBuyOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[])', [orders,
makerAssetFillAmount,
signatures
]);
@@ -2860,11 +2087,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'marketBuyOrders'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('marketBuyOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[])');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public currentContextAddress = {
@@ -2874,12 +2102,7 @@ export class ExchangeContract extends BaseContract {
): Promise<string
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'currentContextAddress()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.currentContextAddress;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('currentContextAddress()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -2890,11 +2113,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'currentContextAddress'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('currentContextAddress()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public transferOwnership = {
@@ -2903,13 +2127,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
- ]);
- const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
+ const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -2931,11 +2149,7 @@ export class ExchangeContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
+ const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -2952,11 +2166,7 @@ export class ExchangeContract extends BaseContract {
newOwner: string,
): string {
const self = this as any as ExchangeContract;
- const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
+ const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
return abiEncodedTransactionData;
},
@@ -2967,15 +2177,7 @@ export class ExchangeContract extends BaseContract {
): Promise<void
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'transferOwnership(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferOwnership;
- const encodedData = ethersFunction.encode([newOwner
+ const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -2987,11 +2189,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'transferOwnership'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public VERSION = {
@@ -3001,12 +2204,7 @@ export class ExchangeContract extends BaseContract {
): Promise<string
> {
const self = this as any as ExchangeContract;
- const functionSignature = 'VERSION()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.VERSION;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('VERSION()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -3017,11 +2215,12 @@ export class ExchangeContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'VERSION'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('VERSION()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public static async deployFrom0xArtifactAsync(
@@ -3074,7 +2273,7 @@ export class ExchangeContract extends BaseContract {
}
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
super('Exchange', abi, address, provider, txDefaults);
- classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
+ classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count
// tslint:enable:no-unbound-method
diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/forwarder.ts b/packages/abi-gen-wrappers/src/generated-wrappers/forwarder.ts
index 8a88431b3..530320792 100644
--- a/packages/abi-gen-wrappers/src/generated-wrappers/forwarder.ts
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/forwarder.ts
@@ -27,31 +27,7 @@ export class ForwarderContract extends BaseContract {
txData: Partial<TxDataPayable> = {},
): Promise<string> {
const self = this as any as ForwarderContract;
- const inputAbi = self._lookupAbi('marketBuyOrdersWithEth(tuple[],uint256,bytes[],tuple[],bytes[],uint256,address)').inputs;
- [orders,
- makerAssetFillAmount,
- signatures,
- feeOrders,
- feeSignatures,
- feePercentage,
- feeRecipient
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- makerAssetFillAmount,
- signatures,
- feeOrders,
- feeSignatures,
- feePercentage,
- feeRecipient
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
- makerAssetFillAmount,
- signatures,
- feeOrders,
- feeSignatures,
- feePercentage,
- feeRecipient
- ]);
- const encodedData = self._lookupEthersInterface('marketBuyOrdersWithEth(tuple[],uint256,bytes[],tuple[],bytes[],uint256,address)').functions.marketBuyOrdersWithEth.encode([orders,
+ const encodedData = self._strictEncodeArguments('marketBuyOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)', [orders,
makerAssetFillAmount,
signatures,
feeOrders,
@@ -91,23 +67,7 @@ export class ForwarderContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ForwarderContract;
- const inputAbi = self._lookupAbi('marketBuyOrdersWithEth(tuple[],uint256,bytes[],tuple[],bytes[],uint256,address)').inputs;
- [orders,
- makerAssetFillAmount,
- signatures,
- feeOrders,
- feeSignatures,
- feePercentage,
- feeRecipient
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- makerAssetFillAmount,
- signatures,
- feeOrders,
- feeSignatures,
- feePercentage,
- feeRecipient
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('marketBuyOrdersWithEth(tuple[],uint256,bytes[],tuple[],bytes[],uint256,address)').functions.marketBuyOrdersWithEth.encode([orders,
+ const encodedData = self._strictEncodeArguments('marketBuyOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)', [orders,
makerAssetFillAmount,
signatures,
feeOrders,
@@ -136,23 +96,7 @@ export class ForwarderContract extends BaseContract {
feeRecipient: string,
): string {
const self = this as any as ForwarderContract;
- const inputAbi = self._lookupAbi('marketBuyOrdersWithEth(tuple[],uint256,bytes[],tuple[],bytes[],uint256,address)').inputs;
- [orders,
- makerAssetFillAmount,
- signatures,
- feeOrders,
- feeSignatures,
- feePercentage,
- feeRecipient
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- makerAssetFillAmount,
- signatures,
- feeOrders,
- feeSignatures,
- feePercentage,
- feeRecipient
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('marketBuyOrdersWithEth(tuple[],uint256,bytes[],tuple[],bytes[],uint256,address)').functions.marketBuyOrdersWithEth.encode([orders,
+ const abiEncodedTransactionData = self._strictEncodeArguments('marketBuyOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)', [orders,
makerAssetFillAmount,
signatures,
feeOrders,
@@ -175,33 +119,7 @@ export class ForwarderContract extends BaseContract {
): Promise<[{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}, {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}]
> {
const self = this as any as ForwarderContract;
- const functionSignature = 'marketBuyOrdersWithEth(tuple[],uint256,bytes[],tuple[],bytes[],uint256,address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [orders,
- makerAssetFillAmount,
- signatures,
- feeOrders,
- feeSignatures,
- feePercentage,
- feeRecipient
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- makerAssetFillAmount,
- signatures,
- feeOrders,
- feeSignatures,
- feePercentage,
- feeRecipient
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
- makerAssetFillAmount,
- signatures,
- feeOrders,
- feeSignatures,
- feePercentage,
- feeRecipient
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.marketBuyOrdersWithEth;
- const encodedData = ethersFunction.encode([orders,
+ const encodedData = self._strictEncodeArguments('marketBuyOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)', [orders,
makerAssetFillAmount,
signatures,
feeOrders,
@@ -219,11 +137,12 @@ export class ForwarderContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'marketBuyOrdersWithEth'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('marketBuyOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],uint256,bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<[{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}, {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}]
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public withdrawAsset = {
@@ -233,16 +152,7 @@ export class ForwarderContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ForwarderContract;
- const inputAbi = self._lookupAbi('withdrawAsset(bytes,uint256)').inputs;
- [assetData,
- amount
- ] = BaseContract._formatABIDataItemList(inputAbi, [assetData,
- amount
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [assetData,
- amount
- ]);
- const encodedData = self._lookupEthersInterface('withdrawAsset(bytes,uint256)').functions.withdrawAsset.encode([assetData,
+ const encodedData = self._strictEncodeArguments('withdrawAsset(bytes,uint256)', [assetData,
amount
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -267,13 +177,7 @@ export class ForwarderContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ForwarderContract;
- const inputAbi = self._lookupAbi('withdrawAsset(bytes,uint256)').inputs;
- [assetData,
- amount
- ] = BaseContract._formatABIDataItemList(inputAbi, [assetData,
- amount
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('withdrawAsset(bytes,uint256)').functions.withdrawAsset.encode([assetData,
+ const encodedData = self._strictEncodeArguments('withdrawAsset(bytes,uint256)', [assetData,
amount
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -292,13 +196,7 @@ export class ForwarderContract extends BaseContract {
amount: BigNumber,
): string {
const self = this as any as ForwarderContract;
- const inputAbi = self._lookupAbi('withdrawAsset(bytes,uint256)').inputs;
- [assetData,
- amount
- ] = BaseContract._formatABIDataItemList(inputAbi, [assetData,
- amount
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('withdrawAsset(bytes,uint256)').functions.withdrawAsset.encode([assetData,
+ const abiEncodedTransactionData = self._strictEncodeArguments('withdrawAsset(bytes,uint256)', [assetData,
amount
]);
return abiEncodedTransactionData;
@@ -311,18 +209,7 @@ export class ForwarderContract extends BaseContract {
): Promise<void
> {
const self = this as any as ForwarderContract;
- const functionSignature = 'withdrawAsset(bytes,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [assetData,
- amount
- ] = BaseContract._formatABIDataItemList(inputAbi, [assetData,
- amount
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [assetData,
- amount
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.withdrawAsset;
- const encodedData = ethersFunction.encode([assetData,
+ const encodedData = self._strictEncodeArguments('withdrawAsset(bytes,uint256)', [assetData,
amount
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -335,11 +222,12 @@ export class ForwarderContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'withdrawAsset'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('withdrawAsset(bytes,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public owner = {
@@ -349,12 +237,7 @@ export class ForwarderContract extends BaseContract {
): Promise<string
> {
const self = this as any as ForwarderContract;
- const functionSignature = 'owner()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.owner;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('owner()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -365,11 +248,12 @@ export class ForwarderContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'owner'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('owner()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public marketSellOrdersWithEth = {
@@ -383,28 +267,7 @@ export class ForwarderContract extends BaseContract {
txData: Partial<TxDataPayable> = {},
): Promise<string> {
const self = this as any as ForwarderContract;
- const inputAbi = self._lookupAbi('marketSellOrdersWithEth(tuple[],bytes[],tuple[],bytes[],uint256,address)').inputs;
- [orders,
- signatures,
- feeOrders,
- feeSignatures,
- feePercentage,
- feeRecipient
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- signatures,
- feeOrders,
- feeSignatures,
- feePercentage,
- feeRecipient
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
- signatures,
- feeOrders,
- feeSignatures,
- feePercentage,
- feeRecipient
- ]);
- const encodedData = self._lookupEthersInterface('marketSellOrdersWithEth(tuple[],bytes[],tuple[],bytes[],uint256,address)').functions.marketSellOrdersWithEth.encode([orders,
+ const encodedData = self._strictEncodeArguments('marketSellOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)', [orders,
signatures,
feeOrders,
feeSignatures,
@@ -441,21 +304,7 @@ export class ForwarderContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ForwarderContract;
- const inputAbi = self._lookupAbi('marketSellOrdersWithEth(tuple[],bytes[],tuple[],bytes[],uint256,address)').inputs;
- [orders,
- signatures,
- feeOrders,
- feeSignatures,
- feePercentage,
- feeRecipient
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- signatures,
- feeOrders,
- feeSignatures,
- feePercentage,
- feeRecipient
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('marketSellOrdersWithEth(tuple[],bytes[],tuple[],bytes[],uint256,address)').functions.marketSellOrdersWithEth.encode([orders,
+ const encodedData = self._strictEncodeArguments('marketSellOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)', [orders,
signatures,
feeOrders,
feeSignatures,
@@ -482,21 +331,7 @@ export class ForwarderContract extends BaseContract {
feeRecipient: string,
): string {
const self = this as any as ForwarderContract;
- const inputAbi = self._lookupAbi('marketSellOrdersWithEth(tuple[],bytes[],tuple[],bytes[],uint256,address)').inputs;
- [orders,
- signatures,
- feeOrders,
- feeSignatures,
- feePercentage,
- feeRecipient
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- signatures,
- feeOrders,
- feeSignatures,
- feePercentage,
- feeRecipient
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('marketSellOrdersWithEth(tuple[],bytes[],tuple[],bytes[],uint256,address)').functions.marketSellOrdersWithEth.encode([orders,
+ const abiEncodedTransactionData = self._strictEncodeArguments('marketSellOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)', [orders,
signatures,
feeOrders,
feeSignatures,
@@ -517,30 +352,7 @@ export class ForwarderContract extends BaseContract {
): Promise<[{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}, {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}]
> {
const self = this as any as ForwarderContract;
- const functionSignature = 'marketSellOrdersWithEth(tuple[],bytes[],tuple[],bytes[],uint256,address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [orders,
- signatures,
- feeOrders,
- feeSignatures,
- feePercentage,
- feeRecipient
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- signatures,
- feeOrders,
- feeSignatures,
- feePercentage,
- feeRecipient
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
- signatures,
- feeOrders,
- feeSignatures,
- feePercentage,
- feeRecipient
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.marketSellOrdersWithEth;
- const encodedData = ethersFunction.encode([orders,
+ const encodedData = self._strictEncodeArguments('marketSellOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)', [orders,
signatures,
feeOrders,
feeSignatures,
@@ -557,11 +369,12 @@ export class ForwarderContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'marketSellOrdersWithEth'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('marketSellOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],bytes[],uint256,address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<[{makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}, {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber}]
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public transferOwnership = {
@@ -570,13 +383,7 @@ export class ForwarderContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ForwarderContract;
- const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
- ]);
- const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
+ const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -598,11 +405,7 @@ export class ForwarderContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ForwarderContract;
- const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
+ const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -619,11 +422,7 @@ export class ForwarderContract extends BaseContract {
newOwner: string,
): string {
const self = this as any as ForwarderContract;
- const inputAbi = self._lookupAbi('transferOwnership(address)').inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('transferOwnership(address)').functions.transferOwnership.encode([newOwner
+ const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
return abiEncodedTransactionData;
},
@@ -634,15 +433,7 @@ export class ForwarderContract extends BaseContract {
): Promise<void
> {
const self = this as any as ForwarderContract;
- const functionSignature = 'transferOwnership(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [newOwner
- ] = BaseContract._formatABIDataItemList(inputAbi, [newOwner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [newOwner
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferOwnership;
- const encodedData = ethersFunction.encode([newOwner
+ const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -654,11 +445,12 @@ export class ForwarderContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'transferOwnership'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public static async deployFrom0xArtifactAsync(
@@ -725,7 +517,7 @@ _wethAssetData
}
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
super('Forwarder', abi, address, provider, txDefaults);
- classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
+ classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count
// tslint:enable:no-unbound-method
diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/i_validator.ts b/packages/abi-gen-wrappers/src/generated-wrappers/i_validator.ts
index 5f38ffdac..6cb9f64fb 100644
--- a/packages/abi-gen-wrappers/src/generated-wrappers/i_validator.ts
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/i_validator.ts
@@ -25,21 +25,7 @@ export class IValidatorContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as IValidatorContract;
- const functionSignature = 'isValidSignature(bytes32,address,bytes)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [hash,
- signerAddress,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [hash,
- signerAddress,
- signature
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [hash,
- signerAddress,
- signature
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.isValidSignature;
- const encodedData = ethersFunction.encode([hash,
+ const encodedData = self._strictEncodeArguments('isValidSignature(bytes32,address,bytes)', [hash,
signerAddress,
signature
]);
@@ -53,11 +39,12 @@ export class IValidatorContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'isValidSignature'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('isValidSignature(bytes32,address,bytes)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public static async deployFrom0xArtifactAsync(
@@ -103,7 +90,7 @@ export class IValidatorContract extends BaseContract {
}
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
super('IValidator', abi, address, provider, txDefaults);
- classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
+ classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count
// tslint:enable:no-unbound-method
diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/i_wallet.ts b/packages/abi-gen-wrappers/src/generated-wrappers/i_wallet.ts
index 5fa6f1577..2185c7999 100644
--- a/packages/abi-gen-wrappers/src/generated-wrappers/i_wallet.ts
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/i_wallet.ts
@@ -24,18 +24,7 @@ export class IWalletContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as IWalletContract;
- const functionSignature = 'isValidSignature(bytes32,bytes)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [hash,
- signature
- ] = BaseContract._formatABIDataItemList(inputAbi, [hash,
- signature
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [hash,
- signature
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.isValidSignature;
- const encodedData = ethersFunction.encode([hash,
+ const encodedData = self._strictEncodeArguments('isValidSignature(bytes32,bytes)', [hash,
signature
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -48,11 +37,12 @@ export class IWalletContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'isValidSignature'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('isValidSignature(bytes32,bytes)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public static async deployFrom0xArtifactAsync(
@@ -98,7 +88,7 @@ export class IWalletContract extends BaseContract {
}
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
super('IWallet', abi, address, provider, txDefaults);
- classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
+ classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count
// tslint:enable:no-unbound-method
diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/multi_asset_proxy.ts b/packages/abi-gen-wrappers/src/generated-wrappers/multi_asset_proxy.ts
new file mode 100644
index 000000000..418cab6a0
--- /dev/null
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/multi_asset_proxy.ts
@@ -0,0 +1,669 @@
+// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma whitespace class-name
+// tslint:disable:no-unused-variable
+// tslint:disable:no-unbound-method
+import { BaseContract } from '@0x/base-contract';
+import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from 'ethereum-types';
+import { BigNumber, classUtils, logUtils } from '@0x/utils';
+import { SimpleContractArtifact } from '@0x/types';
+import { Web3Wrapper } from '@0x/web3-wrapper';
+import * as ethers from 'ethers';
+import * as _ from 'lodash';
+// tslint:enable:no-unused-variable
+
+export type MultiAssetProxyEventArgs =
+ | MultiAssetProxyAuthorizedAddressAddedEventArgs
+ | MultiAssetProxyAuthorizedAddressRemovedEventArgs
+ | MultiAssetProxyAssetProxyRegisteredEventArgs;
+
+export enum MultiAssetProxyEvents {
+ AuthorizedAddressAdded = 'AuthorizedAddressAdded',
+ AuthorizedAddressRemoved = 'AuthorizedAddressRemoved',
+ AssetProxyRegistered = 'AssetProxyRegistered',
+}
+
+export interface MultiAssetProxyAuthorizedAddressAddedEventArgs extends DecodedLogArgs {
+ target: string;
+ caller: string;
+}
+
+export interface MultiAssetProxyAuthorizedAddressRemovedEventArgs extends DecodedLogArgs {
+ target: string;
+ caller: string;
+}
+
+export interface MultiAssetProxyAssetProxyRegisteredEventArgs extends DecodedLogArgs {
+ id: string;
+ assetProxy: string;
+}
+
+
+/* istanbul ignore next */
+// tslint:disable:no-parameter-reassignment
+// tslint:disable-next-line:class-name
+export class MultiAssetProxyContract extends BaseContract {
+ public assetProxies = {
+ async callAsync(
+ index_0: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): Promise<string
+ > {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('assetProxies(bytes4)', [index_0
+ ]);
+ const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
+ BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
+ const abiEncoder = self._lookupAbiEncoder('assetProxies(bytes4)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
+ },
+ };
+ public addAuthorizedAddress = {
+ async sendTransactionAsync(
+ target: string,
+ txData: Partial<TxData> = {},
+ ): Promise<string> {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.addAuthorizedAddress.estimateGasAsync.bind(
+ self,
+ target
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ target: string,
+ txData: Partial<TxData> = {},
+ ): Promise<number> {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ target: string,
+ ): string {
+ const self = this as any as MultiAssetProxyContract;
+ const abiEncodedTransactionData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ target: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): Promise<void
+ > {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
+ ]);
+ const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
+ BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
+ const abiEncoder = self._lookupAbiEncoder('addAuthorizedAddress(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
+ },
+ };
+ public authorities = {
+ async callAsync(
+ index_0: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): Promise<string
+ > {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('authorities(uint256)', [index_0
+ ]);
+ const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
+ BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
+ const abiEncoder = self._lookupAbiEncoder('authorities(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
+ },
+ };
+ public getAssetProxy = {
+ async callAsync(
+ assetProxyId: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): Promise<string
+ > {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('getAssetProxy(bytes4)', [assetProxyId
+ ]);
+ const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
+ BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
+ const abiEncoder = self._lookupAbiEncoder('getAssetProxy(bytes4)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
+ },
+ };
+ public removeAuthorizedAddress = {
+ async sendTransactionAsync(
+ target: string,
+ txData: Partial<TxData> = {},
+ ): Promise<string> {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.removeAuthorizedAddress.estimateGasAsync.bind(
+ self,
+ target
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ target: string,
+ txData: Partial<TxData> = {},
+ ): Promise<number> {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ target: string,
+ ): string {
+ const self = this as any as MultiAssetProxyContract;
+ const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ target: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): Promise<void
+ > {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
+ ]);
+ const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
+ BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
+ const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddress(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
+ },
+ };
+ public owner = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): Promise<string
+ > {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('owner()', []);
+ const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
+ BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
+ const abiEncoder = self._lookupAbiEncoder('owner()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
+ },
+ };
+ public removeAuthorizedAddressAtIndex = {
+ async sendTransactionAsync(
+ target: string,
+ index: BigNumber,
+ txData: Partial<TxData> = {},
+ ): Promise<string> {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
+ index
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.removeAuthorizedAddressAtIndex.estimateGasAsync.bind(
+ self,
+ target,
+ index
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ target: string,
+ index: BigNumber,
+ txData: Partial<TxData> = {},
+ ): Promise<number> {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
+ index
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ target: string,
+ index: BigNumber,
+ ): string {
+ const self = this as any as MultiAssetProxyContract;
+ const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
+ index
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ target: string,
+ index: BigNumber,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): Promise<void
+ > {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
+ index
+ ]);
+ const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
+ BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
+ const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddressAtIndex(address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
+ },
+ };
+ public getProxyId = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): Promise<string
+ > {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('getProxyId()', []);
+ const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
+ BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
+ const abiEncoder = self._lookupAbiEncoder('getProxyId()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
+ },
+ };
+ public authorized = {
+ async callAsync(
+ index_0: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): Promise<boolean
+ > {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('authorized(address)', [index_0
+ ]);
+ const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
+ BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
+ const abiEncoder = self._lookupAbiEncoder('authorized(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
+ },
+ };
+ public registerAssetProxy = {
+ async sendTransactionAsync(
+ assetProxy: string,
+ txData: Partial<TxData> = {},
+ ): Promise<string> {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('registerAssetProxy(address)', [assetProxy
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.registerAssetProxy.estimateGasAsync.bind(
+ self,
+ assetProxy
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ assetProxy: string,
+ txData: Partial<TxData> = {},
+ ): Promise<number> {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('registerAssetProxy(address)', [assetProxy
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ assetProxy: string,
+ ): string {
+ const self = this as any as MultiAssetProxyContract;
+ const abiEncodedTransactionData = self._strictEncodeArguments('registerAssetProxy(address)', [assetProxy
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ assetProxy: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): Promise<void
+ > {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('registerAssetProxy(address)', [assetProxy
+ ]);
+ const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
+ BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
+ const abiEncoder = self._lookupAbiEncoder('registerAssetProxy(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
+ },
+ };
+ public getAuthorizedAddresses = {
+ async callAsync(
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): Promise<string[]
+ > {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('getAuthorizedAddresses()', []);
+ const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
+ BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
+ const abiEncoder = self._lookupAbiEncoder('getAuthorizedAddresses()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string[]
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
+ },
+ };
+ public transferOwnership = {
+ async sendTransactionAsync(
+ newOwner: string,
+ txData: Partial<TxData> = {},
+ ): Promise<string> {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ self.transferOwnership.estimateGasAsync.bind(
+ self,
+ newOwner
+ ),
+ );
+ const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ return txHash;
+ },
+ async estimateGasAsync(
+ newOwner: string,
+ txData: Partial<TxData> = {},
+ ): Promise<number> {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
+ ]);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...txData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
+ return gas;
+ },
+ getABIEncodedTransactionData(
+ newOwner: string,
+ ): string {
+ const self = this as any as MultiAssetProxyContract;
+ const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
+ ]);
+ return abiEncodedTransactionData;
+ },
+ async callAsync(
+ newOwner: string,
+ callData: Partial<CallData> = {},
+ defaultBlock?: BlockParam,
+ ): Promise<void
+ > {
+ const self = this as any as MultiAssetProxyContract;
+ const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
+ ]);
+ const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {
+ to: self.address,
+ ...callData,
+ data: encodedData,
+ },
+ self._web3Wrapper.getContractDefaults(),
+ );
+ const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
+ BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
+ const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
+ },
+ };
+ public static async deployFrom0xArtifactAsync(
+ artifact: ContractArtifact | SimpleContractArtifact,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ ): Promise<MultiAssetProxyContract> {
+ if (_.isUndefined(artifact.compilerOutput)) {
+ throw new Error('Compiler output not found in the artifact file');
+ }
+ const bytecode = artifact.compilerOutput.evm.bytecode.object;
+ const abi = artifact.compilerOutput.abi;
+ return MultiAssetProxyContract.deployAsync(bytecode, abi, provider, txDefaults, );
+ }
+ public static async deployAsync(
+ bytecode: string,
+ abi: ContractAbi,
+ provider: Provider,
+ txDefaults: Partial<TxData>,
+ ): Promise<MultiAssetProxyContract> {
+ const constructorAbi = BaseContract._lookupConstructorAbi(abi);
+ [] = BaseContract._formatABIDataItemList(
+ constructorAbi.inputs,
+ [],
+ BaseContract._bigNumberToString,
+ );
+ const iface = new ethers.utils.Interface(abi);
+ const deployInfo = iface.deployFunction;
+ const txData = deployInfo.encode(bytecode, []);
+ const web3Wrapper = new Web3Wrapper(provider);
+ const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
+ {data: txData},
+ txDefaults,
+ web3Wrapper.estimateGasAsync.bind(web3Wrapper),
+ );
+ const txHash = await web3Wrapper.sendTransactionAsync(txDataWithDefaults);
+ logUtils.log(`transactionHash: ${txHash}`);
+ const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
+ logUtils.log(`MultiAssetProxy successfully deployed at ${txReceipt.contractAddress}`);
+ const contractInstance = new MultiAssetProxyContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
+ contractInstance.constructorArgs = [];
+ return contractInstance;
+ }
+ constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
+ super('MultiAssetProxy', abi, address, provider, txDefaults);
+ classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
+ }
+} // tslint:disable:max-file-line-count
+// tslint:enable:no-unbound-method
diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts b/packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts
index ce47b76fc..366b207ad 100644
--- a/packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts
@@ -24,18 +24,7 @@ export class OrderValidatorContract extends BaseContract {
): Promise<[{orderStatus: number;orderHash: string;orderTakerAssetFilledAmount: BigNumber}, {makerBalance: BigNumber;makerAllowance: BigNumber;takerBalance: BigNumber;takerAllowance: BigNumber;makerZrxBalance: BigNumber;makerZrxAllowance: BigNumber;takerZrxBalance: BigNumber;takerZrxAllowance: BigNumber}]
> {
const self = this as any as OrderValidatorContract;
- const functionSignature = 'getOrderAndTraderInfo({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [order,
- takerAddress
- ] = BaseContract._formatABIDataItemList(inputAbi, [order,
- takerAddress
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [order,
- takerAddress
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getOrderAndTraderInfo;
- const encodedData = ethersFunction.encode([order,
+ const encodedData = self._strictEncodeArguments('getOrderAndTraderInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),address)', [order,
takerAddress
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -48,11 +37,12 @@ export class OrderValidatorContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getOrderAndTraderInfo'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('getOrderAndTraderInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<[{orderStatus: number;orderHash: string;orderTakerAssetFilledAmount: BigNumber}, {makerBalance: BigNumber;makerAllowance: BigNumber;takerBalance: BigNumber;takerAllowance: BigNumber;makerZrxBalance: BigNumber;makerZrxAllowance: BigNumber;takerZrxBalance: BigNumber;takerZrxAllowance: BigNumber}]
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public getBalanceAndAllowance = {
@@ -64,18 +54,7 @@ export class OrderValidatorContract extends BaseContract {
): Promise<[BigNumber, BigNumber]
> {
const self = this as any as OrderValidatorContract;
- const functionSignature = 'getBalanceAndAllowance(address,bytes)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [target,
- assetData
- ] = BaseContract._formatABIDataItemList(inputAbi, [target,
- assetData
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [target,
- assetData
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getBalanceAndAllowance;
- const encodedData = ethersFunction.encode([target,
+ const encodedData = self._strictEncodeArguments('getBalanceAndAllowance(address,bytes)', [target,
assetData
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -88,11 +67,12 @@ export class OrderValidatorContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getBalanceAndAllowance'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('getBalanceAndAllowance(address,bytes)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<[BigNumber, BigNumber]
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public getOrdersAndTradersInfo = {
@@ -104,18 +84,7 @@ export class OrderValidatorContract extends BaseContract {
): Promise<[Array<{orderStatus: number;orderHash: string;orderTakerAssetFilledAmount: BigNumber}>, Array<{makerBalance: BigNumber;makerAllowance: BigNumber;takerBalance: BigNumber;takerAllowance: BigNumber;makerZrxBalance: BigNumber;makerZrxAllowance: BigNumber;takerZrxBalance: BigNumber;takerZrxAllowance: BigNumber}>]
> {
const self = this as any as OrderValidatorContract;
- const functionSignature = 'getOrdersAndTradersInfo(tuple[],address[])';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [orders,
- takerAddresses
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAddresses
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
- takerAddresses
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getOrdersAndTradersInfo;
- const encodedData = ethersFunction.encode([orders,
+ const encodedData = self._strictEncodeArguments('getOrdersAndTradersInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],address[])', [orders,
takerAddresses
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -128,11 +97,12 @@ export class OrderValidatorContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getOrdersAndTradersInfo'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('getOrdersAndTradersInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],address[])');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<[Array<{orderStatus: number;orderHash: string;orderTakerAssetFilledAmount: BigNumber}>, Array<{makerBalance: BigNumber;makerAllowance: BigNumber;takerBalance: BigNumber;takerAllowance: BigNumber;makerZrxBalance: BigNumber;makerZrxAllowance: BigNumber;takerZrxBalance: BigNumber;takerZrxAllowance: BigNumber}>]
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public getTradersInfo = {
@@ -144,18 +114,7 @@ export class OrderValidatorContract extends BaseContract {
): Promise<Array<{makerBalance: BigNumber;makerAllowance: BigNumber;takerBalance: BigNumber;takerAllowance: BigNumber;makerZrxBalance: BigNumber;makerZrxAllowance: BigNumber;takerZrxBalance: BigNumber;takerZrxAllowance: BigNumber}>
> {
const self = this as any as OrderValidatorContract;
- const functionSignature = 'getTradersInfo(tuple[],address[])';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [orders,
- takerAddresses
- ] = BaseContract._formatABIDataItemList(inputAbi, [orders,
- takerAddresses
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [orders,
- takerAddresses
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getTradersInfo;
- const encodedData = ethersFunction.encode([orders,
+ const encodedData = self._strictEncodeArguments('getTradersInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],address[])', [orders,
takerAddresses
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -168,11 +127,12 @@ export class OrderValidatorContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getTradersInfo'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('getTradersInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],address[])');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<Array<{makerBalance: BigNumber;makerAllowance: BigNumber;takerBalance: BigNumber;takerAllowance: BigNumber;makerZrxBalance: BigNumber;makerZrxAllowance: BigNumber;takerZrxBalance: BigNumber;takerZrxAllowance: BigNumber}>
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public getERC721TokenOwner = {
@@ -184,18 +144,7 @@ export class OrderValidatorContract extends BaseContract {
): Promise<string
> {
const self = this as any as OrderValidatorContract;
- const functionSignature = 'getERC721TokenOwner(address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [token,
- tokenId
- ] = BaseContract._formatABIDataItemList(inputAbi, [token,
- tokenId
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [token,
- tokenId
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getERC721TokenOwner;
- const encodedData = ethersFunction.encode([token,
+ const encodedData = self._strictEncodeArguments('getERC721TokenOwner(address,uint256)', [token,
tokenId
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -208,11 +157,12 @@ export class OrderValidatorContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getERC721TokenOwner'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('getERC721TokenOwner(address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public getBalancesAndAllowances = {
@@ -224,18 +174,7 @@ export class OrderValidatorContract extends BaseContract {
): Promise<[BigNumber[], BigNumber[]]
> {
const self = this as any as OrderValidatorContract;
- const functionSignature = 'getBalancesAndAllowances(address,bytes[])';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [target,
- assetData
- ] = BaseContract._formatABIDataItemList(inputAbi, [target,
- assetData
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [target,
- assetData
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getBalancesAndAllowances;
- const encodedData = ethersFunction.encode([target,
+ const encodedData = self._strictEncodeArguments('getBalancesAndAllowances(address,bytes[])', [target,
assetData
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -248,11 +187,12 @@ export class OrderValidatorContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getBalancesAndAllowances'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('getBalancesAndAllowances(address,bytes[])');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<[BigNumber[], BigNumber[]]
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public getTraderInfo = {
@@ -264,18 +204,7 @@ export class OrderValidatorContract extends BaseContract {
): Promise<{makerBalance: BigNumber;makerAllowance: BigNumber;takerBalance: BigNumber;takerAllowance: BigNumber;makerZrxBalance: BigNumber;makerZrxAllowance: BigNumber;takerZrxBalance: BigNumber;takerZrxAllowance: BigNumber}
> {
const self = this as any as OrderValidatorContract;
- const functionSignature = 'getTraderInfo({address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes},address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [order,
- takerAddress
- ] = BaseContract._formatABIDataItemList(inputAbi, [order,
- takerAddress
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [order,
- takerAddress
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.getTraderInfo;
- const encodedData = ethersFunction.encode([order,
+ const encodedData = self._strictEncodeArguments('getTraderInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),address)', [order,
takerAddress
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -288,11 +217,12 @@ export class OrderValidatorContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'getTraderInfo'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('getTraderInfo((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<{makerBalance: BigNumber;makerAllowance: BigNumber;takerBalance: BigNumber;takerAllowance: BigNumber;makerZrxBalance: BigNumber;makerZrxAllowance: BigNumber;takerZrxBalance: BigNumber;takerZrxAllowance: BigNumber}
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public static async deployFrom0xArtifactAsync(
@@ -352,7 +282,7 @@ _zrxAssetData
}
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
super('OrderValidator', abi, address, provider, txDefaults);
- classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
+ classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count
// tslint:enable:no-unbound-method
diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/weth9.ts b/packages/abi-gen-wrappers/src/generated-wrappers/weth9.ts
index 12ec55ae9..5af169e03 100644
--- a/packages/abi-gen-wrappers/src/generated-wrappers/weth9.ts
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/weth9.ts
@@ -57,12 +57,7 @@ export class WETH9Contract extends BaseContract {
): Promise<string
> {
const self = this as any as WETH9Contract;
- const functionSignature = 'name()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.name;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('name()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -73,11 +68,12 @@ export class WETH9Contract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'name'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('name()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public approve = {
@@ -87,16 +83,7 @@ export class WETH9Contract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as WETH9Contract;
- const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
- [guy,
- wad
- ] = BaseContract._formatABIDataItemList(inputAbi, [guy,
- wad
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [guy,
- wad
- ]);
- const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([guy,
+ const encodedData = self._strictEncodeArguments('approve(address,uint256)', [guy,
wad
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -121,13 +108,7 @@ export class WETH9Contract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as WETH9Contract;
- const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
- [guy,
- wad
- ] = BaseContract._formatABIDataItemList(inputAbi, [guy,
- wad
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([guy,
+ const encodedData = self._strictEncodeArguments('approve(address,uint256)', [guy,
wad
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -146,13 +127,7 @@ export class WETH9Contract extends BaseContract {
wad: BigNumber,
): string {
const self = this as any as WETH9Contract;
- const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
- [guy,
- wad
- ] = BaseContract._formatABIDataItemList(inputAbi, [guy,
- wad
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([guy,
+ const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [guy,
wad
]);
return abiEncodedTransactionData;
@@ -165,18 +140,7 @@ export class WETH9Contract extends BaseContract {
): Promise<boolean
> {
const self = this as any as WETH9Contract;
- const functionSignature = 'approve(address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [guy,
- wad
- ] = BaseContract._formatABIDataItemList(inputAbi, [guy,
- wad
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [guy,
- wad
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.approve;
- const encodedData = ethersFunction.encode([guy,
+ const encodedData = self._strictEncodeArguments('approve(address,uint256)', [guy,
wad
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -189,11 +153,12 @@ export class WETH9Contract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'approve'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public totalSupply = {
@@ -203,12 +168,7 @@ export class WETH9Contract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as WETH9Contract;
- const functionSignature = 'totalSupply()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.totalSupply;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('totalSupply()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -219,11 +179,12 @@ export class WETH9Contract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'totalSupply'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('totalSupply()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public transferFrom = {
@@ -234,19 +195,7 @@ export class WETH9Contract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as WETH9Contract;
- const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
- [src,
- dst,
- wad
- ] = BaseContract._formatABIDataItemList(inputAbi, [src,
- dst,
- wad
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [src,
- dst,
- wad
- ]);
- const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([src,
+ const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [src,
dst,
wad
]);
@@ -274,15 +223,7 @@ export class WETH9Contract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as WETH9Contract;
- const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
- [src,
- dst,
- wad
- ] = BaseContract._formatABIDataItemList(inputAbi, [src,
- dst,
- wad
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([src,
+ const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [src,
dst,
wad
]);
@@ -303,15 +244,7 @@ export class WETH9Contract extends BaseContract {
wad: BigNumber,
): string {
const self = this as any as WETH9Contract;
- const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
- [src,
- dst,
- wad
- ] = BaseContract._formatABIDataItemList(inputAbi, [src,
- dst,
- wad
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([src,
+ const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [src,
dst,
wad
]);
@@ -326,21 +259,7 @@ export class WETH9Contract extends BaseContract {
): Promise<boolean
> {
const self = this as any as WETH9Contract;
- const functionSignature = 'transferFrom(address,address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [src,
- dst,
- wad
- ] = BaseContract._formatABIDataItemList(inputAbi, [src,
- dst,
- wad
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [src,
- dst,
- wad
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferFrom;
- const encodedData = ethersFunction.encode([src,
+ const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [src,
dst,
wad
]);
@@ -354,11 +273,12 @@ export class WETH9Contract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'transferFrom'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public withdraw = {
@@ -367,13 +287,7 @@ export class WETH9Contract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as WETH9Contract;
- const inputAbi = self._lookupAbi('withdraw(uint256)').inputs;
- [wad
- ] = BaseContract._formatABIDataItemList(inputAbi, [wad
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [wad
- ]);
- const encodedData = self._lookupEthersInterface('withdraw(uint256)').functions.withdraw.encode([wad
+ const encodedData = self._strictEncodeArguments('withdraw(uint256)', [wad
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -395,11 +309,7 @@ export class WETH9Contract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as WETH9Contract;
- const inputAbi = self._lookupAbi('withdraw(uint256)').inputs;
- [wad
- ] = BaseContract._formatABIDataItemList(inputAbi, [wad
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('withdraw(uint256)').functions.withdraw.encode([wad
+ const encodedData = self._strictEncodeArguments('withdraw(uint256)', [wad
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -416,11 +326,7 @@ export class WETH9Contract extends BaseContract {
wad: BigNumber,
): string {
const self = this as any as WETH9Contract;
- const inputAbi = self._lookupAbi('withdraw(uint256)').inputs;
- [wad
- ] = BaseContract._formatABIDataItemList(inputAbi, [wad
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('withdraw(uint256)').functions.withdraw.encode([wad
+ const abiEncodedTransactionData = self._strictEncodeArguments('withdraw(uint256)', [wad
]);
return abiEncodedTransactionData;
},
@@ -431,15 +337,7 @@ export class WETH9Contract extends BaseContract {
): Promise<void
> {
const self = this as any as WETH9Contract;
- const functionSignature = 'withdraw(uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [wad
- ] = BaseContract._formatABIDataItemList(inputAbi, [wad
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [wad
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.withdraw;
- const encodedData = ethersFunction.encode([wad
+ const encodedData = self._strictEncodeArguments('withdraw(uint256)', [wad
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -451,11 +349,12 @@ export class WETH9Contract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'withdraw'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('withdraw(uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public decimals = {
@@ -465,12 +364,7 @@ export class WETH9Contract extends BaseContract {
): Promise<number
> {
const self = this as any as WETH9Contract;
- const functionSignature = 'decimals()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.decimals;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('decimals()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -481,11 +375,12 @@ export class WETH9Contract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'decimals'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('decimals()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<number
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public balanceOf = {
@@ -496,15 +391,7 @@ export class WETH9Contract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as WETH9Contract;
- const functionSignature = 'balanceOf(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [index_0
- ] = BaseContract._formatABIDataItemList(inputAbi, [index_0
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.balanceOf;
- const encodedData = ethersFunction.encode([index_0
+ const encodedData = self._strictEncodeArguments('balanceOf(address)', [index_0
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -516,11 +403,12 @@ export class WETH9Contract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'balanceOf'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public symbol = {
@@ -530,12 +418,7 @@ export class WETH9Contract extends BaseContract {
): Promise<string
> {
const self = this as any as WETH9Contract;
- const functionSignature = 'symbol()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.symbol;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('symbol()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -546,11 +429,12 @@ export class WETH9Contract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'symbol'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('symbol()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public transfer = {
@@ -560,16 +444,7 @@ export class WETH9Contract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as WETH9Contract;
- const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
- [dst,
- wad
- ] = BaseContract._formatABIDataItemList(inputAbi, [dst,
- wad
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [dst,
- wad
- ]);
- const encodedData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([dst,
+ const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [dst,
wad
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -594,13 +469,7 @@ export class WETH9Contract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as WETH9Contract;
- const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
- [dst,
- wad
- ] = BaseContract._formatABIDataItemList(inputAbi, [dst,
- wad
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([dst,
+ const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [dst,
wad
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -619,13 +488,7 @@ export class WETH9Contract extends BaseContract {
wad: BigNumber,
): string {
const self = this as any as WETH9Contract;
- const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
- [dst,
- wad
- ] = BaseContract._formatABIDataItemList(inputAbi, [dst,
- wad
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([dst,
+ const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [dst,
wad
]);
return abiEncodedTransactionData;
@@ -638,18 +501,7 @@ export class WETH9Contract extends BaseContract {
): Promise<boolean
> {
const self = this as any as WETH9Contract;
- const functionSignature = 'transfer(address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [dst,
- wad
- ] = BaseContract._formatABIDataItemList(inputAbi, [dst,
- wad
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [dst,
- wad
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transfer;
- const encodedData = ethersFunction.encode([dst,
+ const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [dst,
wad
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -662,11 +514,12 @@ export class WETH9Contract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'transfer'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public deposit = {
@@ -674,10 +527,7 @@ export class WETH9Contract extends BaseContract {
txData: Partial<TxDataPayable> = {},
): Promise<string> {
const self = this as any as WETH9Contract;
- const inputAbi = self._lookupAbi('deposit()').inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const encodedData = self._lookupEthersInterface('deposit()').functions.deposit.encode([]);
+ const encodedData = self._strictEncodeArguments('deposit()', []);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -696,9 +546,7 @@ export class WETH9Contract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as WETH9Contract;
- const inputAbi = self._lookupAbi('deposit()').inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('deposit()').functions.deposit.encode([]);
+ const encodedData = self._strictEncodeArguments('deposit()', []);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -713,9 +561,7 @@ export class WETH9Contract extends BaseContract {
getABIEncodedTransactionData(
): string {
const self = this as any as WETH9Contract;
- const inputAbi = self._lookupAbi('deposit()').inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('deposit()').functions.deposit.encode([]);
+ const abiEncodedTransactionData = self._strictEncodeArguments('deposit()', []);
return abiEncodedTransactionData;
},
async callAsync(
@@ -724,12 +570,7 @@ export class WETH9Contract extends BaseContract {
): Promise<void
> {
const self = this as any as WETH9Contract;
- const functionSignature = 'deposit()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.deposit;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('deposit()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -740,11 +581,12 @@ export class WETH9Contract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'deposit'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray;
+ const abiEncoder = self._lookupAbiEncoder('deposit()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<void
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public allowance = {
@@ -756,18 +598,7 @@ export class WETH9Contract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as WETH9Contract;
- const functionSignature = 'allowance(address,address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [index_0,
- index_1
- ] = BaseContract._formatABIDataItemList(inputAbi, [index_0,
- index_1
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [index_0,
- index_1
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.allowance;
- const encodedData = ethersFunction.encode([index_0,
+ const encodedData = self._strictEncodeArguments('allowance(address,address)', [index_0,
index_1
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -780,11 +611,12 @@ export class WETH9Contract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'allowance'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public static async deployFrom0xArtifactAsync(
@@ -830,7 +662,7 @@ export class WETH9Contract extends BaseContract {
}
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
super('WETH9', abi, address, provider, txDefaults);
- classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
+ classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count
// tslint:enable:no-unbound-method
diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/zrx_token.ts b/packages/abi-gen-wrappers/src/generated-wrappers/zrx_token.ts
index 877ffd12d..4f5d7f4c5 100644
--- a/packages/abi-gen-wrappers/src/generated-wrappers/zrx_token.ts
+++ b/packages/abi-gen-wrappers/src/generated-wrappers/zrx_token.ts
@@ -43,12 +43,7 @@ export class ZRXTokenContract extends BaseContract {
): Promise<string
> {
const self = this as any as ZRXTokenContract;
- const functionSignature = 'name()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.name;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('name()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -59,11 +54,12 @@ export class ZRXTokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'name'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('name()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public approve = {
@@ -73,16 +69,7 @@ export class ZRXTokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ZRXTokenContract;
- const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
- [_spender,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
- _value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_spender,
- _value
- ]);
- const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_spender,
+ const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
_value
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -107,13 +94,7 @@ export class ZRXTokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ZRXTokenContract;
- const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
- [_spender,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
- _value
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_spender,
+ const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
_value
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -132,13 +113,7 @@ export class ZRXTokenContract extends BaseContract {
_value: BigNumber,
): string {
const self = this as any as ZRXTokenContract;
- const inputAbi = self._lookupAbi('approve(address,uint256)').inputs;
- [_spender,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
- _value
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('approve(address,uint256)').functions.approve.encode([_spender,
+ const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
_value
]);
return abiEncodedTransactionData;
@@ -151,18 +126,7 @@ export class ZRXTokenContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as ZRXTokenContract;
- const functionSignature = 'approve(address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_spender,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_spender,
- _value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_spender,
- _value
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.approve;
- const encodedData = ethersFunction.encode([_spender,
+ const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
_value
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -175,11 +139,12 @@ export class ZRXTokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'approve'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public totalSupply = {
@@ -189,12 +154,7 @@ export class ZRXTokenContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as ZRXTokenContract;
- const functionSignature = 'totalSupply()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.totalSupply;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('totalSupply()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -205,11 +165,12 @@ export class ZRXTokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'totalSupply'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('totalSupply()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public transferFrom = {
@@ -220,19 +181,7 @@ export class ZRXTokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ZRXTokenContract;
- const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
- [_from,
- _to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
- _to,
- _value
- ]);
- const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
+ const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
_to,
_value
]);
@@ -260,15 +209,7 @@ export class ZRXTokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ZRXTokenContract;
- const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
- [_from,
- _to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _value
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
+ const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
_to,
_value
]);
@@ -289,15 +230,7 @@ export class ZRXTokenContract extends BaseContract {
_value: BigNumber,
): string {
const self = this as any as ZRXTokenContract;
- const inputAbi = self._lookupAbi('transferFrom(address,address,uint256)').inputs;
- [_from,
- _to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _value
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('transferFrom(address,address,uint256)').functions.transferFrom.encode([_from,
+ const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
_to,
_value
]);
@@ -312,21 +245,7 @@ export class ZRXTokenContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as ZRXTokenContract;
- const functionSignature = 'transferFrom(address,address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_from,
- _to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_from,
- _to,
- _value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_from,
- _to,
- _value
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transferFrom;
- const encodedData = ethersFunction.encode([_from,
+ const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
_to,
_value
]);
@@ -340,11 +259,12 @@ export class ZRXTokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'transferFrom'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public decimals = {
@@ -354,12 +274,7 @@ export class ZRXTokenContract extends BaseContract {
): Promise<number
> {
const self = this as any as ZRXTokenContract;
- const functionSignature = 'decimals()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.decimals;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('decimals()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -370,11 +285,12 @@ export class ZRXTokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'decimals'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('decimals()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<number
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public balanceOf = {
@@ -385,15 +301,7 @@ export class ZRXTokenContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as ZRXTokenContract;
- const functionSignature = 'balanceOf(address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_owner
- ] = BaseContract._formatABIDataItemList(inputAbi, [_owner
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.balanceOf;
- const encodedData = ethersFunction.encode([_owner
+ const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
@@ -405,11 +313,12 @@ export class ZRXTokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'balanceOf'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public symbol = {
@@ -419,12 +328,7 @@ export class ZRXTokenContract extends BaseContract {
): Promise<string
> {
const self = this as any as ZRXTokenContract;
- const functionSignature = 'symbol()';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [] = BaseContract._formatABIDataItemList(inputAbi, [], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, []);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.symbol;
- const encodedData = ethersFunction.encode([]);
+ const encodedData = self._strictEncodeArguments('symbol()', []);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
{
to: self.address,
@@ -435,11 +339,12 @@ export class ZRXTokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'symbol'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('symbol()');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<string
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public transfer = {
@@ -449,16 +354,7 @@ export class ZRXTokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<string> {
const self = this as any as ZRXTokenContract;
- const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
- [_to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_to,
- _value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_to,
- _value
- ]);
- const encodedData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([_to,
+ const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
_value
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -483,13 +379,7 @@ export class ZRXTokenContract extends BaseContract {
txData: Partial<TxData> = {},
): Promise<number> {
const self = this as any as ZRXTokenContract;
- const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
- [_to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_to,
- _value
- ], BaseContract._bigNumberToString);
- const encodedData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([_to,
+ const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
_value
]);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -508,13 +398,7 @@ export class ZRXTokenContract extends BaseContract {
_value: BigNumber,
): string {
const self = this as any as ZRXTokenContract;
- const inputAbi = self._lookupAbi('transfer(address,uint256)').inputs;
- [_to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_to,
- _value
- ], BaseContract._bigNumberToString);
- const abiEncodedTransactionData = self._lookupEthersInterface('transfer(address,uint256)').functions.transfer.encode([_to,
+ const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
_value
]);
return abiEncodedTransactionData;
@@ -527,18 +411,7 @@ export class ZRXTokenContract extends BaseContract {
): Promise<boolean
> {
const self = this as any as ZRXTokenContract;
- const functionSignature = 'transfer(address,uint256)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_to,
- _value
- ] = BaseContract._formatABIDataItemList(inputAbi, [_to,
- _value
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_to,
- _value
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.transfer;
- const encodedData = ethersFunction.encode([_to,
+ const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
_value
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -551,11 +424,12 @@ export class ZRXTokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'transfer'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<boolean
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public allowance = {
@@ -567,18 +441,7 @@ export class ZRXTokenContract extends BaseContract {
): Promise<BigNumber
> {
const self = this as any as ZRXTokenContract;
- const functionSignature = 'allowance(address,address)';
- const inputAbi = self._lookupAbi(functionSignature).inputs;
- [_owner,
- _spender
- ] = BaseContract._formatABIDataItemList(inputAbi, [_owner,
- _spender
- ], BaseContract._bigNumberToString.bind(self));
- BaseContract.strictArgumentEncodingCheck(inputAbi, [_owner,
- _spender
- ]);
- const ethersFunction = self._lookupEthersInterface(functionSignature).functions.allowance;
- const encodedData = ethersFunction.encode([_owner,
+ const encodedData = self._strictEncodeArguments('allowance(address,address)', [_owner,
_spender
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
@@ -591,11 +454,12 @@ export class ZRXTokenContract extends BaseContract {
);
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
- let resultArray = ethersFunction.decode(rawCallResult);
- const outputAbi = (_.find(self.abi, {name: 'allowance'}) as MethodAbi).outputs;
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this));
- resultArray = BaseContract._formatABIDataItemList(outputAbi, resultArray, BaseContract._bnToBigNumber.bind(this));
- return resultArray[0];
+ const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
+ // tslint:disable boolean-naming
+ const result = abiEncoder.strictDecodeReturnValue<BigNumber
+ >(rawCallResult);
+ // tslint:enable boolean-naming
+ return result;
},
};
public static async deployFrom0xArtifactAsync(
@@ -641,7 +505,7 @@ export class ZRXTokenContract extends BaseContract {
}
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
super('ZRXToken', abi, address, provider, txDefaults);
- classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
+ classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count
// tslint:enable:no-unbound-method
diff --git a/packages/abi-gen-wrappers/src/index.ts b/packages/abi-gen-wrappers/src/index.ts
index b5a7d0cfe..1a81c0187 100644
--- a/packages/abi-gen-wrappers/src/index.ts
+++ b/packages/abi-gen-wrappers/src/index.ts
@@ -10,6 +10,7 @@ export * from './generated-wrappers/exchange';
export * from './generated-wrappers/forwarder';
export * from './generated-wrappers/i_validator';
export * from './generated-wrappers/i_wallet';
+export * from './generated-wrappers/multi_asset_proxy';
export * from './generated-wrappers/order_validator';
export * from './generated-wrappers/weth9';
export * from './generated-wrappers/zrx_token';
diff --git a/packages/abi-gen/CHANGELOG.json b/packages/abi-gen/CHANGELOG.json
index 19cceb509..173617b65 100644
--- a/packages/abi-gen/CHANGELOG.json
+++ b/packages/abi-gen/CHANGELOG.json
@@ -1,5 +1,32 @@
[
{
+ "version": "2.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "1.0.22",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "1.0.21",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"timestamp": 1547040760,
"version": "1.0.20",
"changes": [
@@ -312,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
},
{
@@ -346,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/abi-gen/CHANGELOG.md b/packages/abi-gen/CHANGELOG.md
index 26d42cd36..af74218b8 100644
--- a/packages/abi-gen/CHANGELOG.md
+++ b/packages/abi-gen/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v1.0.22 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v1.0.21 - _January 11, 2019_
+
+ * Dependencies updated
+
## v1.0.20 - _January 9, 2019_
* Dependencies updated
diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json
index 4a2754233..7f968893c 100644
--- a/packages/abi-gen/package.json
+++ b/packages/abi-gen/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/abi-gen",
- "version": "1.0.20",
+ "version": "1.0.22",
"engines": {
"node": ">=6.12"
},
@@ -31,10 +31,10 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen/README.md",
"dependencies": {
- "@0x/typescript-typings": "^3.0.6",
- "@0x/utils": "^2.1.1",
+ "@0x/typescript-typings": "^3.0.8",
+ "@0x/utils": "^3.0.1",
"chalk": "^2.3.0",
- "ethereum-types": "^1.1.4",
+ "ethereum-types": "^1.1.6",
"glob": "^7.1.2",
"handlebars": "^4.0.11",
"lodash": "^4.17.5",
@@ -45,7 +45,7 @@
"yargs": "^10.0.3"
},
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.2",
"@types/glob": "5.0.35",
"@types/handlebars": "^4.0.36",
"@types/mkdirp": "^0.5.1",
diff --git a/packages/abi-gen/src/index.ts b/packages/abi-gen/src/index.ts
index 5bad920ca..6e0ca2c87 100644
--- a/packages/abi-gen/src/index.ts
+++ b/packages/abi-gen/src/index.ts
@@ -1,6 +1,6 @@
#!/usr/bin/env node
-import { abiUtils, logUtils } from '@0x/utils';
+import { AbiEncoder, abiUtils, logUtils } from '@0x/utils';
import chalk from 'chalk';
import { AbiDefinition, ConstructorAbi, EventAbi, MethodAbi } from 'ethereum-types';
import { sync as globSync } from 'glob';
@@ -133,7 +133,7 @@ for (const abiFileName of abiFileNames) {
singleReturnValue: methodAbi.outputs.length === 1,
hasReturnValue: methodAbi.outputs.length !== 0,
tsName: sanitizedMethodAbis[methodAbiIndex].name,
- functionSignature: abiUtils.getFunctionSignature(methodAbi),
+ functionSignature: new AbiEncoder.Method(methodAbi).getSignature(),
};
return methodData;
});
diff --git a/packages/assert/CHANGELOG.json b/packages/assert/CHANGELOG.json
index 275ec2e4e..278b7dfa1 100644
--- a/packages/assert/CHANGELOG.json
+++ b/packages/assert/CHANGELOG.json
@@ -1,5 +1,32 @@
[
{
+ "version": "2.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "1.0.23",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "1.0.22",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"timestamp": 1547040760,
"version": "1.0.21",
"changes": [
@@ -193,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
}
]
@@ -339,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/assert/CHANGELOG.md b/packages/assert/CHANGELOG.md
index 25383b2d1..5a4af165a 100644
--- a/packages/assert/CHANGELOG.md
+++ b/packages/assert/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v1.0.23 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v1.0.22 - _January 11, 2019_
+
+ * Dependencies updated
+
## v1.0.21 - _January 9, 2019_
* Dependencies updated
diff --git a/packages/assert/package.json b/packages/assert/package.json
index e11ccb3cb..38481d6f0 100644
--- a/packages/assert/package.json
+++ b/packages/assert/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/assert",
- "version": "1.0.21",
+ "version": "1.0.23",
"engines": {
"node": ">=6.12"
},
@@ -29,7 +29,7 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/assert/README.md",
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.2",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"@types/valid-url": "^1.0.2",
@@ -44,9 +44,9 @@
"typescript": "3.0.1"
},
"dependencies": {
- "@0x/json-schemas": "^2.1.5",
- "@0x/typescript-typings": "^3.0.6",
- "@0x/utils": "^2.1.1",
+ "@0x/json-schemas": "^2.1.7",
+ "@0x/typescript-typings": "^3.0.8",
+ "@0x/utils": "^3.0.1",
"lodash": "^4.17.5",
"valid-url": "^1.0.9"
},
diff --git a/packages/assert/src/index.ts b/packages/assert/src/index.ts
index 2d28d51e1..741bd78e1 100644
--- a/packages/assert/src/index.ts
+++ b/packages/assert/src/index.ts
@@ -7,12 +7,12 @@ 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 {
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/CHANGELOG.json b/packages/asset-buyer/CHANGELOG.json
index a7f8d3418..2de603de0 100644
--- a/packages/asset-buyer/CHANGELOG.json
+++ b/packages/asset-buyer/CHANGELOG.json
@@ -1,12 +1,49 @@
[
{
+ "version": "5.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "version": "4.1.0",
+ "changes": [
+ {
+ "note": "Adds new public method getLiquidityForAssetDataAsync, and exposes getOrdersAndFillableAmountsAsync as public method",
+ "pr": 1512
+ }
+ ]
+ },
+ {
+ "timestamp": 1547747677,
+ "version": "4.0.2",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "4.0.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "4.0.0",
"changes": [
{
"note": "Raise custom InsufficientAssetLiquidityError error with amountAvailableToFill attribute",
"pr": 1437
}
- ]
+ ],
+ "timestamp": 1547225310
},
{
"timestamp": 1547040760,
@@ -90,8 +127,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
},
{
@@ -99,13 +135,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
},
{
@@ -126,8 +160,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/asset-buyer/CHANGELOG.md b/packages/asset-buyer/CHANGELOG.md
index 70bbe8302..f2a3d2236 100644
--- a/packages/asset-buyer/CHANGELOG.md
+++ b/packages/asset-buyer/CHANGELOG.md
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v4.0.2 - _January 17, 2019_
+
+ * Dependencies updated
+
+## v4.0.1 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v4.0.0 - _January 11, 2019_
+
+ * Raise custom InsufficientAssetLiquidityError error with amountAvailableToFill attribute (#1437)
+
## v3.0.5 - _January 9, 2019_
* Dependencies updated
diff --git a/packages/asset-buyer/package.json b/packages/asset-buyer/package.json
index dd6780e48..0f79ac06a 100644
--- a/packages/asset-buyer/package.json
+++ b/packages/asset-buyer/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/asset-buyer",
- "version": "3.0.5",
+ "version": "4.0.2",
"engines": {
"node": ">=6.12"
},
@@ -36,27 +36,27 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/asset-buyer/README.md",
"dependencies": {
- "@0x/assert": "^1.0.21",
- "@0x/connect": "^3.0.11",
- "@0x/contract-wrappers": "^4.2.0",
- "@0x/json-schemas": "^2.1.5",
- "@0x/order-utils": "^3.1.0",
- "@0x/subproviders": "^2.1.9",
- "@0x/types": "^1.5.0",
- "@0x/typescript-typings": "^3.0.6",
- "@0x/utils": "^2.1.1",
- "@0x/web3-wrapper": "^3.2.2",
- "ethereum-types": "^1.1.4",
+ "@0x/assert": "^1.0.23",
+ "@0x/connect": "^3.0.13",
+ "@0x/contract-wrappers": "^5.0.1",
+ "@0x/json-schemas": "^2.1.7",
+ "@0x/order-utils": "^3.1.2",
+ "@0x/subproviders": "^2.1.11",
+ "@0x/types": "^1.5.2",
+ "@0x/typescript-typings": "^3.0.8",
+ "@0x/utils": "^3.0.1",
+ "@0x/web3-wrapper": "^3.2.4",
+ "ethereum-types": "^1.1.6",
"lodash": "^4.17.5"
},
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.2",
"@types/lodash": "^4.14.116",
"@types/mocha": "^2.2.42",
"@types/node": "*",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
- "chai-bignumber": "^2.0.1",
+ "chai-bignumber": "^3.0.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",
@@ -65,6 +65,7 @@
"shx": "^0.2.2",
"tslint": "5.11.0",
"typedoc": "0.13.0",
+ "typemoq": "^2.1.0",
"typescript": "3.0.1"
},
"publishConfig": {
diff --git a/packages/asset-buyer/src/asset_buyer.ts b/packages/asset-buyer/src/asset_buyer.ts
index 934410c55..b22b1a122 100644
--- a/packages/asset-buyer/src/asset_buyer.ts
+++ b/packages/asset-buyer/src/asset_buyer.ts
@@ -16,14 +16,16 @@ import {
BuyQuote,
BuyQuoteExecutionOpts,
BuyQuoteRequestOpts,
+ LiquidityForAssetData,
+ LiquidityRequestOpts,
OrderProvider,
- OrderProviderResponse,
OrdersAndFillableAmounts,
} from './types';
import { assert } from './utils/assert';
import { assetDataUtils } from './utils/asset_data_utils';
import { buyQuoteCalculator } from './utils/buy_quote_calculator';
+import { calculateLiquidity } from './utils/calculate_liquidity';
import { orderProviderResponseProcessor } from './utils/order_provider_response_processor';
interface OrdersEntry {
@@ -138,10 +140,10 @@ export class AssetBuyer {
// get the relevant orders for the makerAsset and fees
// if the requested assetData is ZRX, don't get the fee info
const [ordersAndFillableAmounts, feeOrdersAndFillableAmounts] = await Promise.all([
- this._getOrdersAndFillableAmountsAsync(assetData, shouldForceOrderRefresh),
+ this.getOrdersAndFillableAmountsAsync(assetData, shouldForceOrderRefresh),
isMakerAssetZrxToken
? Promise.resolve(constants.EMPTY_ORDERS_AND_FILLABLE_AMOUNTS)
- : this._getOrdersAndFillableAmountsAsync(zrxTokenAssetData, shouldForceOrderRefresh),
+ : this.getOrdersAndFillableAmountsAsync(zrxTokenAssetData, shouldForceOrderRefresh),
shouldForceOrderRefresh,
]);
if (ordersAndFillableAmounts.orders.length === 0) {
@@ -178,6 +180,41 @@ export class AssetBuyer {
return buyQuote;
}
/**
+ * Returns information about available liquidity for an asset
+ * Does not factor in slippage or fees
+ * @param assetData The assetData of the desired asset to buy (for more info: https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md).
+ * @param options Options for the request. See type definition for more information.
+ *
+ * @return An object that conforms to LiquidityForAssetData that satisfies the request. See type definition for more information.
+ */
+ public async getLiquidityForAssetDataAsync(
+ assetData: string,
+ options: Partial<LiquidityRequestOpts> = {},
+ ): Promise<LiquidityForAssetData> {
+ const shouldForceOrderRefresh =
+ options.shouldForceOrderRefresh !== undefined ? options.shouldForceOrderRefresh : false;
+ assert.isString('assetData', assetData);
+ assetDataUtils.decodeAssetDataOrThrow(assetData);
+ assert.isBoolean('options.shouldForceOrderRefresh', shouldForceOrderRefresh);
+
+ const assetPairs = await this.orderProvider.getAvailableMakerAssetDatasAsync(assetData);
+ const etherTokenAssetData = this._getEtherTokenAssetDataOrThrow();
+ if (!assetPairs.includes(etherTokenAssetData)) {
+ return {
+ tokensAvailableInBaseUnits: new BigNumber(0),
+ ethValueAvailableInWei: new BigNumber(0),
+ };
+ }
+
+ const ordersAndFillableAmounts = await this.getOrdersAndFillableAmountsAsync(
+ assetData,
+ shouldForceOrderRefresh,
+ );
+
+ return calculateLiquidity(ordersAndFillableAmounts);
+ }
+
+ /**
* Given a BuyQuote and desired rate, attempt to execute the buy.
* @param buyQuote An object that conforms to BuyQuote. See type definition for more information.
* @param options Options for the execution of the BuyQuote. See type definition for more information.
@@ -260,8 +297,10 @@ export class AssetBuyer {
}
/**
* Grab orders from the map, if there is a miss or it is time to refresh, fetch and process the orders
+ * @param assetData The assetData of the desired asset to buy (for more info: https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md).
+ * @param shouldForceOrderRefresh If set to true, new orders and state will be fetched instead of waiting for the next orderRefreshIntervalMs.
*/
- private async _getOrdersAndFillableAmountsAsync(
+ public async getOrdersAndFillableAmountsAsync(
assetData: string,
shouldForceOrderRefresh: boolean,
): Promise<OrdersAndFillableAmounts> {
diff --git a/packages/asset-buyer/src/index.ts b/packages/asset-buyer/src/index.ts
index a42d7e272..f69cfad69 100644
--- a/packages/asset-buyer/src/index.ts
+++ b/packages/asset-buyer/src/index.ts
@@ -19,6 +19,9 @@ export {
BuyQuoteExecutionOpts,
BuyQuoteInfo,
BuyQuoteRequestOpts,
+ LiquidityForAssetData,
+ LiquidityRequestOpts,
+ OrdersAndFillableAmounts,
OrderProvider,
OrderProviderRequest,
OrderProviderResponse,
diff --git a/packages/asset-buyer/src/types.ts b/packages/asset-buyer/src/types.ts
index d5d6be695..46a2338ce 100644
--- a/packages/asset-buyer/src/types.ts
+++ b/packages/asset-buyer/src/types.ts
@@ -75,6 +75,13 @@ export interface BuyQuoteRequestOpts {
slippagePercentage: number;
}
+/*
+ * Options for checking liquidity
+ *
+ * shouldForceOrderRefresh: If set to true, new orders and state will be fetched instead of waiting for the next orderRefreshIntervalMs. Defaults to false.
+ */
+export type LiquidityRequestOpts = Pick<BuyQuoteRequestOpts, 'shouldForceOrderRefresh'>;
+
/**
* ethAmount: The desired amount of eth to spend. Defaults to buyQuote.worstCaseQuoteInfo.totalEthAmount.
* takerAddress: The address to perform the buy. Defaults to the first available address from the provider.
@@ -117,7 +124,19 @@ export enum AssetBuyerError {
TransactionValueTooLow = 'TRANSACTION_VALUE_TOO_LOW',
}
+/**
+ * orders: An array of signed orders
+ * remainingFillableMakerAssetAmounts: A list of fillable amounts for the signed orders. The index of an item in the array associates the amount with the corresponding order.
+ */
export interface OrdersAndFillableAmounts {
orders: SignedOrder[];
remainingFillableMakerAssetAmounts: BigNumber[];
}
+
+/**
+ * Represents available liquidity for a given assetData
+ */
+export interface LiquidityForAssetData {
+ tokensAvailableInBaseUnits: BigNumber;
+ ethValueAvailableInWei: BigNumber;
+}
diff --git a/packages/asset-buyer/src/utils/buy_quote_calculator.ts b/packages/asset-buyer/src/utils/buy_quote_calculator.ts
index fcded6ab1..125841094 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,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).floor();
+ const amountAvailableToFillConsideringSlippage = amountAbleToFill
+ .div(multiplierNeededWithSlippage)
+ .integerValue(BigNumber.ROUND_FLOOR);
throw new InsufficientAssetLiquidityError(amountAvailableToFillConsideringSlippage);
}
@@ -131,7 +133,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 +170,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/calculate_liquidity.ts b/packages/asset-buyer/src/utils/calculate_liquidity.ts
new file mode 100644
index 000000000..a8d165b4b
--- /dev/null
+++ b/packages/asset-buyer/src/utils/calculate_liquidity.ts
@@ -0,0 +1,34 @@
+import { BigNumber } from '@0x/utils';
+
+import { LiquidityForAssetData, OrdersAndFillableAmounts } from '../types';
+
+import { orderUtils } from './order_utils';
+
+export const calculateLiquidity = (ordersAndFillableAmounts: OrdersAndFillableAmounts): LiquidityForAssetData => {
+ const { orders, remainingFillableMakerAssetAmounts } = ordersAndFillableAmounts;
+ const liquidityInBigNumbers = orders.reduce(
+ (acc, order, curIndex) => {
+ const availableMakerAssetAmount = remainingFillableMakerAssetAmounts[curIndex];
+ if (availableMakerAssetAmount === undefined) {
+ throw new Error(`No corresponding fillableMakerAssetAmounts at index ${curIndex}`);
+ }
+
+ const tokensAvailableForCurrentOrder = availableMakerAssetAmount;
+ const ethValueAvailableForCurrentOrder = orderUtils.getTakerFillAmount(order, availableMakerAssetAmount);
+ return {
+ tokensAvailableInBaseUnits: acc.tokensAvailableInBaseUnits.plus(tokensAvailableForCurrentOrder),
+ ethValueAvailableInWei: acc.ethValueAvailableInWei.plus(ethValueAvailableForCurrentOrder),
+ };
+ },
+ {
+ tokensAvailableInBaseUnits: new BigNumber(0),
+ ethValueAvailableInWei: new BigNumber(0),
+ },
+ );
+
+ // Turn into regular numbers
+ return {
+ tokensAvailableInBaseUnits: liquidityInBigNumbers.tokensAvailableInBaseUnits,
+ ethValueAvailableInWei: liquidityInBigNumbers.ethValueAvailableInWei,
+ };
+};
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 25e85b2cc..f08cd6150 100644
--- a/packages/asset-buyer/src/utils/order_provider_response_processor.ts
+++ b/packages/asset-buyer/src/utils/order_provider_response_processor.ts
@@ -105,15 +105,12 @@ function getValidOrdersWithRemainingFillableMakerAssetAmountsFromOnChain(
// get corresponding on-chain state for the order
const { orderInfo, traderInfo } = ordersAndTradersInfo[index];
// if the order IS NOT fillable, do not add anything to the accumulations and continue iterating
- if (orderInfo.orderStatus !== OrderStatus.FILLABLE) {
+ if (orderInfo.orderStatus !== OrderStatus.Fillable) {
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 1cc2cf95f..3ea3cafd3 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/asset_buyer_test.ts b/packages/asset-buyer/test/asset_buyer_test.ts
new file mode 100644
index 000000000..f117b4d7a
--- /dev/null
+++ b/packages/asset-buyer/test/asset_buyer_test.ts
@@ -0,0 +1,212 @@
+import { orderFactory } from '@0x/order-utils/lib/src/order_factory';
+import { Web3ProviderEngine } from '@0x/subproviders';
+import { SignedOrder } from '@0x/types';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
+import * as chai from 'chai';
+import 'mocha';
+import * as TypeMoq from 'typemoq';
+
+import { AssetBuyer } from '../src';
+import { constants } from '../src/constants';
+import { LiquidityForAssetData, OrderProvider, OrdersAndFillableAmounts } from '../src/types';
+
+import { chaiSetup } from './utils/chai_setup';
+import {
+ mockAvailableAssetDatas,
+ mockedAssetBuyerWithOrdersAndFillableAmounts,
+ orderProviderMock,
+} from './utils/mocks';
+
+chaiSetup.configure();
+const expect = chai.expect;
+
+const FAKE_SRA_URL = 'https://fakeurl.com';
+const FAKE_ASSET_DATA = '0xf47261b00000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c48';
+const TOKEN_DECIMALS = 18;
+const DAI_ASSET_DATA = '0xf47261b000000000000000000000000089d24a6b4ccb1b6faa2625fe562bdd9a23260359"';
+const WETH_ASSET_DATA = '0xf47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2';
+const WETH_DECIMALS = constants.ETHER_TOKEN_DECIMALS;
+
+const baseUnitAmount = (unitAmount: number, decimals = TOKEN_DECIMALS): BigNumber => {
+ return Web3Wrapper.toBaseUnitAmount(new BigNumber(unitAmount), decimals);
+};
+
+const expectLiquidityResult = async (
+ web3Provider: Web3ProviderEngine,
+ orderProvider: OrderProvider,
+ ordersAndFillableAmounts: OrdersAndFillableAmounts,
+ expectedLiquidityResult: LiquidityForAssetData,
+) => {
+ const mockedAssetBuyer = mockedAssetBuyerWithOrdersAndFillableAmounts(
+ web3Provider,
+ orderProvider,
+ FAKE_ASSET_DATA,
+ ordersAndFillableAmounts,
+ );
+ const liquidityResult = await mockedAssetBuyer.object.getLiquidityForAssetDataAsync(FAKE_ASSET_DATA);
+ expect(liquidityResult).to.deep.equal(expectedLiquidityResult);
+};
+
+// tslint:disable:custom-no-magic-numbers
+describe('AssetBuyer', () => {
+ describe('getLiquidityForAssetDataAsync', () => {
+ const mockWeb3Provider = TypeMoq.Mock.ofType(Web3ProviderEngine);
+ const mockOrderProvider = orderProviderMock();
+
+ beforeEach(() => {
+ mockWeb3Provider.reset();
+ mockOrderProvider.reset();
+ });
+
+ afterEach(() => {
+ mockWeb3Provider.verifyAll();
+ mockOrderProvider.verifyAll();
+ });
+
+ describe('validation', () => {
+ it('should ensure assetData is a string', async () => {
+ const assetBuyer = AssetBuyer.getAssetBuyerForStandardRelayerAPIUrl(
+ mockWeb3Provider.object,
+ FAKE_SRA_URL,
+ );
+
+ expect(assetBuyer.getLiquidityForAssetDataAsync(false as any)).to.be.rejectedWith(
+ 'Expected assetData to be of type string, encountered: false',
+ );
+ });
+ });
+
+ describe('asset pair not supported', () => {
+ it('should return 0s when no asset pair not supported', async () => {
+ mockAvailableAssetDatas(mockOrderProvider, FAKE_ASSET_DATA, []);
+
+ const assetBuyer = new AssetBuyer(mockWeb3Provider.object, mockOrderProvider.object);
+ const liquidityResult = await assetBuyer.getLiquidityForAssetDataAsync(FAKE_ASSET_DATA);
+ expect(liquidityResult).to.deep.equal({
+ tokensAvailableInBaseUnits: new BigNumber(0),
+ ethValueAvailableInWei: new BigNumber(0),
+ });
+ });
+ it('should return 0s when only other asset pair supported', async () => {
+ mockAvailableAssetDatas(mockOrderProvider, FAKE_ASSET_DATA, [DAI_ASSET_DATA]);
+
+ const assetBuyer = new AssetBuyer(mockWeb3Provider.object, mockOrderProvider.object);
+ const liquidityResult = await assetBuyer.getLiquidityForAssetDataAsync(FAKE_ASSET_DATA);
+ expect(liquidityResult).to.deep.equal({
+ tokensAvailableInBaseUnits: new BigNumber(0),
+ ethValueAvailableInWei: new BigNumber(0),
+ });
+ });
+ });
+
+ describe('assetData is supported', () => {
+ // orders
+ const sellTwoTokensFor1Weth: SignedOrder = orderFactory.createSignedOrderFromPartial({
+ makerAssetAmount: baseUnitAmount(2),
+ takerAssetAmount: baseUnitAmount(1, WETH_DECIMALS),
+ });
+ const sellTenTokensFor10Weth: SignedOrder = orderFactory.createSignedOrderFromPartial({
+ makerAssetAmount: baseUnitAmount(10),
+ takerAssetAmount: baseUnitAmount(10, WETH_DECIMALS),
+ });
+
+ beforeEach(() => {
+ mockAvailableAssetDatas(mockOrderProvider, FAKE_ASSET_DATA, [WETH_ASSET_DATA]);
+ });
+
+ it('should return 0s when no orders available', async () => {
+ const ordersAndFillableAmounts: OrdersAndFillableAmounts = {
+ orders: [],
+ remainingFillableMakerAssetAmounts: [],
+ };
+ const expectedResult = {
+ tokensAvailableInBaseUnits: new BigNumber(0),
+ ethValueAvailableInWei: new BigNumber(0),
+ };
+ await expectLiquidityResult(
+ mockWeb3Provider.object,
+ mockOrderProvider.object,
+ ordersAndFillableAmounts,
+ expectedResult,
+ );
+ });
+
+ it('should return correct computed value when orders provided with full fillableAmounts', async () => {
+ const orders: SignedOrder[] = [sellTwoTokensFor1Weth, sellTenTokensFor10Weth];
+ const ordersAndFillableAmounts = {
+ orders: [sellTwoTokensFor1Weth, sellTenTokensFor10Weth],
+ remainingFillableMakerAssetAmounts: orders.map(o => o.makerAssetAmount),
+ };
+
+ const expectedTokensAvailable = orders[0].makerAssetAmount.plus(orders[1].makerAssetAmount);
+ const expectedEthValueAvailable = orders[0].takerAssetAmount.plus(orders[1].takerAssetAmount);
+ const expectedResult = {
+ tokensAvailableInBaseUnits: expectedTokensAvailable,
+ ethValueAvailableInWei: expectedEthValueAvailable,
+ };
+
+ await expectLiquidityResult(
+ mockWeb3Provider.object,
+ mockOrderProvider.object,
+ ordersAndFillableAmounts,
+ expectedResult,
+ );
+ });
+
+ it('should return correct computed value with one partial fillableAmounts', async () => {
+ const ordersAndFillableAmounts = {
+ orders: [sellTwoTokensFor1Weth],
+ remainingFillableMakerAssetAmounts: [baseUnitAmount(1)],
+ };
+ const expectedResult = {
+ tokensAvailableInBaseUnits: baseUnitAmount(1),
+ ethValueAvailableInWei: baseUnitAmount(0.5, WETH_DECIMALS),
+ };
+
+ await expectLiquidityResult(
+ mockWeb3Provider.object,
+ mockOrderProvider.object,
+ ordersAndFillableAmounts,
+ expectedResult,
+ );
+ });
+
+ it('should return correct computed value with multiple orders and fillable amounts', async () => {
+ const ordersAndFillableAmounts = {
+ orders: [sellTwoTokensFor1Weth, sellTenTokensFor10Weth],
+ remainingFillableMakerAssetAmounts: [baseUnitAmount(1), baseUnitAmount(3)],
+ };
+ const expectedResult = {
+ tokensAvailableInBaseUnits: baseUnitAmount(4),
+ ethValueAvailableInWei: baseUnitAmount(3.5, WETH_DECIMALS),
+ };
+
+ await expectLiquidityResult(
+ mockWeb3Provider.object,
+ mockOrderProvider.object,
+ ordersAndFillableAmounts,
+ expectedResult,
+ );
+ });
+
+ it('should return 0s when no amounts fillable', async () => {
+ const ordersAndFillableAmounts = {
+ orders: [sellTwoTokensFor1Weth, sellTenTokensFor10Weth],
+ remainingFillableMakerAssetAmounts: [baseUnitAmount(0), baseUnitAmount(0)],
+ };
+ const expectedResult = {
+ tokensAvailableInBaseUnits: baseUnitAmount(0),
+ ethValueAvailableInWei: baseUnitAmount(0, WETH_DECIMALS),
+ };
+
+ await expectLiquidityResult(
+ mockWeb3Provider.object,
+ mockOrderProvider.object,
+ ordersAndFillableAmounts,
+ expectedResult,
+ );
+ });
+ });
+ });
+});
diff --git a/packages/asset-buyer/test/buy_quote_calculator_test.ts b/packages/asset-buyer/test/buy_quote_calculator_test.ts
index fdc17ef25..177fd8fe6 100644
--- a/packages/asset-buyer/test/buy_quote_calculator_test.ts
+++ b/packages/asset-buyer/test/buy_quote_calculator_test.ts
@@ -168,7 +168,7 @@ describe('buyQuoteCalculator', () => {
};
testHelpers.expectInsufficientLiquidityError(expect, errorFunction, new BigNumber(1));
});
- it('should throw without amount available to fill if amount rounds to 0', () => {
+ it('should throw with 0 available to fill if amount rounds to 0', () => {
const smallOrder = orderFactory.createSignedOrderFromPartial({
makerAssetAmount: new BigNumber(1),
takerAssetAmount: new BigNumber(1),
@@ -184,7 +184,7 @@ describe('buyQuoteCalculator', () => {
false,
);
};
- testHelpers.expectInsufficientLiquidityError(expect, errorFunction, undefined);
+ testHelpers.expectInsufficientLiquidityError(expect, errorFunction, new BigNumber(0));
});
});
it('should not throw if order is fillable', () => {
@@ -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/asset-buyer/test/utils/mocks.ts b/packages/asset-buyer/test/utils/mocks.ts
new file mode 100644
index 000000000..d3e1c09c4
--- /dev/null
+++ b/packages/asset-buyer/test/utils/mocks.ts
@@ -0,0 +1,68 @@
+import { Web3ProviderEngine } from '@0x/subproviders';
+import * as TypeMoq from 'typemoq';
+
+import { AssetBuyer } from '../../src/asset_buyer';
+import { OrderProvider, OrderProviderResponse, OrdersAndFillableAmounts } from '../../src/types';
+
+// tslint:disable:promise-function-async
+
+// Implementing dummy class for using in mocks, see https://github.com/florinn/typemoq/issues/3
+class OrderProviderClass implements OrderProvider {
+ // tslint:disable-next-line:prefer-function-over-method
+ public async getOrdersAsync(): Promise<OrderProviderResponse> {
+ return Promise.resolve({ orders: [] });
+ }
+ // tslint:disable-next-line:prefer-function-over-method
+ public async getAvailableMakerAssetDatasAsync(takerAssetData: string): Promise<string[]> {
+ return Promise.resolve([]);
+ }
+}
+
+export const orderProviderMock = () => {
+ return TypeMoq.Mock.ofType(OrderProviderClass, TypeMoq.MockBehavior.Strict);
+};
+
+export const mockAvailableAssetDatas = (
+ mockOrderProvider: TypeMoq.IMock<OrderProviderClass>,
+ assetData: string,
+ availableAssetDatas: string[],
+) => {
+ mockOrderProvider
+ .setup(op => op.getAvailableMakerAssetDatasAsync(TypeMoq.It.isValue(assetData)))
+ .returns(() => {
+ return Promise.resolve(availableAssetDatas);
+ })
+ .verifiable(TypeMoq.Times.once());
+};
+
+const partiallyMockedAssetBuyer = (
+ provider: Web3ProviderEngine,
+ orderProvider: OrderProvider,
+): TypeMoq.IMock<AssetBuyer> => {
+ const rawAssetBuyer = new AssetBuyer(provider, orderProvider);
+ const mockedAssetBuyer = TypeMoq.Mock.ofInstance(rawAssetBuyer, TypeMoq.MockBehavior.Loose, false);
+ mockedAssetBuyer.callBase = true;
+ return mockedAssetBuyer;
+};
+
+const mockGetOrdersAndAvailableAmounts = (
+ mockedAssetBuyer: TypeMoq.IMock<AssetBuyer>,
+ assetData: string,
+ ordersAndFillableAmounts: OrdersAndFillableAmounts,
+): void => {
+ mockedAssetBuyer
+ .setup(a => a.getOrdersAndFillableAmountsAsync(assetData, false))
+ .returns(() => Promise.resolve(ordersAndFillableAmounts))
+ .verifiable(TypeMoq.Times.once());
+};
+
+export const mockedAssetBuyerWithOrdersAndFillableAmounts = (
+ provider: Web3ProviderEngine,
+ orderProvider: OrderProvider,
+ assetData: string,
+ ordersAndFillableAmounts: OrdersAndFillableAmounts,
+): TypeMoq.IMock<AssetBuyer> => {
+ const mockedAssetBuyer = partiallyMockedAssetBuyer(provider, orderProvider);
+ mockGetOrdersAndAvailableAmounts(mockedAssetBuyer, assetData, ordersAndFillableAmounts);
+ return mockedAssetBuyer;
+};
diff --git a/packages/asset-buyer/test/utils/test_helpers.ts b/packages/asset-buyer/test/utils/test_helpers.ts
index 9c7c244af..04a58d2c8 100644
--- a/packages/asset-buyer/test/utils/test_helpers.ts
+++ b/packages/asset-buyer/test/utils/test_helpers.ts
@@ -6,7 +6,7 @@ export const testHelpers = {
expectInsufficientLiquidityError: (
expect: Chai.ExpectStatic,
functionWhichTriggersError: () => void,
- expectedAmountAvailableToFill?: BigNumber,
+ expectedAmountAvailableToFill: BigNumber,
): void => {
let wasErrorThrown = false;
try {
diff --git a/packages/base-contract/CHANGELOG.json b/packages/base-contract/CHANGELOG.json
index 1a6e3f845..63b1fe8f7 100644
--- a/packages/base-contract/CHANGELOG.json
+++ b/packages/base-contract/CHANGELOG.json
@@ -1,5 +1,32 @@
[
{
+ "version": "4.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "3.0.13",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "3.0.12",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"timestamp": 1547040760,
"version": "3.0.11",
"changes": [
@@ -243,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/base-contract/CHANGELOG.md b/packages/base-contract/CHANGELOG.md
index 7a1a96639..975a56fd4 100644
--- a/packages/base-contract/CHANGELOG.md
+++ b/packages/base-contract/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v3.0.13 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v3.0.12 - _January 11, 2019_
+
+ * Dependencies updated
+
## v3.0.11 - _January 9, 2019_
* Dependencies updated
diff --git a/packages/base-contract/package.json b/packages/base-contract/package.json
index 7193c4881..db09b16a1 100644
--- a/packages/base-contract/package.json
+++ b/packages/base-contract/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/base-contract",
- "version": "3.0.11",
+ "version": "3.0.13",
"engines": {
"node": ">=6.12"
},
@@ -29,7 +29,7 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/base-contract/README.md",
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.2",
"@types/lodash": "4.14.104",
"chai": "^4.0.1",
"make-promises-safe": "^1.1.0",
@@ -40,10 +40,10 @@
"typescript": "3.0.1"
},
"dependencies": {
- "@0x/typescript-typings": "^3.0.6",
- "@0x/utils": "^2.1.1",
- "@0x/web3-wrapper": "^3.2.2",
- "ethereum-types": "^1.1.4",
+ "@0x/typescript-typings": "^3.0.8",
+ "@0x/utils": "^3.0.1",
+ "@0x/web3-wrapper": "^3.2.4",
+ "ethereum-types": "^1.1.6",
"ethers": "~4.0.4",
"lodash": "^4.17.5"
},
diff --git a/packages/base-contract/src/index.ts b/packages/base-contract/src/index.ts
index fbb8478b7..0238106f3 100644
--- a/packages/base-contract/src/index.ts
+++ b/packages/base-contract/src/index.ts
@@ -1,4 +1,4 @@
-import { abiUtils, BigNumber } from '@0x/utils';
+import { AbiEncoder, abiUtils, BigNumber } from '@0x/utils';
import { Web3Wrapper } from '@0x/web3-wrapper';
import {
AbiDefinition,
@@ -16,8 +16,8 @@ import * as _ from 'lodash';
import { formatABIDataItem } from './utils';
-export interface EthersInterfaceByFunctionSignature {
- [key: string]: ethers.utils.Interface;
+export interface AbiEncoderByFunctionSignature {
+ [key: string]: AbiEncoder.Method;
}
const REVERT_ERROR_SELECTOR = '08c379a0';
@@ -26,7 +26,7 @@ const REVERT_ERROR_SELECTOR_BYTES_LENGTH = 4;
const REVERT_ERROR_SELECTOR_END = REVERT_ERROR_SELECTOR_OFFSET + REVERT_ERROR_SELECTOR_BYTES_LENGTH * 2;
export class BaseContract {
- protected _ethersInterfacesByFunctionSignature: EthersInterfaceByFunctionSignature;
+ protected _abiEncoderByFunctionSignature: AbiEncoderByFunctionSignature;
protected _web3Wrapper: Web3Wrapper;
public abi: ContractAbi;
public address: string;
@@ -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(
@@ -65,9 +65,6 @@ export class BaseContract {
return defaultConstructorAbi;
}
}
- protected static _bnToBigNumber(_type: string, value: any): any {
- return _.isObject(value) && value._hex ? new BigNumber(value.toString()) : value;
- }
protected static async _applyDefaultsToTxDataAsync<T extends Partial<TxData | TxDataPayable>>(
txData: T,
txDefaults: Partial<TxData>,
@@ -89,10 +86,15 @@ export class BaseContract {
}
protected static _throwIfRevertWithReasonCallResult(rawCallResult: string): void {
if (rawCallResult.slice(REVERT_ERROR_SELECTOR_OFFSET, REVERT_ERROR_SELECTOR_END) === REVERT_ERROR_SELECTOR) {
- const revertReason = ethers.utils.defaultAbiCoder.decode(
- ['string'],
+ const revertReasonArray = AbiEncoder.create('(string)').decodeAsArray(
ethers.utils.hexDataSlice(rawCallResult, REVERT_ERROR_SELECTOR_BYTES_LENGTH),
);
+ if (revertReasonArray.length !== 1) {
+ throw new Error(
+ `Cannot safely decode revert reason: Expected an array with one element, got ${revertReasonArray}`,
+ );
+ }
+ const revertReason = revertReasonArray[0];
throw new Error(revertReason);
}
}
@@ -100,11 +102,11 @@ export class BaseContract {
// the given inputAbi. An argument may not be considered safely encodeable
// if it overflows the corresponding Solidity type, there is a bug in the
// encoder, or the encoder performs unsafe type coercion.
- public static strictArgumentEncodingCheck(inputAbi: DataItem[], args: any[]): void {
- const coder = new ethers.utils.AbiCoder();
+ public static strictArgumentEncodingCheck(inputAbi: DataItem[], args: any[]): string {
+ const abiEncoder = AbiEncoder.create(inputAbi);
const params = abiUtils.parseEthersParams(inputAbi);
- const rawEncoded = coder.encode(inputAbi, args);
- const rawDecoded = coder.decode(inputAbi, rawEncoded);
+ const rawEncoded = abiEncoder.encode(args);
+ const rawDecoded = abiEncoder.decodeAsArray(rawEncoded);
for (let i = 0; i < rawDecoded.length; i++) {
const original = args[i];
const decoded = rawDecoded[i];
@@ -116,13 +118,14 @@ export class BaseContract {
);
}
}
+ return rawEncoded;
}
- protected _lookupEthersInterface(functionSignature: string): ethers.utils.Interface {
- const ethersInterface = this._ethersInterfacesByFunctionSignature[functionSignature];
- if (_.isUndefined(ethersInterface)) {
+ protected _lookupAbiEncoder(functionSignature: string): AbiEncoder.Method {
+ const abiEncoder = this._abiEncoderByFunctionSignature[functionSignature];
+ if (_.isUndefined(abiEncoder)) {
throw new Error(`Failed to lookup method with function signature '${functionSignature}'`);
}
- return ethersInterface;
+ return abiEncoder;
}
protected _lookupAbi(functionSignature: string): MethodAbi {
const methodAbi = _.find(this.abi, (abiDefinition: AbiDefinition) => {
@@ -130,7 +133,7 @@ export class BaseContract {
return false;
}
// tslint:disable-next-line:no-unnecessary-type-assertion
- const abiFunctionSignature = abiUtils.getFunctionSignature(abiDefinition as MethodAbi);
+ const abiFunctionSignature = new AbiEncoder.Method(abiDefinition as MethodAbi).getSignature();
if (abiFunctionSignature === functionSignature) {
return true;
}
@@ -138,6 +141,15 @@ export class BaseContract {
}) as MethodAbi;
return methodAbi;
}
+ protected _strictEncodeArguments(functionSignature: string, functionArguments: any): string {
+ const abiEncoder = this._lookupAbiEncoder(functionSignature);
+ const inputAbi = abiEncoder.getDataItem().components;
+ if (inputAbi === undefined) {
+ throw new Error(`Undefined Method Input ABI`);
+ }
+ const abiEncodedArguments = abiEncoder.encode(functionArguments);
+ return abiEncodedArguments;
+ }
constructor(
contractName: string,
abi: ContractAbi,
@@ -152,10 +164,11 @@ export class BaseContract {
const methodAbis = this.abi.filter(
(abiDefinition: AbiDefinition) => abiDefinition.type === AbiType.Function,
) as MethodAbi[];
- this._ethersInterfacesByFunctionSignature = {};
+ this._abiEncoderByFunctionSignature = {};
_.each(methodAbis, methodAbi => {
- const functionSignature = abiUtils.getFunctionSignature(methodAbi);
- this._ethersInterfacesByFunctionSignature[functionSignature] = new ethers.utils.Interface([methodAbi]);
+ const abiEncoder = new AbiEncoder.Method(methodAbi);
+ const functionSignature = abiEncoder.getSignature();
+ this._abiEncoderByFunctionSignature[functionSignature] = abiEncoder;
});
}
}
diff --git a/packages/connect/CHANGELOG.json b/packages/connect/CHANGELOG.json
index fe32990e2..c2f16d96a 100644
--- a/packages/connect/CHANGELOG.json
+++ b/packages/connect/CHANGELOG.json
@@ -1,5 +1,32 @@
[
{
+ "version": "4.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "3.0.13",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "3.0.12",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"timestamp": 1547040760,
"version": "3.0.11",
"changes": [
@@ -228,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/connect/CHANGELOG.md b/packages/connect/CHANGELOG.md
index d01caa613..7556aae72 100644
--- a/packages/connect/CHANGELOG.md
+++ b/packages/connect/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v3.0.13 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v3.0.12 - _January 11, 2019_
+
+ * Dependencies updated
+
## v3.0.11 - _January 9, 2019_
* Dependencies updated
diff --git a/packages/connect/README.md b/packages/connect/README.md
index 6d3ee66a0..386b7bbbf 100644
--- a/packages/connect/README.md
+++ b/packages/connect/README.md
@@ -18,8 +18,8 @@ If your project is in [TypeScript](https://www.typescriptlang.org/), add the fol
## Usage
-* [Docs](https://0xproject.com/docs/connect)
-* [Tutorials](https://0xproject.com/wiki#connect)
+- [Docs](https://0xproject.com/docs/connect)
+- [Tutorials](https://0xproject.com/wiki#connect)
## Contributing
diff --git a/packages/connect/package.json b/packages/connect/package.json
index 76817f23e..15a4c12f1 100644
--- a/packages/connect/package.json
+++ b/packages/connect/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/connect",
- "version": "3.0.11",
+ "version": "3.0.13",
"engines": {
"node": ">=6.12"
},
@@ -44,12 +44,12 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/connect/README.md",
"dependencies": {
- "@0x/assert": "^1.0.21",
- "@0x/json-schemas": "^2.1.5",
- "@0x/order-utils": "^3.1.0",
- "@0x/types": "^1.5.0",
- "@0x/typescript-typings": "^3.0.6",
- "@0x/utils": "^2.1.1",
+ "@0x/assert": "^1.0.23",
+ "@0x/json-schemas": "^2.1.7",
+ "@0x/order-utils": "^3.1.2",
+ "@0x/types": "^1.5.2",
+ "@0x/typescript-typings": "^3.0.8",
+ "@0x/utils": "^3.0.1",
"lodash": "^4.17.5",
"query-string": "^5.0.1",
"sinon": "^4.0.0",
@@ -57,7 +57,7 @@
"websocket": "^1.0.25"
},
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.2",
"@types/fetch-mock": "^6.0.3",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
diff --git a/packages/contract-addresses/CHANGELOG.json b/packages/contract-addresses/CHANGELOG.json
index 36684d443..8800f2f73 100644
--- a/packages/contract-addresses/CHANGELOG.json
+++ b/packages/contract-addresses/CHANGELOG.json
@@ -1,5 +1,15 @@
[
{
+ "version": "2.2.0",
+ "changes": [
+ {
+ "note": "Added migration for `MultiAssetProxy` contract",
+ "pr": 1503
+ }
+ ],
+ "timestamp": 1547561734
+ },
+ {
"version": "2.1.0",
"changes": [
{
diff --git a/packages/contract-addresses/CHANGELOG.md b/packages/contract-addresses/CHANGELOG.md
index d7f2ff7ea..1f3d187a4 100644
--- a/packages/contract-addresses/CHANGELOG.md
+++ b/packages/contract-addresses/CHANGELOG.md
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v2.2.0 - _January 15, 2019_
+
+ * Added migration for `MultiAssetProxy` contract (#1503)
+
## v2.1.0 - _January 9, 2019_
* Added testnet entries for Dutch Auction contract (kovan,rinkeby,ropsten) (#1465)
diff --git a/packages/contract-addresses/package.json b/packages/contract-addresses/package.json
index c5a133ddf..260322081 100644
--- a/packages/contract-addresses/package.json
+++ b/packages/contract-addresses/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/contract-addresses",
- "version": "2.1.0",
+ "version": "2.2.0",
"engines": {
"node": ">=6.12"
},
diff --git a/packages/contract-addresses/src/index.ts b/packages/contract-addresses/src/index.ts
index d181a1bec..4f580e825 100644
--- a/packages/contract-addresses/src/index.ts
+++ b/packages/contract-addresses/src/index.ts
@@ -70,15 +70,15 @@ const networkToAddresses: { [networkId: number]: ContractAddresses } = {
},
// NetworkId 50 represents our Ganache snapshot generated from migrations.
50: {
- exchange: '0x48bacb9266a570d521063ef5dd96e61686dbe788',
erc20Proxy: '0x1dc4c1cefef38a777b15aa20260a54e584b16c48',
erc721Proxy: '0x1d7022f5b17d2f8b695918fb48fa1089c9f85401',
zrxToken: '0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c',
etherToken: '0x0b1ba0af832d7c05fd64161e0db78e85978e8082',
- assetProxyOwner: '0x34d402f14d58e001d8efbe6585051bf9706aa064',
- forwarder: '0xb69e673309512a9d726f87304c6984054f87a93b',
- orderValidator: '0xe86bb98fcf9bff3512c74589b78fb168200cc546',
- dutchAuction: '0xdc688d29394a3f1e6f1e5100862776691afaf3d2',
+ exchange: '0x48bacb9266a570d521063ef5dd96e61686dbe788',
+ assetProxyOwner: '0x04b5dadd2c0d6a261bfafbc964e0cac48585def3',
+ forwarder: '0x6000eca38b8b5bba64986182fe2a69c57f6b5414',
+ orderValidator: '0x32eecaf51dfea9618e9bc94e9fbfddb1bbdcba15',
+ dutchAuction: '0x7e3f4e1deb8d3a05d9d2da87d9521268d0ec3239',
},
};
diff --git a/packages/contract-artifacts/CHANGELOG.json b/packages/contract-artifacts/CHANGELOG.json
index 237014d09..c488fa5c5 100644
--- a/packages/contract-artifacts/CHANGELOG.json
+++ b/packages/contract-artifacts/CHANGELOG.json
@@ -1,5 +1,15 @@
[
{
+ "version": "1.3.0",
+ "changes": [
+ {
+ "note": "Added artifact for `MultiAssetProxy` contract",
+ "pr": 1503
+ }
+ ],
+ "timestamp": 1547561734
+ },
+ {
"version": "1.2.0",
"changes": [
{
diff --git a/packages/contract-artifacts/CHANGELOG.md b/packages/contract-artifacts/CHANGELOG.md
index 7f96cb571..c1118a3b9 100644
--- a/packages/contract-artifacts/CHANGELOG.md
+++ b/packages/contract-artifacts/CHANGELOG.md
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v1.3.0 - _January 15, 2019_
+
+ * Added artifact for `MultiAssetProxy` contract (#1503)
+
## v1.2.0 - _January 9, 2019_
* Added artifact for Dutch Auction contract (#1465)
diff --git a/packages/contract-artifacts/artifacts/MultiAssetProxy.json b/packages/contract-artifacts/artifacts/MultiAssetProxy.json
new file mode 100644
index 000000000..f143cd817
--- /dev/null
+++ b/packages/contract-artifacts/artifacts/MultiAssetProxy.json
@@ -0,0 +1,263 @@
+{
+ "schemaVersion": "2.0.0",
+ "contractName": "MultiAssetProxy",
+ "compilerOutput": {
+ "abi": [
+ {
+ "constant": true,
+ "inputs": [
+ {
+ "name": "",
+ "type": "bytes4"
+ }
+ ],
+ "name": "assetProxies",
+ "outputs": [
+ {
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "payable": false,
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "name": "target",
+ "type": "address"
+ }
+ ],
+ "name": "addAuthorizedAddress",
+ "outputs": [],
+ "payable": false,
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [
+ {
+ "name": "",
+ "type": "uint256"
+ }
+ ],
+ "name": "authorities",
+ "outputs": [
+ {
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "payable": false,
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [
+ {
+ "name": "assetProxyId",
+ "type": "bytes4"
+ }
+ ],
+ "name": "getAssetProxy",
+ "outputs": [
+ {
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "payable": false,
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "name": "target",
+ "type": "address"
+ }
+ ],
+ "name": "removeAuthorizedAddress",
+ "outputs": [],
+ "payable": false,
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [],
+ "name": "owner",
+ "outputs": [
+ {
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "payable": false,
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "name": "target",
+ "type": "address"
+ },
+ {
+ "name": "index",
+ "type": "uint256"
+ }
+ ],
+ "name": "removeAuthorizedAddressAtIndex",
+ "outputs": [],
+ "payable": false,
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [],
+ "name": "getProxyId",
+ "outputs": [
+ {
+ "name": "",
+ "type": "bytes4"
+ }
+ ],
+ "payable": false,
+ "stateMutability": "pure",
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [
+ {
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "name": "authorized",
+ "outputs": [
+ {
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "payable": false,
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "name": "assetProxy",
+ "type": "address"
+ }
+ ],
+ "name": "registerAssetProxy",
+ "outputs": [],
+ "payable": false,
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "constant": true,
+ "inputs": [],
+ "name": "getAuthorizedAddresses",
+ "outputs": [
+ {
+ "name": "",
+ "type": "address[]"
+ }
+ ],
+ "payable": false,
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "constant": false,
+ "inputs": [
+ {
+ "name": "newOwner",
+ "type": "address"
+ }
+ ],
+ "name": "transferOwnership",
+ "outputs": [],
+ "payable": false,
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "payable": false,
+ "stateMutability": "nonpayable",
+ "type": "fallback"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "name": "target",
+ "type": "address"
+ },
+ {
+ "indexed": true,
+ "name": "caller",
+ "type": "address"
+ }
+ ],
+ "name": "AuthorizedAddressAdded",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "name": "target",
+ "type": "address"
+ },
+ {
+ "indexed": true,
+ "name": "caller",
+ "type": "address"
+ }
+ ],
+ "name": "AuthorizedAddressRemoved",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": false,
+ "name": "id",
+ "type": "bytes4"
+ },
+ {
+ "indexed": false,
+ "name": "assetProxy",
+ "type": "address"
+ }
+ ],
+ "name": "AssetProxyRegistered",
+ "type": "event"
+ }
+ ],
+ "evm": {
+ "bytecode": {
+ "linkReferences": {},
+ "object": "0x608060405260008054600160a060020a03191633179055611527806100256000396000f3006080604052600436106100b95763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633fd3c997811461048457806342f1181e146104e7578063494503d414610517578063607041081461052f57806370712939146105695780638da5cb5b146105975780639ad26744146105ac578063ae25532e146105dd578063b918161114610627578063c585bb9314610669578063d39de6e914610697578063f2fde38b146106fc575b3480156100c557600080fd5b507fffffffff00000000000000000000000000000000000000000000000000000000600035167fa85e59e40000000000000000000000000000000000000000000000000000000081141561047f573360005260026020526040600020541515610199577f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c1553454e4445525f4e4f545f415554484f52495a454400000000000000604052600060605260646000fd5b600435602881013560488201356048820183016020810335604883018501602081033580830315610235577f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c0f4c454e4754485f4d49534d4154434800000000000000000000000000604052600060605260646000fd5b60646000803760806004526064356020840260008060005b8381101561047c5780890135858102818782041487151715156102db577f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c1055494e543235365f4f564552464c4f57000000000000000000000000604052600060605260646000fd5b8060645282890135606881018d018f01602081038035600481101561038a577f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c1e4c454e4754485f475245415445525f5448414e5f335f5245515549526040527f454400000000000000000000000000000000000000000000000000000000000060605260646000fd5b7fffffffff00000000000000000000000000000000000000000000000000000000833516898103156103cb5780995089608452600160a45260406084205498505b881515610443577f08c379a0000000000000000000000000000000000000000000000000000000006000527c20000000000000000000000000000000000000000000000000000000006020527c1a41535345545f50524f58595f444f45535f4e4f545f45584953540000604052600060605260646000fd5b60208201836084376000808360a4016000808d5af1801515610469573d6000803e3d6000fd5b505050505050505060208101905061024d565b50005b600080fd5b34801561049057600080fd5b506104be7fffffffff000000000000000000000000000000000000000000000000000000006004351661072a565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156104f357600080fd5b5061051573ffffffffffffffffffffffffffffffffffffffff60043516610752565b005b34801561052357600080fd5b506104be60043561093e565b34801561053b57600080fd5b506104be7fffffffff0000000000000000000000000000000000000000000000000000000060043516610973565b34801561057557600080fd5b5061051573ffffffffffffffffffffffffffffffffffffffff600435166109bd565b3480156105a357600080fd5b506104be610cb6565b3480156105b857600080fd5b5061051573ffffffffffffffffffffffffffffffffffffffff60043516602435610cd2565b3480156105e957600080fd5b506105f2611087565b604080517fffffffff000000000000000000000000000000000000000000000000000000009092168252519081900360200190f35b34801561063357600080fd5b5061065573ffffffffffffffffffffffffffffffffffffffff600435166110bd565b604080519115158252519081900360200190f35b34801561067557600080fd5b5061051573ffffffffffffffffffffffffffffffffffffffff600435166110d2565b3480156106a357600080fd5b506106ac61135f565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156106e85781810151838201526020016106d0565b505050509050019250505060405180910390f35b34801561070857600080fd5b5061051573ffffffffffffffffffffffffffffffffffffffff600435166113ce565b60016020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1633146107d857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081526002602052604090205460ff161561086d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f5441524745545f414c52454144595f415554484f52495a454400000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff811660008181526002602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001684179055513392917f3147867c59d17e8fa9d522465651d44aae0a9e38f902f3475b97e58072f0ed4c91a350565b600380548290811061094c57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b7fffffffff000000000000000000000000000000000000000000000000000000001660009081526001602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b6000805473ffffffffffffffffffffffffffffffffffffffff163314610a4457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526002602052604090205460ff161515610ada57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5441524745545f4e4f545f415554484f52495a45440000000000000000000000604482015290519081900360640190fd5b5073ffffffffffffffffffffffffffffffffffffffff8116600090815260026020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690555b600354811015610c6f578173ffffffffffffffffffffffffffffffffffffffff16600382815481101515610b5757fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff161415610c6757600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101908110610baf57fe5b6000918252602090912001546003805473ffffffffffffffffffffffffffffffffffffffff9092169183908110610be257fe5b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190610c6190826114b4565b50610c6f565b600101610b27565b604051339073ffffffffffffffffffffffffffffffffffffffff8416907f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b090600090a35050565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314610d5857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526002602052604090205460ff161515610dee57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5441524745545f4e4f545f415554484f52495a45440000000000000000000000604482015290519081900360640190fd5b6003548110610e5e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f494e4445585f4f55545f4f465f424f554e445300000000000000000000000000604482015290519081900360640190fd5b8173ffffffffffffffffffffffffffffffffffffffff16600382815481101515610e8457fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1614610f1257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f415554484f52495a45445f414444524553535f4d49534d415443480000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260026020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101908110610f8d57fe5b6000918252602090912001546003805473ffffffffffffffffffffffffffffffffffffffff9092169183908110610fc057fe5b600091825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019061103f90826114b4565b50604051339073ffffffffffffffffffffffffffffffffffffffff8416907f1f32c1b084e2de0713b8fb16bd46bb9df710a3dbeae2f3ca93af46e016dcc6b090600090a35050565b604080517f4d756c746941737365742875696e743235365b5d2c62797465735b5d290000008152905190819003601d0190205b90565b60026020526000908152604090205460ff1681565b600080548190819073ffffffffffffffffffffffffffffffffffffffff16331461115d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b8392508273ffffffffffffffffffffffffffffffffffffffff1663ae25532e6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1580156111c457600080fd5b505af11580156111d8573d6000803e3d6000fd5b505050506040513d60208110156111ee57600080fd5b50517fffffffff00000000000000000000000000000000000000000000000000000000811660009081526001602052604090205490925073ffffffffffffffffffffffffffffffffffffffff16905080156112aa57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f41535345545f50524f58595f414c52454144595f455849535453000000000000604482015290519081900360640190fd5b7fffffffff00000000000000000000000000000000000000000000000000000000821660008181526001602090815260409182902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff88811691909117909155825193845287169083015280517fd2c6b762299c609bdb96520b58a49bfb80186934d4f71a86a367571a15c031949281900390910190a150505050565b606060038054806020026020016040519081016040528092919081815260200182805480156113c457602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311611399575b5050505050905090565b60005473ffffffffffffffffffffffffffffffffffffffff16331461145457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f434f4e54524143545f4f574e455200000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116156114b157600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790555b50565b8154818355818111156114d8576000838152602090206114d89181019083016114dd565b505050565b6110ba91905b808211156114f757600081556001016114e3565b50905600a165627a7a72305820edc27b59aaf514c0deebc8a00d0f17f092fc6e8b8544bcccb6f7e8f4a81c781d0029"
+ }
+ }
+ },
+ "networks": {}
+}
diff --git a/packages/contract-artifacts/package.json b/packages/contract-artifacts/package.json
index b819520c6..6a98615d7 100644
--- a/packages/contract-artifacts/package.json
+++ b/packages/contract-artifacts/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/contract-artifacts",
- "version": "1.2.0",
+ "version": "1.3.0",
"engines": {
"node": ">=6.12"
},
diff --git a/packages/contract-artifacts/src/index.ts b/packages/contract-artifacts/src/index.ts
index bd5f8fee3..1cbda9518 100644
--- a/packages/contract-artifacts/src/index.ts
+++ b/packages/contract-artifacts/src/index.ts
@@ -1,7 +1,7 @@
import * as AssetProxyOwner from '../artifacts/AssetProxyOwner.json';
-import * as DutchAuction from '../artifacts/DutchAuction.json';
import * as DummyERC20Token from '../artifacts/DummyERC20Token.json';
import * as DummyERC721Token from '../artifacts/DummyERC721Token.json';
+import * as DutchAuction from '../artifacts/DutchAuction.json';
import * as ERC20Proxy from '../artifacts/ERC20Proxy.json';
import * as ERC20Token from '../artifacts/ERC20Token.json';
import * as ERC721Proxy from '../artifacts/ERC721Proxy.json';
@@ -10,6 +10,7 @@ import * as Exchange from '../artifacts/Exchange.json';
import * as Forwarder from '../artifacts/Forwarder.json';
import * as IValidator from '../artifacts/IValidator.json';
import * as IWallet from '../artifacts/IWallet.json';
+import * as MultiAssetProxy from '../artifacts/MultiAssetProxy.json';
import * as OrderValidator from '../artifacts/OrderValidator.json';
import * as WETH9 from '../artifacts/WETH9.json';
import * as ZRXToken from '../artifacts/ZRXToken.json';
@@ -27,6 +28,7 @@ export {
Forwarder,
IValidator,
IWallet,
+ MultiAssetProxy,
OrderValidator,
WETH9,
ZRXToken,
diff --git a/packages/contract-artifacts/tsconfig.json b/packages/contract-artifacts/tsconfig.json
index 59169fceb..1aef41bb8 100644
--- a/packages/contract-artifacts/tsconfig.json
+++ b/packages/contract-artifacts/tsconfig.json
@@ -19,6 +19,7 @@
"./artifacts/Forwarder.json",
"./artifacts/IValidator.json",
"./artifacts/IWallet.json",
+ "./artifacts/MultiAssetProxy.json",
"./artifacts/OrderValidator.json",
"./artifacts/WETH9.json",
"./artifacts/ZRXToken.json"
diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json
index fd8dfa427..30199ae1d 100644
--- a/packages/contract-wrappers/CHANGELOG.json
+++ b/packages/contract-wrappers/CHANGELOG.json
@@ -1,5 +1,46 @@
[
{
+ "version": "6.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547747677,
+ "version": "5.0.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "version": "5.0.0",
+ "changes": [
+ {
+ "note": "Renamed OrderStatus enum members to PascalCase to conform with tslint enum-naming rule",
+ "pr": 1474
+ },
+ {
+ "note": "Remove Exchange `matchOrdersAsync` optimization",
+ "pr": 1514
+ }
+ ],
+ "timestamp": 1547561734
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "4.2.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "4.2.0",
"changes": [
{
@@ -52,8 +93,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
}
],
@@ -81,18 +121,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
}
],
@@ -123,28 +160,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
},
{
@@ -180,13 +212,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
}
],
@@ -235,18 +265,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
}
],
@@ -265,13 +292,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/contract-wrappers/CHANGELOG.md b/packages/contract-wrappers/CHANGELOG.md
index fe7bb7b81..28cbf2ec6 100644
--- a/packages/contract-wrappers/CHANGELOG.md
+++ b/packages/contract-wrappers/CHANGELOG.md
@@ -5,6 +5,19 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v5.0.1 - _January 17, 2019_
+
+ * Dependencies updated
+
+## v5.0.0 - _January 15, 2019_
+
+ * Renamed OrderStatus enum members to PascalCase to conform with tslint enum-naming rule (#1474)
+ * Remove Exchange `matchOrdersAsync` optimization (#1514)
+
+## v4.2.1 - _January 11, 2019_
+
+ * Dependencies updated
+
## v4.2.0 - _January 9, 2019_
* Added Dutch Auction wrapper (#1465)
diff --git a/packages/contract-wrappers/package.json b/packages/contract-wrappers/package.json
index 708b4249a..cc7dc1a3e 100644
--- a/packages/contract-wrappers/package.json
+++ b/packages/contract-wrappers/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/contract-wrappers",
- "version": "4.2.0",
+ "version": "5.0.1",
"description": "Smart TS wrappers for 0x smart contracts",
"keywords": [
"0xproject",
@@ -37,10 +37,10 @@
"node": ">=6.0.0"
},
"devDependencies": {
- "@0x/dev-utils": "^1.0.22",
- "@0x/migrations": "^2.3.0",
- "@0x/subproviders": "^2.1.9",
- "@0x/tslint-config": "^2.0.0",
+ "@0x/dev-utils": "^1.0.24",
+ "@0x/migrations": "^2.4.0",
+ "@0x/subproviders": "^2.1.11",
+ "@0x/tslint-config": "^2.0.2",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"@types/node": "*",
@@ -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": "^3.0.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",
@@ -65,19 +65,19 @@
"web3-provider-engine": "14.0.6"
},
"dependencies": {
- "@0x/abi-gen-wrappers": "^2.1.0",
- "@0x/assert": "^1.0.21",
- "@0x/contract-addresses": "^2.1.0",
- "@0x/contract-artifacts": "^1.2.0",
- "@0x/contracts-test-utils": "^1.0.3",
- "@0x/fill-scenarios": "^1.1.0",
- "@0x/json-schemas": "^2.1.5",
- "@0x/order-utils": "^3.1.0",
- "@0x/types": "^1.5.0",
- "@0x/typescript-typings": "^3.0.6",
- "@0x/utils": "^2.1.1",
- "@0x/web3-wrapper": "^3.2.2",
- "ethereum-types": "^1.1.4",
+ "@0x/abi-gen-wrappers": "^2.2.0",
+ "@0x/assert": "^1.0.23",
+ "@0x/contract-addresses": "^2.2.0",
+ "@0x/contract-artifacts": "^1.3.0",
+ "@0x/contracts-test-utils": "^2.0.1",
+ "@0x/fill-scenarios": "^1.1.2",
+ "@0x/json-schemas": "^2.1.7",
+ "@0x/order-utils": "^3.1.2",
+ "@0x/types": "^1.5.2",
+ "@0x/typescript-typings": "^3.0.8",
+ "@0x/utils": "^3.0.1",
+ "@0x/web3-wrapper": "^3.2.4",
+ "ethereum-types": "^1.1.6",
"ethereumjs-abi": "0.6.5",
"ethereumjs-blockstream": "6.0.0",
"ethereumjs-util": "^5.1.1",
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 ad42cfd4f..cd79a0e5d 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/contract_wrappers/exchange_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts
index c9556971a..49193f816 100644
--- a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts
+++ b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts
@@ -743,10 +743,6 @@ export class ExchangeWrapper extends ContractWrapper {
rightSignedOrder.takerAssetData !== leftSignedOrder.makerAssetData
) {
throw new Error(ExchangeWrapperError.AssetDataMismatch);
- } else {
- // Smart contracts assigns the asset data from the left order to the right one so we can save gas on reducing the size of call data
- rightSignedOrder.makerAssetData = '0x';
- rightSignedOrder.takerAssetData = '0x';
}
const exchangeInstance = await this._getExchangeContractAsync();
if (orderTransactionOpts.shouldValidate) {
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 1ff130a48..c35b24664 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/types.ts b/packages/contract-wrappers/src/types.ts
index 945ca88cd..29cf8b2c4 100644
--- a/packages/contract-wrappers/src/types.ts
+++ b/packages/contract-wrappers/src/types.ts
@@ -177,13 +177,13 @@ export interface OrderInfo {
}
export enum OrderStatus {
- INVALID = 0,
- INVALID_MAKER_ASSET_AMOUNT,
- INVALID_TAKER_ASSET_AMOUNT,
- FILLABLE,
- EXPIRED,
- FULLY_FILLED,
- CANCELLED,
+ Invalid = 0,
+ InvalidMakerAssetAmount,
+ InvalidTakerAssetAmount,
+ Fillable,
+ Expired,
+ FullyFilled,
+ Cancelled,
}
export interface TraderInfo {
diff --git a/packages/contract-wrappers/src/utils/assert.ts b/packages/contract-wrappers/src/utils/assert.ts
index 3f02ed052..d30c6b29c 100644
--- a/packages/contract-wrappers/src/utils/assert.ts
+++ b/packages/contract-wrappers/src/utils/assert.ts
@@ -70,7 +70,7 @@ export const assert = {
/*
* Asserts that all the orders have the same value for the provided propertyName
* If the value parameter is provided, this asserts that all orders have the prope
- */
+ */
ordersHaveAtMostOneUniqueValueForProperty(orders: Order[], propertyName: string, value?: any): void {
const allValues = _.map(orders, order => _.get(order, propertyName));
sharedAssert.hasAtMostOneUniqueValue(
diff --git a/packages/contract-wrappers/src/utils/exchange_transfer_simulator.ts b/packages/contract-wrappers/src/utils/exchange_transfer_simulator.ts
index f374d509b..4b75ea386 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 0b3270e78..ab69385e7 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<T extends object>(obj: T): Partial<T> {
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 e3efef19d..cc2419aa2 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/contract-wrappers/test/exchange_wrapper_test.ts b/packages/contract-wrappers/test/exchange_wrapper_test.ts
index 73ce6c743..a1d60dc6e 100644
--- a/packages/contract-wrappers/test/exchange_wrapper_test.ts
+++ b/packages/contract-wrappers/test/exchange_wrapper_test.ts
@@ -109,7 +109,7 @@ describe('ExchangeWrapper', () => {
);
await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
const orderInfo = await contractWrappers.exchange.getOrderInfoAsync(signedOrder);
- expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FULLY_FILLED);
+ expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FullyFilled);
});
});
describe('#fillOrKillOrderAsync', () => {
@@ -157,7 +157,7 @@ describe('ExchangeWrapper', () => {
);
await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
const orderInfo = await contractWrappers.exchange.getOrderInfoAsync(signedOrder);
- expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FULLY_FILLED);
+ expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FullyFilled);
});
});
describe('#marketSellOrdersAsync', () => {
@@ -183,7 +183,7 @@ describe('ExchangeWrapper', () => {
);
await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
const orderInfo = await contractWrappers.exchange.getOrderInfoAsync(signedOrder);
- expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FULLY_FILLED);
+ expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FullyFilled);
});
});
describe('#batchFillOrdersNoThrowAsync', () => {
@@ -197,9 +197,9 @@ describe('ExchangeWrapper', () => {
);
await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
let orderInfo = await contractWrappers.exchange.getOrderInfoAsync(signedOrder);
- expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FULLY_FILLED);
+ expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FullyFilled);
orderInfo = await contractWrappers.exchange.getOrderInfoAsync(anotherSignedOrder);
- expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FULLY_FILLED);
+ expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FullyFilled);
});
});
describe('#batchFillOrKillOrdersAsync', () => {
diff --git a/packages/contract-wrappers/test/forwarder_wrapper_test.ts b/packages/contract-wrappers/test/forwarder_wrapper_test.ts
index ff4ff8b67..0d197eced 100644
--- a/packages/contract-wrappers/test/forwarder_wrapper_test.ts
+++ b/packages/contract-wrappers/test/forwarder_wrapper_test.ts
@@ -97,8 +97,8 @@ describe('ForwarderWrapper', () => {
);
await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
const ordersInfo = await contractWrappers.exchange.getOrdersInfoAsync([signedOrder, anotherSignedOrder]);
- expect(ordersInfo[0].orderStatus).to.be.equal(OrderStatus.FULLY_FILLED);
- expect(ordersInfo[1].orderStatus).to.be.equal(OrderStatus.FULLY_FILLED);
+ expect(ordersInfo[0].orderStatus).to.be.equal(OrderStatus.FullyFilled);
+ expect(ordersInfo[1].orderStatus).to.be.equal(OrderStatus.FullyFilled);
});
it('should throw when invalid transaction and shouldValidate is true', async () => {
const signedOrders = [signedOrder];
@@ -131,8 +131,8 @@ describe('ForwarderWrapper', () => {
);
await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
const ordersInfo = await contractWrappers.exchange.getOrdersInfoAsync([signedOrder, anotherSignedOrder]);
- expect(ordersInfo[0].orderStatus).to.be.equal(OrderStatus.FULLY_FILLED);
- expect(ordersInfo[1].orderStatus).to.be.equal(OrderStatus.FILLABLE);
+ expect(ordersInfo[0].orderStatus).to.be.equal(OrderStatus.FullyFilled);
+ expect(ordersInfo[1].orderStatus).to.be.equal(OrderStatus.Fillable);
expect(ordersInfo[1].orderTakerAssetFilledAmount).to.be.bignumber.equal(new BigNumber(4)); // only 95% of ETH is sold
});
it('should throw when invalid transaction and shouldValidate is true', async () => {
diff --git a/packages/contract-wrappers/test/order_validator_wrapper_test.ts b/packages/contract-wrappers/test/order_validator_wrapper_test.ts
index da3f99e72..c61c05d31 100644
--- a/packages/contract-wrappers/test/order_validator_wrapper_test.ts
+++ b/packages/contract-wrappers/test/order_validator_wrapper_test.ts
@@ -117,9 +117,9 @@ describe('OrderValidator', () => {
it('should return correct on-chain order info for input orders', async () => {
const firstOrderInfo = ordersInfo[0];
const secondOrderInfo = ordersInfo[1];
- expect(firstOrderInfo.orderStatus).to.be.equal(OrderStatus.FILLABLE);
+ expect(firstOrderInfo.orderStatus).to.be.equal(OrderStatus.Fillable);
expect(firstOrderInfo.orderTakerAssetFilledAmount).to.bignumber.equal(constants.ZERO_AMOUNT);
- expect(secondOrderInfo.orderStatus).to.be.equal(OrderStatus.FILLABLE);
+ expect(secondOrderInfo.orderStatus).to.be.equal(OrderStatus.Fillable);
expect(secondOrderInfo.orderTakerAssetFilledAmount).to.bignumber.equal(constants.ZERO_AMOUNT);
});
it('should return correct on-chain trader info for input takers', async () => {
diff --git a/packages/contract-wrappers/test/utils/token_utils.ts b/packages/contract-wrappers/test/utils/token_utils.ts
index f8a88637f..e390d2775 100644
--- a/packages/contract-wrappers/test/utils/token_utils.ts
+++ b/packages/contract-wrappers/test/utils/token_utils.ts
@@ -9,14 +9,14 @@ import { provider, txDefaults, web3Wrapper } from './web3_wrapper';
// Before we were fetching them from the TokenRegistry but now we can't as it's deprecated and removed.
// TODO(albrow): Import these from the migrations package instead of hard-coding them.
const DUMMY_ERC_20_ADRESSES = [
- '0x6dfff22588be9b3ef8cf0ad6dc9b84796f9fb45f',
- '0xcfc18cec799fbd1793b5c43e773c98d4d61cc2db',
- '0xf22469f31527adc53284441bae1665a7b9214dba',
- '0x10add991de718a69dec2117cb6aa28098836511b',
- '0x8d61158a366019ac78db4149d75fff9dda51160d',
+ '0x34d402f14d58e001d8efbe6585051bf9706aa064',
+ '0x25b8fe1de9daf8ba351890744ff28cf7dfa8f5e3',
+ '0xcdb594a32b1cc3479d8746279712c39d18a07fc0',
+ '0x1e2f9e10d02a6b8f8f69fcbf515e75039d2ea30d',
+ '0xbe0037eaf2d64fe5529bca93c18c9702d3930376',
];
-const DUMMY_ERC_721_ADRESSES = ['0x131855dda0aaff096f6854854c55a4debf61077a'];
+const DUMMY_ERC_721_ADRESSES = ['0x07f96aa816c1f244cbc6ef114bb2b023ba54a2eb'];
export const tokenUtils = {
getDummyERC20TokenAddresses(): string[] {
diff --git a/packages/dev-tools-pages/.gitignore b/packages/dev-tools-pages/.gitignore
index 557b82311..d70ebaa1d 100644
--- a/packages/dev-tools-pages/.gitignore
+++ b/packages/dev-tools-pages/.gitignore
@@ -1,3 +1 @@
-public
-assets/fonts/*.woff
-assets/fonts/*.woff2 \ No newline at end of file
+public \ No newline at end of file
diff --git a/packages/dev-tools-pages/README.md b/packages/dev-tools-pages/README.md
index cbc459be7..47d7e5865 100644
--- a/packages/dev-tools-pages/README.md
+++ b/packages/dev-tools-pages/README.md
@@ -73,13 +73,13 @@ yarn prettier
##### Toolkit
-* [Styled Components](https://www.styled-components.com/)
-* [BassCSS](http://basscss.com/)
+- [Styled Components](https://www.styled-components.com/)
+- [BassCSS](http://basscss.com/)
##### Recommended Atom packages:
-* [atom-typescript](https://atom.io/packages/atom-typescript)
-* [linter-tslint](https://atom.io/packages/linter-tslint)
+- [atom-typescript](https://atom.io/packages/atom-typescript)
+- [linter-tslint](https://atom.io/packages/linter-tslint)
## Contributing
diff --git a/packages/dev-tools-pages/assets/crawl.html b/packages/dev-tools-pages/assets/crawl.html
index 9135c3ede..352300d73 100644
--- a/packages/dev-tools-pages/assets/crawl.html
+++ b/packages/dev-tools-pages/assets/crawl.html
@@ -1,20 +1,17 @@
<!DOCTYPE html>
<html lang="en">
-<head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>Document</title>
-</head>
-<body>
-
-<ul>
-<li><a href="/compiler">Compiler</a></li>
-<li><a href="/cov">Cov</a></li>
-<li><a href="/profiler">Profiler</a></li>
-<li><a href="/trace">Trace</a></li>
-
-</ul>
-
-</body>
-</html> \ No newline at end of file
+ <head>
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta http-equiv="X-UA-Compatible" content="ie=edge" />
+ <title>Test</title>
+ </head>
+ <body>
+ <ul>
+ <li><a href="/compiler">Compiler</a></li>
+ <li><a href="/coverage">Coverage</a></li>
+ <li><a href="/profiler">Profiler</a></li>
+ <li><a href="/trace">Trace</a></li>
+ </ul>
+ </body>
+</html>
diff --git a/packages/dev-tools-pages/assets/fonts/MaisonNeue-Bold-subset.woff2 b/packages/dev-tools-pages/assets/fonts/MaisonNeue-Bold-subset.woff2
new file mode 100644
index 000000000..54424f6fc
--- /dev/null
+++ b/packages/dev-tools-pages/assets/fonts/MaisonNeue-Bold-subset.woff2
Binary files differ
diff --git a/packages/dev-tools-pages/assets/fonts/MaisonNeue-Book-subset.woff2 b/packages/dev-tools-pages/assets/fonts/MaisonNeue-Book-subset.woff2
new file mode 100644
index 000000000..8c2dea7ef
--- /dev/null
+++ b/packages/dev-tools-pages/assets/fonts/MaisonNeue-Book-subset.woff2
Binary files differ
diff --git a/packages/dev-tools-pages/package.json b/packages/dev-tools-pages/package.json
index db927849e..feab72856 100644
--- a/packages/dev-tools-pages/package.json
+++ b/packages/dev-tools-pages/package.json
@@ -1,22 +1,32 @@
{
"name": "@0x/dev-tools-pages",
- "version": "0.0.11",
+ "version": "0.0.14",
"engines": {
"node": ">=6.12"
},
"private": true,
"description": "0x Dev tools pages",
"scripts": {
- "build": "node --max_old_space_size=8192 ../../node_modules/.bin/webpack --mode production && react-snap",
+ "build": "node --max_old_space_size=8192 ../../node_modules/.bin/webpack --mode production",
"build:ci": "yarn build",
"build:dev": "../../node_modules/.bin/webpack --mode development",
"clean": "shx rm -f public/bundle*",
"lint": "tslint --format stylish --project . 'ts/**/*.ts' 'ts/**/*.tsx'",
- "dev": "webpack-dev-server --mode development --content-base public"
+ "dev": "webpack-dev-server --mode development --content-base public",
+ "deploy:all": "npm run build; npm run deploy:compiler; npm run deploy:compiler:index; npm run deploy:coverage; npm run deploy:coverage:index; npm run deploy:profiler; npm run deploy:profiler:index; npm run deploy:trace; npm run deploy:trace:index;",
+ "deploy:compiler": "DIR_NAME=./public/. BUCKET=s3://sol-compiler.com yarn s3:sync --exclude 'bundle-cov*' --exclude 'bundle-trace*' --exclude 'bundle-profiler*'",
+ "deploy:coverage": "DIR_NAME=./public/. BUCKET=s3://sol-coverage.com yarn s3:sync --exclude 'bundle-compiler*' --exclude 'bundle-trace*' --exclude 'bundle-profiler*'",
+ "deploy:profiler": "DIR_NAME=./public/. BUCKET=s3://sol-profiler.com yarn s3:sync --exclude 'bundle-cov*' --exclude 'bundle-trace*' --exclude 'bundle-compiler*'",
+ "deploy:trace": "DIR_NAME=./public/. BUCKET=s3://sol-trace.com yarn s3:sync --exclude 'bundle-cov*' --exclude 'bundle-compiler*' --exclude 'bundle-profiler*'",
+ "deploy:compiler:index": "DIR_NAME=./public/compiler/. BUCKET=s3://sol-compiler.com yarn s3:sync",
+ "deploy:coverage:index": "DIR_NAME=./public/coverage/. BUCKET=s3://sol-coverage.com yarn s3:sync",
+ "deploy:profiler:index": "DIR_NAME=./public/profiler/. BUCKET=s3://sol-profiler.com yarn s3:sync",
+ "deploy:trace:index": "DIR_NAME=./public/trace/. BUCKET=s3://sol-trace.com yarn s3:sync",
+ "s3:sync": "aws s3 sync $DIR_NAME $BUCKET --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --exclude *.map.js --exclude 'profiler/*' --exclude 'trace/*' --exclude 'coverage/*' --exclude 'compiler/*'"
},
"license": "Apache-2.0",
"dependencies": {
- "@0x/react-shared": "^1.1.0",
+ "@0x/react-shared": "^1.1.2",
"basscss": "^8.0.3",
"bowser": "^1.9.3",
"highlight.js": "^9.13.1",
@@ -51,7 +61,6 @@
"less-loader": "^4.1.0",
"make-promises-safe": "^1.1.0",
"raw-loader": "^0.5.1",
- "react-snap": "^1.19.0",
"react-svg-loader": "^2.1.0",
"shx": "^0.2.2",
"source-map-loader": "^0.2.4",
@@ -65,12 +74,5 @@
"webpack-bundle-analyzer": "^3.0.3",
"webpack-cli": "3.1.2",
"webpack-dev-server": "^3.1.9"
- },
- "reactSnap": {
- "source": "public",
- "puppeteerArgs": [
- "--no-sandbox",
- "--disable-setuid-sandbox"
- ]
}
}
diff --git a/packages/dev-tools-pages/pages.js b/packages/dev-tools-pages/pages.js
index 7609a07e9..488c2ecd7 100644
--- a/packages/dev-tools-pages/pages.js
+++ b/packages/dev-tools-pages/pages.js
@@ -11,26 +11,26 @@ const pages = [
'og-title': { property: 'og:title', content: 'sol-compiler' },
'og-description': { property: 'og:description', content: 'Solidity compilation that just works' },
'og-type': { property: 'og:type', content: 'website' },
- 'og-image': { property: 'og:image', content: '/images/og-compiler' },
+ 'og-image': { property: 'og:image', content: '/images/og-compiler.png' },
'twitter:site': '@0xproject',
- 'twitter:image': '/images/og-compiler',
+ 'twitter:image': '/images/og-compiler.png',
},
},
{
- title: 'sol-cov',
- filename: 'cov/index.html',
+ title: 'sol-coverage',
+ filename: 'coverage/index.html',
template: 'assets/index.html',
- chunks: ['cov'],
+ chunks: ['coverage'],
favicon: 'assets/favicons/cov.ico',
minify: true,
meta: {
description: 'Solidity code coverage',
- 'og-title': { property: 'og:title', content: 'sol-cov' },
+ 'og-title': { property: 'og:title', content: 'sol-coverage' },
'og-description': { property: 'og:description', content: 'Solidity code coverage' },
'og-type': { property: 'og:type', content: 'website' },
- 'og-image': { property: 'og:image', content: '/images/og-cov' },
+ 'og-image': { property: 'og:image', content: '/images/og-cov.png' },
'twitter:site': '@0xproject',
- 'twitter:image': '/images/og-cov',
+ 'twitter:image': '/images/og-cov.png',
},
},
{
@@ -45,9 +45,9 @@ const pages = [
'og-title': { property: 'og:title', content: 'sol-profiler' },
'og-description': { property: 'og:description', content: 'Gas profiling for Solidity' },
'og-type': { property: 'og:type', content: 'website' },
- 'og-image': { property: 'og:image', content: '/images/og-profiler' },
+ 'og-image': { property: 'og:image', content: '/images/og-profiler.png' },
'twitter:site': '@0xproject',
- 'twitter:image': '/images/og-profiler',
+ 'twitter:image': '/images/og-profiler.png',
},
},
{
@@ -62,9 +62,9 @@ const pages = [
'og-title': { property: 'og:title', content: 'sol-trace' },
'og-description': { property: 'og:description', content: 'Human-readable stack traces' },
'og-type': { property: 'og:type', content: 'website' },
- 'og-image': { property: 'og:image', content: '/images/og-trace' },
+ 'og-image': { property: 'og:image', content: '/images/og-trace.png' },
'twitter:site': '@0xproject',
- 'twitter:image': '/images/og-trace',
+ 'twitter:image': '/images/og-trace.png',
},
},
];
diff --git a/packages/dev-tools-pages/ts/components/animations/index.tsx b/packages/dev-tools-pages/ts/components/animations/index.tsx
index 8e5421f5c..106acf707 100644
--- a/packages/dev-tools-pages/ts/components/animations/index.tsx
+++ b/packages/dev-tools-pages/ts/components/animations/index.tsx
@@ -69,10 +69,7 @@ class BaseAnimation extends React.PureComponent<AnimationProps, AnimationState>
}
}
-const Container =
- styled.div <
- AnimationProps >
- `
+const Container = styled.div<AnimationProps>`
width: 100%;
height: ${props => props.height}px;
position: absolute;
diff --git a/packages/dev-tools-pages/ts/components/button.tsx b/packages/dev-tools-pages/ts/components/button.tsx
index d3b36ebfd..ae032eb05 100644
--- a/packages/dev-tools-pages/ts/components/button.tsx
+++ b/packages/dev-tools-pages/ts/components/button.tsx
@@ -6,40 +6,37 @@ interface ButtonProps {
large?: boolean;
}
-const Button =
- styled.button <
- ButtonProps >
- `
- font-family: inherit;
- line-height: 1;
- font-weight: 500;
- white-space: nowrap;
- vertical-align: middle;
- background-color: ${props => props.theme.colors.secondary};
- color: ${colors.black};
- border: 0;
- border-radius: 5rem;
- display: inline-flex;
- justify-content: space-between;
- align-items: center;
-
- ${props =>
- props.large
- ? `
+const Button = styled.button<ButtonProps>`
+ font-family: inherit;
+ line-height: 1;
+ font-weight: 500;
+ white-space: nowrap;
+ vertical-align: middle;
+ background-color: ${props => props.theme.colors.secondary};
+ color: ${colors.black};
+ border: 0;
+ border-radius: 5rem;
+ display: inline-flex;
+ justify-content: space-between;
+ align-items: center;
+
+ ${props =>
+ props.large
+ ? `
font-size: 1rem;
padding: 1.1875rem 2.375rem 1.0625rem;
`
- : `
+ : `
font-size: .875rem;
padding: .5625rem 1.25rem;
`}
- :hover, :focus {
- background-color: ${props => props.theme.colors.secondary_alt};
- outline: 0;
- }
+ :hover, :focus {
+ background-color: ${props => props.theme.colors.secondary_alt};
+ outline: 0;
+ }
- ${media.small`
+ ${media.small`
font-size: .875rem;
padding: .5625rem 1.25rem;
`}
diff --git a/packages/dev-tools-pages/ts/components/call_to_action.tsx b/packages/dev-tools-pages/ts/components/call_to_action.tsx
new file mode 100644
index 000000000..3805a7c8c
--- /dev/null
+++ b/packages/dev-tools-pages/ts/components/call_to_action.tsx
@@ -0,0 +1,40 @@
+import * as React from 'react';
+import styled from 'styled-components';
+
+import { ContextInterface, ThemeContext } from 'ts/context';
+
+import { Button } from './button';
+
+const CallToAction: React.StatelessComponent<ContextInterface> = ({ children }) => (
+ <ThemeContext.Consumer>
+ {({ docLink }: ContextInterface) => (
+ <StyledCallToAction>
+ <CallToActionContainer>
+ <Button as="a" href={docLink} target="_blank" large={true}>
+ Read the Docs
+ </Button>
+ </CallToActionContainer>
+ {children}
+ </StyledCallToAction>
+ )}
+ </ThemeContext.Consumer>
+);
+
+const StyledCallToAction = styled.section`
+ text-align: center;
+ padding-top: 0;
+ padding-bottom: 1rem;
+ padding-left: 2.5rem;
+ padding-right: 2.5rem;
+ min-height: min-content;
+ max-height: 37.5rem;
+ height: 20vh;
+ position: relative;
+`;
+
+const CallToActionContainer = styled.div`
+ margin: 0 auto;
+ max-width: 590px;
+`;
+
+export { CallToAction };
diff --git a/packages/dev-tools-pages/ts/components/code.tsx b/packages/dev-tools-pages/ts/components/code.tsx
index 71d7a7752..0f7d6a0cd 100644
--- a/packages/dev-tools-pages/ts/components/code.tsx
+++ b/packages/dev-tools-pages/ts/components/code.tsx
@@ -45,11 +45,8 @@ const Container = styled.div`
}
`;
-const Base =
- styled.div <
- CodeProps >
- `
- font-size: .875rem;
+const Base = styled.div<CodeProps>`
+ font-size: 0.875rem;
color: ${props => (_.isUndefined(props.language) ? colors.white : 'inherit')};
background-color: ${props =>
props.isLight ? 'rgba(255,255,255,.15)' : _.isUndefined(props.language) ? colors.black : '#F1F4F5'};
@@ -110,10 +107,7 @@ const StyledCodeDiff = styled(CodeDiff)`
}
`;
-const StyledPre =
- styled.pre <
- CodeProps >
- `
+const StyledPre = styled.pre<CodeProps>`
margin: 0;
${props =>
!props.isDiff
@@ -145,7 +139,6 @@ class Code extends React.Component<CodeProps, CodeState> {
public render(): React.ReactNode {
const { language, isLight, isDiff, children, gutterLength, canCopy } = this.props;
const { hlCode } = this.state;
-
return (
<Container>
<Base language={language} isDiff={isDiff} isLight={isLight}>
@@ -163,7 +156,7 @@ class Code extends React.Component<CodeProps, CodeState> {
<StyledCopyInput readOnly={true} aria-hidden="true" ref={this._code} value={children} />
) : null}
</Base>
- {navigator.userAgent !== 'ReactSnap' && canCopy ? (
+ {canCopy ? (
<Button onClick={this._handleCopyAsync.bind(this)}>{this.state.didCopy ? 'Copied' : 'Copy'}</Button>
) : null}
</Container>
diff --git a/packages/dev-tools-pages/ts/components/compiler.tsx b/packages/dev-tools-pages/ts/components/compiler.tsx
index 694a535dd..c00e3a2b9 100644
--- a/packages/dev-tools-pages/ts/components/compiler.tsx
+++ b/packages/dev-tools-pages/ts/components/compiler.tsx
@@ -45,7 +45,7 @@ const Dd = styled.dd`
const cards = [
{
- title: 'A Project-centric',
+ title: 'Project-centric',
body: (
<React.Fragment>
Compiles an entire project instead of only individual <InlineCode isAlt={true}>.sol</InlineCode> files.
@@ -54,7 +54,7 @@ const cards = [
},
{
title: 'Incremental builds',
- body: 'Recompiles your smart contracts after they have changed',
+ body: 'Only recompiles smart contracts that have been modified.',
},
{
title: 'Customizable artifacts',
@@ -63,12 +63,16 @@ const cards = [
},
{
title: 'Seamless',
- body: 'Fetches and caches the required compiler binaries.',
+ body: 'Fetches and caches the required compiler binaries for the Solidity versions you use.',
},
{
title: 'Versioning',
body:
- 'Compiles each contract with the version specified at the top of its file (sol-compiler even supports version ranges!).',
+ 'Compiles each contract with the Solidity version specified at the top of its file (it even supports version ranges!).',
+ },
+ {
+ title: 'Watch mode',
+ body: 'Have your contracts instantly recompile on file save.',
},
];
diff --git a/packages/dev-tools-pages/ts/components/container.tsx b/packages/dev-tools-pages/ts/components/container.tsx
index 1b9212ed2..192d82af8 100644
--- a/packages/dev-tools-pages/ts/components/container.tsx
+++ b/packages/dev-tools-pages/ts/components/container.tsx
@@ -4,10 +4,7 @@ interface ContainerProps {
wide?: boolean;
}
-const Container =
- styled.div <
- ContainerProps >
- `
+const Container = styled.div<ContainerProps>`
max-width: 77.5rem;
margin: 0 auto;
width: ${props => (props.wide ? '100%' : 'calc(100% - 5rem)')};
diff --git a/packages/dev-tools-pages/ts/components/content.tsx b/packages/dev-tools-pages/ts/components/content.tsx
index f74e09af7..b3c353f8a 100644
--- a/packages/dev-tools-pages/ts/components/content.tsx
+++ b/packages/dev-tools-pages/ts/components/content.tsx
@@ -3,10 +3,7 @@ import styled from 'styled-components';
import { Container } from './container';
-const StyledMain =
- styled.div <
- MainProps >
- `
+const StyledMain = styled.div<MainProps>`
padding-top: 6.25rem;
padding-bottom: 6.25rem;
${props =>
diff --git a/packages/dev-tools-pages/ts/components/footer.tsx b/packages/dev-tools-pages/ts/components/footer.tsx
index 04fd9b88e..7e44bf128 100644
--- a/packages/dev-tools-pages/ts/components/footer.tsx
+++ b/packages/dev-tools-pages/ts/components/footer.tsx
@@ -3,7 +3,7 @@ import * as React from 'react';
import styled from 'styled-components';
import { context as compiler } from 'ts/context/compiler';
-import { context as cov } from 'ts/context/cov';
+import { context as coverage } from 'ts/context/coverage';
import { context as profiler } from 'ts/context/profiler';
import { context as trace } from 'ts/context/trace';
import MainIcon from 'ts/icons/logos/0x.svg';
@@ -12,7 +12,7 @@ import { media } from 'ts/variables';
import { Container } from './container';
import { Alpha, Beta } from './typography';
-const tools = [trace, cov, compiler, profiler];
+const tools = [trace, coverage, compiler, profiler];
const Footer: React.StatelessComponent<{}> = () => (
<StyledFooter>
@@ -20,9 +20,9 @@ const Footer: React.StatelessComponent<{}> = () => (
<Top>
<Alpha>Other tools by 0x</Alpha>
<List>
- {_.map(tools, ({ title, subtitle, icon }) => (
+ {_.map(tools, ({ title, subtitle, icon, name }) => (
<ListItem key={title}>
- <ListLink href="#">
+ <ListLink href={`https://sol-${name}.com`}>
<Icon as={icon as 'svg'} />
<div>
<Beta>{title}</Beta>
@@ -37,6 +37,10 @@ const Footer: React.StatelessComponent<{}> = () => (
<Icon as={MainIcon} />
<Small>
0x is an open, permissionless protocol allowing for tokens to be traded on the Ethereum blockchain.
+ Interested in joining our team?{' '}
+ <a href="https://0x.org/careers" target="_blank">
+ We're hiring
+ </a>
</Small>
</Media>
</Container>
diff --git a/packages/dev-tools-pages/ts/components/header.tsx b/packages/dev-tools-pages/ts/components/header.tsx
index 2787692c1..4d3a8685c 100644
--- a/packages/dev-tools-pages/ts/components/header.tsx
+++ b/packages/dev-tools-pages/ts/components/header.tsx
@@ -17,7 +17,7 @@ const Header: React.StatelessComponent<{}> = () => (
<Title>{title}</Title>
</LogoMark>
- <Link as="a" href="https://0xproject.com/">
+ <Link as="a" href="https://0x.org/" target="_blank">
Built by 0x
</Link>
</Container>
diff --git a/packages/dev-tools-pages/ts/components/hero.tsx b/packages/dev-tools-pages/ts/components/hero.tsx
index cdcad6982..e2977f3f2 100644
--- a/packages/dev-tools-pages/ts/components/hero.tsx
+++ b/packages/dev-tools-pages/ts/components/hero.tsx
@@ -9,16 +9,16 @@ import { Beta } from './typography';
const Hero: React.StatelessComponent<ContextInterface> = ({ children }) => (
<ThemeContext.Consumer>
- {({ subtitle, tagline }: ContextInterface) => (
+ {({ subtitle, tagline, docLink }: ContextInterface) => (
<StyledHero>
<HeroContainer>
<Subtitle>{subtitle}</Subtitle>
<Tagline as="p">{tagline}</Tagline>
- <Button as="a" href="#" large={true}>
+ <Button as="a" href={docLink} target="_blank" large={true}>
Read the Docs
</Button>
</HeroContainer>
- {navigator.userAgent !== 'ReactSnap' ? children : null}
+ {children}
</StyledHero>
)}
</ThemeContext.Consumer>
diff --git a/packages/dev-tools-pages/ts/components/tabs.tsx b/packages/dev-tools-pages/ts/components/tabs.tsx
index 1d26f2777..fa2145208 100644
--- a/packages/dev-tools-pages/ts/components/tabs.tsx
+++ b/packages/dev-tools-pages/ts/components/tabs.tsx
@@ -48,7 +48,9 @@ const Tabs: React.StatelessComponent<{}> = props => (
})}
</StyledTabList>
- {React.Children.map(props.children, child => <TabPanel>{child}</TabPanel>)}
+ {React.Children.map(props.children, child => (
+ <TabPanel>{child}</TabPanel>
+ ))}
</ReactTabs>
</Breakout>
);
diff --git a/packages/dev-tools-pages/ts/components/trace.tsx b/packages/dev-tools-pages/ts/components/trace.tsx
index 108154648..81f6db0ab 100644
--- a/packages/dev-tools-pages/ts/components/trace.tsx
+++ b/packages/dev-tools-pages/ts/components/trace.tsx
@@ -25,7 +25,7 @@ const Trace: React.StatelessComponent<{}> = () => (
troublemaking line of code. The only hint you'll get is a generic error.
</MainCopy>
<Breakout>
- <Code isLight={true}>Error: VM Exception while processing transaction: rever</Code>
+ <Code isLight={true}>Error: VM Exception while processing transaction: revert</Code>
</Breakout>
<List>
@@ -44,8 +44,8 @@ const Trace: React.StatelessComponent<{}> = () => (
<Copy dark={true}>
<Gamma as="h3">Time-consuming</Gamma>
<p>
- Working with a large code-base that contains hundreds of smart contracts,
- finding the failing line of code quickly becomes a daunting task.
+ Working within a large code-base that contains many smart contracts, finding the
+ failing line of code quickly becomes a daunting task.
</p>
</Copy>
<Icon as={TimeConsuming} />
@@ -78,8 +78,8 @@ const Trace: React.StatelessComponent<{}> = () => (
<Copy>
<Gamma as="h3">Exact location</Gamma>
<p>
- It shows you the exact location of the specific code linen and where it was
- called from.
+ It shows you the exact location of the offending line and where it was called
+ from.
</p>
</Copy>
<Icon as={ExactLocation} />
@@ -90,8 +90,7 @@ const Trace: React.StatelessComponent<{}> = () => (
<Gamma as="h3">Time-saving</Gamma>
<p>
Turning "Your code failed somewhere, good luck debugging it" into "Your code
- failed on line X of contract Y", it drastically improves the developer
- experience.
+ failed on line X of contract Y", drastically improves the developer experience.
</p>
</Copy>
<Icon as={TimeSaving} />
@@ -108,10 +107,7 @@ interface TraceProps {
background?: string;
}
-const StyledSection =
- styled.section <
- TraceProps >
- `
+const StyledSection = styled.section<TraceProps>`
max-width: 90rem;
margin: 0 auto;
background: linear-gradient(to right, ${colors.black} 50%, ${props => props.background} 50%);
@@ -138,10 +134,7 @@ const Wrapper = styled(Container)`
`};
`;
-const Block =
- styled.div <
- TraceProps >
- `
+const Block = styled.div<TraceProps>`
width: 50%;
background: ${props => (props.background ? props.background : colors.black)};
color: ${props => (props.background ? 'inherit' : colors.white)};
@@ -200,10 +193,7 @@ const Item = styled.li`
}
`;
-const Copy =
- styled.div <
- { dark: boolean } >
- `
+const Copy = styled.div<{ dark: boolean }>`
margin-right: 5.875rem;
${props =>
props.dark &&
diff --git a/packages/dev-tools-pages/ts/context/compiler.tsx b/packages/dev-tools-pages/ts/context/compiler.tsx
index 177e265e5..e4642c826 100644
--- a/packages/dev-tools-pages/ts/context/compiler.tsx
+++ b/packages/dev-tools-pages/ts/context/compiler.tsx
@@ -5,6 +5,7 @@ import { ContextInterface } from './index';
export const context: ContextInterface = {
title: 'sol-compiler',
name: 'compiler',
+ docLink: 'https://0x.org/docs/sol-compiler',
subtitle: 'Solidity compilation that just works',
tagline: 'Seamlessly compile an entire solidity project and generate customisable artifacts',
icon: Icon,
diff --git a/packages/dev-tools-pages/ts/context/cov.tsx b/packages/dev-tools-pages/ts/context/coverage.tsx
index 1ade45e9d..3e44b6ec2 100644
--- a/packages/dev-tools-pages/ts/context/cov.tsx
+++ b/packages/dev-tools-pages/ts/context/coverage.tsx
@@ -3,9 +3,10 @@ import Icon from 'ts/icons/logos/cov.svg';
import { ContextInterface } from './index';
export const context: ContextInterface = {
- title: 'sol-cov',
- name: 'cov',
+ title: 'sol-coverage',
+ name: 'coverage',
subtitle: 'Solidity code coverage',
+ docLink: 'https://0x.org/docs/sol-coverage',
tagline: 'Measure Solidity code coverage',
icon: Icon,
colors: {
diff --git a/packages/dev-tools-pages/ts/context/index.tsx b/packages/dev-tools-pages/ts/context/index.tsx
index 35c647ad6..97ccf5c16 100644
--- a/packages/dev-tools-pages/ts/context/index.tsx
+++ b/packages/dev-tools-pages/ts/context/index.tsx
@@ -3,6 +3,7 @@ import { createContext } from 'react';
interface ContextInterface {
title?: string;
name?: string;
+ docLink?: string;
subtitle?: string;
tagline?: string;
icon?: React.ReactNode;
diff --git a/packages/dev-tools-pages/ts/context/profiler.tsx b/packages/dev-tools-pages/ts/context/profiler.tsx
index 5ccfa5b4c..e2ddcb230 100644
--- a/packages/dev-tools-pages/ts/context/profiler.tsx
+++ b/packages/dev-tools-pages/ts/context/profiler.tsx
@@ -5,6 +5,7 @@ import { ContextInterface } from './index';
export const context: ContextInterface = {
title: 'sol-profiler',
name: 'profiler',
+ docLink: 'https://0x.org/docs/sol-profiler',
subtitle: 'Gas profiling for Solidity',
tagline: "Implement data-guided optimizations by profiling your contract's gas usage",
icon: Icon,
diff --git a/packages/dev-tools-pages/ts/context/trace.tsx b/packages/dev-tools-pages/ts/context/trace.tsx
index 9627cc0a4..3c19661f2 100644
--- a/packages/dev-tools-pages/ts/context/trace.tsx
+++ b/packages/dev-tools-pages/ts/context/trace.tsx
@@ -6,6 +6,7 @@ export const context: ContextInterface = {
title: 'sol-trace',
name: 'trace',
subtitle: 'Human-readable stack traces',
+ docLink: 'https://0x.org/docs/sol-trace',
tagline: 'Immediately locate Solidity errors and rapidly debug failed transactions',
icon: Icon,
colors: {
diff --git a/packages/dev-tools-pages/ts/globalStyles.tsx b/packages/dev-tools-pages/ts/globalStyles.tsx
index a77fb4eef..507497dd4 100644
--- a/packages/dev-tools-pages/ts/globalStyles.tsx
+++ b/packages/dev-tools-pages/ts/globalStyles.tsx
@@ -5,10 +5,7 @@ import styledNormalize from 'styled-normalize';
import { ContextInterface } from 'ts/context';
import { media } from 'ts/variables';
-const GlobalStyles =
- createGlobalStyle <
- ContextInterface >
- `
+const GlobalStyles = createGlobalStyle<ContextInterface>`
${styledNormalize}
${hljsStyles}
diff --git a/packages/dev-tools-pages/ts/pages/compiler.tsx b/packages/dev-tools-pages/ts/pages/compiler.tsx
index 93a667562..407646add 100644
--- a/packages/dev-tools-pages/ts/pages/compiler.tsx
+++ b/packages/dev-tools-pages/ts/pages/compiler.tsx
@@ -6,6 +6,7 @@ import { context } from 'ts/context/compiler';
import { Base } from 'ts/components/base';
import { Breakout } from 'ts/components/breakout';
+import { CallToAction } from 'ts/components/call_to_action';
import { Code } from 'ts/components/code';
import { Compiler as CompilerComponent } from 'ts/components/compiler';
import { Content } from 'ts/components/content';
@@ -24,6 +25,9 @@ const Animation = Loadable({
},
});
+const SOLIDITY_INPUT_FORMAT_DOCS =
+ 'https://solidity.readthedocs.io/en/v0.4.24/using-the-compiler.html#compiler-input-and-output-json-description';
+
const Compiler: React.StatelessComponent<{}> = () => (
<Base context={context}>
<Hero>
@@ -40,7 +44,7 @@ const Compiler: React.StatelessComponent<{}> = () => (
<ContentBlock title="Run">
<Breakout>
- <Code>cd /your_project_dir && sol-compiler</Code>
+ <Code canCopy={true}>cd /your_project_dir && sol-compiler</Code>
</Breakout>
</ContentBlock>
@@ -49,11 +53,11 @@ const Compiler: React.StatelessComponent<{}> = () => (
Configure via a <InlineCode>compiler.json</InlineCode> file.
</p>
<Breakout>
- <Code>mkdir compiler.json</Code>
+ <Code canCopy={true}>mkdir compiler.json</Code>
</Breakout>
<p>Example of settings:</p>
<Breakout>
- <Code language="json">
+ <Code language="json" canCopy={true}>
{`{
"contractsDir": "contracts",
"artifactsDir": "artifacts",
@@ -74,15 +78,19 @@ const Compiler: React.StatelessComponent<{}> = () => (
<Content dark={true}>
<ContentBlock main={true} title="Artifacts">
<Lead>
- Sol compiler uses solidity standard JSON output format for the artifacts. This way, you can define
- which parts of the artifact you need.
+ Sol compiler uses{' '}
+ <a href={SOLIDITY_INPUT_FORMAT_DOCS} target="_blank">
+ Solidity standard JSON input format
+ </a>{' '}
+ to specify what to include in the generated artifacts. This way, you have complete flexibility on
+ what is included.
</Lead>
</ContentBlock>
<ContentBlock title="Production">
<p>
- Sol compiler uses solidity standard JSON output format for the artifacts. This way, you can define
- which parts of the artifact you need.
+ In production, you want to optimize for a small bundle size, so your compiler.json config would
+ instruct sol-compiler to only output the contract ABI.
</p>
<Breakout>
<Code isLight={true} language="json" isEtc={true}>
@@ -109,8 +117,9 @@ const Compiler: React.StatelessComponent<{}> = () => (
</ContentBlock>
<ContentBlock title="Development">
<p>
- Sometimes you need to use some debuggers or other dev tools and you’ll need more info in the
- artifact.
+ In development, you need to use profiler and other dev tools that require more information from the
+ artifact. To do this, you can specify that the artifact also contain the bytecode, deployed bytecode
+ and source maps.
</p>
<Breakout>
<Code isLight={true} language="json" isEtc={true}>
@@ -158,6 +167,9 @@ const Compiler: React.StatelessComponent<{}> = () => (
</Breakout>
</ContentBlock>
</Content>
+ <div style={{ paddingTop: '5rem' }}>
+ <CallToAction />
+ </div>
</Base>
);
diff --git a/packages/dev-tools-pages/ts/pages/cov.tsx b/packages/dev-tools-pages/ts/pages/coverage.tsx
index 85487248a..575891f3b 100644
--- a/packages/dev-tools-pages/ts/pages/cov.tsx
+++ b/packages/dev-tools-pages/ts/pages/coverage.tsx
@@ -2,10 +2,11 @@ import * as React from 'react';
import { hydrate, render } from 'react-dom';
import * as Loadable from 'react-loadable';
-import { context } from 'ts/context/cov';
+import { context } from 'ts/context/coverage';
import { Base } from 'ts/components/base';
import { Breakout } from 'ts/components/breakout';
+import { CallToAction } from 'ts/components/call_to_action';
import { Code } from 'ts/components/code';
import { Content } from 'ts/components/content';
import { ContentBlock } from 'ts/components/content-block';
@@ -25,7 +26,7 @@ const Animation = Loadable({
},
});
-const Cov: React.StatelessComponent<{}> = () => (
+const Coverage: React.StatelessComponent<{}> = () => (
<Base context={context}>
<Hero>
<Animation />
@@ -33,9 +34,9 @@ const Cov: React.StatelessComponent<{}> = () => (
<Intro>
<IntroLead title="Measure your tests">
<p>
- When it comes to writing smart contracts, testing is one of the most important steps of the process.
- In order to quantify the robustness of your Solidity testing suite, you need to measure its code
- coverage.
+ When it comes to writing secure smart contracts, testing is one of the most important steps in the
+ process. In order to quantify the robustness of your Solidity testing suite, you need to measure its
+ code coverage.
</p>
</IntroLead>
<IntroAside>
@@ -69,29 +70,57 @@ const Cov: React.StatelessComponent<{}> = () => (
<ContentBlock title="Prerequisites">
<List>
<ListItem>
- Use <a href="#">ganache-cli</a> as a backing node.
+ Use{' '}
+ <a href="https://github.com/ethereum/go-ethereum" target="_blank">
+ Geth
+ </a>{' '}
+ as a backing node. We recommend using our{' '}
+ <a href="https://hub.docker.com/r/0xorg/devnet" target="_blank">
+ Devnet Docker container
+ </a>{' '}
+ which sets up a Geth node for testing purposes.{' '}
+ <a href="https://github.com/0xProject/0x-monorepo/issues/1520" target="_blank">
+ Ganache support is a work in progress.
+ </a>
</ListItem>
<ListItem>
- Understand and use <a href="#">web3-provider-engine</a>.
+ Understand and use{' '}
+ <a href="https://github.com/MetaMask/provider-engine" target="_blank">
+ web3-provider-engine
+ </a>
+ .
</ListItem>
</List>
</ContentBlock>
<ContentBlock title="Installation">
<Breakout>
- <Code>npm install @0x/sol-coverage --save</Code>
+ <Code canCopy={true}>npm install @0x/sol-coverage --save</Code>
</Breakout>
<p>
- Sol-cov is a subprovider that needs to be prepended to your <a href="#">provider engine</a>.
- Depending on your project setup, you will need to use a specific ArtifactAdapter. Sol-cov ships with
- the <InlineCode>SolCompilerArtifactAdapter</InlineCode> for use with <a href="#">Sol-compiler</a>{' '}
+ Sol-coverage is a subprovider that needs to be prepended to your{' '}
+ <a href="https://github.com/MetaMask/provider-engine" target="_blank">
+ provider engine
+ </a>
+ . Depending on your project setup, you will need to use a specific ArtifactAdapter. Sol-coverage
+ ships with the <InlineCode>SolCompilerArtifactAdapter</InlineCode> for use with{' '}
+ <a href="https://sol-compiler.com" target="_blank">
+ Sol-compiler
+ </a>{' '}
and <InlineCode>TruffleArtifactAdapter</InlineCode> for use with the{' '}
- <a href="#">Truffle framework</a>. You can also write your own and support any artifact format.
+ <a href="https://truffleframework.com/truffle" target="_blank">
+ Truffle framework
+ </a>{' '}
+ (Also see our{' '}
+ <a href="https://github.com/0xProject/dev-tools-truffle-example" target="_blank">
+ Truffle example project
+ </a>{' '}
+ for a complete walk-through). You can also write your own and support any artifact format.
</p>
<Tabs>
<TabBlock title="Sol-compiler">
- <Code language="javascript">
+ <Code language="javascript" canCopy={true}>
{`import { SolCompilerArtifactAdapter } from '@0x/sol-trace';
// Both artifactsDir and contractsDir are optional and will be fetched from compiler.json if not passed in
@@ -99,16 +128,16 @@ const artifactAdapter = new SolCompilerArtifactAdapter(artifactsDir, contractsDi
</Code>
</TabBlock>
<TabBlock title="Truffle">
- <Code language="javascript">
+ <Code language="javascript" canCopy={true}>
{`import { TruffleArtifactAdapter } from '@0x/sol-trace';
const projectRoot = '.';
-const solcVersion = '0.4.24';
+const solcVersion = '0.5.0';
const artifactAdapter = new TruffleArtifactAdapter(projectRoot, solcVersion);`}
</Code>
</TabBlock>
<TabBlock title="Custom">
- <Code language="javascript">
+ <Code language="javascript" canCopy={true}>
{`import { AbstractArtifactAdapter } from '@0x/sol-trace';
class YourCustomArtifactsAdapter extends AbstractArtifactAdapter {...};
@@ -118,32 +147,33 @@ const artifactAdapter = new YourCustomArtifactsAdapter(...);`}
</Tabs>
<p>
Now that we have an <InlineCode>artifactAdapter</InlineCode>, we can create a{' '}
- <InlineCode>RevertTraceSubprovider</InlineCode> and append it to our provider engine.
+ <InlineCode>CoverageSubprovider</InlineCode> and append it to our provider engine.
</p>
<Breakout>
- <Code language="javascript">
+ <Code language="javascript" canCopy={true}>
{`import { ProviderEngine, RpcSubprovider } from 'web3-provider-engine';
-import { RevertTraceSubprovider } from '@0x/sol-coverage';
+import { CoverageSubprovider } from '@0x/sol-coverage';
const defaultFromAddress = "..."; // Some ethereum address with test funds
-const revertTraceSubprovider = new RevertTraceSubprovider(artifactAdapter, defaultFromAddress);
+const coverageSubprovider = new CoverageSubprovider(artifactAdapter, defaultFromAddress);
const providerEngine = new ProviderEngine();
-providerEngine.addProvider(revertTraceSubprovider);
+providerEngine.addProvider(coverageSubprovider);
providerEngine.addProvider(new RpcSubprovider({rpcUrl: 'http://localhost:8545'}));
providerEngine.start();`}
</Code>
</Breakout>
</ContentBlock>
</Content>
+ <CallToAction />
</Base>
);
const root = document.getElementById('app');
if (root.hasChildNodes()) {
- hydrate(<Cov />, root);
+ hydrate(<Coverage />, root);
} else {
- render(<Cov />, root);
+ render(<Coverage />, root);
}
diff --git a/packages/dev-tools-pages/ts/pages/profiler.tsx b/packages/dev-tools-pages/ts/pages/profiler.tsx
index 16ac9088e..0bc4efa45 100644
--- a/packages/dev-tools-pages/ts/pages/profiler.tsx
+++ b/packages/dev-tools-pages/ts/pages/profiler.tsx
@@ -6,6 +6,7 @@ import { context } from 'ts/context/profiler';
import { Base } from 'ts/components/base';
import { Breakout } from 'ts/components/breakout';
+import { CallToAction } from 'ts/components/call_to_action';
import { Code } from 'ts/components/code';
import { Content } from 'ts/components/content';
import { ContentBlock } from 'ts/components/content-block';
@@ -66,29 +67,57 @@ const Profiler: React.StatelessComponent<{}> = () => (
<ContentBlock title="Prerequisites">
<List>
<ListItem>
- Use <a href="#">ganache-cli</a> as a backing node.
+ Use{' '}
+ <a href="https://github.com/ethereum/go-ethereum" target="_blank">
+ Geth
+ </a>{' '}
+ as a backing node. We recommend using our{' '}
+ <a href="https://hub.docker.com/r/0xorg/devnet" target="_blank">
+ Devnet Docker container
+ </a>{' '}
+ which sets up a Geth node for testing purposes.{' '}
+ <a href="https://github.com/0xProject/0x-monorepo/issues/1520" target="_blank">
+ Ganache support is a work in progress.
+ </a>
</ListItem>
<ListItem>
- Understand and use <a href="#">web3-provider-engine</a>.
+ Understand and use{' '}
+ <a href="https://github.com/MetaMask/provider-engine" target="_blank">
+ web3-provider-engine
+ </a>
+ .
</ListItem>
</List>
</ContentBlock>
<ContentBlock title="Installation">
<Breakout>
- <Code>npm install @0x/sol-trace --save</Code>
+ <Code canCopy={true}>npm install @0x/sol-trace --save</Code>
</Breakout>
<p>
- Sol-trace is a subprovider that needs to be prepended to your <a href="#">provider engine</a>.
- Depending on your project setup, you will need to use a specific ArtifactAdapter. Sol-trace ships
+ Sol-trace is a subprovider that needs to be prepended to your{' '}
+ <a href="https://github.com/MetaMask/provider-engine" target="_blank">
+ provider engine
+ </a>
+ . Depending on your project setup, you will need to use a specific ArtifactAdapter. Sol-trace ships
with the <InlineCode>SolCompilerArtifactAdapter</InlineCode> for use with{' '}
- <a href="#">Sol-compiler</a> and <InlineCode>TruffleArtifactAdapter</InlineCode> for use with the{' '}
- <a href="#">Truffle framework</a>. You can also write your own and support any artifact format.
+ <a href="https://sol-compiler.com" target="_blank">
+ Sol-compiler
+ </a>{' '}
+ and <InlineCode>TruffleArtifactAdapter</InlineCode> for use with the{' '}
+ <a href="https://truffleframework.com/truffle" target="_blank">
+ Truffle framework
+ </a>{' '}
+ (Also see our{' '}
+ <a href="https://github.com/0xProject/dev-tools-truffle-example" target="_blank">
+ Truffle example project
+ </a>{' '}
+ for a complete walk-through). You can also write your own and support any artifact format.
</p>
<Tabs>
<TabBlock title="Sol-compiler">
- <Code language="javascript">
+ <Code language="javascript" canCopy={true}>
{`import { SolCompilerArtifactAdapter } from '@0x/sol-trace';
// Both artifactsDir and contractsDir are optional and will be fetched from compiler.json if not passed in
@@ -96,16 +125,16 @@ const artifactAdapter = new SolCompilerArtifactAdapter(artifactsDir, contractsDi
</Code>
</TabBlock>
<TabBlock title="Truffle">
- <Code language="javascript">
+ <Code language="javascript" canCopy={true}>
{`import { TruffleArtifactAdapter } from '@0x/sol-trace';
const projectRoot = '.';
-const solcVersion = '0.4.24';
+const solcVersion = '0.5.0';
const artifactAdapter = new TruffleArtifactAdapter(projectRoot, solcVersion);`}
</Code>
</TabBlock>
<TabBlock title="Custom">
- <Code language="javascript">
+ <Code language="javascript" canCopy={true}>
{`import { AbstractArtifactAdapter } from '@0x/sol-trace';
class YourCustomArtifactsAdapter extends AbstractArtifactAdapter {...};
@@ -115,25 +144,26 @@ const artifactAdapter = new YourCustomArtifactsAdapter(...);`}
</Tabs>
<p>
Now that we have an <InlineCode>artifactAdapter</InlineCode>, we can create a{' '}
- <InlineCode>RevertTraceSubprovider</InlineCode> and append it to our provider engine.
+ <InlineCode>ProfilerSubprovider</InlineCode> and append it to our provider engine.
</p>
<Breakout>
- <Code language="javascript">
+ <Code language="javascript" canCopy={true}>
{`import { ProviderEngine, RpcSubprovider } from 'web3-provider-engine';
-import { RevertTraceSubprovider } from '@0x/sol-coverage';
+import { ProfilerSubprovider } from '@0x/sol-profiler';
const defaultFromAddress = "..."; // Some ethereum address with test funds
-const revertTraceSubprovider = new RevertTraceSubprovider(artifactAdapter, defaultFromAddress);
+const profilerSubprovider = new ProfilerSubprovider(artifactAdapter, defaultFromAddress);
const providerEngine = new ProviderEngine();
-providerEngine.addProvider(revertTraceSubprovider);
+providerEngine.addProvider(profilerSubprovider);
providerEngine.addProvider(new RpcSubprovider({rpcUrl: 'http://localhost:8545'}));
providerEngine.start();`}
</Code>
</Breakout>
</ContentBlock>
</Content>
+ <CallToAction />
</Base>
);
diff --git a/packages/dev-tools-pages/ts/pages/trace.tsx b/packages/dev-tools-pages/ts/pages/trace.tsx
index cc34e0fbe..cd6180fb9 100644
--- a/packages/dev-tools-pages/ts/pages/trace.tsx
+++ b/packages/dev-tools-pages/ts/pages/trace.tsx
@@ -6,6 +6,7 @@ import { context } from 'ts/context/trace';
import { Base } from 'ts/components/base';
import { Breakout } from 'ts/components/breakout';
+import { CallToAction } from 'ts/components/call_to_action';
import { Code } from 'ts/components/code';
import { Content } from 'ts/components/content';
import { ContentBlock } from 'ts/components/content-block';
@@ -36,29 +37,57 @@ const Trace: React.StatelessComponent<{}> = () => (
<ContentBlock title="Prerequisites">
<List>
<ListItem>
- Use <a href="#">ganache-cli</a> as a backing node.
+ Use{' '}
+ <a href="https://github.com/ethereum/go-ethereum" target="_blank">
+ Geth
+ </a>{' '}
+ as a backing node. We recommend using our{' '}
+ <a href="https://hub.docker.com/r/0xorg/devnet" target="_blank">
+ Devnet Docker container
+ </a>{' '}
+ which sets up a Geth node for testing purposes.{' '}
+ <a href="https://github.com/0xProject/0x-monorepo/issues/1520" target="_blank">
+ Ganache support is a work in progress.
+ </a>
</ListItem>
<ListItem>
- Understand and use <a href="#">web3-provider-engine</a>.
+ Understand and use{' '}
+ <a href="https://github.com/MetaMask/provider-engine" target="_blank">
+ web3-provider-engine
+ </a>
+ .
</ListItem>
</List>
</ContentBlock>
<ContentBlock title="Installation">
<Breakout>
- <Code>npm install @0x/sol-trace --save</Code>
+ <Code canCopy={true}>npm install @0x/sol-trace --save</Code>
</Breakout>
<p>
- Sol-trace is a subprovider that needs to be prepended to your <a href="#">provider engine</a>.
- Depending on your project setup, you will need to use a specific ArtifactAdapter. Sol-trace ships
+ Sol-trace is a subprovider that needs to be prepended to your{' '}
+ <a href="https://github.com/MetaMask/provider-engine" target="_blank">
+ provider engine
+ </a>
+ . Depending on your project setup, you will need to use a specific ArtifactAdapter. Sol-trace ships
with the <InlineCode>SolCompilerArtifactAdapter</InlineCode> for use with{' '}
- <a href="#">Sol-compiler</a> and <InlineCode>TruffleArtifactAdapter</InlineCode> for use with the{' '}
- <a href="#">Truffle framework</a>. You can also write your own and support any artifact format.
+ <a href="https://sol-compiler.com" target="_blank">
+ Sol-compiler
+ </a>{' '}
+ and <InlineCode>TruffleArtifactAdapter</InlineCode> for use with the{' '}
+ <a href="https://truffleframework.com/truffle" target="_blank">
+ Truffle framework
+ </a>{' '}
+ (Also see our{' '}
+ <a href="https://github.com/0xProject/dev-tools-truffle-example" target="_blank">
+ Truffle example project
+ </a>{' '}
+ for a complete walk-through). You can also write your own and support any artifact format.
</p>
<Tabs>
<TabBlock title="Sol-compiler">
- <Code language="javascript">
+ <Code language="javascript" canCopy={true}>
{`import { SolCompilerArtifactAdapter } from '@0x/sol-trace';
// Both artifactsDir and contractsDir are optional and will be fetched from compiler.json if not passed in
@@ -66,16 +95,16 @@ const artifactAdapter = new SolCompilerArtifactAdapter(artifactsDir, contractsDi
</Code>
</TabBlock>
<TabBlock title="Truffle">
- <Code language="javascript">
+ <Code language="javascript" canCopy={true}>
{`import { TruffleArtifactAdapter } from '@0x/sol-trace';
const projectRoot = '.';
-const solcVersion = '0.4.24';
+const solcVersion = '0.5.0';
const artifactAdapter = new TruffleArtifactAdapter(projectRoot, solcVersion);`}
</Code>
</TabBlock>
<TabBlock title="Custom">
- <Code language="javascript">
+ <Code language="javascript" canCopy={true}>
{`import { AbstractArtifactAdapter } from '@0x/sol-trace';
class YourCustomArtifactsAdapter extends AbstractArtifactAdapter {...};
@@ -85,13 +114,13 @@ const artifactAdapter = new YourCustomArtifactsAdapter(...);`}
</Tabs>
<p>
Now that we have an <InlineCode>artifactAdapter</InlineCode>, we can create a{' '}
- <InlineCode>RevertTraceSubprovider</InlineCode> and append it to our provider engine.
+ <InlineCode>revertTraceSubprovider</InlineCode> and append it to our provider engine.
</p>
<Breakout>
- <Code language="javascript">
+ <Code language="javascript" canCopy={true}>
{`import { ProviderEngine, RpcSubprovider } from 'web3-provider-engine';
-import { RevertTraceSubprovider } from '@0x/sol-coverage';
+import { RevertTraceSubprovider } from '@0x/sol-trace';
const defaultFromAddress = "..."; // Some ethereum address with test funds
const revertTraceSubprovider = new RevertTraceSubprovider(artifactAdapter, defaultFromAddress);
@@ -102,8 +131,10 @@ providerEngine.addProvider(new RpcSubprovider({rpcUrl: 'http://localhost:8545'})
providerEngine.start();`}
</Code>
</Breakout>
+ <p>Stack traces will now be printed whenever your contracts revert!</p>
</ContentBlock>
</Content>
+ <CallToAction />
</Base>
);
diff --git a/packages/dev-tools-pages/webpack.config.js b/packages/dev-tools-pages/webpack.config.js
index 640297770..ef2f98cf2 100644
--- a/packages/dev-tools-pages/webpack.config.js
+++ b/packages/dev-tools-pages/webpack.config.js
@@ -3,7 +3,6 @@ const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const HtmlWebpackPlugin = require('html-webpack-plugin');
-const childProcess = require('child_process');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
@@ -12,7 +11,7 @@ const pages = require('./pages');
const config = {
entry: {
compiler: './ts/pages/compiler.tsx',
- cov: './ts/pages/cov.tsx',
+ coverage: './ts/pages/coverage.tsx',
profiler: './ts/pages/profiler.tsx',
trace: './ts/pages/trace.tsx',
},
diff --git a/packages/dev-utils/CHANGELOG.json b/packages/dev-utils/CHANGELOG.json
index 8f355466c..d05e41d2d 100644
--- a/packages/dev-utils/CHANGELOG.json
+++ b/packages/dev-utils/CHANGELOG.json
@@ -1,5 +1,32 @@
[
{
+ "version": "2.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "1.0.24",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "1.0.23",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"timestamp": 1547040760,
"version": "1.0.22",
"changes": [
diff --git a/packages/dev-utils/CHANGELOG.md b/packages/dev-utils/CHANGELOG.md
index 04ee860b5..958fded86 100644
--- a/packages/dev-utils/CHANGELOG.md
+++ b/packages/dev-utils/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v1.0.24 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v1.0.23 - _January 11, 2019_
+
+ * Dependencies updated
+
## v1.0.22 - _January 9, 2019_
* Dependencies updated
diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json
index cb27ad5c5..4ab1d6439 100644
--- a/packages/dev-utils/package.json
+++ b/packages/dev-utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/dev-utils",
- "version": "1.0.22",
+ "version": "1.0.24",
"engines": {
"node": ">=6.12"
},
@@ -29,7 +29,7 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/dev-utils/README.md",
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.2",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"make-promises-safe": "^1.1.0",
@@ -41,14 +41,14 @@
"typescript": "3.0.1"
},
"dependencies": {
- "@0x/subproviders": "^2.1.9",
- "@0x/types": "^1.5.0",
- "@0x/typescript-typings": "^3.0.6",
- "@0x/utils": "^2.1.1",
- "@0x/web3-wrapper": "^3.2.2",
+ "@0x/subproviders": "^2.1.11",
+ "@0x/types": "^1.5.2",
+ "@0x/typescript-typings": "^3.0.8",
+ "@0x/utils": "^3.0.1",
+ "@0x/web3-wrapper": "^3.2.4",
"@types/web3-provider-engine": "^14.0.0",
"chai": "^4.0.1",
- "ethereum-types": "^1.1.4",
+ "ethereum-types": "^1.1.6",
"lodash": "^4.17.5"
},
"publishConfig": {
diff --git a/packages/devnet/docker-compose.yml b/packages/devnet/docker-compose.yml
new file mode 100644
index 000000000..1c1e7ca75
--- /dev/null
+++ b/packages/devnet/docker-compose.yml
@@ -0,0 +1,8 @@
+version: '3'
+services:
+ devnet:
+ image: 0x-devnet:latest
+ build:
+ context: .
+ ports:
+ - 8501:8501
diff --git a/packages/devnet/genesis.json b/packages/devnet/genesis.json
index 90431c31c..073672dd9 100644
--- a/packages/devnet/genesis.json
+++ b/packages/devnet/genesis.json
@@ -14,8 +14,7 @@
},
"nonce": "0x0",
"timestamp": "0x5af1ffac",
- "extraData":
- "0x0000000000000000000000000000000000000000000000000000000000000000e8816898d851d5b61b7f950627d04d794c07ca370000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000e8816898d851d5b61b7f950627d04d794c07ca370000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x4c4b400000",
"difficulty": "0x1",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
diff --git a/packages/devnet/run.sh b/packages/devnet/run.sh
index dea243396..6000813f0 100755
--- a/packages/devnet/run.sh
+++ b/packages/devnet/run.sh
@@ -15,6 +15,7 @@ mkdir -p /var/log
--rpc \
--rpcaddr '0.0.0.0' \
--rpcport 8501 \
+ --rpcvhosts '*' \
--rpcapi 'personal,db,eth,net,web3,txpool,miner,debug' \
--networkid 50 \
--gasprice '2000000000' \
diff --git a/packages/ethereum-types/CHANGELOG.json b/packages/ethereum-types/CHANGELOG.json
index 9a0f2ad49..c106d43a9 100644
--- a/packages/ethereum-types/CHANGELOG.json
+++ b/packages/ethereum-types/CHANGELOG.json
@@ -1,5 +1,32 @@
[
{
+ "version": "2.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "1.1.6",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "1.1.5",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "1.1.4",
"changes": [
{
diff --git a/packages/ethereum-types/CHANGELOG.md b/packages/ethereum-types/CHANGELOG.md
index 1d27757f3..c1857495d 100644
--- a/packages/ethereum-types/CHANGELOG.md
+++ b/packages/ethereum-types/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v1.1.6 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v1.1.5 - _January 11, 2019_
+
+ * Dependencies updated
+
## v1.1.4 - _December 13, 2018_
* Dependencies updated
diff --git a/packages/ethereum-types/package.json b/packages/ethereum-types/package.json
index 69ae64c2b..bd3748058 100644
--- a/packages/ethereum-types/package.json
+++ b/packages/ethereum-types/package.json
@@ -1,6 +1,6 @@
{
"name": "ethereum-types",
- "version": "1.1.4",
+ "version": "1.1.6",
"engines": {
"node": ">=6.12"
},
@@ -29,7 +29,7 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/ethereum-types/README.md",
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.2",
"make-promises-safe": "^1.1.0",
"shx": "^0.2.2",
"tslint": "5.11.0",
@@ -37,7 +37,7 @@
},
"dependencies": {
"@types/node": "*",
- "bignumber.js": "~4.1.0"
+ "bignumber.js": "~8.0.2"
},
"publishConfig": {
"access": "public"
diff --git a/packages/ethereum-types/src/index.ts b/packages/ethereum-types/src/index.ts
index 9430fdc98..a8dcfd68a 100644
--- a/packages/ethereum-types/src/index.ts
+++ b/packages/ethereum-types/src/index.ts
@@ -306,6 +306,8 @@ export interface TraceParams {
disableMemory?: boolean;
disableStack?: boolean;
disableStorage?: boolean;
+ tracer?: string;
+ timeout?: string;
}
export type OutputField =
diff --git a/packages/fill-scenarios/CHANGELOG.json b/packages/fill-scenarios/CHANGELOG.json
index 125a62cdf..beffdd097 100644
--- a/packages/fill-scenarios/CHANGELOG.json
+++ b/packages/fill-scenarios/CHANGELOG.json
@@ -1,5 +1,32 @@
[
{
+ "version": "2.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "1.1.2",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "1.1.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "1.1.0",
"changes": [
{
@@ -176,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/fill-scenarios/CHANGELOG.md b/packages/fill-scenarios/CHANGELOG.md
index 45cee1ce3..7df8b5ab3 100644
--- a/packages/fill-scenarios/CHANGELOG.md
+++ b/packages/fill-scenarios/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v1.1.2 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v1.1.1 - _January 11, 2019_
+
+ * Dependencies updated
+
## v1.1.0 - _January 9, 2019_
* Add support for MultiAssetProxy (#1363)
diff --git a/packages/fill-scenarios/package.json b/packages/fill-scenarios/package.json
index a38dcc1c3..d882aba76 100644
--- a/packages/fill-scenarios/package.json
+++ b/packages/fill-scenarios/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/fill-scenarios",
- "version": "1.1.0",
+ "version": "1.1.2",
"description": "0x order fill scenario generator",
"main": "lib/index.js",
"types": "lib/index.d.ts",
@@ -20,7 +20,7 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/fill-scenarios/README.md",
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.2",
"@types/lodash": "4.14.104",
"make-promises-safe": "^1.1.0",
"shx": "^0.2.2",
@@ -28,15 +28,15 @@
"typescript": "3.0.1"
},
"dependencies": {
- "@0x/abi-gen-wrappers": "^2.1.0",
- "@0x/base-contract": "^3.0.11",
- "@0x/contract-artifacts": "^1.2.0",
- "@0x/order-utils": "^3.1.0",
- "@0x/types": "^1.5.0",
- "@0x/typescript-typings": "^3.0.6",
- "@0x/utils": "^2.1.1",
- "@0x/web3-wrapper": "^3.2.2",
- "ethereum-types": "^1.1.4",
+ "@0x/abi-gen-wrappers": "^2.2.0",
+ "@0x/base-contract": "^3.0.13",
+ "@0x/contract-artifacts": "^1.3.0",
+ "@0x/order-utils": "^3.1.2",
+ "@0x/types": "^1.5.2",
+ "@0x/typescript-typings": "^3.0.8",
+ "@0x/utils": "^3.0.1",
+ "@0x/web3-wrapper": "^3.2.4",
+ "ethereum-types": "^1.1.6",
"ethers": "~4.0.4",
"lodash": "^4.17.5"
},
diff --git a/packages/instant/CHANGELOG.json b/packages/instant/CHANGELOG.json
index db187140f..c7348c3c0 100644
--- a/packages/instant/CHANGELOG.json
+++ b/packages/instant/CHANGELOG.json
@@ -1,5 +1,23 @@
[
{
+ "version": "3.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "version": "2.0.0",
+ "changes": [
+ {
+ "note": "Renamed ActionTypes enum members to PascalCase to conform with tslint enum-naming rule",
+ "pr": 1474
+ }
+ ]
+ },
+ {
"timestamp": 1542821676,
"version": "1.0.1",
"changes": [
diff --git a/packages/instant/README.md b/packages/instant/README.md
index 32abf76e0..f09c4776c 100644
--- a/packages/instant/README.md
+++ b/packages/instant/README.md
@@ -8,18 +8,21 @@ Check out a live sample integration [here](https://www.rexrelay.com/instant).
## Installation
-The package is available as a UMD module named `zeroExInstant` at https://instant.0xproject.com/instant.js.
+The package is available as a UMD module named `zeroExInstant` at https://instant.0x.org/instant.js.
```html
<head>
- <script type="text/javascript" src="https://instant.0xproject.com/instant.js" charset="utf-8"></script>
+ <script type="text/javascript" src="https://instant.0x.org/instant.js" charset="utf-8"></script>
</head>
<body>
<div id="zeroExInstantContainer"></div>
<script>
- zeroExInstant.render({
- // Initialization options
- }, '#zeroExInstantContainer');
+ zeroExInstant.render(
+ {
+ // Initialization options
+ },
+ '#zeroExInstantContainer',
+ );
</script>
</body>
```
@@ -44,7 +47,7 @@ To build and deploy to this bundle, run
yarn deploy_staging
```
-Finally, we have our live production bundle that is only meant to be updated with stable, polished releases: https://instant.0xproject.com/instant.js
+Finally, we have our live production bundle that is only meant to be updated with stable, polished releases: https://instant.0x.org/instant.js
To build and deploy to this bundle, run
diff --git a/packages/instant/package.json b/packages/instant/package.json
index 1104d9829..f7e15a3e0 100644
--- a/packages/instant/package.json
+++ b/packages/instant/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/instant",
- "version": "1.0.5",
+ "version": "1.0.8",
"engines": {
"node": ">=6.12"
},
@@ -42,19 +42,19 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/instant/README.md",
"dependencies": {
- "@0x/assert": "^1.0.21",
- "@0x/asset-buyer": "^3.0.5",
- "@0x/json-schemas": "^2.1.5",
- "@0x/order-utils": "^3.1.0",
- "@0x/subproviders": "^2.1.9",
- "@0x/types": "^1.5.0",
- "@0x/typescript-typings": "^3.0.6",
- "@0x/utils": "^2.1.1",
- "@0x/web3-wrapper": "^3.2.2",
+ "@0x/assert": "^1.0.23",
+ "@0x/asset-buyer": "^4.0.2",
+ "@0x/json-schemas": "^2.1.7",
+ "@0x/order-utils": "^3.1.2",
+ "@0x/subproviders": "^2.1.11",
+ "@0x/types": "^1.5.2",
+ "@0x/typescript-typings": "^3.0.8",
+ "@0x/utils": "^3.0.1",
+ "@0x/web3-wrapper": "^3.2.4",
"babel-runtime": "^6.26.0",
"bowser": "^1.9.4",
"copy-to-clipboard": "^3.0.8",
- "ethereum-types": "^1.1.4",
+ "ethereum-types": "^1.1.6",
"lodash": "^4.17.5",
"polished": "^2.2.0",
"react": "^16.5.2",
@@ -67,7 +67,7 @@
"ts-optchain": "^0.1.1"
},
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.2",
"@static/discharge": "https://github.com/0xProject/discharge.git",
"@types/enzyme": "^3.1.14",
"@types/enzyme-adapter-react-16": "^1.0.3",
diff --git a/packages/instant/src/components/animations/full_rotation.tsx b/packages/instant/src/components/animations/full_rotation.tsx
index 9adb565f9..1dff1b1fc 100644
--- a/packages/instant/src/components/animations/full_rotation.tsx
+++ b/packages/instant/src/components/animations/full_rotation.tsx
@@ -14,10 +14,7 @@ to {
}
`;
-export const FullRotation =
- styled.div <
- FullRotationProps >
- `
+export const FullRotation = styled.div<FullRotationProps>`
animation: ${rotatingKeyframes} 2s linear infinite;
height: ${props => props.height};
width: ${props => props.width};
diff --git a/packages/instant/src/components/animations/position_animation.tsx b/packages/instant/src/components/animations/position_animation.tsx
index 8b3b294b7..4f8f25679 100644
--- a/packages/instant/src/components/animations/position_animation.tsx
+++ b/packages/instant/src/components/animations/position_animation.tsx
@@ -95,10 +95,7 @@ const animationForSize = (
return animationSettingsForSize && mediaFn`${generatePositionAnimationCss(animationSettingsForSize)}`;
};
-export const PositionAnimation =
- styled.div <
- PositionAnimationProps >
- `
+export const PositionAnimation = styled.div<PositionAnimationProps>`
&& {
${props => props.zIndex && stylesForMedia<number>('z-index', props.zIndex)}
${props => defaultAnimation(props.positionSettings)}
diff --git a/packages/instant/src/components/css_reset.tsx b/packages/instant/src/components/css_reset.tsx
index 0bef85389..d1b20f4c9 100644
--- a/packages/instant/src/components/css_reset.tsx
+++ b/packages/instant/src/components/css_reset.tsx
@@ -4,9 +4,9 @@ import { createGlobalStyle } from '../style/theme';
export interface CSSResetProps {}
/*
-* Derived from
-* https://github.com/jtrost/Complete-CSS-Reset
-*/
+ * Derived from
+ * https://github.com/jtrost/Complete-CSS-Reset
+ */
export const CSSReset = createGlobalStyle`
.${INJECTED_DIV_CLASS} {
a, abbr, area, article, aside, audio, b, bdo, blockquote, body, button,
diff --git a/packages/instant/src/components/order_details.tsx b/packages/instant/src/components/order_details.tsx
index 4db20b13e..3ded50652 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<OrderDetailsProps> {
}
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<OrderDetailsProps> {
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/components/timed_progress_bar.tsx b/packages/instant/src/components/timed_progress_bar.tsx
index b1644b871..287269af7 100644
--- a/packages/instant/src/components/timed_progress_bar.tsx
+++ b/packages/instant/src/components/timed_progress_bar.tsx
@@ -68,10 +68,7 @@ interface ProgressProps {
animationSettings?: WidthAnimationSettings;
}
-export const Progress =
- styled.div <
- ProgressProps >
- `
+export const Progress = styled.div<ProgressProps>`
&& {
background-color: ${props => props.theme[ColorOption.primaryColor]};
border-radius: 6px;
diff --git a/packages/instant/src/components/ui/circle.tsx b/packages/instant/src/components/ui/circle.tsx
index 4f9f56f12..e4f2c5260 100644
--- a/packages/instant/src/components/ui/circle.tsx
+++ b/packages/instant/src/components/ui/circle.tsx
@@ -8,16 +8,15 @@ export interface CircleProps {
}
export const Circle = withTheme(
- styled.div <
- CircleProps >
- `
- && {
- width: ${props => props.diameter}px;
- height: ${props => props.diameter}px;
- background-color: ${props => (props.rawColor ? props.rawColor : props.theme[props.color || ColorOption.white])};
- border-radius: 50%;
- }
-`,
+ styled.div<CircleProps>`
+ && {
+ width: ${props => props.diameter}px;
+ height: ${props => props.diameter}px;
+ background-color: ${props =>
+ props.rawColor ? props.rawColor : props.theme[props.color || ColorOption.white]};
+ border-radius: 50%;
+ }
+ `,
);
Circle.displayName = 'Circle';
diff --git a/packages/instant/src/components/ui/container.tsx b/packages/instant/src/components/ui/container.tsx
index 58d7d5871..59b733f3e 100644
--- a/packages/instant/src/components/ui/container.tsx
+++ b/packages/instant/src/components/ui/container.tsx
@@ -51,10 +51,7 @@ const getBackgroundColor = (theme: any, backgroundColor?: ColorOption, rawBackgr
return 'none';
};
-export const Container =
- styled.div <
- ContainerProps >
- `
+export const Container = styled.div<ContainerProps>`
&& {
box-sizing: border-box;
${props => cssRuleIfExists(props, 'flex-grow')}
diff --git a/packages/instant/src/components/ui/flex.tsx b/packages/instant/src/components/ui/flex.tsx
index 274c46b9e..145e654f1 100644
--- a/packages/instant/src/components/ui/flex.tsx
+++ b/packages/instant/src/components/ui/flex.tsx
@@ -14,10 +14,7 @@ export interface FlexProps {
flexGrow?: number | string;
}
-export const Flex =
- styled.div <
- FlexProps >
- `
+export const Flex = styled.div<FlexProps>`
&& {
display: ${props => (props.inline ? 'inline-flex' : 'flex')};
flex-direction: ${props => props.direction};
diff --git a/packages/instant/src/components/ui/input.tsx b/packages/instant/src/components/ui/input.tsx
index 53c43ea0b..024e81b15 100644
--- a/packages/instant/src/components/ui/input.tsx
+++ b/packages/instant/src/components/ui/input.tsx
@@ -14,10 +14,7 @@ export interface InputProps extends React.HTMLAttributes<HTMLInputElement> {
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
}
-export const Input =
- styled.input <
- InputProps >
- `
+export const Input = styled.input<InputProps>`
&& {
all: initial;
font-size: ${props => props.fontSize};
@@ -32,10 +29,11 @@ export const Input =
color: ${props => props.theme[props.fontColor || 'white']} !important;
opacity: 0.5 !important;
}
- &::-webkit-outer-spin-button, &::-webkit-inner-spin-button {
+ &::-webkit-outer-spin-button,
+ &::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
- }
+ }
}
`;
diff --git a/packages/instant/src/components/ui/overlay.tsx b/packages/instant/src/components/ui/overlay.tsx
index 0b5eaf299..0b1be6a65 100644
--- a/packages/instant/src/components/ui/overlay.tsx
+++ b/packages/instant/src/components/ui/overlay.tsx
@@ -12,10 +12,7 @@ export interface OverlayProps {
showMaxWidth?: ScreenWidths;
}
-export const Overlay =
- styled.div <
- OverlayProps >
- `
+export const Overlay = styled.div<OverlayProps>`
&& {
position: fixed;
top: 0;
diff --git a/packages/instant/src/components/ui/text.tsx b/packages/instant/src/components/ui/text.tsx
index 282477758..ca120f3bd 100644
--- a/packages/instant/src/components/ui/text.tsx
+++ b/packages/instant/src/components/ui/text.tsx
@@ -31,10 +31,7 @@ export const Text: React.StatelessComponent<TextProps> = ({ href, onClick, ...re
};
const opacityOnHoverAmount = 0.5;
-export const StyledText =
- styled.div <
- TextProps >
- `
+export const StyledText = styled.div<TextProps>`
&& {
font-family: 'Inter UI', sans-serif;
font-style: ${props => props.fontStyle};
diff --git a/packages/instant/src/constants.ts b/packages/instant/src/constants.ts
index bfd9e9098..d407925a3 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/latest_error.tsx b/packages/instant/src/containers/latest_error.tsx
index 6da4558ef..57a2dbdc2 100644
--- a/packages/instant/src/containers/latest_error.tsx
+++ b/packages/instant/src/containers/latest_error.tsx
@@ -62,4 +62,7 @@ const mapDispatchToProps = (dispatch: Dispatch<Action>, _ownProps: LatestErrorPr
},
});
-export const LatestError = connect(mapStateToProps, mapDispatchToProps)(LatestErrorComponent);
+export const LatestError = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(LatestErrorComponent);
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 cb9df527e..4b9993332 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/index.umd.ts b/packages/instant/src/index.umd.ts
index d172f4145..0acf3f2ad 100644
--- a/packages/instant/src/index.umd.ts
+++ b/packages/instant/src/index.umd.ts
@@ -1,3 +1,6 @@
+import { AssetBuyer, BigNumber } from '@0x/asset-buyer';
+import { assetDataUtils } from '@0x/order-utils';
+import { Provider } from 'ethereum-types';
import * as _ from 'lodash';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
@@ -9,9 +12,12 @@ import {
INJECTED_DIV_ID,
NPM_PACKAGE_VERSION,
} from './constants';
+import { assetMetaDataMap } from './data/asset_meta_data_map';
import { ZeroExInstantOverlay, ZeroExInstantOverlayProps } from './index';
+import { Network, OrderSource } from './types';
import { analytics } from './util/analytics';
import { assert } from './util/assert';
+import { providerFactory } from './util/provider_factory';
import { util } from './util/util';
const isInstantRendered = (): boolean => !!document.getElementById(INJECTED_DIV_ID);
@@ -122,6 +128,42 @@ export const render = (config: ZeroExInstantConfig, selector: string = DEFAULT_Z
window.onpopstate = onPopStateHandler;
};
+export const assetDataForERC20TokenAddress = (tokenAddress: string): string => {
+ assert.isETHAddressHex('tokenAddress', tokenAddress);
+ return assetDataUtils.encodeERC20AssetData(tokenAddress);
+};
+
+export const hasMetaDataForAssetData = (assetData: string): boolean => {
+ assert.isHexString('assetData', assetData);
+ return assetMetaDataMap[assetData] !== undefined;
+};
+
+export const hasLiquidityForAssetDataAsync = async (
+ assetData: string,
+ orderSource: OrderSource,
+ networkId: Network = Network.Mainnet,
+ provider?: Provider,
+): Promise<boolean> => {
+ assert.isHexString('assetData', assetData);
+ assert.isValidOrderSource('orderSource', orderSource);
+ assert.isNumber('networkId', networkId);
+
+ if (provider !== undefined) {
+ assert.isWeb3Provider('provider', provider);
+ }
+
+ const bestProvider: Provider = provider || providerFactory.getFallbackNoSigningProvider(networkId);
+
+ const assetBuyerOptions = { networkId };
+
+ const assetBuyer = _.isString(orderSource)
+ ? AssetBuyer.getAssetBuyerForStandardRelayerAPIUrl(bestProvider, orderSource, assetBuyerOptions)
+ : AssetBuyer.getAssetBuyerForProvidedOrders(bestProvider, orderSource, assetBuyerOptions);
+
+ const liquidity = await assetBuyer.getLiquidityForAssetDataAsync(assetData);
+ return liquidity.ethValueAvailableInWei.gt(new BigNumber(0));
+};
+
// Write version info to the exported object for debugging
export const GIT_SHA = GIT_SHA_FROM_CONSTANT;
export const NPM_VERSION = NPM_PACKAGE_VERSION;
diff --git a/packages/instant/src/redux/actions.ts b/packages/instant/src/redux/actions.ts
index 9d7a61fc7..ca0be543b 100644
--- a/packages/instant/src/redux/actions.ts
+++ b/packages/instant/src/redux/actions.ts
@@ -21,57 +21,56 @@ function createAction<T extends string, P>(type: T, data?: P): PlainAction<T> |
}
export enum ActionTypes {
- SET_ACCOUNT_STATE_LOADING = 'SET_ACCOUNT_STATE_LOADING',
- SET_ACCOUNT_STATE_LOCKED = 'SET_ACCOUNT_STATE_LOCKED',
- SET_ACCOUNT_STATE_READY = 'SET_ACCOUNT_STATE_READY',
- UPDATE_ACCOUNT_ETH_BALANCE = 'UPDATE_ACCOUNT_ETH_BALANCE',
- UPDATE_ETH_USD_PRICE = 'UPDATE_ETH_USD_PRICE',
- UPDATE_SELECTED_ASSET_UNIT_AMOUNT = 'UPDATE_SELECTED_ASSET_UNIT_AMOUNT',
- SET_BUY_ORDER_STATE_NONE = 'SET_BUY_ORDER_STATE_NONE',
- SET_BUY_ORDER_STATE_VALIDATING = 'SET_BUY_ORDER_STATE_VALIDATING',
- SET_BUY_ORDER_STATE_PROCESSING = 'SET_BUY_ORDER_STATE_PROCESSING',
- SET_BUY_ORDER_STATE_FAILURE = 'SET_BUY_ORDER_STATE_FAILURE',
- SET_BUY_ORDER_STATE_SUCCESS = 'SET_BUY_ORDER_STATE_SUCCESS',
- UPDATE_LATEST_BUY_QUOTE = 'UPDATE_LATEST_BUY_QUOTE',
- UPDATE_SELECTED_ASSET = 'UPDATE_SELECTED_ASSET',
- SET_AVAILABLE_ASSETS = 'SET_AVAILABLE_ASSETS',
- SET_QUOTE_REQUEST_STATE_PENDING = 'SET_QUOTE_REQUEST_STATE_PENDING',
- SET_QUOTE_REQUEST_STATE_FAILURE = 'SET_QUOTE_REQUEST_STATE_FAILURE',
- SET_ERROR_MESSAGE = 'SET_ERROR_MESSAGE',
- HIDE_ERROR = 'HIDE_ERROR',
- CLEAR_ERROR = 'CLEAR_ERROR',
- RESET_AMOUNT = 'RESET_AMOUNT',
- OPEN_STANDARD_SLIDING_PANEL = 'OPEN_STANDARD_SLIDING_PANEL',
- CLOSE_STANDARD_SLIDING_PANEL = 'CLOSE_STANDARD_SLIDING_PANEL',
- UPDATE_BASE_CURRENCY = 'UPDATE_BASE_CURRENCY',
+ SetAccountStateLoading = 'SET_ACCOUNT_STATE_LOADING',
+ SetAccountStateLocked = 'SET_ACCOUNT_STATE_LOCKED',
+ SetAccountStateReady = 'SET_ACCOUNT_STATE_READY',
+ UpdateAccountEthBalance = 'UPDATE_ACCOUNT_ETH_BALANCE',
+ UpdateEthUsdPrice = 'UPDATE_ETH_USD_PRICE',
+ UpdateSelectedAssetUnitAmount = 'UPDATE_SELECTED_ASSET_UNIT_AMOUNT',
+ SetBuyOrderStateNone = 'SET_BUY_ORDER_STATE_NONE',
+ SetBuyOrderStateValidating = 'SET_BUY_ORDER_STATE_VALIDATING',
+ SetBuyOrderStateProcessing = 'SET_BUY_ORDER_STATE_PROCESSING',
+ SetBuyOrderStateFailure = 'SET_BUY_ORDER_STATE_FAILURE',
+ SetBuyOrderStateSuccess = 'SET_BUY_ORDER_STATE_SUCCESS',
+ UpdateLatestBuyQuote = 'UPDATE_LATEST_BUY_QUOTE',
+ UpdateSelectedAsset = 'UPDATE_SELECTED_ASSET',
+ SetAvailableAssets = 'SET_AVAILABLE_ASSETS',
+ SetQuoteRequestStatePending = 'SET_QUOTE_REQUEST_STATE_PENDING',
+ SetQuoteRequestStateFailure = 'SET_QUOTE_REQUEST_STATE_FAILURE',
+ SetErrorMessage = 'SET_ERROR_MESSAGE',
+ HideError = 'HIDE_ERROR',
+ ClearError = 'CLEAR_ERROR',
+ ResetAmount = 'RESET_AMOUNT',
+ OpenStandardSlidingPanel = 'OPEN_STANDARD_SLIDING_PANEL',
+ CloseStandardSlidingPanel = 'CLOSE_STANDARD_SLIDING_PANEL',
+ UpdateBaseCurrency = 'UPDATE_BASE_CURRENCY',
}
export const actions = {
- setAccountStateLoading: () => createAction(ActionTypes.SET_ACCOUNT_STATE_LOADING),
- setAccountStateLocked: () => createAction(ActionTypes.SET_ACCOUNT_STATE_LOCKED),
- setAccountStateReady: (address: string) => createAction(ActionTypes.SET_ACCOUNT_STATE_READY, address),
+ setAccountStateLoading: () => createAction(ActionTypes.SetAccountStateLoading),
+ setAccountStateLocked: () => createAction(ActionTypes.SetAccountStateLocked),
+ setAccountStateReady: (address: string) => createAction(ActionTypes.SetAccountStateReady, address),
updateAccountEthBalance: (addressAndBalance: AddressAndEthBalanceInWei) =>
- createAction(ActionTypes.UPDATE_ACCOUNT_ETH_BALANCE, addressAndBalance),
- updateEthUsdPrice: (price?: BigNumber) => createAction(ActionTypes.UPDATE_ETH_USD_PRICE, price),
- updateSelectedAssetAmount: (amount?: BigNumber) =>
- createAction(ActionTypes.UPDATE_SELECTED_ASSET_UNIT_AMOUNT, amount),
- setBuyOrderStateNone: () => createAction(ActionTypes.SET_BUY_ORDER_STATE_NONE),
- setBuyOrderStateValidating: () => createAction(ActionTypes.SET_BUY_ORDER_STATE_VALIDATING),
+ createAction(ActionTypes.UpdateAccountEthBalance, addressAndBalance),
+ updateEthUsdPrice: (price?: BigNumber) => createAction(ActionTypes.UpdateEthUsdPrice, price),
+ updateSelectedAssetAmount: (amount?: BigNumber) => createAction(ActionTypes.UpdateSelectedAssetUnitAmount, amount),
+ setBuyOrderStateNone: () => createAction(ActionTypes.SetBuyOrderStateNone),
+ setBuyOrderStateValidating: () => createAction(ActionTypes.SetBuyOrderStateValidating),
setBuyOrderStateProcessing: (txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) =>
- createAction(ActionTypes.SET_BUY_ORDER_STATE_PROCESSING, { txHash, startTimeUnix, expectedEndTimeUnix }),
- setBuyOrderStateFailure: (txHash: string) => createAction(ActionTypes.SET_BUY_ORDER_STATE_FAILURE, txHash),
- setBuyOrderStateSuccess: (txHash: string) => createAction(ActionTypes.SET_BUY_ORDER_STATE_SUCCESS, txHash),
- updateLatestBuyQuote: (buyQuote?: BuyQuote) => createAction(ActionTypes.UPDATE_LATEST_BUY_QUOTE, buyQuote),
- updateSelectedAsset: (asset: Asset) => createAction(ActionTypes.UPDATE_SELECTED_ASSET, asset),
- setAvailableAssets: (availableAssets: Asset[]) => createAction(ActionTypes.SET_AVAILABLE_ASSETS, availableAssets),
- setQuoteRequestStatePending: () => createAction(ActionTypes.SET_QUOTE_REQUEST_STATE_PENDING),
- setQuoteRequestStateFailure: () => createAction(ActionTypes.SET_QUOTE_REQUEST_STATE_FAILURE),
- setErrorMessage: (errorMessage: string) => createAction(ActionTypes.SET_ERROR_MESSAGE, errorMessage),
- hideError: () => createAction(ActionTypes.HIDE_ERROR),
- clearError: () => createAction(ActionTypes.CLEAR_ERROR),
- resetAmount: () => createAction(ActionTypes.RESET_AMOUNT),
+ createAction(ActionTypes.SetBuyOrderStateProcessing, { txHash, startTimeUnix, expectedEndTimeUnix }),
+ setBuyOrderStateFailure: (txHash: string) => createAction(ActionTypes.SetBuyOrderStateFailure, txHash),
+ setBuyOrderStateSuccess: (txHash: string) => createAction(ActionTypes.SetBuyOrderStateSuccess, txHash),
+ updateLatestBuyQuote: (buyQuote?: BuyQuote) => createAction(ActionTypes.UpdateLatestBuyQuote, buyQuote),
+ updateSelectedAsset: (asset: Asset) => createAction(ActionTypes.UpdateSelectedAsset, asset),
+ setAvailableAssets: (availableAssets: Asset[]) => createAction(ActionTypes.SetAvailableAssets, availableAssets),
+ setQuoteRequestStatePending: () => createAction(ActionTypes.SetQuoteRequestStatePending),
+ setQuoteRequestStateFailure: () => createAction(ActionTypes.SetQuoteRequestStateFailure),
+ setErrorMessage: (errorMessage: string) => createAction(ActionTypes.SetErrorMessage, errorMessage),
+ hideError: () => createAction(ActionTypes.HideError),
+ clearError: () => createAction(ActionTypes.ClearError),
+ resetAmount: () => createAction(ActionTypes.ResetAmount),
openStandardSlidingPanel: (content: StandardSlidingPanelContent) =>
- createAction(ActionTypes.OPEN_STANDARD_SLIDING_PANEL, content),
- closeStandardSlidingPanel: () => createAction(ActionTypes.CLOSE_STANDARD_SLIDING_PANEL),
- updateBaseCurrency: (baseCurrency: BaseCurrency) => createAction(ActionTypes.UPDATE_BASE_CURRENCY, baseCurrency),
+ createAction(ActionTypes.OpenStandardSlidingPanel, content),
+ closeStandardSlidingPanel: () => createAction(ActionTypes.CloseStandardSlidingPanel),
+ updateBaseCurrency: (baseCurrency: BaseCurrency) => createAction(ActionTypes.UpdateBaseCurrency, baseCurrency),
};
diff --git a/packages/instant/src/redux/analytics_middleware.ts b/packages/instant/src/redux/analytics_middleware.ts
index a86a16b1a..4b4d30213 100644
--- a/packages/instant/src/redux/analytics_middleware.ts
+++ b/packages/instant/src/redux/analytics_middleware.ts
@@ -21,7 +21,7 @@ export const analyticsMiddleware: Middleware = store => next => middlewareAction
const curAccount = curState.providerState.account;
switch (nextAction.type) {
- case ActionTypes.SET_ACCOUNT_STATE_READY:
+ case ActionTypes.SetAccountStateReady:
if (curAccount.state === AccountState.Ready) {
const didJustTurnReady = prevAccount.state !== AccountState.Ready;
const didJustUpdateAddress =
@@ -38,13 +38,13 @@ export const analyticsMiddleware: Middleware = store => next => middlewareAction
}
}
break;
- case ActionTypes.SET_ACCOUNT_STATE_LOCKED:
+ case ActionTypes.SetAccountStateLocked:
if (prevAccount.state !== AccountState.Locked && curAccount.state === AccountState.Locked) {
// if we are moving from account not locked to account locked, track `Account - Locked`
analytics.trackAccountLocked();
}
break;
- case ActionTypes.UPDATE_ACCOUNT_ETH_BALANCE:
+ case ActionTypes.UpdateAccountEthBalance:
if (
curAccount.state === AccountState.Ready &&
curAccount.ethBalanceInWei &&
@@ -58,7 +58,7 @@ export const analyticsMiddleware: Middleware = store => next => middlewareAction
analytics.addEventProperties({ ethBalanceInUnitAmount });
}
break;
- case ActionTypes.UPDATE_SELECTED_ASSET:
+ case ActionTypes.UpdateSelectedAsset:
const selectedAsset = curState.selectedAsset;
if (selectedAsset) {
const assetName = selectedAsset.metaData.name;
@@ -79,7 +79,7 @@ export const analyticsMiddleware: Middleware = store => next => middlewareAction
analytics.addEventProperties(selectedAssetEventProperties);
}
break;
- case ActionTypes.SET_AVAILABLE_ASSETS:
+ case ActionTypes.SetAvailableAssets:
const availableAssets = curState.availableAssets;
if (availableAssets) {
analytics.addEventProperties({
@@ -87,19 +87,19 @@ export const analyticsMiddleware: Middleware = store => next => middlewareAction
});
}
break;
- case ActionTypes.OPEN_STANDARD_SLIDING_PANEL:
+ case ActionTypes.OpenStandardSlidingPanel:
const openSlidingContent = curState.standardSlidingPanelSettings.content;
if (openSlidingContent === StandardSlidingPanelContent.InstallWallet) {
analytics.trackInstallWalletModalOpened();
}
break;
- case ActionTypes.CLOSE_STANDARD_SLIDING_PANEL:
+ case ActionTypes.CloseStandardSlidingPanel:
const closeSlidingContent = curState.standardSlidingPanelSettings.content;
if (closeSlidingContent === StandardSlidingPanelContent.InstallWallet) {
analytics.trackInstallWalletModalClosed();
}
break;
- case ActionTypes.UPDATE_BASE_CURRENCY:
+ case ActionTypes.UpdateBaseCurrency:
analytics.trackBaseCurrencyChanged(curState.baseCurrency);
analytics.addEventProperties({ baseCurrency: curState.baseCurrency });
}
diff --git a/packages/instant/src/redux/async_data.ts b/packages/instant/src/redux/async_data.ts
index 884ab103d..f20fe319f 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/redux/reducer.ts b/packages/instant/src/redux/reducer.ts
index 8c13c9c72..0d8bb4b05 100644
--- a/packages/instant/src/redux/reducer.ts
+++ b/packages/instant/src/redux/reducer.ts
@@ -72,11 +72,11 @@ export const DEFAULT_STATE: DefaultState = {
export const createReducer = (initialState: State) => {
const reducer = (state: State = initialState, action: Action): State => {
switch (action.type) {
- case ActionTypes.SET_ACCOUNT_STATE_LOADING:
+ case ActionTypes.SetAccountStateLoading:
return reduceStateWithAccount(state, LOADING_ACCOUNT);
- case ActionTypes.SET_ACCOUNT_STATE_LOCKED:
+ case ActionTypes.SetAccountStateLocked:
return reduceStateWithAccount(state, LOCKED_ACCOUNT);
- case ActionTypes.SET_ACCOUNT_STATE_READY: {
+ case ActionTypes.SetAccountStateReady: {
const address = action.data;
let newAccount: AccountReady = {
state: AccountState.Ready,
@@ -91,7 +91,7 @@ export const createReducer = (initialState: State) => {
}
return reduceStateWithAccount(state, newAccount);
}
- case ActionTypes.UPDATE_ACCOUNT_ETH_BALANCE: {
+ case ActionTypes.UpdateAccountEthBalance: {
const { address, ethBalanceInWei } = action.data;
const currentAccount = state.providerState.account;
if (currentAccount.state !== AccountState.Ready || currentAccount.address !== address) {
@@ -104,17 +104,17 @@ export const createReducer = (initialState: State) => {
return reduceStateWithAccount(state, newAccount);
}
}
- case ActionTypes.UPDATE_ETH_USD_PRICE:
+ case ActionTypes.UpdateEthUsdPrice:
return {
...state,
ethUsdPrice: action.data,
};
- case ActionTypes.UPDATE_SELECTED_ASSET_UNIT_AMOUNT:
+ case ActionTypes.UpdateSelectedAssetUnitAmount:
return {
...state,
selectedAssetUnitAmount: action.data,
};
- case ActionTypes.UPDATE_LATEST_BUY_QUOTE:
+ case ActionTypes.UpdateLatestBuyQuote:
const newBuyQuoteIfExists = action.data;
const shouldUpdate =
_.isUndefined(newBuyQuoteIfExists) || doesBuyQuoteMatchState(newBuyQuoteIfExists, state);
@@ -127,29 +127,29 @@ export const createReducer = (initialState: State) => {
} else {
return state;
}
- case ActionTypes.SET_QUOTE_REQUEST_STATE_PENDING:
+ case ActionTypes.SetQuoteRequestStatePending:
return {
...state,
latestBuyQuote: undefined,
quoteRequestState: AsyncProcessState.Pending,
};
- case ActionTypes.SET_QUOTE_REQUEST_STATE_FAILURE:
+ case ActionTypes.SetQuoteRequestStateFailure:
return {
...state,
latestBuyQuote: undefined,
quoteRequestState: AsyncProcessState.Failure,
};
- case ActionTypes.SET_BUY_ORDER_STATE_NONE:
+ case ActionTypes.SetBuyOrderStateNone:
return {
...state,
buyOrderState: { processState: OrderProcessState.None },
};
- case ActionTypes.SET_BUY_ORDER_STATE_VALIDATING:
+ case ActionTypes.SetBuyOrderStateValidating:
return {
...state,
buyOrderState: { processState: OrderProcessState.Validating },
};
- case ActionTypes.SET_BUY_ORDER_STATE_PROCESSING:
+ case ActionTypes.SetBuyOrderStateProcessing:
const processingData = action.data;
const { startTimeUnix, expectedEndTimeUnix } = processingData;
return {
@@ -163,7 +163,7 @@ export const createReducer = (initialState: State) => {
},
},
};
- case ActionTypes.SET_BUY_ORDER_STATE_FAILURE:
+ case ActionTypes.SetBuyOrderStateFailure:
const failureTxHash = action.data;
if ('txHash' in state.buyOrderState) {
if (state.buyOrderState.txHash === failureTxHash) {
@@ -179,7 +179,7 @@ export const createReducer = (initialState: State) => {
}
}
return state;
- case ActionTypes.SET_BUY_ORDER_STATE_SUCCESS:
+ case ActionTypes.SetBuyOrderStateSuccess:
const successTxHash = action.data;
if ('txHash' in state.buyOrderState) {
if (state.buyOrderState.txHash === successTxHash) {
@@ -195,29 +195,29 @@ export const createReducer = (initialState: State) => {
}
}
return state;
- case ActionTypes.SET_ERROR_MESSAGE:
+ case ActionTypes.SetErrorMessage:
return {
...state,
latestErrorMessage: action.data,
latestErrorDisplayStatus: DisplayStatus.Present,
};
- case ActionTypes.HIDE_ERROR:
+ case ActionTypes.HideError:
return {
...state,
latestErrorDisplayStatus: DisplayStatus.Hidden,
};
- case ActionTypes.CLEAR_ERROR:
+ case ActionTypes.ClearError:
return {
...state,
latestErrorMessage: undefined,
latestErrorDisplayStatus: DisplayStatus.Hidden,
};
- case ActionTypes.UPDATE_SELECTED_ASSET:
+ case ActionTypes.UpdateSelectedAsset:
return {
...state,
selectedAsset: action.data,
};
- case ActionTypes.RESET_AMOUNT:
+ case ActionTypes.ResetAmount:
return {
...state,
latestBuyQuote: undefined,
@@ -225,12 +225,12 @@ export const createReducer = (initialState: State) => {
buyOrderState: { processState: OrderProcessState.None },
selectedAssetUnitAmount: undefined,
};
- case ActionTypes.SET_AVAILABLE_ASSETS:
+ case ActionTypes.SetAvailableAssets:
return {
...state,
availableAssets: action.data,
};
- case ActionTypes.OPEN_STANDARD_SLIDING_PANEL:
+ case ActionTypes.OpenStandardSlidingPanel:
return {
...state,
standardSlidingPanelSettings: {
@@ -238,7 +238,7 @@ export const createReducer = (initialState: State) => {
animationState: 'slidIn',
},
};
- case ActionTypes.CLOSE_STANDARD_SLIDING_PANEL:
+ case ActionTypes.CloseStandardSlidingPanel:
return {
...state,
standardSlidingPanelSettings: {
@@ -246,7 +246,7 @@ export const createReducer = (initialState: State) => {
animationState: 'slidOut',
},
};
- case ActionTypes.UPDATE_BASE_CURRENCY:
+ case ActionTypes.UpdateBaseCurrency:
return {
...state,
baseCurrency: action.data,
diff --git a/packages/instant/src/style/theme.ts b/packages/instant/src/style/theme.ts
index fd3f03c3f..49f3c81e6 100644
--- a/packages/instant/src/style/theme.ts
+++ b/packages/instant/src/style/theme.ts
@@ -11,7 +11,7 @@ const {
} = styledComponents;
export type Theme = { [key in ColorOption]: string };
-
+// tslint:disable:enum-naming
export enum ColorOption {
primaryColor = 'primaryColor',
black = 'black',
diff --git a/packages/instant/src/types.ts b/packages/instant/src/types.ts
index f07a407da..606294c93 100644
--- a/packages/instant/src/types.ts
+++ b/packages/instant/src/types.ts
@@ -27,8 +27,8 @@ export enum QuoteFetchOrigin {
}
export enum BaseCurrency {
- USD = 'USD',
- ETH = 'ETH',
+ USD = 'USD', // tslint:disable-line:enum-naming
+ ETH = 'ETH', // tslint:disable-line:enum-naming
}
export interface SimulatedProgress {
@@ -95,7 +95,7 @@ export enum Network {
export enum ZeroExInstantError {
AssetMetaDataNotAvailable = 'ASSET_META_DATA_NOT_AVAILABLE',
- InsufficientETH = 'INSUFFICIENT_ETH',
+ InsufficientETH = 'INSUFFICIENT_ETH', // tslint:disable-line:enum-naming
CouldNotSubmitTransaction = 'COULD_NOT_SUBMIT_TRANSACTION',
}
@@ -168,7 +168,7 @@ export enum WalletSuggestion {
export enum OperatingSystem {
Android = 'ANDROID',
- iOS = 'IOS',
+ iOS = 'IOS', // tslint:disable-line:enum-naming
Mac = 'MAC',
Windows = 'WINDOWS',
WindowsPhone = 'WINDOWS_PHONE',
diff --git a/packages/instant/src/util/analytics.ts b/packages/instant/src/util/analytics.ts
index 4faeaaf5a..fa8a72a2c 100644
--- a/packages/instant/src/util/analytics.ts
+++ b/packages/instant/src/util/analytics.ts
@@ -31,38 +31,38 @@ export const evaluateIfEnabled = (fnCall: () => void) => {
};
enum EventNames {
- INSTANT_OPENED = 'Instant - Opened',
- INSTANT_CLOSED = 'Instant - Closed',
- ACCOUNT_LOCKED = 'Account - Locked',
- ACCOUNT_READY = 'Account - Ready',
- ACCOUNT_UNLOCK_REQUESTED = 'Account - Unlock Requested',
- ACCOUNT_UNLOCK_DENIED = 'Account - Unlock Denied',
- ACCOUNT_ADDRESS_CHANGED = 'Account - Address Changed',
- BASE_CURRENCY_CHANGED = 'Base Currency - Changed',
- PAYMENT_METHOD_DROPDOWN_OPENED = 'Payment Method - Dropdown Opened',
- PAYMENT_METHOD_OPENED_ETHERSCAN = 'Payment Method - Opened Etherscan',
- PAYMENT_METHOD_COPIED_ADDRESS = 'Payment Method - Copied Address',
- BUY_NOT_ENOUGH_ETH = 'Buy - Not Enough Eth',
- BUY_STARTED = 'Buy - Started',
- BUY_SIGNATURE_DENIED = 'Buy - Signature Denied',
- BUY_SIMULATION_FAILED = 'Buy - Simulation Failed',
- BUY_UNKNOWN_ERROR = 'Buy - Unknown Error',
- BUY_TX_SUBMITTED = 'Buy - Tx Submitted',
- BUY_TX_SUCCEEDED = 'Buy - Tx Succeeded',
- BUY_TX_FAILED = 'Buy - Tx Failed',
- USD_PRICE_FETCH_FAILED = 'USD Price - Fetch Failed',
- INSTALL_WALLET_CLICKED = 'Install Wallet - Clicked',
- INSTALL_WALLET_MODAL_OPENED = 'Install Wallet - Modal - Opened',
- INSTALL_WALLET_MODAL_CLICKED_EXPLANATION = 'Install Wallet - Modal - Clicked Explanation',
- INSTALL_WALLET_MODAL_CLICKED_GET = 'Install Wallet - Modal - Clicked Get',
- INSTALL_WALLET_MODAL_CLOSED = 'Install Wallet - Modal - Closed',
- TOKEN_SELECTOR_OPENED = 'Token Selector - Opened',
- TOKEN_SELECTOR_CLOSED = 'Token Selector - Closed',
- TOKEN_SELECTOR_CHOSE = 'Token Selector - Chose',
- TOKEN_SELECTOR_SEARCHED = 'Token Selector - Searched',
- TRANSACTION_VIEWED = 'Transaction - Viewed',
- QUOTE_FETCHED = 'Quote - Fetched',
- QUOTE_ERROR = 'Quote - Error',
+ InstantOpened = 'Instant - Opened',
+ InstantClosed = 'Instant - Closed',
+ AccountLocked = 'Account - Locked',
+ AccountReady = 'Account - Ready',
+ AccountUnlockRequested = 'Account - Unlock Requested',
+ AccountUnlockDenied = 'Account - Unlock Denied',
+ AccountAddressChanged = 'Account - Address Changed',
+ BaseCurrencyChanged = 'Base Currency - Changed',
+ PaymentMethodDropdownOpened = 'Payment Method - Dropdown Opened',
+ PaymentMethodOpenedEtherscan = 'Payment Method - Opened Etherscan',
+ PaymentMethodCopiedAddress = 'Payment Method - Copied Address',
+ BuyNotEnoughEth = 'Buy - Not Enough Eth',
+ BuyStarted = 'Buy - Started',
+ BuySignatureDenied = 'Buy - Signature Denied',
+ BuySimulationFailed = 'Buy - Simulation Failed',
+ BuyUnknownError = 'Buy - Unknown Error',
+ BuyTxSubmitted = 'Buy - Tx Submitted',
+ BuyTxSucceeded = 'Buy - Tx Succeeded',
+ BuyTxFailed = 'Buy - Tx Failed',
+ UsdPriceFetchFailed = 'USD Price - Fetch Failed',
+ InstallWalletClicked = 'Install Wallet - Clicked',
+ InstallWalletModalOpened = 'Install Wallet - Modal - Opened',
+ InstallWalletModalClickedExplanation = 'Install Wallet - Modal - Clicked Explanation',
+ InstallWalletModalClickedGet = 'Install Wallet - Modal - Clicked Get',
+ InstallWalletModalClosed = 'Install Wallet - Modal - Closed',
+ TokenSelectorOpened = 'Token Selector - Opened',
+ TokenSelectorClosed = 'Token Selector - Closed',
+ TokenSelectorChose = 'Token Selector - Chose',
+ TokenSelectorSearched = 'Token Selector - Searched',
+ TransactionViewed = 'Transaction - Viewed',
+ QuoteFetched = 'Quote - Fetched',
+ QuoteError = 'Quote - Error',
}
const track = (eventName: EventNames, eventProperties: EventProperties = {}): void => {
@@ -125,7 +125,7 @@ export interface AnalyticsEventOptions {
baseCurrency?: string;
}
export enum TokenSelectorClosedVia {
- ClickedX = 'Clicked X',
+ ClickedX = 'Clicked X', // tslint:disable-line:enum-naming
TokenChose = 'Token Chose',
}
export const analytics = {
@@ -169,80 +169,80 @@ export const analytics = {
};
return eventOptions;
},
- trackInstantOpened: trackingEventFnWithoutPayload(EventNames.INSTANT_OPENED),
- trackInstantClosed: trackingEventFnWithoutPayload(EventNames.INSTANT_CLOSED),
- trackAccountLocked: trackingEventFnWithoutPayload(EventNames.ACCOUNT_LOCKED),
- trackAccountReady: (address: string) => trackingEventFnWithPayload(EventNames.ACCOUNT_READY)({ address }),
- trackAccountUnlockRequested: trackingEventFnWithoutPayload(EventNames.ACCOUNT_UNLOCK_REQUESTED),
- trackAccountUnlockDenied: trackingEventFnWithoutPayload(EventNames.ACCOUNT_UNLOCK_DENIED),
+ trackInstantOpened: trackingEventFnWithoutPayload(EventNames.InstantOpened),
+ trackInstantClosed: trackingEventFnWithoutPayload(EventNames.InstantClosed),
+ trackAccountLocked: trackingEventFnWithoutPayload(EventNames.AccountLocked),
+ trackAccountReady: (address: string) => trackingEventFnWithPayload(EventNames.AccountReady)({ address }),
+ trackAccountUnlockRequested: trackingEventFnWithoutPayload(EventNames.AccountUnlockRequested),
+ trackAccountUnlockDenied: trackingEventFnWithoutPayload(EventNames.AccountUnlockDenied),
trackAccountAddressChanged: (address: string) =>
- trackingEventFnWithPayload(EventNames.ACCOUNT_ADDRESS_CHANGED)({ address }),
+ trackingEventFnWithPayload(EventNames.AccountAddressChanged)({ address }),
trackBaseCurrencyChanged: (currencyChangedTo: BaseCurrency) =>
- trackingEventFnWithPayload(EventNames.BASE_CURRENCY_CHANGED)({ currencyChangedTo }),
- trackPaymentMethodDropdownOpened: trackingEventFnWithoutPayload(EventNames.PAYMENT_METHOD_DROPDOWN_OPENED),
- trackPaymentMethodOpenedEtherscan: trackingEventFnWithoutPayload(EventNames.PAYMENT_METHOD_OPENED_ETHERSCAN),
- trackPaymentMethodCopiedAddress: trackingEventFnWithoutPayload(EventNames.PAYMENT_METHOD_COPIED_ADDRESS),
+ trackingEventFnWithPayload(EventNames.BaseCurrencyChanged)({ currencyChangedTo }),
+ trackPaymentMethodDropdownOpened: trackingEventFnWithoutPayload(EventNames.PaymentMethodDropdownOpened),
+ trackPaymentMethodOpenedEtherscan: trackingEventFnWithoutPayload(EventNames.PaymentMethodOpenedEtherscan),
+ trackPaymentMethodCopiedAddress: trackingEventFnWithoutPayload(EventNames.PaymentMethodCopiedAddress),
trackBuyNotEnoughEth: (buyQuote: BuyQuote) =>
- trackingEventFnWithPayload(EventNames.BUY_NOT_ENOUGH_ETH)(buyQuoteEventProperties(buyQuote)),
+ trackingEventFnWithPayload(EventNames.BuyNotEnoughEth)(buyQuoteEventProperties(buyQuote)),
trackBuyStarted: (buyQuote: BuyQuote) =>
- trackingEventFnWithPayload(EventNames.BUY_STARTED)(buyQuoteEventProperties(buyQuote)),
+ trackingEventFnWithPayload(EventNames.BuyStarted)(buyQuoteEventProperties(buyQuote)),
trackBuySignatureDenied: (buyQuote: BuyQuote) =>
- trackingEventFnWithPayload(EventNames.BUY_SIGNATURE_DENIED)(buyQuoteEventProperties(buyQuote)),
+ trackingEventFnWithPayload(EventNames.BuySignatureDenied)(buyQuoteEventProperties(buyQuote)),
trackBuySimulationFailed: (buyQuote: BuyQuote) =>
- trackingEventFnWithPayload(EventNames.BUY_SIMULATION_FAILED)(buyQuoteEventProperties(buyQuote)),
+ trackingEventFnWithPayload(EventNames.BuySimulationFailed)(buyQuoteEventProperties(buyQuote)),
trackBuyUnknownError: (buyQuote: BuyQuote, errorMessage: string) =>
- trackingEventFnWithPayload(EventNames.BUY_UNKNOWN_ERROR)({
+ trackingEventFnWithPayload(EventNames.BuyUnknownError)({
...buyQuoteEventProperties(buyQuote),
errorMessage,
}),
trackBuyTxSubmitted: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) =>
- trackingEventFnWithPayload(EventNames.BUY_TX_SUBMITTED)({
+ trackingEventFnWithPayload(EventNames.BuyTxSubmitted)({
...buyQuoteEventProperties(buyQuote),
txHash,
expectedTxTimeMs: expectedEndTimeUnix - startTimeUnix,
}),
trackBuyTxSucceeded: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) =>
- trackingEventFnWithPayload(EventNames.BUY_TX_SUCCEEDED)({
+ trackingEventFnWithPayload(EventNames.BuyTxSucceeded)({
...buyQuoteEventProperties(buyQuote),
txHash,
expectedTxTimeMs: expectedEndTimeUnix - startTimeUnix,
actualTxTimeMs: new Date().getTime() - startTimeUnix,
}),
trackBuyTxFailed: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) =>
- trackingEventFnWithPayload(EventNames.BUY_TX_FAILED)({
+ trackingEventFnWithPayload(EventNames.BuyTxFailed)({
...buyQuoteEventProperties(buyQuote),
txHash,
expectedTxTimeMs: expectedEndTimeUnix - startTimeUnix,
actualTxTimeMs: new Date().getTime() - startTimeUnix,
}),
trackInstallWalletClicked: (walletSuggestion: WalletSuggestion) =>
- trackingEventFnWithPayload(EventNames.INSTALL_WALLET_CLICKED)({ walletSuggestion }),
+ trackingEventFnWithPayload(EventNames.InstallWalletClicked)({ walletSuggestion }),
trackInstallWalletModalClickedExplanation: trackingEventFnWithoutPayload(
- EventNames.INSTALL_WALLET_MODAL_CLICKED_EXPLANATION,
+ EventNames.InstallWalletModalClickedExplanation,
),
- trackInstallWalletModalClickedGet: trackingEventFnWithoutPayload(EventNames.INSTALL_WALLET_MODAL_CLICKED_GET),
- trackInstallWalletModalOpened: trackingEventFnWithoutPayload(EventNames.INSTALL_WALLET_MODAL_OPENED),
- trackInstallWalletModalClosed: trackingEventFnWithoutPayload(EventNames.INSTALL_WALLET_MODAL_CLOSED),
- trackTokenSelectorOpened: trackingEventFnWithoutPayload(EventNames.TOKEN_SELECTOR_OPENED),
+ trackInstallWalletModalClickedGet: trackingEventFnWithoutPayload(EventNames.InstallWalletModalClickedGet),
+ trackInstallWalletModalOpened: trackingEventFnWithoutPayload(EventNames.InstallWalletModalOpened),
+ trackInstallWalletModalClosed: trackingEventFnWithoutPayload(EventNames.InstallWalletModalClosed),
+ trackTokenSelectorOpened: trackingEventFnWithoutPayload(EventNames.TokenSelectorOpened),
trackTokenSelectorClosed: (closedVia: TokenSelectorClosedVia) =>
- trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_CLOSED)({ closedVia }),
+ trackingEventFnWithPayload(EventNames.TokenSelectorClosed)({ closedVia }),
trackTokenSelectorChose: (payload: { assetName: string; assetData: string }) =>
- trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_CHOSE)(payload),
+ trackingEventFnWithPayload(EventNames.TokenSelectorChose)(payload),
trackTokenSelectorSearched: (searchText: string) =>
- trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_SEARCHED)({ searchText }),
+ trackingEventFnWithPayload(EventNames.TokenSelectorSearched)({ searchText }),
trackTransactionViewed: (orderProcesState: OrderProcessState) =>
- trackingEventFnWithPayload(EventNames.TRANSACTION_VIEWED)({ orderState: orderProcesState }),
+ trackingEventFnWithPayload(EventNames.TransactionViewed)({ orderState: orderProcesState }),
trackQuoteFetched: (buyQuote: BuyQuote, fetchOrigin: QuoteFetchOrigin) =>
- trackingEventFnWithPayload(EventNames.QUOTE_FETCHED)({
+ trackingEventFnWithPayload(EventNames.QuoteFetched)({
...buyQuoteEventProperties(buyQuote),
fetchOrigin,
}),
trackQuoteError: (errorMessage: string, assetBuyAmount: BigNumber, fetchOrigin: QuoteFetchOrigin) => {
- trackingEventFnWithPayload(EventNames.QUOTE_ERROR)({
+ trackingEventFnWithPayload(EventNames.QuoteError)({
errorMessage,
assetBuyAmount: assetBuyAmount.toString(),
fetchOrigin,
});
},
- trackUsdPriceFailed: trackingEventFnWithoutPayload(EventNames.USD_PRICE_FETCH_FAILED),
+ trackUsdPriceFailed: trackingEventFnWithoutPayload(EventNames.UsdPriceFetchFailed),
};
diff --git a/packages/instant/src/util/asset.ts b/packages/instant/src/util/asset.ts
index b009a327f..b5c97913d 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);
},
@@ -115,15 +114,18 @@ 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.decimalPlaces(
+ 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 4adb63e21..61aeb839f 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.decimalPlaces(decimalPlaces).precision(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 332c8d00a..9792b60ba 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<GasInfo> => {
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 9d3746e10..f48473389 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<BigNumber>, val2: Maybe<BigNumber>): boolean => {
if (!_.isUndefined(val1) && !_.isUndefined(val2)) {
- return val1.equals(val2);
+ return val1.isEqualTo(val2);
}
return _.isUndefined(val1) && _.isUndefined(val2);
},
diff --git a/packages/json-schemas/CHANGELOG.json b/packages/json-schemas/CHANGELOG.json
index 79435426b..66de84299 100644
--- a/packages/json-schemas/CHANGELOG.json
+++ b/packages/json-schemas/CHANGELOG.json
@@ -1,5 +1,32 @@
[
{
+ "version": "3.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "2.1.7",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "2.1.6",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"timestamp": 1547040760,
"version": "2.1.5",
"changes": [
@@ -48,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
},
{
@@ -63,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
}
],
@@ -255,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/json-schemas/CHANGELOG.md b/packages/json-schemas/CHANGELOG.md
index 6d3373336..4e562d9e8 100644
--- a/packages/json-schemas/CHANGELOG.md
+++ b/packages/json-schemas/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v2.1.7 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v2.1.6 - _January 11, 2019_
+
+ * Dependencies updated
+
## v2.1.5 - _January 9, 2019_
* Dependencies updated
diff --git a/packages/json-schemas/package.json b/packages/json-schemas/package.json
index 5103486db..cd515a747 100644
--- a/packages/json-schemas/package.json
+++ b/packages/json-schemas/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/json-schemas",
- "version": "2.1.5",
+ "version": "2.1.7",
"engines": {
"node": ">=6.12"
},
@@ -39,14 +39,14 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/json-schemas/README.md",
"dependencies": {
- "@0x/typescript-typings": "^3.0.6",
+ "@0x/typescript-typings": "^3.0.8",
"@types/node": "*",
"jsonschema": "^1.2.0",
"lodash.values": "^4.3.0"
},
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
- "@0x/utils": "^2.1.1",
+ "@0x/tslint-config": "^2.0.2",
+ "@0x/utils": "^3.0.1",
"@types/lodash.foreach": "^4.5.3",
"@types/lodash.values": "^4.3.3",
"@types/mocha": "^2.2.42",
diff --git a/packages/metacoin/README.md b/packages/metacoin/README.md
index 4f9609dde..6f35dfc25 100644
--- a/packages/metacoin/README.md
+++ b/packages/metacoin/README.md
@@ -3,12 +3,12 @@
This is an example project that demonstrates how the many Ethereum dev tools developed by 0x can be used in any Solidity/TS project.
It supports:
-* Compiling & testing smart contracts
-* Generating typed contract wrappers
-* Solidity coverage
-* Solidity gas profiling
-* Running tests against Ganache
-* Running tests against our fork of Geth (it supports snapshotting & time travel)
+- Compiling & testing smart contracts
+- Generating typed contract wrappers
+- Solidity coverage
+- Solidity gas profiling
+- Running tests against Ganache
+- Running tests against our fork of Geth (it supports snapshotting & time travel)
## Contributing
diff --git a/packages/metacoin/package.json b/packages/metacoin/package.json
index 6812ff823..3b082f075 100644
--- a/packages/metacoin/package.json
+++ b/packages/metacoin/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/metacoin",
- "version": "0.0.33",
+ "version": "0.0.36",
"engines": {
"node": ">=6.12"
},
@@ -29,31 +29,31 @@
"author": "",
"license": "Apache-2.0",
"dependencies": {
- "@0x/abi-gen": "^1.0.20",
- "@0x/abi-gen-templates": "^1.0.1",
- "@0x/base-contract": "^3.0.11",
- "@0x/sol-coverage": "^1.0.0",
- "@0x/sol-profiler": "^1.0.0",
- "@0x/sol-trace": "^1.0.0",
- "@0x/subproviders": "^2.1.9",
- "@0x/tslint-config": "^2.0.0",
- "@0x/types": "^1.5.0",
- "@0x/typescript-typings": "^3.0.6",
- "@0x/utils": "^2.1.1",
- "@0x/web3-wrapper": "^3.2.2",
+ "@0x/abi-gen": "^1.0.22",
+ "@0x/abi-gen-templates": "^1.0.2",
+ "@0x/base-contract": "^3.0.13",
+ "@0x/sol-coverage": "^1.0.3",
+ "@0x/sol-profiler": "^1.0.3",
+ "@0x/sol-trace": "^1.0.3",
+ "@0x/subproviders": "^2.1.11",
+ "@0x/tslint-config": "^2.0.2",
+ "@0x/types": "^1.5.2",
+ "@0x/typescript-typings": "^3.0.8",
+ "@0x/utils": "^3.0.1",
+ "@0x/web3-wrapper": "^3.2.4",
"@types/mocha": "^5.2.2",
"copyfiles": "^2.0.0",
- "ethereum-types": "^1.1.4",
+ "ethereum-types": "^1.1.6",
"ethers": "~4.0.4",
"lodash": "^4.17.5",
"run-s": "^0.0.0"
},
"devDependencies": {
- "@0x/dev-utils": "^1.0.22",
- "@0x/sol-compiler": "^2.0.0",
+ "@0x/dev-utils": "^1.0.24",
+ "@0x/sol-compiler": "^2.0.2",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
- "chai-bignumber": "^2.0.1",
+ "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/migrations/CHANGELOG.json b/packages/migrations/CHANGELOG.json
index e09106bcd..64ae94b14 100644
--- a/packages/migrations/CHANGELOG.json
+++ b/packages/migrations/CHANGELOG.json
@@ -1,5 +1,33 @@
[
{
+ "version": "3.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "version": "2.4.0",
+ "changes": [
+ {
+ "note": "Added migrations for `MultiAssetProxy` contract",
+ "pr": 1503
+ }
+ ],
+ "timestamp": 1547561734
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "2.3.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "2.3.0",
"changes": [
{
@@ -49,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
}
],
@@ -96,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/migrations/CHANGELOG.md b/packages/migrations/CHANGELOG.md
index 420769187..6c9a84018 100644
--- a/packages/migrations/CHANGELOG.md
+++ b/packages/migrations/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v2.4.0 - _January 15, 2019_
+
+ * Added migrations for `MultiAssetProxy` contract (#1503)
+
+## v2.3.1 - _January 11, 2019_
+
+ * Dependencies updated
+
## v2.3.0 - _January 9, 2019_
* Added migrations for Dutch Auction contract (#1465)
diff --git a/packages/migrations/package.json b/packages/migrations/package.json
index 774236ab4..3ca4e8d6b 100644
--- a/packages/migrations/package.json
+++ b/packages/migrations/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/migrations",
- "version": "2.3.0",
+ "version": "2.4.0",
"engines": {
"node": ">=6.12"
},
@@ -35,9 +35,9 @@
},
"license": "Apache-2.0",
"devDependencies": {
- "@0x/dev-utils": "^1.0.22",
- "@0x/tslint-config": "^2.0.0",
- "@0x/types": "^1.5.0",
+ "@0x/dev-utils": "^1.0.24",
+ "@0x/tslint-config": "^2.0.2",
+ "@0x/types": "^1.5.2",
"@types/yargs": "^10.0.0",
"make-promises-safe": "^1.1.0",
"npm-run-all": "^4.1.2",
@@ -48,18 +48,18 @@
"yargs": "^10.0.3"
},
"dependencies": {
- "@0x/abi-gen-wrappers": "^2.1.0",
- "@0x/base-contract": "^3.0.11",
- "@0x/contract-addresses": "^2.1.0",
- "@0x/contract-artifacts": "^1.2.0",
- "@0x/order-utils": "^3.1.0",
- "@0x/sol-compiler": "^2.0.0",
- "@0x/subproviders": "^2.1.9",
- "@0x/typescript-typings": "^3.0.6",
- "@0x/utils": "^2.1.1",
- "@0x/web3-wrapper": "^3.2.2",
+ "@0x/abi-gen-wrappers": "^2.2.0",
+ "@0x/base-contract": "^3.0.13",
+ "@0x/contract-addresses": "^2.2.0",
+ "@0x/contract-artifacts": "^1.3.0",
+ "@0x/order-utils": "^3.1.2",
+ "@0x/sol-compiler": "^2.0.2",
+ "@0x/subproviders": "^2.1.11",
+ "@0x/typescript-typings": "^3.0.8",
+ "@0x/utils": "^3.0.1",
+ "@0x/web3-wrapper": "^3.2.4",
"@ledgerhq/hw-app-eth": "^4.3.0",
- "ethereum-types": "^1.1.4",
+ "ethereum-types": "^1.1.6",
"ethers": "~4.0.4",
"lodash": "^4.17.5"
},
diff --git a/packages/migrations/src/migration.ts b/packages/migrations/src/migration.ts
index 99d1719f1..e0f245017 100644
--- a/packages/migrations/src/migration.ts
+++ b/packages/migrations/src/migration.ts
@@ -18,6 +18,8 @@ import { erc20TokenInfo, erc721TokenInfo } from './utils/token_info';
*/
export async function runMigrationsAsync(provider: Provider, txDefaults: Partial<TxData>): Promise<ContractAddresses> {
const web3Wrapper = new Web3Wrapper(provider);
+ const accounts: string[] = await web3Wrapper.getAvailableAddressesAsync();
+ const owner = accounts[0];
// Proxies
const erc20Proxy = await wrappers.ERC20ProxyContract.deployFrom0xArtifactAsync(
@@ -50,22 +52,35 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial
zrxAssetData,
);
- // Multisigs
- const accounts: string[] = await web3Wrapper.getAvailableAddressesAsync();
- const owners = [accounts[0], accounts[1]];
- const confirmationsRequired = new BigNumber(2);
- const secondsRequired = new BigNumber(0);
- const owner = accounts[0];
+ // Dummy ERC20 tokens
+ for (const token of erc20TokenInfo) {
+ const totalSupply = new BigNumber(1000000000000000000000000000);
+ // tslint:disable-next-line:no-unused-variable
+ const dummyErc20Token = await wrappers.DummyERC20TokenContract.deployFrom0xArtifactAsync(
+ artifacts.DummyERC20Token,
+ provider,
+ txDefaults,
+ token.name,
+ token.symbol,
+ token.decimals,
+ totalSupply,
+ );
+ }
- // AssetProxyOwner
- const assetProxyOwner = await wrappers.AssetProxyOwnerContract.deployFrom0xArtifactAsync(
- artifacts.AssetProxyOwner,
+ // ERC721
+ // tslint:disable-next-line:no-unused-variable
+ const cryptoKittieToken = await wrappers.DummyERC721TokenContract.deployFrom0xArtifactAsync(
+ artifacts.DummyERC721Token,
+ provider,
+ txDefaults,
+ erc721TokenInfo[0].name,
+ erc721TokenInfo[0].symbol,
+ );
+
+ const multiAssetProxy = await wrappers.MultiAssetProxyContract.deployFrom0xArtifactAsync(
+ artifacts.MultiAssetProxy,
provider,
txDefaults,
- owners,
- [erc20Proxy.address, erc721Proxy.address],
- confirmationsRequired,
- secondsRequired,
);
await web3Wrapper.awaitTransactionSuccessAsync(
@@ -74,20 +89,33 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial
}),
);
await web3Wrapper.awaitTransactionSuccessAsync(
- await erc20Proxy.transferOwnership.sendTransactionAsync(assetProxyOwner.address, {
+ await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, {
from: owner,
}),
);
await web3Wrapper.awaitTransactionSuccessAsync(
- await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, {
+ await multiAssetProxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, {
from: owner,
}),
);
+
+ // MultiAssetProxy
await web3Wrapper.awaitTransactionSuccessAsync(
- await erc721Proxy.transferOwnership.sendTransactionAsync(assetProxyOwner.address, {
+ await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, {
from: owner,
}),
);
+ await web3Wrapper.awaitTransactionSuccessAsync(
+ await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, {
+ from: owner,
+ }),
+ );
+ await web3Wrapper.awaitTransactionSuccessAsync(
+ await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc20Proxy.address),
+ );
+ await web3Wrapper.awaitTransactionSuccessAsync(
+ await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc721Proxy.address),
+ );
// Register the Asset Proxies to the Exchange
await web3Wrapper.awaitTransactionSuccessAsync(
@@ -96,30 +124,8 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial
await web3Wrapper.awaitTransactionSuccessAsync(
await exchange.registerAssetProxy.sendTransactionAsync(erc721Proxy.address),
);
-
- // Dummy ERC20 tokens
- for (const token of erc20TokenInfo) {
- const totalSupply = new BigNumber(1000000000000000000000000000);
- // tslint:disable-next-line:no-unused-variable
- const dummyErc20Token = await wrappers.DummyERC20TokenContract.deployFrom0xArtifactAsync(
- artifacts.DummyERC20Token,
- provider,
- txDefaults,
- token.name,
- token.symbol,
- token.decimals,
- totalSupply,
- );
- }
-
- // ERC721
- // tslint:disable-next-line:no-unused-variable
- const cryptoKittieToken = await wrappers.DummyERC721TokenContract.deployFrom0xArtifactAsync(
- artifacts.DummyERC721Token,
- provider,
- txDefaults,
- erc721TokenInfo[0].name,
- erc721TokenInfo[0].symbol,
+ await web3Wrapper.awaitTransactionSuccessAsync(
+ await exchange.registerAssetProxy.sendTransactionAsync(multiAssetProxy.address),
);
// Forwarder
@@ -149,6 +155,39 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial
exchange.address,
);
+ // Multisigs
+ const owners = [accounts[0], accounts[1]];
+ const confirmationsRequired = new BigNumber(2);
+ const secondsRequired = new BigNumber(0);
+
+ // AssetProxyOwner
+ const assetProxyOwner = await wrappers.AssetProxyOwnerContract.deployFrom0xArtifactAsync(
+ artifacts.AssetProxyOwner,
+ provider,
+ txDefaults,
+ owners,
+ [erc20Proxy.address, erc721Proxy.address, multiAssetProxy.address],
+ confirmationsRequired,
+ secondsRequired,
+ );
+
+ // Transfer Ownership to the Asset Proxy Owner
+ await web3Wrapper.awaitTransactionSuccessAsync(
+ await erc20Proxy.transferOwnership.sendTransactionAsync(assetProxyOwner.address, {
+ from: owner,
+ }),
+ );
+ await web3Wrapper.awaitTransactionSuccessAsync(
+ await erc721Proxy.transferOwnership.sendTransactionAsync(assetProxyOwner.address, {
+ from: owner,
+ }),
+ );
+ await web3Wrapper.awaitTransactionSuccessAsync(
+ await multiAssetProxy.transferOwnership.sendTransactionAsync(assetProxyOwner.address, {
+ from: owner,
+ }),
+ );
+
// Fund the Forwarder with ZRX
const zrxDecimals = await zrxToken.decimals.callAsync();
const zrxForwarderAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(5000), zrxDecimals);
@@ -156,7 +195,7 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial
await zrxToken.transfer.sendTransactionAsync(forwarder.address, zrxForwarderAmount, txDefaults),
);
- return {
+ const contractAddresses = {
erc20Proxy: erc20Proxy.address,
erc721Proxy: erc721Proxy.address,
zrxToken: zrxToken.address,
@@ -167,6 +206,8 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial
orderValidator: orderValidator.address,
dutchAuction: dutchAuction.address,
};
+
+ return contractAddresses;
}
let _cachedContractAddresses: ContractAddresses;
diff --git a/packages/monorepo-scripts/CHANGELOG.json b/packages/monorepo-scripts/CHANGELOG.json
index cebe7ec72..a71bfbd6d 100644
--- a/packages/monorepo-scripts/CHANGELOG.json
+++ b/packages/monorepo-scripts/CHANGELOG.json
@@ -1,5 +1,14 @@
[
{
+ "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/monorepo-scripts/package.json b/packages/monorepo-scripts/package.json
index 3286b8412..187a80c93 100644
--- a/packages/monorepo-scripts/package.json
+++ b/packages/monorepo-scripts/package.json
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@0x/monorepo-scripts",
- "version": "1.0.16",
+ "version": "1.0.19",
"engines": {
"node": ">=6.12"
},
@@ -47,7 +47,7 @@
"typescript": "3.0.1"
},
"dependencies": {
- "@0x/utils": "^2.0.8",
+ "@0x/utils": "^3.0.1",
"@lerna/batch-packages": "^3.0.0-beta.18",
"@types/depcheck": "^0.6.0",
"async-child-process": "^1.1.1",
diff --git a/packages/monorepo-scripts/src/prepublish_checks.ts b/packages/monorepo-scripts/src/prepublish_checks.ts
index 82eaf5cf9..021e57226 100644
--- a/packages/monorepo-scripts/src/prepublish_checks.ts
+++ b/packages/monorepo-scripts/src/prepublish_checks.ts
@@ -6,6 +6,8 @@ import semverSort = require('semver-sort');
import { constants } from './constants';
import { Package } from './types';
import { changelogUtils } from './utils/changelog_utils';
+import { configs } from './utils/configs';
+import { dockerHubUtils } from './utils/docker_hub_utils';
import { npmUtils } from './utils/npm_utils';
import { utils } from './utils/utils';
@@ -17,6 +19,12 @@ async function prepublishChecksAsync(): Promise<void> {
await checkChangelogFormatAsync(updatedPublicPackages);
await checkGitTagsForNextVersionAndDeleteIfExistAsync(updatedPublicPackages);
await checkPublishRequiredSetupAsync();
+ await checkDockerHubSetupAsync();
+}
+
+async function checkDockerHubSetupAsync(): Promise<void> {
+ await dockerHubUtils.checkUserAddedToOrganizationOrThrowAsync(configs.DOCKER_HUB_ORG);
+ await dockerHubUtils.loginUserToDockerCommandlineOrThrowAsync();
}
async function checkGitTagsForNextVersionAndDeleteIfExistAsync(updatedPublicPackages: Package[]): Promise<void> {
diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts
index e0602a74f..105d87dcd 100644
--- a/packages/monorepo-scripts/src/publish.ts
+++ b/packages/monorepo-scripts/src/publish.ts
@@ -1,11 +1,12 @@
#!/usr/bin/env node
+import { logUtils } from '@0x/utils';
import * as promisify from 'es6-promisify';
import * as fs from 'fs';
import * as _ from 'lodash';
import * as moment from 'moment';
import opn = require('opn');
-import { exec as execAsync } from 'promisify-child-process';
+import { exec as execAsync, spawn as spawnAsync } from 'promisify-child-process';
import * as prompt from 'prompt';
import semver = require('semver');
import semverSort = require('semver-sort');
@@ -79,12 +80,16 @@ async function confirmAsync(message: string): Promise<void> {
});
utils.log(`Calling 'lerna publish'...`);
await lernaPublishAsync(packageToNextVersion);
- if (!configs.IS_LOCAL_PUBLISH) {
+
+ const isDryRun = configs.IS_LOCAL_PUBLISH;
+ if (!isDryRun) {
+ // Publish docker images to DockerHub
+ await publishImagesToDockerHubAsync(allPackagesToPublish);
+
const isStaging = false;
const shouldUploadDocs = true;
await generateAndUploadDocJsonsAsync(packagesWithDocs, isStaging, shouldUploadDocs);
}
- const isDryRun = configs.IS_LOCAL_PUBLISH;
const releaseNotes = await publishReleaseNotesAsync(updatedPublicPackages, isDryRun);
utils.log('Published release notes');
@@ -95,11 +100,45 @@ async function confirmAsync(message: string): Promise<void> {
utils.log("Publish successful, but couldn't auto-alert discord (", e.message, '), Please alert manually.');
}
}
+ process.exit(0);
})().catch(err => {
utils.log(err);
process.exit(1);
});
+async function publishImagesToDockerHubAsync(allUpdatedPackages: Package[]): Promise<void> {
+ for (const pkg of allUpdatedPackages) {
+ const packageJSON = pkg.packageJson;
+ const shouldPublishDockerImage =
+ !_.isUndefined(packageJSON.config) &&
+ !_.isUndefined(packageJSON.config.postpublish) &&
+ !_.isUndefined(packageJSON.config.postpublish.dockerHubRepo);
+ if (!shouldPublishDockerImage) {
+ continue;
+ }
+ const dockerHubRepo = _.get(packageJSON, 'config.postpublish.dockerHubRepo');
+ const pkgName = pkg.packageJson.name;
+ const packageDirName = _.startsWith(pkgName, '@0x/') ? pkgName.split('/')[1] : pkgName;
+
+ // Build the Docker image
+ logUtils.log(`Building '${dockerHubRepo}' docker image...`);
+ await spawnAsync('docker', ['build', '-t', dockerHubRepo, '.'], {
+ cwd: `${constants.monorepoRootPath}/packages/${packageDirName}`,
+ });
+
+ // Tag the docker image with the latest version
+ const version = pkg.packageJson.version;
+ logUtils.log(`Tagging '${dockerHubRepo}' docker image with version ${version}...`);
+ await execAsync(`docker tag ${dockerHubRepo} ${configs.DOCKER_HUB_ORG}/${dockerHubRepo}:${version}`);
+ await execAsync(`docker tag ${dockerHubRepo} ${configs.DOCKER_HUB_ORG}/${dockerHubRepo}:latest`);
+
+ // Publish to DockerHub
+ logUtils.log(`Pushing '${dockerHubRepo}' docker image to DockerHub...`);
+ await execAsync(`docker push ${configs.DOCKER_HUB_ORG}/${dockerHubRepo}:${version}`);
+ await execAsync(`docker push ${configs.DOCKER_HUB_ORG}/${dockerHubRepo}:latest`);
+ }
+}
+
function getPackagesWithDocs(allUpdatedPackages: Package[]): Package[] {
const rootPackageJsonPath = `${constants.monorepoRootPath}/package.json`;
const rootPackageJson = JSON.parse(fs.readFileSync(rootPackageJsonPath).toString());
diff --git a/packages/monorepo-scripts/src/types.ts b/packages/monorepo-scripts/src/types.ts
index 3c2ec5069..4af4fd257 100644
--- a/packages/monorepo-scripts/src/types.ts
+++ b/packages/monorepo-scripts/src/types.ts
@@ -41,7 +41,11 @@ export interface PackageJSON {
main?: string;
scripts?: { [command: string]: string };
config?: {
- additionalTsTypings?: string[];
+ postpublish?: {
+ assets?: string[];
+ docOmitExports?: string[];
+ dockerHubRepo?: string;
+ };
};
}
diff --git a/packages/monorepo-scripts/src/utils/configs.ts b/packages/monorepo-scripts/src/utils/configs.ts
index e579bdb7c..b6b6e2c5e 100644
--- a/packages/monorepo-scripts/src/utils/configs.ts
+++ b/packages/monorepo-scripts/src/utils/configs.ts
@@ -5,4 +5,5 @@ const REMOTE_NPM_REGISTRY_URL = 'https://registry.npmjs.org';
export const configs = {
IS_LOCAL_PUBLISH,
NPM_REGISTRY_URL: IS_LOCAL_PUBLISH ? LOCAL_NPM_REGISTRY_URL : REMOTE_NPM_REGISTRY_URL,
+ DOCKER_HUB_ORG: '0xorg',
};
diff --git a/packages/monorepo-scripts/src/utils/docker_hub_utils.ts b/packages/monorepo-scripts/src/utils/docker_hub_utils.ts
new file mode 100644
index 000000000..62215a579
--- /dev/null
+++ b/packages/monorepo-scripts/src/utils/docker_hub_utils.ts
@@ -0,0 +1,65 @@
+import { fetchAsync } from '@0x/utils';
+import { exec as execAsync } from 'promisify-child-process';
+
+import { utils } from './utils';
+
+const API_ENDPOINT = 'https://hub.docker.com/v2';
+const HTTP_OK_STATUS = 200;
+
+export const dockerHubUtils = {
+ async getTokenAsync(): Promise<string> {
+ const payload = {
+ username: process.env.DOCKER_USERNAME,
+ password: process.env.DOCKER_PASS,
+ };
+ const response = await fetchAsync(`${API_ENDPOINT}/users/login`, {
+ method: 'POST',
+ headers: {
+ Accept: 'application/json',
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify(payload),
+ });
+ if (response.status !== HTTP_OK_STATUS) {
+ throw new Error(
+ `DockerHub user login failed (status code: ${
+ response.status
+ }). Make sure you have environment variables 'DOCKER_USERNAME; and 'DOCKER_PASS' set`,
+ );
+ }
+ const respPayload = await response.json();
+ const token = respPayload.token;
+ return token;
+ },
+ async checkUserAddedToOrganizationOrThrowAsync(organization: string): Promise<void> {
+ utils.log('Checking that the user was added to the 0xorg DockerHub organization...');
+ const token = await dockerHubUtils.getTokenAsync();
+ const response = await fetchAsync(`${API_ENDPOINT}/repositories/${organization}/?page_size=10`, {
+ method: 'GET',
+ headers: {
+ Accept: 'application/json',
+ Authorization: `JWT ${token}`,
+ },
+ });
+ const respPayload = await response.json();
+ if (response.status !== HTTP_OK_STATUS || respPayload.count === 0) {
+ throw new Error(
+ `Failed to fetch org: ${organization}'s list of repos (status code: ${
+ response.status
+ }). Make sure your account has been added to the '${organization}' org on DockerHub`,
+ );
+ }
+ },
+ async loginUserToDockerCommandlineOrThrowAsync(): Promise<void> {
+ try {
+ utils.log('Checking that the user is logged in to docker command...');
+ await execAsync(`echo "$DOCKER_PASS" | docker login -u $DOCKER_USERNAME --password-stdin`);
+ } catch (err) {
+ throw new Error(
+ `Failed to log you into the 'docker' commandline tool. Make sure you have the 'docker' commandline tool installed. Full error: ${
+ err.message
+ }`,
+ );
+ }
+ },
+};
diff --git a/packages/monorepo-scripts/src/utils/utils.ts b/packages/monorepo-scripts/src/utils/utils.ts
index 95b187cc2..28c5658f3 100644
--- a/packages/monorepo-scripts/src/utils/utils.ts
+++ b/packages/monorepo-scripts/src/utils/utils.ts
@@ -106,8 +106,10 @@ export const utils = {
return nextVersionIfValid;
},
async getRemoteGitTagsAsync(): Promise<string[]> {
+ const TEN_MEGA_BYTES = 1024 * 1024 * 10; // tslint:disable-line custom-no-magic-numbers
const result = await execAsync(`git ls-remote --tags`, {
cwd: constants.monorepoRootPath,
+ maxBuffer: TEN_MEGA_BYTES,
});
const tagsString = result.stdout;
const tagOutputs: string[] = tagsString.split('\n');
diff --git a/packages/order-utils/CHANGELOG.json b/packages/order-utils/CHANGELOG.json
index d3f15f092..08d88da5b 100644
--- a/packages/order-utils/CHANGELOG.json
+++ b/packages/order-utils/CHANGELOG.json
@@ -1,10 +1,36 @@
[
{
+ "version": "4.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "3.1.2",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "3.1.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"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
}
],
@@ -78,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
}
],
@@ -113,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
},
{
@@ -145,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
}
],
@@ -228,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
},
{
@@ -252,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
}
],
@@ -264,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
},
{
@@ -313,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
@@ -377,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-utils/CHANGELOG.md b/packages/order-utils/CHANGELOG.md
index eb36616d1..c82458f2e 100644
--- a/packages/order-utils/CHANGELOG.md
+++ b/packages/order-utils/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v3.1.2 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v3.1.1 - _January 11, 2019_
+
+ * Dependencies updated
+
## v3.1.0 - _January 9, 2019_
* Use new ABI encoder, add encoding/decoding logic for MultiAsset assetData, and add information to return values in orderStateUtils (#1363)
diff --git a/packages/order-utils/package.json b/packages/order-utils/package.json
index e59ea664f..7a4d4aa84 100644
--- a/packages/order-utils/package.json
+++ b/packages/order-utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/order-utils",
- "version": "3.1.0",
+ "version": "3.1.2",
"engines": {
"node": ">=6.12"
},
@@ -35,13 +35,13 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/order-utils/README.md",
"devDependencies": {
- "@0x/dev-utils": "^1.0.22",
- "@0x/tslint-config": "^2.0.0",
+ "@0x/dev-utils": "^1.0.24",
+ "@0x/tslint-config": "^2.0.2",
"@types/bn.js": "^4.11.0",
"@types/lodash": "4.14.104",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
- "chai-bignumber": "^2.0.1",
+ "chai-bignumber": "^3.0.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",
@@ -53,18 +53,18 @@
"typescript": "3.0.1"
},
"dependencies": {
- "@0x/abi-gen-wrappers": "^2.1.0",
- "@0x/assert": "^1.0.21",
- "@0x/base-contract": "^3.0.11",
- "@0x/contract-artifacts": "^1.2.0",
- "@0x/json-schemas": "^2.1.5",
- "@0x/types": "^1.5.0",
- "@0x/typescript-typings": "^3.0.6",
- "@0x/utils": "^2.1.1",
- "@0x/web3-wrapper": "^3.2.2",
+ "@0x/abi-gen-wrappers": "^2.2.0",
+ "@0x/assert": "^1.0.23",
+ "@0x/base-contract": "^3.0.13",
+ "@0x/contract-artifacts": "^1.3.0",
+ "@0x/json-schemas": "^2.1.7",
+ "@0x/types": "^1.5.2",
+ "@0x/typescript-typings": "^3.0.8",
+ "@0x/utils": "^3.0.1",
+ "@0x/web3-wrapper": "^3.2.4",
"@types/node": "*",
"bn.js": "^4.11.8",
- "ethereum-types": "^1.1.4",
+ "ethereum-types": "^1.1.6",
"ethereumjs-abi": "0.6.5",
"ethereumjs-util": "^5.1.1",
"ethers": "~4.0.4",
diff --git a/packages/order-utils/src/crypto.ts b/packages/order-utils/src/crypto.ts
index 0f1504a72..8b835ff48 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/order-utils/src/exchange_transfer_simulator.ts b/packages/order-utils/src/exchange_transfer_simulator.ts
index 06621fd9e..922ae8e17 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 fa32f1413..9042551fa 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 389419587..430178b5d 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 ae4291ea8..95215d918 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 416e00c67..dacdbd5a2 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 052eafa1d..92ffc8e80 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 ff47ab5d2..95df66c99 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 6b2261001..64195dbed 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 c55a76def..affad8f1c 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 84e5559a9..937382056 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/CHANGELOG.json b/packages/order-watcher/CHANGELOG.json
index afd523f88..585bb48e6 100644
--- a/packages/order-watcher/CHANGELOG.json
+++ b/packages/order-watcher/CHANGELOG.json
@@ -1,5 +1,41 @@
[
{
+ "version": "3.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547747677,
+ "version": "2.4.3",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "2.4.2",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "2.4.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "2.4.0",
"changes": [
{
@@ -13,8 +49,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
}
]
@@ -59,8 +94,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
}
],
@@ -74,8 +108,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
@@ -106,8 +139,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
}
],
@@ -136,18 +168,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
}
],
@@ -211,8 +240,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/order-watcher/CHANGELOG.md b/packages/order-watcher/CHANGELOG.md
index 600b9fa6f..df065866c 100644
--- a/packages/order-watcher/CHANGELOG.md
+++ b/packages/order-watcher/CHANGELOG.md
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v2.4.3 - _January 17, 2019_
+
+ * Dependencies updated
+
+## v2.4.2 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v2.4.1 - _January 11, 2019_
+
+ * Dependencies updated
+
## v2.4.0 - _January 9, 2019_
* Add support for `MultiAssetProxy` (#1363)
diff --git a/packages/order-watcher/README.md b/packages/order-watcher/README.md
index 385fe4715..a841775b6 100644
--- a/packages/order-watcher/README.md
+++ b/packages/order-watcher/README.md
@@ -36,7 +36,7 @@ If your project is in [TypeScript](https://www.typescriptlang.org/), add the fol
**Environmental Variables**
Several environmental variables can be set to configure the server:
-* `ORDER_WATCHER_HTTP_PORT` specifies the port that the http server will listen on
+- `ORDER_WATCHER_HTTP_PORT` specifies the port that the http server will listen on
and accept connections from. When this is not set, we default to 8080.
**Requests**
@@ -58,10 +58,10 @@ wsClient = create_connection("ws://127.0.0.1:8080")
With the connection established, you prepare the payload for your request. The payload is a json object with a format established by the [JSON RPC specification](https://www.jsonrpc.org/specification):
-* `id`: All requests require you to specify a numerical `id`. When the server responds to the request, the response will have the same `id` as the one supplied with your request.
-* `jsonrpc`: This is always the string `'2.0'`.
-* `method`: This specifies the OrderWatcher method you want to call. I.e., `'ADD_ORDER'`, `'REMOVE_ORDER'` or `'GET_STATS'`.
-* `params`: These contain the parameters needed by OrderWatcher to execute the method you called. For `ADD_ORDER`, provide `{ signedOrder: <your signedOrder> }`. For `REMOVE_ORDER`, provide `{ orderHash: <your orderHash> }`. For `GET_STATS`, no parameters are needed, so you may leave this empty.
+- `id`: All requests require you to specify a numerical `id`. When the server responds to the request, the response will have the same `id` as the one supplied with your request.
+- `jsonrpc`: This is always the string `'2.0'`.
+- `method`: This specifies the OrderWatcher method you want to call. I.e., `'ADD_ORDER'`, `'REMOVE_ORDER'` or `'GET_STATS'`.
+- `params`: These contain the parameters needed by OrderWatcher to execute the method you called. For `ADD_ORDER`, provide `{ signedOrder: <your signedOrder> }`. For `REMOVE_ORDER`, provide `{ orderHash: <your orderHash> }`. For `GET_STATS`, no parameters are needed, so you may leave this empty.
Next, convert the payload to a string and send it through the connection.
In Javascript:
@@ -92,11 +92,11 @@ wsClient.send(json.dumps(remove_order_payload));
**Response**
The server responds to all requests in a similar format. In the data field, you'll find another object containing the following fields:
-* `id`: The id corresponding to the request that the server is responding to. `UPDATE` responses are not based on any requests so the `id` field is omitted`.
-* `jsonrpc`: Always `'2.0'`.
-* `method`: The method the server is responding to. Eg. `ADD_ORDER`. When order states change the server may also initiate a response. In this case, method will be listed as `UPDATE`.
-* `result`: This field varies based on the method. `UPDATE` responses contain the new order state. `GET_STATS` responses contain the current order count. When there are errors, this field is omitted.
-* `error`: When there is an error executing a request, the [JSON RPC](https://www.jsonrpc.org/specification) error object is listed here. When the server responds successfully, this field is omitted.
+- `id`: The id corresponding to the request that the server is responding to. `UPDATE` responses are not based on any requests so the `id` field is omitted`.
+- `jsonrpc`: Always `'2.0'`.
+- `method`: The method the server is responding to. Eg. `ADD_ORDER`. When order states change the server may also initiate a response. In this case, method will be listed as `UPDATE`.
+- `result`: This field varies based on the method. `UPDATE` responses contain the new order state. `GET_STATS` responses contain the current order count. When there are errors, this field is omitted.
+- `error`: When there is an error executing a request, the [JSON RPC](https://www.jsonrpc.org/specification) error object is listed here. When the server responds successfully, this field is omitted.
In Javascript, the responses can be parsed using the `onmessage` callback:
diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json
index 5919759dd..895c64813 100644
--- a/packages/order-watcher/package.json
+++ b/packages/order-watcher/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/order-watcher",
- "version": "2.4.0",
+ "version": "2.4.3",
"description": "An order watcher daemon that watches for order validity",
"keywords": [
"0x",
@@ -24,6 +24,11 @@
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js lib/test/global_hooks.js --timeout 10000 --bail --exit",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
},
+ "config": {
+ "postpublish": {
+ "dockerHubRepo": "order-watcher"
+ }
+ },
"repository": {
"type": "git",
"url": "https://github.com/0xProject/0x-monorepo"
@@ -33,10 +38,10 @@
"node": ">=6.0.0"
},
"devDependencies": {
- "@0x/dev-utils": "^1.0.22",
- "@0x/migrations": "^2.3.0",
- "@0x/subproviders": "^2.1.9",
- "@0x/tslint-config": "^2.0.0",
+ "@0x/dev-utils": "^1.0.24",
+ "@0x/migrations": "^2.4.0",
+ "@0x/subproviders": "^2.1.11",
+ "@0x/tslint-config": "^2.0.2",
"@types/bintrees": "^1.0.2",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
@@ -44,7 +49,7 @@
"@types/sinon": "^2.2.2",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
- "chai-bignumber": "^2.0.1",
+ "chai-bignumber": "^3.0.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",
@@ -58,21 +63,21 @@
"typescript": "3.0.1"
},
"dependencies": {
- "@0x/abi-gen-wrappers": "^2.1.0",
- "@0x/assert": "^1.0.21",
- "@0x/base-contract": "^3.0.11",
- "@0x/contract-addresses": "^2.1.0",
- "@0x/contract-artifacts": "^1.2.0",
- "@0x/contract-wrappers": "^4.2.0",
- "@0x/fill-scenarios": "^1.1.0",
- "@0x/json-schemas": "^2.1.5",
- "@0x/order-utils": "^3.1.0",
- "@0x/types": "^1.5.0",
- "@0x/typescript-typings": "^3.0.6",
- "@0x/utils": "^2.1.1",
- "@0x/web3-wrapper": "^3.2.2",
+ "@0x/abi-gen-wrappers": "^2.2.0",
+ "@0x/assert": "^1.0.23",
+ "@0x/base-contract": "^3.0.13",
+ "@0x/contract-addresses": "^2.2.0",
+ "@0x/contract-artifacts": "^1.3.0",
+ "@0x/contract-wrappers": "^5.0.1",
+ "@0x/fill-scenarios": "^1.1.2",
+ "@0x/json-schemas": "^2.1.7",
+ "@0x/order-utils": "^3.1.2",
+ "@0x/types": "^1.5.2",
+ "@0x/typescript-typings": "^3.0.8",
+ "@0x/utils": "^3.0.1",
+ "@0x/web3-wrapper": "^3.2.4",
"bintrees": "^1.0.2",
- "ethereum-types": "^1.1.4",
+ "ethereum-types": "^1.1.6",
"ethereumjs-blockstream": "6.0.0",
"ethers": "~4.0.4",
"lodash": "^4.17.5",
diff --git a/packages/order-watcher/src/order_watcher/expiration_watcher.ts b/packages/order-watcher/src/order_watcher/expiration_watcher.ts
index ad20a6e3f..82590efde 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 a7d10aaf9..9c3849ff1 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 41dc884d5..28b564b32 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/README.md b/packages/pipeline/README.md
index 40a64cdd1..4fc8e0ff9 100644
--- a/packages/pipeline/README.md
+++ b/packages/pipeline/README.md
@@ -164,20 +164,21 @@ set the`ZEROEX_DATA_PIPELINE_DB_URL` environment variable to a valid
#### Additional guidelines and tips:
-* Table names should be plural and separated by underscores (e.g.,
+- Table names should be plural and separated by underscores (e.g.,
`exchange_fill_events`).
-* Any table which contains data which comes directly from a third-party source
+- Any table which contains data which comes directly from a third-party source
should be namespaced in the `raw` PostgreSQL schema.
-* Column names in the database should be separated by underscores (e.g.,
+- Column names in the database should be separated by underscores (e.g.,
`maker_asset_type`).
-* Field names in entity classes (like any other fields in TypeScript) should
+- Field names in entity classes (like any other fields in TypeScript) should
be camel-cased (e.g., `makerAssetType`).
-* All timestamps should be stored as milliseconds since the Unix Epoch.
-* Use the `BigNumber` type for TypeScript code which deals with 256-bit
+- All timestamps should be stored as milliseconds since the Unix Epoch.
+- Use the `BigNumber` type for TypeScript code which deals with 256-bit
numbers from smart contracts or for any case where we are dealing with large
floating point numbers.
-* [TypeORM documentation](http://typeorm.io/#/) is pretty robust and can be a
+- [TypeORM documentation](http://typeorm.io/#/) is pretty robust and can be a
helpful resource.
+
* Scripts/parsers should perform minimum data transformation/normalization.
The idea here is to have a raw data feed that will be cleaned up and
synthesized in a separate step.
diff --git a/packages/pipeline/package.json b/packages/pipeline/package.json
index 47150300d..908734687 100644
--- a/packages/pipeline/package.json
+++ b/packages/pipeline/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/pipeline",
- "version": "1.0.3",
+ "version": "1.0.5",
"private": true,
"description": "Data pipeline for offline analysis",
"scripts": {
@@ -27,35 +27,35 @@
},
"license": "Apache-2.0",
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.2",
"@types/axios": "^0.14.0",
"@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",
"typescript": "3.0.1"
},
"dependencies": {
- "@0x/connect": "^3.0.11",
- "@0x/contract-addresses": "^2.1.0",
- "@0x/contract-artifacts": "^1.2.0",
+ "@0x/connect": "^3.0.13",
+ "@0x/contract-addresses": "^2.2.0",
+ "@0x/contract-artifacts": "^1.3.0",
"@0x/contract-wrappers": "^3.0.0",
- "@0x/dev-utils": "^1.0.22",
- "@0x/order-utils": "^3.1.0",
- "@0x/subproviders": "^2.1.9",
- "@0x/types": "^1.5.0",
- "@0x/utils": "^2.1.1",
- "@0x/web3-wrapper": "^3.2.2",
+ "@0x/dev-utils": "^1.0.24",
+ "@0x/order-utils": "^3.1.2",
+ "@0x/subproviders": "^2.1.11",
+ "@0x/types": "^1.5.2",
+ "@0x/utils": "^3.0.1",
+ "@0x/web3-wrapper": "^3.2.4",
"@types/dockerode": "^2.5.9",
"@types/p-limit": "^2.0.0",
"async-parallel": "^1.2.3",
"axios": "^0.18.0",
"bottleneck": "^2.13.2",
"dockerode": "^2.5.7",
- "ethereum-types": "^1.1.4",
+ "ethereum-types": "^1.1.6",
"pg": "^7.5.0",
"prettier": "^1.15.3",
"ramda": "^0.25.0",
diff --git a/packages/pipeline/src/parsers/copper/index.ts b/packages/pipeline/src/parsers/copper/index.ts
index 6c0c5abd5..07da66d10 100644
--- a/packages/pipeline/src/parsers/copper/index.ts
+++ b/packages/pipeline/src/parsers/copper/index.ts
@@ -44,8 +44,8 @@ export interface CopperActivityParentResponse {
// custom activity types
export enum CopperActivityTypeCategory {
- user = 'user',
- system = 'system',
+ User = 'user',
+ System = 'system',
}
export interface CopperActivityTypeResponse {
id: number;
@@ -90,7 +90,7 @@ export enum CopperCustomFieldType {
Date = 'Date',
Checkbox = 'Checkbox',
Float = 'Float',
- URL = 'URL',
+ URL = 'URL', // tslint:disable-line:enum-naming
Percentage = 'Percentage',
Currency = 'Currency',
Connect = 'Connect',
diff --git a/packages/pipeline/src/scripts/pull_competing_dex_trades.ts b/packages/pipeline/src/scripts/pull_competing_dex_trades.ts
index 1478d5615..14644bb2e 100644
--- a/packages/pipeline/src/scripts/pull_competing_dex_trades.ts
+++ b/packages/pipeline/src/scripts/pull_competing_dex_trades.ts
@@ -1,7 +1,8 @@
-// tslint:disable:no-console
import 'reflect-metadata';
import { Connection, ConnectionOptions, createConnection, Repository } from 'typeorm';
+import { logUtils } from '@0x/utils';
+
import { BloxySource } from '../data_sources/bloxy';
import { DexTrade } from '../entities';
import * as ormConfig from '../ormconfig';
@@ -27,14 +28,14 @@ async function getAndSaveTradesAsync(): Promise<void> {
const bloxySource = new BloxySource(apiKey);
const tradesRepository = connection.getRepository(DexTrade);
const lastSeenTimestamp = await getLastSeenTimestampAsync(tradesRepository);
- console.log(`Last seen timestamp: ${lastSeenTimestamp === 0 ? 'none' : lastSeenTimestamp}`);
- console.log('Getting latest dex trades...');
+ logUtils.log(`Last seen timestamp: ${lastSeenTimestamp === 0 ? 'none' : lastSeenTimestamp}`);
+ logUtils.log('Getting latest dex trades...');
const rawTrades = await bloxySource.getDexTradesAsync(lastSeenTimestamp);
- console.log(`Parsing ${rawTrades.length} trades...`);
+ logUtils.log(`Parsing ${rawTrades.length} trades...`);
const trades = parseBloxyTrades(rawTrades);
- console.log(`Saving ${trades.length} trades...`);
+ logUtils.log(`Saving ${trades.length} trades...`);
await tradesRepository.save(trades, { chunk: Math.ceil(trades.length / BATCH_SAVE_SIZE) });
- console.log('Done saving trades.');
+ logUtils.log('Done saving trades.');
}
async function getLastSeenTimestampAsync(tradesRepository: Repository<DexTrade>): Promise<number> {
diff --git a/packages/pipeline/src/scripts/pull_copper.ts b/packages/pipeline/src/scripts/pull_copper.ts
index 69814f209..5e4a6a643 100644
--- a/packages/pipeline/src/scripts/pull_copper.ts
+++ b/packages/pipeline/src/scripts/pull_copper.ts
@@ -1,7 +1,8 @@
-// tslint:disable:no-console
import * as R from 'ramda';
import { Connection, ConnectionOptions, createConnection, Repository } from 'typeorm';
+import { logUtils } from '@0x/utils';
+
import { CopperEndpoint, CopperSearchParams, CopperSource } from '../data_sources/copper';
import { CopperActivity, CopperActivityType, CopperCustomField, CopperLead, CopperOpportunity } from '../entities';
import * as ormConfig from '../ormconfig';
@@ -43,14 +44,14 @@ let connection: Connection;
async function fetchAndSaveLeadsAsync(source: CopperSource): Promise<void> {
const repository = connection.getRepository(CopperLead);
const startTime = await getMaxAsync(connection, 'date_modified', 'raw.copper_leads');
- console.log(`Fetching Copper leads starting from ${startTime}...`);
+ logUtils.log(`Fetching Copper leads starting from ${startTime}...`);
await fetchAndSaveAsync(CopperEndpoint.Leads, source, startTime, {}, parseLeads, repository);
}
async function fetchAndSaveOpportunitiesAsync(source: CopperSource): Promise<void> {
const repository = connection.getRepository(CopperOpportunity);
const startTime = await getMaxAsync(connection, 'date_modified', 'raw.copper_opportunities');
- console.log(`Fetching Copper opportunities starting from ${startTime}...`);
+ logUtils.log(`Fetching Copper opportunities starting from ${startTime}...`);
await fetchAndSaveAsync(
CopperEndpoint.Opportunities,
source,
@@ -67,7 +68,7 @@ async function fetchAndSaveActivitiesAsync(source: CopperSource): Promise<void>
const searchParams = {
minimum_activity_date: Math.floor(startTime / ONE_SECOND),
};
- console.log(`Fetching Copper activities starting from ${startTime}...`);
+ logUtils.log(`Fetching Copper activities starting from ${startTime}...`);
await fetchAndSaveAsync(CopperEndpoint.Activities, source, startTime, searchParams, parseActivities, repository);
}
@@ -97,7 +98,7 @@ async function fetchAndSaveAsync<T extends CopperSearchResponse, E>(
const numPages = await source.fetchNumberOfPagesAsync(endpoint);
try {
for (let i = numPages; i > 0; i--) {
- console.log(`Fetching page ${i}/${numPages} of ${endpoint}...`);
+ logUtils.log(`Fetching page ${i}/${numPages} of ${endpoint}...`);
const raw = await source.fetchSearchResultsAsync<T>(endpoint, {
...searchParams,
page_number: i,
@@ -108,21 +109,21 @@ async function fetchAndSaveAsync<T extends CopperSearchResponse, E>(
saved += newRecords.length;
}
} catch (err) {
- console.log(`Error fetching ${endpoint}, stopping: ${err.stack}`);
+ logUtils.log(`Error fetching ${endpoint}, stopping: ${err.stack}`);
} finally {
- console.log(`Saved ${saved} items from ${endpoint}, done.`);
+ logUtils.log(`Saved ${saved} items from ${endpoint}, done.`);
}
}
async function fetchAndSaveActivityTypesAsync(source: CopperSource): Promise<void> {
- console.log(`Fetching Copper activity types...`);
+ logUtils.log(`Fetching Copper activity types...`);
const activityTypes = await source.fetchActivityTypesAsync();
const repository = connection.getRepository(CopperActivityType);
await repository.save(parseActivityTypes(activityTypes));
}
async function fetchAndSaveCustomFieldsAsync(source: CopperSource): Promise<void> {
- console.log(`Fetching Copper custom fields...`);
+ logUtils.log(`Fetching Copper custom fields...`);
const customFields = await source.fetchCustomFieldsAsync();
const repository = connection.getRepository(CopperCustomField);
await repository.save(parseCustomFields(customFields));
diff --git a/packages/pipeline/src/scripts/pull_exchange_events.ts b/packages/pipeline/src/scripts/pull_exchange_events.ts
index e98fc6629..f8ce4038d 100644
--- a/packages/pipeline/src/scripts/pull_exchange_events.ts
+++ b/packages/pipeline/src/scripts/pull_exchange_events.ts
@@ -1,6 +1,6 @@
-// tslint:disable:no-console
import { web3Factory } from '@0x/dev-utils';
import { Web3ProviderEngine } from '@0x/subproviders';
+import { logUtils } from '@0x/utils';
import { Web3Wrapper } from '@0x/web3-wrapper';
import R = require('ramda');
import 'reflect-metadata';
@@ -32,38 +32,38 @@ let connection: Connection;
})().catch(handleError);
async function getFillEventsAsync(eventsSource: ExchangeEventsSource, endBlock: number): Promise<void> {
- console.log('Checking existing fill events...');
+ logUtils.log('Checking existing fill events...');
const repository = connection.getRepository(ExchangeFillEvent);
const startBlock = await getStartBlockAsync(repository);
- console.log(`Getting fill events starting at ${startBlock}...`);
+ logUtils.log(`Getting fill events starting at ${startBlock}...`);
const eventLogs = await eventsSource.getFillEventsAsync(startBlock, endBlock);
- console.log('Parsing fill events...');
+ logUtils.log('Parsing fill events...');
const events = parseExchangeFillEvents(eventLogs);
- console.log(`Retrieved and parsed ${events.length} total fill events.`);
+ logUtils.log(`Retrieved and parsed ${events.length} total fill events.`);
await saveEventsAsync(startBlock === EXCHANGE_START_BLOCK, repository, events);
}
async function getCancelEventsAsync(eventsSource: ExchangeEventsSource, endBlock: number): Promise<void> {
- console.log('Checking existing cancel events...');
+ logUtils.log('Checking existing cancel events...');
const repository = connection.getRepository(ExchangeCancelEvent);
const startBlock = await getStartBlockAsync(repository);
- console.log(`Getting cancel events starting at ${startBlock}...`);
+ logUtils.log(`Getting cancel events starting at ${startBlock}...`);
const eventLogs = await eventsSource.getCancelEventsAsync(startBlock, endBlock);
- console.log('Parsing cancel events...');
+ logUtils.log('Parsing cancel events...');
const events = parseExchangeCancelEvents(eventLogs);
- console.log(`Retrieved and parsed ${events.length} total cancel events.`);
+ logUtils.log(`Retrieved and parsed ${events.length} total cancel events.`);
await saveEventsAsync(startBlock === EXCHANGE_START_BLOCK, repository, events);
}
async function getCancelUpToEventsAsync(eventsSource: ExchangeEventsSource, endBlock: number): Promise<void> {
- console.log('Checking existing CancelUpTo events...');
+ logUtils.log('Checking existing CancelUpTo events...');
const repository = connection.getRepository(ExchangeCancelUpToEvent);
const startBlock = await getStartBlockAsync(repository);
- console.log(`Getting CancelUpTo events starting at ${startBlock}...`);
+ logUtils.log(`Getting CancelUpTo events starting at ${startBlock}...`);
const eventLogs = await eventsSource.getCancelUpToEventsAsync(startBlock, endBlock);
- console.log('Parsing CancelUpTo events...');
+ logUtils.log('Parsing CancelUpTo events...');
const events = parseExchangeCancelUpToEvents(eventLogs);
- console.log(`Retrieved and parsed ${events.length} total CancelUpTo events.`);
+ logUtils.log(`Retrieved and parsed ${events.length} total CancelUpTo events.`);
await saveEventsAsync(startBlock === EXCHANGE_START_BLOCK, repository, events);
}
@@ -72,7 +72,7 @@ const tableNameRegex = /^[a-zA-Z_]*$/;
async function getStartBlockAsync<T extends ExchangeEvent>(repository: Repository<T>): Promise<number> {
const fillEventCount = await repository.count();
if (fillEventCount === 0) {
- console.log(`No existing ${repository.metadata.name}s found.`);
+ logUtils.log(`No existing ${repository.metadata.name}s found.`);
return EXCHANGE_START_BLOCK;
}
const tableName = repository.metadata.tableName;
@@ -91,7 +91,7 @@ async function saveEventsAsync<T extends ExchangeEvent>(
repository: Repository<T>,
events: T[],
): Promise<void> {
- console.log(`Saving ${repository.metadata.name}s...`);
+ logUtils.log(`Saving ${repository.metadata.name}s...`);
if (isInitialPull) {
// Split data into numChunks pieces of maximum size BATCH_SAVE_SIZE
// each.
@@ -104,7 +104,7 @@ async function saveEventsAsync<T extends ExchangeEvent>(
await saveIndividuallyWithFallbackAsync(repository, events);
}
const totalEvents = await repository.count();
- console.log(`Done saving events. There are now ${totalEvents} total ${repository.metadata.name}s.`);
+ logUtils.log(`Done saving events. There are now ${totalEvents} total ${repository.metadata.name}s.`);
}
async function saveIndividuallyWithFallbackAsync<T extends ExchangeEvent>(
diff --git a/packages/pipeline/src/scripts/pull_missing_blocks.ts b/packages/pipeline/src/scripts/pull_missing_blocks.ts
index ced9d99eb..345ea38fe 100644
--- a/packages/pipeline/src/scripts/pull_missing_blocks.ts
+++ b/packages/pipeline/src/scripts/pull_missing_blocks.ts
@@ -1,5 +1,6 @@
-// tslint:disable:no-console
import { web3Factory } from '@0x/dev-utils';
+import { logUtils } from '@0x/utils';
+
import * as Parallel from 'async-parallel';
import R = require('ramda');
import 'reflect-metadata';
@@ -47,7 +48,7 @@ interface MissingBlocksResponse {
async function getAllMissingBlocksAsync(web3Source: Web3Source, tableName: string): Promise<void> {
const blocksRepository = connection.getRepository(Block);
while (true) {
- console.log(`Checking for missing blocks in ${tableName}...`);
+ logUtils.log(`Checking for missing blocks in ${tableName}...`);
const blockNumbers = await getMissingBlockNumbersAsync(tableName);
if (blockNumbers.length === 0) {
// There are no more missing blocks. We're done.
@@ -56,7 +57,7 @@ async function getAllMissingBlocksAsync(web3Source: Web3Source, tableName: strin
await getAndSaveBlocksAsync(web3Source, blocksRepository, blockNumbers);
}
const totalBlocks = await blocksRepository.count();
- console.log(`Done saving blocks for ${tableName}. There are now ${totalBlocks} total blocks.`);
+ logUtils.log(`Done saving blocks for ${tableName}. There are now ${totalBlocks} total blocks.`);
}
async function getMissingBlockNumbersAsync(tableName: string): Promise<number[]> {
@@ -68,7 +69,7 @@ async function getMissingBlockNumbersAsync(tableName: string): Promise<number[]>
)) as MissingBlocksResponse[];
const blockNumberStrings = R.pluck('block_number', response);
const blockNumbers = R.map(parseInt, blockNumberStrings);
- console.log(`Found ${blockNumbers.length} missing blocks.`);
+ logUtils.log(`Found ${blockNumbers.length} missing blocks.`);
return blockNumbers;
}
@@ -77,14 +78,14 @@ async function getAndSaveBlocksAsync(
blocksRepository: Repository<Block>,
blockNumbers: number[],
): Promise<void> {
- console.log(`Getting block data for ${blockNumbers.length} blocks...`);
+ logUtils.log(`Getting block data for ${blockNumbers.length} blocks...`);
Parallel.setConcurrency(MAX_CONCURRENCY);
const rawBlocks = await Parallel.map(blockNumbers, async (blockNumber: number) =>
web3Source.getBlockInfoAsync(blockNumber),
);
- console.log(`Parsing ${rawBlocks.length} blocks...`);
+ logUtils.log(`Parsing ${rawBlocks.length} blocks...`);
const blocks = R.map(parseBlock, rawBlocks);
- console.log(`Saving ${blocks.length} blocks...`);
+ logUtils.log(`Saving ${blocks.length} blocks...`);
await blocksRepository.save(blocks, { chunk: Math.ceil(blocks.length / BATCH_SAVE_SIZE) });
- console.log('Done saving this batch of blocks');
+ logUtils.log('Done saving this batch of blocks');
}
diff --git a/packages/pipeline/src/scripts/pull_ohlcv_cryptocompare.ts b/packages/pipeline/src/scripts/pull_ohlcv_cryptocompare.ts
index d44eb5cc6..caac7b9d4 100644
--- a/packages/pipeline/src/scripts/pull_ohlcv_cryptocompare.ts
+++ b/packages/pipeline/src/scripts/pull_ohlcv_cryptocompare.ts
@@ -1,6 +1,7 @@
-// tslint:disable:no-console
import { Connection, ConnectionOptions, createConnection, Repository } from 'typeorm';
+import { logUtils } from '@0x/utils';
+
import { CryptoCompareOHLCVSource } from '../data_sources/ohlcv_external/crypto_compare';
import { OHLCVExternal } from '../entities';
import * as ormConfig from '../ormconfig';
@@ -24,14 +25,14 @@ let connection: Connection;
const jobTime = new Date().getTime();
const tradingPairs = await fetchOHLCVTradingPairsAsync(connection, SOURCE_NAME, EARLIEST_BACKFILL_TIME);
- console.log(`Starting ${tradingPairs.length} job(s) to scrape Crypto Compare for OHLCV records...`);
+ logUtils.log(`Starting ${tradingPairs.length} job(s) to scrape Crypto Compare for OHLCV records...`);
const fetchAndSavePromises = tradingPairs.map(async pair => {
const pairs = source.generateBackfillIntervals(pair);
return fetchAndSaveAsync(source, repository, jobTime, pairs);
});
await Promise.all(fetchAndSavePromises);
- console.log(`Finished scraping OHLCV records from Crypto Compare, exiting...`);
+ logUtils.log(`Finished scraping OHLCV records from Crypto Compare, exiting...`);
process.exit(0);
})().catch(handleError);
@@ -60,7 +61,7 @@ async function fetchAndSaveAsync(
}
try {
const records = await source.getHourlyOHLCVAsync(pair);
- console.log(`Retrieved ${records.length} records for ${JSON.stringify(pair)}`);
+ logUtils.log(`Retrieved ${records.length} records for ${JSON.stringify(pair)}`);
if (records.length > 0) {
const metadata: OHLCVMetadata = {
exchange: source.defaultExchange,
@@ -75,7 +76,7 @@ async function fetchAndSaveAsync(
}
i++;
} catch (err) {
- console.log(`Error scraping OHLCVRecords, stopping task for ${JSON.stringify(pair)} [${err}]`);
+ logUtils.log(`Error scraping OHLCVRecords, stopping task for ${JSON.stringify(pair)} [${err}]`);
break;
}
}
@@ -90,6 +91,6 @@ async function saveRecordsAsync(repository: Repository<OHLCVExternal>, records:
new Date(records[records.length - 1].endTime),
];
- console.log(`Saving ${records.length} records to ${repository.metadata.name}... ${JSON.stringify(metadata)}`);
+ logUtils.log(`Saving ${records.length} records to ${repository.metadata.name}... ${JSON.stringify(metadata)}`);
await repository.save(records);
}
diff --git a/packages/pipeline/src/scripts/pull_radar_relay_orders.ts b/packages/pipeline/src/scripts/pull_radar_relay_orders.ts
index 40bb6fc97..8e8720803 100644
--- a/packages/pipeline/src/scripts/pull_radar_relay_orders.ts
+++ b/packages/pipeline/src/scripts/pull_radar_relay_orders.ts
@@ -1,5 +1,6 @@
-// tslint:disable:no-console
import { HttpClient } from '@0x/connect';
+import { logUtils } from '@0x/utils';
+
import * as R from 'ramda';
import 'reflect-metadata';
import { Connection, ConnectionOptions, createConnection, EntityManager } from 'typeorm';
@@ -21,26 +22,31 @@ let connection: Connection;
})().catch(handleError);
async function getOrderbookAsync(): Promise<void> {
- console.log('Getting all orders...');
+ logUtils.log('Getting all orders...');
const connectClient = new HttpClient(RADAR_RELAY_URL);
const rawOrders = await connectClient.getOrdersAsync({
perPage: ORDERS_PER_PAGE,
});
- console.log(`Got ${rawOrders.records.length} orders.`);
- console.log('Parsing orders...');
+ logUtils.log(`Got ${rawOrders.records.length} orders.`);
+ logUtils.log('Parsing orders...');
// Parse the sra orders, then add source url to each.
- const orders = R.pipe(parseSraOrders, R.map(setSourceUrl(RADAR_RELAY_URL)))(rawOrders);
+ const orders = R.pipe(
+ parseSraOrders,
+ R.map(setSourceUrl(RADAR_RELAY_URL)),
+ )(rawOrders);
// Save all the orders and update the observed time stamps in a single
// transaction.
- console.log('Saving orders and updating timestamps...');
+ logUtils.log('Saving orders and updating timestamps...');
const observedTimestamp = Date.now();
- await connection.transaction(async (manager: EntityManager): Promise<void> => {
- for (const order of orders) {
- await manager.save(SraOrder, order);
- const orderObservation = createObservedTimestampForOrder(order, observedTimestamp);
- await manager.save(orderObservation);
- }
- });
+ await connection.transaction(
+ async (manager: EntityManager): Promise<void> => {
+ for (const order of orders) {
+ await manager.save(SraOrder, order);
+ const orderObservation = createObservedTimestampForOrder(order, observedTimestamp);
+ await manager.save(orderObservation);
+ }
+ },
+ );
}
const sourceUrlProp = R.lensProp('sourceUrl');
@@ -49,6 +55,8 @@ const sourceUrlProp = R.lensProp('sourceUrl');
* Sets the source url for a single order. Returns a new order instead of
* mutating the given one.
*/
-const setSourceUrl = R.curry((sourceURL: string, order: SraOrder): SraOrder => {
- return R.set(sourceUrlProp, sourceURL, order);
-});
+const setSourceUrl = R.curry(
+ (sourceURL: string, order: SraOrder): SraOrder => {
+ return R.set(sourceUrlProp, sourceURL, order);
+ },
+);
diff --git a/packages/pipeline/src/scripts/pull_trusted_tokens.ts b/packages/pipeline/src/scripts/pull_trusted_tokens.ts
index 5906deee6..8afb3e052 100644
--- a/packages/pipeline/src/scripts/pull_trusted_tokens.ts
+++ b/packages/pipeline/src/scripts/pull_trusted_tokens.ts
@@ -1,6 +1,8 @@
import 'reflect-metadata';
import { Connection, ConnectionOptions, createConnection } from 'typeorm';
+import { logUtils } from '@0x/utils';
+
import { MetamaskTrustedTokenMeta, TrustedTokenSource, ZeroExTrustedTokenMeta } from '../data_sources/trusted_tokens';
import { TokenMetadata } from '../entities';
import * as ormConfig from '../ormconfig';
@@ -22,31 +24,25 @@ let connection: Connection;
})().catch(handleError);
async function getMetamaskTrustedTokensAsync(): Promise<void> {
- // tslint:disable-next-line:no-console
- console.log('Getting latest metamask trusted tokens list ...');
+ logUtils.log('Getting latest metamask trusted tokens list ...');
const trustedTokensRepository = connection.getRepository(TokenMetadata);
const trustedTokensSource = new TrustedTokenSource<Map<string, MetamaskTrustedTokenMeta>>(
METAMASK_TRUSTED_TOKENS_URL,
);
const resp = await trustedTokensSource.getTrustedTokenMetaAsync();
const trustedTokens = parseMetamaskTrustedTokens(resp);
- // tslint:disable-next-line:no-console
- console.log('Saving metamask trusted tokens list');
+ logUtils.log('Saving metamask trusted tokens list');
await trustedTokensRepository.save(trustedTokens);
- // tslint:disable-next-line:no-console
- console.log('Done saving metamask trusted tokens.');
+ logUtils.log('Done saving metamask trusted tokens.');
}
async function getZeroExTrustedTokensAsync(): Promise<void> {
- // tslint:disable-next-line:no-console
- console.log('Getting latest 0x trusted tokens list ...');
+ logUtils.log('Getting latest 0x trusted tokens list ...');
const trustedTokensRepository = connection.getRepository(TokenMetadata);
const trustedTokensSource = new TrustedTokenSource<ZeroExTrustedTokenMeta[]>(ZEROEX_TRUSTED_TOKENS_URL);
const resp = await trustedTokensSource.getTrustedTokenMetaAsync();
const trustedTokens = parseZeroExTrustedTokens(resp);
- // tslint:disable-next-line:no-console
- console.log('Saving metamask trusted tokens list');
+ logUtils.log('Saving metamask trusted tokens list');
await trustedTokensRepository.save(trustedTokens);
- // tslint:disable-next-line:no-console
- console.log('Done saving metamask trusted tokens.');
+ logUtils.log('Done saving metamask trusted tokens.');
}
diff --git a/packages/pipeline/src/scripts/update_relayer_info.ts b/packages/pipeline/src/scripts/update_relayer_info.ts
index 41d29b385..910a0157c 100644
--- a/packages/pipeline/src/scripts/update_relayer_info.ts
+++ b/packages/pipeline/src/scripts/update_relayer_info.ts
@@ -1,7 +1,8 @@
-// tslint:disable:no-console
import 'reflect-metadata';
import { Connection, ConnectionOptions, createConnection } from 'typeorm';
+import { logUtils } from '@0x/utils';
+
import { RelayerRegistrySource } from '../data_sources/relayer-registry';
import { Relayer } from '../entities';
import * as ormConfig from '../ormconfig';
@@ -22,12 +23,12 @@ let connection: Connection;
})().catch(handleError);
async function getRelayersAsync(): Promise<void> {
- console.log('Getting latest relayer info...');
+ logUtils.log('Getting latest relayer info...');
const relayerRepository = connection.getRepository(Relayer);
const relayerSource = new RelayerRegistrySource(RELAYER_REGISTRY_URL);
const relayersResp = await relayerSource.getRelayerInfoAsync();
const relayers = parseRelayers(relayersResp);
- console.log('Saving relayer info...');
+ logUtils.log('Saving relayer info...');
await relayerRepository.save(relayers);
- console.log('Done saving relayer info.');
+ logUtils.log('Done saving relayer info.');
}
diff --git a/packages/pipeline/src/utils/transformers/number_to_bigint.ts b/packages/pipeline/src/utils/transformers/number_to_bigint.ts
index 9736d7c18..8fbd52093 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/pipeline/test/fixtures/copper/api_v1_list_leads.json b/packages/pipeline/test/fixtures/copper/api_v1_list_leads.json
index 5223976f9..e7161085d 100644
--- a/packages/pipeline/test/fixtures/copper/api_v1_list_leads.json
+++ b/packages/pipeline/test/fixtures/copper/api_v1_list_leads.json
@@ -305,8 +305,7 @@
"custom_fields": [
{
"custom_field_definition_id": 100764,
- "value":
- "|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------"
+ "value": "|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------"
},
{
"custom_field_definition_id": 103481,
@@ -345,8 +344,7 @@
"custom_fields": [
{
"custom_field_definition_id": 100764,
- "value":
- "|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5-----"
+ "value": "|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5-----"
},
{
"custom_field_definition_id": 103481,
@@ -385,13 +383,11 @@
"custom_fields": [
{
"custom_field_definition_id": 100764,
- "value":
- "|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5-----"
+ "value": "|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5-----"
},
{
"custom_field_definition_id": 103481,
- "value":
- "|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------"
+ "value": "|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------"
}
],
"date_created": 1489791470,
@@ -426,13 +422,11 @@
"custom_fields": [
{
"custom_field_definition_id": 100764,
- "value":
- "|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5-----"
+ "value": "|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5-----"
},
{
"custom_field_definition_id": 103481,
- "value":
- "|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------"
+ "value": "|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------|--------1---------2---------3---------4---------5---------6---------7---------8---------9---------"
}
],
"date_created": 1489791672,
diff --git a/packages/react-docs/CHANGELOG.json b/packages/react-docs/CHANGELOG.json
index 13109e613..8b418fc11 100644
--- a/packages/react-docs/CHANGELOG.json
+++ b/packages/react-docs/CHANGELOG.json
@@ -1,5 +1,32 @@
[
{
+ "version": "2.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "1.0.25",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "1.0.24",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"timestamp": 1547040760,
"version": "1.0.23",
"changes": [
@@ -337,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
},
{
@@ -362,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-docs/CHANGELOG.md b/packages/react-docs/CHANGELOG.md
index 01f987645..5ec82b5be 100644
--- a/packages/react-docs/CHANGELOG.md
+++ b/packages/react-docs/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v1.0.25 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v1.0.24 - _January 11, 2019_
+
+ * Dependencies updated
+
## v1.0.23 - _January 9, 2019_
* Dependencies updated
diff --git a/packages/react-docs/README.md b/packages/react-docs/README.md
index 19c092e4d..7b1f4f80a 100644
--- a/packages/react-docs/README.md
+++ b/packages/react-docs/README.md
@@ -11,15 +11,15 @@ A full-page React component for rendering beautiful documentation for Solidity a
#### Features
-* Mobile optimized
-* Reads Javadoc-style comments in your code to generate class/method/argument/return/type comments.
-* Syntax highlighting support for TypeScript & Solidity
-* Type declaration linking
-* Type declaration popovers to avoid clicking through to the definition
-* Section/method/type anchors for easily pointing others to a specific part of your docs.
-* Version picker
-* Customizable sidebar header
-* Supports custom markdown sections so you can easily add an intro or installation instructions.
+- Mobile optimized
+- Reads Javadoc-style comments in your code to generate class/method/argument/return/type comments.
+- Syntax highlighting support for TypeScript & Solidity
+- Type declaration linking
+- Type declaration popovers to avoid clicking through to the definition
+- Section/method/type anchors for easily pointing others to a specific part of your docs.
+- Version picker
+- Customizable sidebar header
+- Supports custom markdown sections so you can easily add an intro or installation instructions.
## Installation
@@ -45,9 +45,9 @@ If your project is in [TypeScript](https://www.typescriptlang.org/), add the fol
Feel free to contribute to these improvements!
-* Allow user to pass in styling for all major elements similar to [Material-UI](http://www.material-ui.com/).
-* Allow user to define an alternative font and have it change everywhere.
-* Add source links to Solidity docs (currently unsupported by solc, which underlies sol-doc).
+- Allow user to pass in styling for all major elements similar to [Material-UI](http://www.material-ui.com/).
+- Allow user to define an alternative font and have it change everywhere.
+- Add source links to Solidity docs (currently unsupported by solc, which underlies sol-doc).
## Contributing
diff --git a/packages/react-docs/package.json b/packages/react-docs/package.json
index 7cd0ae55a..f8f2b6276 100644
--- a/packages/react-docs/package.json
+++ b/packages/react-docs/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/react-docs",
- "version": "1.0.23",
+ "version": "1.0.25",
"engines": {
"node": ">=6.12"
},
@@ -24,8 +24,8 @@
"url": "https://github.com/0xProject/0x-monorepo.git"
},
"devDependencies": {
- "@0x/dev-utils": "^1.0.22",
- "@0x/tslint-config": "^2.0.0",
+ "@0x/dev-utils": "^1.0.24",
+ "@0x/tslint-config": "^2.0.2",
"@types/compare-versions": "^3.0.0",
"@types/styled-components": "4.0.0",
"make-promises-safe": "^1.1.0",
@@ -34,9 +34,9 @@
"typescript": "3.0.1"
},
"dependencies": {
- "@0x/react-shared": "^1.1.0",
- "@0x/types": "^1.5.0",
- "@0x/utils": "^2.1.1",
+ "@0x/react-shared": "^1.1.2",
+ "@0x/types": "^1.5.2",
+ "@0x/utils": "^3.0.1",
"@types/lodash": "4.14.104",
"@types/material-ui": "^0.20.0",
"@types/node": "*",
@@ -47,13 +47,13 @@
"compare-versions": "^3.0.1",
"lodash": "^4.17.5",
"material-ui": "^0.20.0",
- "react": "^16.4.2",
- "react-dom": "^16.4.2",
+ "react": "^16.5.2",
+ "react-dom": "^16.5.2",
"react-markdown": "^3.2.2",
"react-scroll": "0xproject/react-scroll#pr-330-and-replace-state",
"react-tooltip": "^3.2.7",
"semver": "5.5.0",
- "styled-components": "^3.3.0"
+ "styled-components": "^4.0.1"
},
"publishConfig": {
"access": "public"
diff --git a/packages/react-docs/src/components/doc_reference.tsx b/packages/react-docs/src/components/doc_reference.tsx
index 85547576b..424fe9ecf 100644
--- a/packages/react-docs/src/components/doc_reference.tsx
+++ b/packages/react-docs/src/components/doc_reference.tsx
@@ -194,21 +194,19 @@ export class DocReference extends React.Component<DocReferenceProps, DocReferenc
<div>{functionDefs}</div>
</div>
)}
- {!_.isUndefined(docSection.events) &&
- docSection.events.length > 0 && (
- <div>
- <h2 style={headerStyle}>Events</h2>
- <div>{eventDefs}</div>
- </div>
- )}
+ {!_.isUndefined(docSection.events) && docSection.events.length > 0 && (
+ <div>
+ <h2 style={headerStyle}>Events</h2>
+ <div>{eventDefs}</div>
+ </div>
+ )}
{!_.isUndefined(docSection.externalExportToLink) &&
this._renderExternalExports(docSection.externalExportToLink)}
- {!_.isUndefined(typeDefs) &&
- typeDefs.length > 0 && (
- <div>
- <div>{typeDefs}</div>
- </div>
- )}
+ {!_.isUndefined(typeDefs) && typeDefs.length > 0 && (
+ <div>
+ <div>{typeDefs}</div>
+ </div>
+ )}
<div
style={{
width: '100%',
diff --git a/packages/react-docs/src/components/interface.tsx b/packages/react-docs/src/components/interface.tsx
index 0df44ca1c..06896159f 100644
--- a/packages/react-docs/src/components/interface.tsx
+++ b/packages/react-docs/src/components/interface.tsx
@@ -45,7 +45,8 @@ export const Interface: React.SFC<InterfaceProps> = (props: InterfaceProps): any
typeDefinitionByName={props.typeDefinitionByName}
isInPopover={props.isInPopover}
/>
- )},
+ )}
+ ,
</span>
);
});
diff --git a/packages/react-docs/src/components/signature_block.tsx b/packages/react-docs/src/components/signature_block.tsx
index 7cdf19bb0..3189d86cf 100644
--- a/packages/react-docs/src/components/signature_block.tsx
+++ b/packages/react-docs/src/components/signature_block.tsx
@@ -91,16 +91,14 @@ export class SignatureBlock extends React.Component<SignatureBlockProps, Signatu
/>
)}
{method.comment && <Comment comment={method.comment} className="py2" />}
- {method.parameters &&
- !_.isEmpty(method.parameters) &&
- hasExclusivelyNamedParams && (
- <div>
- <h4 className="pb1 thin" style={{ borderBottom: '1px solid #e1e8ed' }}>
- ARGUMENTS
- </h4>
- {this._renderParameterDescriptions(method.parameters, method.name)}
- </div>
- )}
+ {method.parameters && !_.isEmpty(method.parameters) && hasExclusivelyNamedParams && (
+ <div>
+ <h4 className="pb1 thin" style={{ borderBottom: '1px solid #e1e8ed' }}>
+ ARGUMENTS
+ </h4>
+ {this._renderParameterDescriptions(method.parameters, method.name)}
+ </div>
+ )}
{method.returnComment && (
<div className="pt1 comment">
<h4 className="pb1 thin" style={{ borderBottom: '1px solid #e1e8ed' }}>
diff --git a/packages/react-docs/src/components/type.tsx b/packages/react-docs/src/components/type.tsx
index fa3b658b4..894c3f560 100644
--- a/packages/react-docs/src/components/type.tsx
+++ b/packages/react-docs/src/components/type.tsx
@@ -53,7 +53,8 @@ export const Type: React.SFC<TypeProps> = (props: TypeProps): any => {
typeDefinitionByName={props.typeDefinitionByName}
docsInfo={props.docsInfo}
isInPopover={props.isInPopover}
- />[]
+ />
+ []
</span>
);
} else {
@@ -181,9 +182,11 @@ export const Type: React.SFC<TypeProps> = (props: TypeProps): any => {
});
typeName = (
<div>
- [{_.reduce(tupleTypes, (prev: React.ReactNode, curr: React.ReactNode) => {
+ [
+ {_.reduce(tupleTypes, (prev: React.ReactNode, curr: React.ReactNode) => {
return [prev, ', ', curr];
- })}]
+ })}
+ ]
</div>
);
break;
diff --git a/packages/react-shared/CHANGELOG.json b/packages/react-shared/CHANGELOG.json
index aaf2485d1..99a8779ac 100644
--- a/packages/react-shared/CHANGELOG.json
+++ b/packages/react-shared/CHANGELOG.json
@@ -1,10 +1,36 @@
[
{
+ "version": "2.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "1.1.2",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "1.1.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"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/react-shared/CHANGELOG.md b/packages/react-shared/CHANGELOG.md
index a8f2764dd..e1a5df403 100644
--- a/packages/react-shared/CHANGELOG.md
+++ b/packages/react-shared/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v1.1.2 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v1.1.1 - _January 11, 2019_
+
+ * Dependencies updated
+
## v1.1.0 - _January 9, 2019_
* Change implementation to use react-router-dom NavLink instead of Link. Expose `activeStyle` prop. (#1448)
diff --git a/packages/react-shared/package.json b/packages/react-shared/package.json
index 5754e238b..4be4742b0 100644
--- a/packages/react-shared/package.json
+++ b/packages/react-shared/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/react-shared",
- "version": "1.1.0",
+ "version": "1.1.2",
"engines": {
"node": ">=6.12"
},
@@ -25,15 +25,15 @@
"url": "https://github.com/0xProject/0x-monorepo.git"
},
"devDependencies": {
- "@0x/dev-utils": "^1.0.22",
- "@0x/tslint-config": "^2.0.0",
+ "@0x/dev-utils": "^1.0.24",
+ "@0x/tslint-config": "^2.0.2",
"make-promises-safe": "^1.1.0",
"shx": "^0.2.2",
"tslint": "^5.9.1",
"typescript": "3.0.1"
},
"dependencies": {
- "@0x/types": "^1.5.0",
+ "@0x/types": "^1.5.2",
"@material-ui/core": "^3.0.1",
"@types/is-mobile": "0.3.0",
"@types/lodash": "4.14.104",
@@ -50,13 +50,13 @@
"is-mobile": "^0.2.2",
"lodash": "^4.17.5",
"material-ui": "^0.20.0",
- "react": "^16.4.2",
- "react-dom": "^16.4.2",
- "react-highlight": "0xproject/react-highlight#2f40a42e0a3f0ad126f9f42d505b97b603fc7162",
+ "react": "^16.5.2",
+ "react-dom": "^16.5.2",
+ "react-highlight": "0xproject/react-highlight#fix/react-version",
"react-markdown": "^3.2.2",
"react-router-dom": "^4.1.1",
"react-scroll": "0xproject/react-scroll#pr-330-and-replace-state",
- "styled-components": "^3.3.0",
+ "styled-components": "^4.0.1",
"valid-url": "^1.0.9"
},
"publishConfig": {
diff --git a/packages/react-shared/src/components/anchor_title.tsx b/packages/react-shared/src/components/anchor_title.tsx
index a9105e132..fccd56de7 100644
--- a/packages/react-shared/src/components/anchor_title.tsx
+++ b/packages/react-shared/src/components/anchor_title.tsx
@@ -32,18 +32,15 @@ interface AnchorIconProps {
shouldShowAnchor: boolean;
}
-const AnchorIcon =
- styled.i <
- AnchorIconProps >
- `
- opacity: ${props => (props.shouldShowAnchor ? 1 : 0)};
- &:hover {
- opacity: ${props => (props.shouldShowAnchor ? 0.6 : 0)};
- }
- font-size: 20px;
- transform: rotate(45deg);
- cursor: pointer;
- `;
+const AnchorIcon = styled.i<AnchorIconProps>`
+ opacity: ${props => (props.shouldShowAnchor ? 1 : 0)};
+ &:hover {
+ opacity: ${props => (props.shouldShowAnchor ? 0.6 : 0)};
+ }
+ font-size: 20px;
+ transform: rotate(45deg);
+ cursor: pointer;
+`;
export class AnchorTitle extends React.Component<AnchorTitleProps, AnchorTitleState> {
public static defaultProps: Partial<AnchorTitleProps> = {
diff --git a/packages/sol-compiler/CHANGELOG.json b/packages/sol-compiler/CHANGELOG.json
index 3c88bf4e9..672939a4a 100644
--- a/packages/sol-compiler/CHANGELOG.json
+++ b/packages/sol-compiler/CHANGELOG.json
@@ -1,5 +1,32 @@
[
{
+ "version": "3.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "2.0.2",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "2.0.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "2.0.0",
"changes": [
{
@@ -166,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
},
{
@@ -381,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
},
{
@@ -390,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
},
{
@@ -412,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-compiler/CHANGELOG.md b/packages/sol-compiler/CHANGELOG.md
index 6ec804c3a..dfcec1fa7 100644
--- a/packages/sol-compiler/CHANGELOG.md
+++ b/packages/sol-compiler/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v2.0.2 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v2.0.1 - _January 11, 2019_
+
+ * Dependencies updated
+
## v2.0.0 - _January 9, 2019_
* Add sol-compiler watch mode with -w flag (#1461)
diff --git a/packages/sol-compiler/README.md b/packages/sol-compiler/README.md
index 445aea315..412a5fc02 100644
--- a/packages/sol-compiler/README.md
+++ b/packages/sol-compiler/README.md
@@ -2,11 +2,11 @@
Sol-compiler is a wrapper around [solc-js](https://www.npmjs.com/package/solc) that adds:
-* Smart re-compilation: Only recompiles when smart contracts have changed
-* Ability to compile an entire project instead of only individual `.sol` files
-* Compilation using the Solidity version specified at the top of each individual `.sol` file
-* Proper parsing of Solidity version ranges
-* Support for the standard [input description](https://solidity.readthedocs.io/en/develop/using-the-compiler.html#input-description) for what information you'd like added to the resulting `artifacts` file (i.e 100% configurable artifacts content).
+- Smart re-compilation: Only recompiles when smart contracts have changed
+- Ability to compile an entire project instead of only individual `.sol` files
+- Compilation using the Solidity version specified at the top of each individual `.sol` file
+- Proper parsing of Solidity version ranges
+- Support for the standard [input description](https://solidity.readthedocs.io/en/develop/using-the-compiler.html#input-description) for what information you'd like added to the resulting `artifacts` file (i.e 100% configurable artifacts content).
### Read the [Documentation](https://0xproject.com/docs/sol-compiler).
diff --git a/packages/sol-compiler/package.json b/packages/sol-compiler/package.json
index 6c9435bcd..0b53cffd5 100644
--- a/packages/sol-compiler/package.json
+++ b/packages/sol-compiler/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/sol-compiler",
- "version": "2.0.0",
+ "version": "2.0.2",
"engines": {
"node": ">=6.12"
},
@@ -42,8 +42,8 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-compiler/README.md",
"devDependencies": {
- "@0x/dev-utils": "^1.0.22",
- "@0x/tslint-config": "^2.0.0",
+ "@0x/dev-utils": "^1.0.24",
+ "@0x/tslint-config": "^2.0.2",
"@types/chokidar": "^1.7.5",
"@types/mkdirp": "^0.5.2",
"@types/pluralize": "^0.0.29",
@@ -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",
@@ -67,17 +67,17 @@
"zeppelin-solidity": "1.8.0"
},
"dependencies": {
- "@0x/assert": "^1.0.21",
- "@0x/json-schemas": "^2.1.5",
- "@0x/sol-resolver": "^1.2.1",
- "@0x/types": "^1.5.0",
- "@0x/typescript-typings": "^3.0.6",
- "@0x/utils": "^2.1.1",
- "@0x/web3-wrapper": "^3.2.2",
+ "@0x/assert": "^1.0.23",
+ "@0x/json-schemas": "^2.1.7",
+ "@0x/sol-resolver": "^1.2.3",
+ "@0x/types": "^1.5.2",
+ "@0x/typescript-typings": "^3.0.8",
+ "@0x/utils": "^3.0.1",
+ "@0x/web3-wrapper": "^3.2.4",
"@types/yargs": "^11.0.0",
"chalk": "^2.3.0",
"chokidar": "^2.0.4",
- "ethereum-types": "^1.1.4",
+ "ethereum-types": "^1.1.6",
"ethereumjs-util": "^5.1.1",
"lodash": "^4.17.5",
"mkdirp": "^0.5.1",
diff --git a/packages/sol-compiler/src/cli.ts b/packages/sol-compiler/src/cli.ts
index 18cc68aaf..db0c09581 100644
--- a/packages/sol-compiler/src/cli.ts
+++ b/packages/sol-compiler/src/cli.ts
@@ -33,8 +33,8 @@ const SEPARATOR = ',';
const contracts = _.isUndefined(argv.contracts)
? undefined
: argv.contracts === DEFAULT_CONTRACTS_LIST
- ? DEFAULT_CONTRACTS_LIST
- : argv.contracts.split(SEPARATOR);
+ ? DEFAULT_CONTRACTS_LIST
+ : argv.contracts.split(SEPARATOR);
const opts = {
contractsDir: argv.contractsDir,
artifactsDir: argv.artifactsDir,
diff --git a/packages/sol-coverage/CHANGELOG.json b/packages/sol-coverage/CHANGELOG.json
index 223400eae..550ca2feb 100644
--- a/packages/sol-coverage/CHANGELOG.json
+++ b/packages/sol-coverage/CHANGELOG.json
@@ -1,5 +1,41 @@
[
{
+ "version": "2.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547747677,
+ "version": "1.0.3",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "1.0.2",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "1.0.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "1.0.0",
"changes": [
{
diff --git a/packages/sol-coverage/CHANGELOG.md b/packages/sol-coverage/CHANGELOG.md
new file mode 100644
index 000000000..18c1719bf
--- /dev/null
+++ b/packages/sol-coverage/CHANGELOG.md
@@ -0,0 +1,22 @@
+<!--
+changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly.
+Edit the package's CHANGELOG.json file only.
+-->
+
+CHANGELOG
+
+## v1.0.3 - _January 17, 2019_
+
+ * Dependencies updated
+
+## v1.0.2 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v1.0.1 - _January 11, 2019_
+
+ * Dependencies updated
+
+## v1.0.0 - _Invalid date_
+
+ * Initial release as a separate package. For historical entries see @0x/sol-tracing-utils (#1492)
diff --git a/packages/sol-coverage/package.json b/packages/sol-coverage/package.json
index 7dc764efd..805e2e670 100644
--- a/packages/sol-coverage/package.json
+++ b/packages/sol-coverage/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/sol-coverage",
- "version": "1.0.0",
+ "version": "1.0.3",
"engines": {
"node": ">=6.12"
},
@@ -29,14 +29,14 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-coverage/README.md",
"dependencies": {
- "@0x/subproviders": "^2.1.8",
- "@0x/sol-tracing-utils": "^2.1.16",
- "@0x/typescript-typings": "^3.0.6",
- "ethereum-types": "^1.1.4",
+ "@0x/sol-tracing-utils": "^4.0.1",
+ "@0x/subproviders": "^2.1.11",
+ "@0x/typescript-typings": "^3.0.8",
+ "ethereum-types": "^1.1.6",
"lodash": "^4.17.5"
},
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.2",
"@types/node": "*",
"npm-run-all": "^4.1.2",
"nyc": "^11.0.1",
diff --git a/packages/sol-coverage/src/coverage_subprovider.ts b/packages/sol-coverage/src/coverage_subprovider.ts
index e6b546c4a..2d92b25ca 100644
--- a/packages/sol-coverage/src/coverage_subprovider.ts
+++ b/packages/sol-coverage/src/coverage_subprovider.ts
@@ -50,6 +50,8 @@ export class CoverageSubprovider extends TraceInfoSubprovider {
}
}
+const IGNORE_REGEXP = /\/\*\s*solcov\s+ignore\s+next\s*\*\/\s*/gm;
+
/**
* Computed partial coverage for a single file & subtrace.
* @param contractData Contract metadata (source, srcMap, bytecode)
@@ -65,7 +67,7 @@ export const coverageHandler: SingleFileSubtraceHandler = (
fileIndex: number,
): Coverage => {
const absoluteFileName = contractData.sources[fileIndex];
- const coverageEntriesDescription = collectCoverageEntries(contractData.sourceCodes[fileIndex]);
+ const coverageEntriesDescription = collectCoverageEntries(contractData.sourceCodes[fileIndex], IGNORE_REGEXP);
// if the source wasn't provided for the fileIndex, we can't cover the file
if (_.isUndefined(coverageEntriesDescription)) {
@@ -74,19 +76,19 @@ export const coverageHandler: SingleFileSubtraceHandler = (
let sourceRanges = _.map(subtrace, structLog => pcToSourceRange[structLog.pc]);
sourceRanges = _.compact(sourceRanges); // Some PC's don't map to a source range and we just ignore them.
- // By default lodash does a shallow object comparasion. We JSON.stringify them and compare as strings.
+ // By default lodash does a shallow object comparison. We JSON.stringify them and compare as strings.
sourceRanges = _.uniqBy(sourceRanges, s => JSON.stringify(s)); // We don't care if one PC was covered multiple times within a single transaction
sourceRanges = _.filter(sourceRanges, sourceRange => sourceRange.fileName === absoluteFileName);
const branchCoverage: BranchCoverage = {};
const branchIds = _.keys(coverageEntriesDescription.branchMap);
for (const branchId of branchIds) {
const branchDescription = coverageEntriesDescription.branchMap[branchId];
- const isBranchCoveredByBranchIndex = _.map(branchDescription.locations, location => {
+ const branchIndexToIsBranchCovered = _.map(branchDescription.locations, location => {
const isBranchCovered = _.some(sourceRanges, range => utils.isRangeInside(range.location, location));
const timesBranchCovered = Number(isBranchCovered);
return timesBranchCovered;
});
- branchCoverage[branchId] = isBranchCoveredByBranchIndex;
+ branchCoverage[branchId] = branchIndexToIsBranchCovered;
}
const statementCoverage: StatementCoverage = {};
const statementIds = _.keys(coverageEntriesDescription.statementMap);
diff --git a/packages/sol-coverage/src/index.ts b/packages/sol-coverage/src/index.ts
index 97b4ecee6..6a91a3966 100644
--- a/packages/sol-coverage/src/index.ts
+++ b/packages/sol-coverage/src/index.ts
@@ -4,6 +4,8 @@ export {
TruffleArtifactAdapter,
AbstractArtifactAdapter,
ContractData,
+ SourceCodes,
+ Sources,
} from '@0x/sol-tracing-utils';
export {
diff --git a/packages/sol-doc/CHANGELOG.json b/packages/sol-doc/CHANGELOG.json
index 1be3b2121..662915faf 100644
--- a/packages/sol-doc/CHANGELOG.json
+++ b/packages/sol-doc/CHANGELOG.json
@@ -1,5 +1,32 @@
[
{
+ "version": "2.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "1.0.14",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "1.0.13",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"timestamp": 1547040760,
"version": "1.0.12",
"changes": [
@@ -111,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-doc/CHANGELOG.md b/packages/sol-doc/CHANGELOG.md
index 3416662e5..1a60b5f89 100644
--- a/packages/sol-doc/CHANGELOG.md
+++ b/packages/sol-doc/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v1.0.14 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v1.0.13 - _January 11, 2019_
+
+ * Dependencies updated
+
## v1.0.12 - _January 9, 2019_
* Dependencies updated
diff --git a/packages/sol-doc/package.json b/packages/sol-doc/package.json
index f93abfe49..179f45e81 100644
--- a/packages/sol-doc/package.json
+++ b/packages/sol-doc/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/sol-doc",
- "version": "1.0.12",
+ "version": "1.0.14",
"description": "Solidity documentation generator",
"main": "lib/src/index.js",
"types": "lib/src/index.d.js",
@@ -25,19 +25,19 @@
"author": "F. Eugene Aumson",
"license": "Apache-2.0",
"dependencies": {
- "@0x/sol-compiler": "^2.0.0",
- "@0x/types": "^1.5.0",
- "@0x/utils": "^2.1.1",
- "ethereum-types": "^1.1.4",
+ "@0x/sol-compiler": "^2.0.2",
+ "@0x/types": "^1.5.2",
+ "@0x/utils": "^3.0.1",
+ "ethereum-types": "^1.1.6",
"ethereumjs-util": "^5.1.1",
"lodash": "^4.17.10",
"yargs": "^12.0.2"
},
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@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/sol-profiler/CHANGELOG.json b/packages/sol-profiler/CHANGELOG.json
index 223400eae..fc928b516 100644
--- a/packages/sol-profiler/CHANGELOG.json
+++ b/packages/sol-profiler/CHANGELOG.json
@@ -1,5 +1,50 @@
[
{
+ "version": "2.0.1",
+ "changes": [
+ {
+ "note": "Fix a bug when some parts of the profiling report were missing because of the coverage ignore lines",
+ "pr": 1535
+ }
+ ]
+ },
+ {
+ "version": "2.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547747677,
+ "version": "1.0.3",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "1.0.2",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "1.0.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "1.0.0",
"changes": [
{
diff --git a/packages/sol-profiler/CHANGELOG.md b/packages/sol-profiler/CHANGELOG.md
new file mode 100644
index 000000000..18c1719bf
--- /dev/null
+++ b/packages/sol-profiler/CHANGELOG.md
@@ -0,0 +1,22 @@
+<!--
+changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly.
+Edit the package's CHANGELOG.json file only.
+-->
+
+CHANGELOG
+
+## v1.0.3 - _January 17, 2019_
+
+ * Dependencies updated
+
+## v1.0.2 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v1.0.1 - _January 11, 2019_
+
+ * Dependencies updated
+
+## v1.0.0 - _Invalid date_
+
+ * Initial release as a separate package. For historical entries see @0x/sol-tracing-utils (#1492)
diff --git a/packages/sol-profiler/package.json b/packages/sol-profiler/package.json
index b85c82ed2..4fe2928c7 100644
--- a/packages/sol-profiler/package.json
+++ b/packages/sol-profiler/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/sol-profiler",
- "version": "1.0.0",
+ "version": "1.0.3",
"engines": {
"node": ">=6.12"
},
@@ -29,14 +29,14 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-profiler/README.md",
"dependencies": {
- "@0x/subproviders": "^2.1.8",
- "@0x/typescript-typings": "^3.0.6",
- "@0x/sol-tracing-utils": "^2.1.16",
- "ethereum-types": "^1.1.4",
+ "@0x/sol-tracing-utils": "^4.0.1",
+ "@0x/subproviders": "^2.1.11",
+ "@0x/typescript-typings": "^3.0.8",
+ "ethereum-types": "^1.1.6",
"lodash": "^4.17.5"
},
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.2",
"@types/node": "*",
"npm-run-all": "^4.1.2",
"shx": "^0.2.2",
diff --git a/packages/sol-profiler/src/index.ts b/packages/sol-profiler/src/index.ts
index 5d4806be4..fcb715d2d 100644
--- a/packages/sol-profiler/src/index.ts
+++ b/packages/sol-profiler/src/index.ts
@@ -3,6 +3,8 @@ export {
SolCompilerArtifactAdapter,
TruffleArtifactAdapter,
ContractData,
+ SourceCodes,
+ Sources,
} from '@0x/sol-tracing-utils';
// HACK: ProfilerSubprovider is a hacky way to do profiling using coverage tools. Not production ready
diff --git a/packages/sol-profiler/src/profiler_subprovider.ts b/packages/sol-profiler/src/profiler_subprovider.ts
index c3ed13ea5..9f195f768 100644
--- a/packages/sol-profiler/src/profiler_subprovider.ts
+++ b/packages/sol-profiler/src/profiler_subprovider.ts
@@ -63,7 +63,7 @@ export const profilerHandler: SingleFileSubtraceHandler = (
): Coverage => {
const absoluteFileName = contractData.sources[fileIndex];
const profilerEntriesDescription = collectCoverageEntries(contractData.sourceCodes[fileIndex]);
- const gasConsumedByStatement: { [statementId: string]: number } = {};
+ const statementToGasConsumed: { [statementId: string]: number } = {};
const statementIds = _.keys(profilerEntriesDescription.statementMap);
for (const statementId of statementIds) {
const statementDescription = profilerEntriesDescription.statementMap[statementId];
@@ -83,14 +83,14 @@ export const profilerHandler: SingleFileSubtraceHandler = (
}
}),
);
- gasConsumedByStatement[statementId] = totalGasCost;
+ statementToGasConsumed[statementId] = totalGasCost;
}
const partialProfilerOutput = {
[absoluteFileName]: {
...profilerEntriesDescription,
path: absoluteFileName,
f: {}, // I's meaningless in profiling context
- s: gasConsumedByStatement,
+ s: statementToGasConsumed,
b: {}, // I's meaningless in profiling context
},
};
diff --git a/packages/sol-resolver/CHANGELOG.json b/packages/sol-resolver/CHANGELOG.json
index d541dc320..f5a005fd4 100644
--- a/packages/sol-resolver/CHANGELOG.json
+++ b/packages/sol-resolver/CHANGELOG.json
@@ -1,5 +1,32 @@
[
{
+ "version": "2.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "1.2.3",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "1.2.2",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "1.2.1",
"changes": [
{
diff --git a/packages/sol-resolver/CHANGELOG.md b/packages/sol-resolver/CHANGELOG.md
index b03f21b79..a48561cc3 100644
--- a/packages/sol-resolver/CHANGELOG.md
+++ b/packages/sol-resolver/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v1.2.3 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v1.2.2 - _January 11, 2019_
+
+ * Dependencies updated
+
## v1.2.1 - _January 9, 2019_
* Add `absolutePath` to `ContractSource` type (#1461)
diff --git a/packages/sol-resolver/package.json b/packages/sol-resolver/package.json
index b33a4f494..0518cde95 100644
--- a/packages/sol-resolver/package.json
+++ b/packages/sol-resolver/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/sol-resolver",
- "version": "1.2.1",
+ "version": "1.2.3",
"engines": {
"node": ">=6.12"
},
@@ -23,15 +23,15 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/resolver/README.md",
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.2",
"make-promises-safe": "^1.1.0",
"shx": "^0.2.2",
"tslint": "5.11.0",
"typescript": "3.0.1"
},
"dependencies": {
- "@0x/types": "^1.5.0",
- "@0x/typescript-typings": "^3.0.6",
+ "@0x/types": "^1.5.2",
+ "@0x/typescript-typings": "^3.0.8",
"lodash": "^4.17.5"
},
"publishConfig": {
diff --git a/packages/sol-trace/CHANGELOG.json b/packages/sol-trace/CHANGELOG.json
index 223400eae..550ca2feb 100644
--- a/packages/sol-trace/CHANGELOG.json
+++ b/packages/sol-trace/CHANGELOG.json
@@ -1,5 +1,41 @@
[
{
+ "version": "2.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547747677,
+ "version": "1.0.3",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "1.0.2",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "1.0.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "1.0.0",
"changes": [
{
diff --git a/packages/sol-trace/CHANGELOG.md b/packages/sol-trace/CHANGELOG.md
new file mode 100644
index 000000000..18c1719bf
--- /dev/null
+++ b/packages/sol-trace/CHANGELOG.md
@@ -0,0 +1,22 @@
+<!--
+changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly.
+Edit the package's CHANGELOG.json file only.
+-->
+
+CHANGELOG
+
+## v1.0.3 - _January 17, 2019_
+
+ * Dependencies updated
+
+## v1.0.2 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v1.0.1 - _January 11, 2019_
+
+ * Dependencies updated
+
+## v1.0.0 - _Invalid date_
+
+ * Initial release as a separate package. For historical entries see @0x/sol-tracing-utils (#1492)
diff --git a/packages/sol-trace/package.json b/packages/sol-trace/package.json
index 3013be6f9..2aedf7ebc 100644
--- a/packages/sol-trace/package.json
+++ b/packages/sol-trace/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/sol-trace",
- "version": "1.0.0",
+ "version": "1.0.3",
"engines": {
"node": ">=6.12"
},
@@ -29,16 +29,16 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-trace/README.md",
"dependencies": {
- "@0x/subproviders": "^2.1.8",
- "@0x/typescript-typings": "^3.0.6",
- "@0x/sol-tracing-utils": "^2.1.16",
- "ethereum-types": "^1.1.4",
+ "@0x/sol-tracing-utils": "^4.0.1",
+ "@0x/subproviders": "^2.1.11",
+ "@0x/typescript-typings": "^3.0.8",
+ "ethereum-types": "^1.1.6",
"ethereumjs-util": "^5.1.1",
"lodash": "^4.17.5",
"loglevel": "^1.6.1"
},
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.2",
"@types/loglevel": "^1.5.3",
"@types/node": "*",
"npm-run-all": "^4.1.2",
diff --git a/packages/sol-trace/src/index.ts b/packages/sol-trace/src/index.ts
index 120c0d0a9..61b5d8cb7 100644
--- a/packages/sol-trace/src/index.ts
+++ b/packages/sol-trace/src/index.ts
@@ -3,6 +3,8 @@ export {
TruffleArtifactAdapter,
SolCompilerArtifactAdapter,
ContractData,
+ SourceCodes,
+ Sources,
} from '@0x/sol-tracing-utils';
export { RevertTraceSubprovider } from './revert_trace_subprovider';
diff --git a/packages/sol-trace/src/revert_trace_subprovider.ts b/packages/sol-trace/src/revert_trace_subprovider.ts
index 31067a402..046dad812 100644
--- a/packages/sol-trace/src/revert_trace_subprovider.ts
+++ b/packages/sol-trace/src/revert_trace_subprovider.ts
@@ -106,11 +106,10 @@ export class RevertTraceSubprovider extends TraceCollectionSubprovider {
continue;
}
- const fileIndex = contractData.sources.indexOf(sourceRange.fileName);
+ const fileNameToFileIndex = _.invert(contractData.sources);
+ const fileIndex = _.parseInt(fileNameToFileIndex[sourceRange.fileName]);
const sourceSnippet = getSourceRangeSnippet(sourceRange, contractData.sourceCodes[fileIndex]);
- if (sourceSnippet !== null) {
- sourceSnippets.push(sourceSnippet);
- }
+ sourceSnippets.push(sourceSnippet);
}
const filteredSnippets = filterSnippets(sourceSnippets);
if (filteredSnippets.length > 0) {
@@ -134,9 +133,7 @@ function filterSnippets(sourceSnippets: SourceSnippet[]): SourceSnippet[] {
const results: SourceSnippet[] = [sourceSnippets[0]];
let prev = sourceSnippets[0];
for (const sourceSnippet of sourceSnippets) {
- if (sourceSnippet.type === 'IfStatement') {
- continue;
- } else if (sourceSnippet.source === prev.source) {
+ if (sourceSnippet.source === prev.source) {
prev = sourceSnippet;
continue;
}
@@ -156,12 +153,5 @@ function getStackTraceString(sourceSnippet: SourceSnippet): string {
}
function getSourceSnippetString(sourceSnippet: SourceSnippet): string {
- switch (sourceSnippet.type) {
- case 'ContractDefinition':
- return `contract ${sourceSnippet.name}`;
- case 'FunctionDefinition':
- return `function ${sourceSnippet.name}`;
- default:
- return `${sourceSnippet.source}`;
- }
+ return `${sourceSnippet.source}`;
}
diff --git a/packages/sol-tracing-utils/CHANGELOG.json b/packages/sol-tracing-utils/CHANGELOG.json
index c39753ea1..16a12ca63 100644
--- a/packages/sol-tracing-utils/CHANGELOG.json
+++ b/packages/sol-tracing-utils/CHANGELOG.json
@@ -1,12 +1,87 @@
[
{
+ "version": "6.0.0",
+ "changes": [
+ {
+ "note": "`SolCompilerArtifactAdapter` now uses `SolResolver` under the hood which allows to resolve `NPM` dependencies properly",
+ "pr": 1535
+ },
+ {
+ "note": "Cache the `utils.getContractDataIfExists` leading to faster execution",
+ "pr": 1535
+ },
+ {
+ "note": "`SolCompilerArtifactAdapter` now doesn't return the `ContractData` for interfaces",
+ "pr": 1535
+ },
+ {
+ "note": "Print resasonable error message on bytecode collision",
+ "pr": 1535
+ }
+ ]
+ },
+ {
+ "version": "5.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "version": "4.0.1",
+ "changes": [
+ {
+ "note": "Fix a bug where a custom `Geth` tracer didn't return stack entries for `DELEGATECALL`",
+ "pr": 1521
+ },
+ {
+ "note": "Fix a bug where `TraceCollectionSubprovider` was hanging on the fake `Geth` snapshot transaction",
+ "pr": 1521
+ },
+ {
+ "note": "Fix/simplify handling of revert trace snippets",
+ "pr": 1521
+ }
+ ],
+ "timestamp": 1547747677
+ },
+ {
+ "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",
+ "pr": 1498
+ },
+ {
+ "note": "Change the types of `ContractData.sources` and `ContractData.sourceCodes` to be objects instead of arrays",
+ "pr": 1498
+ },
+ {
+ "note": "Use custom JS tracer to speed up tracing on clients that support it (e.g., Geth)",
+ "pr": 1498
+ },
+ {
+ "note": "Log errors encountered in `TraceCollectionSubprovider`",
+ "pr": 1498
+ },
+ {
+ "note": "Add support for assembly statements",
+ "pr": 1498
+ }
+ ],
+ "timestamp": 1547561734
+ },
+ {
"version": "3.0.0",
"changes": [
{
"note": "Move out specific tools and leave just the shared parts of the codebase",
"pr": 1492
}
- ]
+ ],
+ "timestamp": 1547225310
},
{
"timestamp": 1547040760,
@@ -166,8 +241,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
}
],
@@ -177,8 +251,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
},
{
@@ -186,13 +259,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
}
],
@@ -230,8 +301,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
},
{
@@ -287,8 +357,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/sol-tracing-utils/CHANGELOG.md b/packages/sol-tracing-utils/CHANGELOG.md
index c2bc3cd01..9bffb2a6d 100644
--- a/packages/sol-tracing-utils/CHANGELOG.md
+++ b/packages/sol-tracing-utils/CHANGELOG.md
@@ -5,6 +5,24 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v4.0.1 - _January 17, 2019_
+
+ * Fix a bug where a custom `Geth` tracer didn't return stack entries for `DELEGATECALL` (#1521)
+ * Fix a bug where `TraceCollectionSubprovider` was hanging on the fake `Geth` snapshot transaction (#1521)
+ * Fix/simplify handling of revert trace snippets (#1521)
+
+## v4.0.0 - _January 15, 2019_
+
+ * Fix a bug with incorrect parsing of `sourceMaps` due to sources being in an array instead of a map (#1498)
+ * Change the types of `ContractData.sources` and `ContractData.sourceCodes` to be objects instead of arrays (#1498)
+ * Use custom JS tracer to speed up tracing on clients that support it (e.g., Geth) (#1498)
+ * Log errors encountered in `TraceCollectionSubprovider` (#1498)
+ * Add support for assembly statements (#1498)
+
+## v3.0.0 - _January 11, 2019_
+
+ * Move out specific tools and leave just the shared parts of the codebase (#1492)
+
## v2.1.17 - _January 9, 2019_
* Dependencies updated
diff --git a/packages/sol-tracing-utils/package.json b/packages/sol-tracing-utils/package.json
index 9486ab541..4b0fff222 100644
--- a/packages/sol-tracing-utils/package.json
+++ b/packages/sol-tracing-utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/sol-tracing-utils",
- "version": "2.1.17",
+ "version": "4.0.1",
"engines": {
"node": ">=6.12"
},
@@ -42,14 +42,15 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-tracing-utils/README.md",
"dependencies": {
- "@0x/dev-utils": "^1.0.22",
- "@0x/sol-compiler": "^2.0.0",
- "@0x/subproviders": "^2.1.9",
- "@0x/typescript-typings": "^3.0.6",
- "@0x/utils": "^2.1.1",
- "@0x/web3-wrapper": "^3.2.2",
+ "@0x/dev-utils": "^1.0.24",
+ "@0x/sol-compiler": "^2.0.2",
+ "@0x/sol-resolver": "^1.2.3",
+ "@0x/subproviders": "^2.1.11",
+ "@0x/typescript-typings": "^3.0.8",
+ "@0x/utils": "^3.0.1",
+ "@0x/web3-wrapper": "^3.2.4",
"@types/solidity-parser-antlr": "^0.2.0",
- "ethereum-types": "^1.1.4",
+ "ethereum-types": "^1.1.6",
"ethereumjs-util": "^5.1.1",
"glob": "^7.1.2",
"istanbul": "^0.4.5",
@@ -61,7 +62,7 @@
"solidity-parser-antlr": "^0.2.12"
},
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.2",
"@types/istanbul": "^0.4.30",
"@types/loglevel": "^1.5.3",
"@types/mkdirp": "^0.5.1",
diff --git a/packages/sol-tracing-utils/src/artifact_adapters/sol_compiler_artifact_adapter.ts b/packages/sol-tracing-utils/src/artifact_adapters/sol_compiler_artifact_adapter.ts
index 57391abbe..bfd3a504a 100644
--- a/packages/sol-tracing-utils/src/artifact_adapters/sol_compiler_artifact_adapter.ts
+++ b/packages/sol-tracing-utils/src/artifact_adapters/sol_compiler_artifact_adapter.ts
@@ -1,3 +1,4 @@
+import { FallthroughResolver, FSResolver, NPMResolver, RelativeFSResolver, URLResolver } from '@0x/sol-resolver';
import { logUtils } from '@0x/utils';
import { CompilerOptions, ContractArtifact } from 'ethereum-types';
import * as fs from 'fs';
@@ -5,7 +6,7 @@ import * as glob from 'glob';
import * as _ from 'lodash';
import * as path from 'path';
-import { ContractData } from '../types';
+import { ContractData, SourceCodes, Sources } from '../types';
import { AbstractArtifactAdapter } from './abstract_artifact_adapter';
@@ -14,6 +15,7 @@ const CONFIG_FILE = 'compiler.json';
export class SolCompilerArtifactAdapter extends AbstractArtifactAdapter {
private readonly _artifactsPath: string;
private readonly _sourcesPath: string;
+ private readonly _resolver: FallthroughResolver;
/**
* Instantiates a SolCompilerArtifactAdapter
* @param artifactsPath Path to your artifacts directory
@@ -32,6 +34,12 @@ export class SolCompilerArtifactAdapter extends AbstractArtifactAdapter {
throw new Error(`contractsDir not found in ${CONFIG_FILE}`);
}
this._sourcesPath = (sourcesPath || config.contractsDir) as string;
+ this._resolver = new FallthroughResolver();
+ this._resolver.appendResolver(new URLResolver());
+ const packagePath = path.resolve('');
+ this._resolver.appendResolver(new NPMResolver(packagePath));
+ this._resolver.appendResolver(new RelativeFSResolver(this._sourcesPath));
+ this._resolver.appendResolver(new FSResolver());
}
public async collectContractsDataAsync(): Promise<ContractData[]> {
const artifactsGlob = `${this._artifactsPath}/**/*.json`;
@@ -43,9 +51,13 @@ export class SolCompilerArtifactAdapter extends AbstractArtifactAdapter {
logUtils.warn(`${artifactFileName} doesn't contain bytecode. Skipping...`);
continue;
}
- let sources = _.keys(artifact.sources);
- sources = _.map(sources, relativeFilePath => path.resolve(this._sourcesPath, relativeFilePath));
- const sourceCodes = _.map(sources, (source: string) => fs.readFileSync(source).toString());
+ const sources: Sources = {};
+ const sourceCodes: SourceCodes = {};
+ _.map(artifact.sources, (value: { id: number }, relativeFilePath: string) => {
+ const source = this._resolver.resolve(relativeFilePath);
+ sources[value.id] = source.absolutePath;
+ sourceCodes[value.id] = source.source;
+ });
const contractData = {
sourceCodes,
sources,
@@ -54,6 +66,10 @@ export class SolCompilerArtifactAdapter extends AbstractArtifactAdapter {
runtimeBytecode: artifact.compilerOutput.evm.deployedBytecode.object,
sourceMapRuntime: artifact.compilerOutput.evm.deployedBytecode.sourceMap,
};
+ const isInterfaceContract = contractData.bytecode === '0x' && contractData.runtimeBytecode === '0x';
+ if (isInterfaceContract) {
+ continue;
+ }
contractsData.push(contractData);
}
return contractsData;
diff --git a/packages/sol-tracing-utils/src/ast_visitor.ts b/packages/sol-tracing-utils/src/ast_visitor.ts
index e55cdf6ec..1ac9cd1de 100644
--- a/packages/sol-tracing-utils/src/ast_visitor.ts
+++ b/packages/sol-tracing-utils/src/ast_visitor.ts
@@ -1,7 +1,7 @@
import * as _ from 'lodash';
import * as Parser from 'solidity-parser-antlr';
-import { BranchMap, FnMap, LocationByOffset, SingleFileSourceRange, StatementMap } from './types';
+import { BranchMap, FnMap, OffsetToLocation, SingleFileSourceRange, StatementMap } from './types';
export interface CoverageEntriesDescription {
fnMap: FnMap;
@@ -22,13 +22,13 @@ export class ASTVisitor {
private readonly _branchMap: BranchMap = {};
private readonly _modifiersStatementIds: number[] = [];
private readonly _statementMap: StatementMap = {};
- private readonly _locationByOffset: LocationByOffset;
+ private readonly _offsetToLocation: OffsetToLocation;
private readonly _ignoreRangesBeginningAt: number[];
// keep track of contract/function ranges that are to be ignored
// so we can also ignore any children nodes within the contract/function
private readonly _ignoreRangesWithin: Array<[number, number]> = [];
- constructor(locationByOffset: LocationByOffset, ignoreRangesBeginningAt: number[] = []) {
- this._locationByOffset = locationByOffset;
+ constructor(offsetToLocation: OffsetToLocation, ignoreRangesBeginningAt: number[] = []) {
+ this._offsetToLocation = offsetToLocation;
this._ignoreRangesBeginningAt = ignoreRangesBeginningAt;
}
public getCollectedCoverageEntries(): CoverageEntriesDescription {
@@ -94,6 +94,39 @@ export class ASTVisitor {
public InlineAssemblyStatement(ast: Parser.InlineAssemblyStatement): void {
this._visitStatement(ast);
}
+ public AssemblyLocalDefinition(ast: Parser.AssemblyLocalDefinition): void {
+ this._visitStatement(ast);
+ }
+ public AssemblyCall(ast: Parser.AssemblyCall): void {
+ this._visitStatement(ast);
+ }
+ public AssemblyIf(ast: Parser.AssemblyIf): void {
+ this._visitStatement(ast);
+ }
+ public AssemblyBlock(ast: Parser.AssemblyBlock): void {
+ this._visitStatement(ast);
+ }
+ public AssemblyExpression(ast: Parser.AssemblyExpression): void {
+ this._visitStatement(ast);
+ }
+ public AssemblyAssignment(ast: Parser.AssemblyAssignment): void {
+ this._visitStatement(ast);
+ }
+ public LabelDefinition(ast: Parser.LabelDefinition): void {
+ this._visitStatement(ast);
+ }
+ public AssemblySwitch(ast: Parser.AssemblySwitch): void {
+ this._visitStatement(ast);
+ }
+ public AssemblyFunctionDefinition(ast: Parser.AssemblyFunctionDefinition): void {
+ this._visitStatement(ast);
+ }
+ public AssemblyFor(ast: Parser.AssemblyFor): void {
+ this._visitStatement(ast);
+ }
+ public SubAssembly(ast: Parser.SubAssembly): void {
+ this._visitStatement(ast);
+ }
public BinaryOperation(ast: Parser.BinaryOperation): void {
const BRANCHING_BIN_OPS = ['&&', '||'];
if (_.includes(BRANCHING_BIN_OPS, ast.operator)) {
@@ -136,8 +169,8 @@ export class ASTVisitor {
}
private _getExpressionRange(ast: Parser.ASTNode): SingleFileSourceRange {
const astRange = ast.range as [number, number];
- const start = this._locationByOffset[astRange[0]];
- const end = this._locationByOffset[astRange[1] + 1];
+ const start = this._offsetToLocation[astRange[0]];
+ const end = this._offsetToLocation[astRange[1] + 1];
const range = {
start,
end,
diff --git a/packages/sol-tracing-utils/src/collect_coverage_entries.ts b/packages/sol-tracing-utils/src/collect_coverage_entries.ts
index bdbcd613e..d5045b106 100644
--- a/packages/sol-tracing-utils/src/collect_coverage_entries.ts
+++ b/packages/sol-tracing-utils/src/collect_coverage_entries.ts
@@ -3,34 +3,34 @@ import * as _ from 'lodash';
import * as parser from 'solidity-parser-antlr';
import { ASTVisitor, CoverageEntriesDescription } from './ast_visitor';
-import { getLocationByOffset } from './source_maps';
-
-const IGNORE_RE = /\/\*\s*solcov\s+ignore\s+next\s*\*\/\s*/gm;
+import { getOffsetToLocation } from './source_maps';
// Parsing source code for each transaction/code is slow and therefore we cache it
-const coverageEntriesBySourceHash: { [sourceHash: string]: CoverageEntriesDescription } = {};
+const sourceHashToCoverageEntries: { [sourceHash: string]: CoverageEntriesDescription } = {};
-export const collectCoverageEntries = (contractSource: string) => {
+export const collectCoverageEntries = (contractSource: string, ignoreRegexp?: RegExp) => {
const sourceHash = ethUtil.sha3(contractSource).toString('hex');
- if (_.isUndefined(coverageEntriesBySourceHash[sourceHash]) && !_.isUndefined(contractSource)) {
+ if (_.isUndefined(sourceHashToCoverageEntries[sourceHash]) && !_.isUndefined(contractSource)) {
const ast = parser.parse(contractSource, { range: true });
- const locationByOffset = getLocationByOffset(contractSource);
- const ignoreRangesBegingingAt = gatherRangesToIgnore(contractSource);
- const visitor = new ASTVisitor(locationByOffset, ignoreRangesBegingingAt);
+ const offsetToLocation = getOffsetToLocation(contractSource);
+ const ignoreRangesBeginningAt = _.isUndefined(ignoreRegexp)
+ ? []
+ : gatherRangesToIgnore(contractSource, ignoreRegexp);
+ const visitor = new ASTVisitor(offsetToLocation, ignoreRangesBeginningAt);
parser.visit(ast, visitor);
- coverageEntriesBySourceHash[sourceHash] = visitor.getCollectedCoverageEntries();
+ sourceHashToCoverageEntries[sourceHash] = visitor.getCollectedCoverageEntries();
}
- const coverageEntriesDescription = coverageEntriesBySourceHash[sourceHash];
+ const coverageEntriesDescription = sourceHashToCoverageEntries[sourceHash];
return coverageEntriesDescription;
};
// Gather the start index of all code blocks preceeded by "/* solcov ignore next */"
-function gatherRangesToIgnore(contractSource: string): number[] {
+function gatherRangesToIgnore(contractSource: string, ignoreRegexp: RegExp): number[] {
const ignoreRangesStart = [];
let match;
do {
- match = IGNORE_RE.exec(contractSource);
+ match = ignoreRegexp.exec(contractSource);
if (match) {
const matchLen = match[0].length;
ignoreRangesStart.push(match.index + matchLen);
diff --git a/packages/sol-tracing-utils/src/get_source_range_snippet.ts b/packages/sol-tracing-utils/src/get_source_range_snippet.ts
index f578675d3..c1f6e3a4e 100644
--- a/packages/sol-tracing-utils/src/get_source_range_snippet.ts
+++ b/packages/sol-tracing-utils/src/get_source_range_snippet.ts
@@ -1,185 +1,16 @@
-import * as ethUtil from 'ethereumjs-util';
-import * as _ from 'lodash';
-import * as Parser from 'solidity-parser-antlr';
-
-import { SingleFileSourceRange, SourceRange, SourceSnippet } from './types';
+import { SourceRange, SourceSnippet } from './types';
import { utils } from './utils';
-interface ASTInfo {
- type: string;
- node: Parser.ASTNode;
- name: string | null;
- range?: SingleFileSourceRange;
-}
-
-// Parsing source code for each transaction/code is slow and therefore we cache it
-const parsedSourceByHash: { [sourceHash: string]: Parser.ASTNode } = {};
-
/**
* Gets the source range snippet by source range to be used by revert trace.
* @param sourceRange source range
* @param sourceCode source code
*/
-export function getSourceRangeSnippet(sourceRange: SourceRange, sourceCode: string): SourceSnippet | null {
- const sourceHash = ethUtil.sha3(sourceCode).toString('hex');
- if (_.isUndefined(parsedSourceByHash[sourceHash])) {
- parsedSourceByHash[sourceHash] = Parser.parse(sourceCode, { loc: true });
- }
- const astNode = parsedSourceByHash[sourceHash];
- const visitor = new ASTInfoVisitor();
- Parser.visit(astNode, visitor);
- const astInfo = visitor.getASTInfoForRange(sourceRange);
- if (astInfo === null) {
- return null;
- }
+export function getSourceRangeSnippet(sourceRange: SourceRange, sourceCode: string): SourceSnippet {
const sourceCodeInRange = utils.getRange(sourceCode, sourceRange.location);
return {
- ...astInfo,
- range: astInfo.range as SingleFileSourceRange,
+ range: sourceRange.location,
source: sourceCodeInRange,
fileName: sourceRange.fileName,
};
}
-
-// A visitor which collects ASTInfo for most nodes in the AST.
-class ASTInfoVisitor {
- private readonly _astInfos: ASTInfo[] = [];
- public getASTInfoForRange(sourceRange: SourceRange): ASTInfo | null {
- // HACK(albrow): Sometimes the source range doesn't exactly match that
- // of astInfo. To work around that we try with a +/-1 offset on
- // end.column. If nothing matches even with the offset, we return null.
- const offset = {
- start: {
- line: 0,
- column: 0,
- },
- end: {
- line: 0,
- column: 0,
- },
- };
- let astInfo = this._getASTInfoForRange(sourceRange, offset);
- if (astInfo !== null) {
- return astInfo;
- }
- offset.end.column += 1;
- astInfo = this._getASTInfoForRange(sourceRange, offset);
- if (astInfo !== null) {
- return astInfo;
- }
- offset.end.column -= 2;
- astInfo = this._getASTInfoForRange(sourceRange, offset);
- if (astInfo !== null) {
- return astInfo;
- }
- return null;
- }
- public ContractDefinition(ast: Parser.ContractDefinition): void {
- this._visitContractDefinition(ast);
- }
- public IfStatement(ast: Parser.IfStatement): void {
- this._visitStatement(ast);
- }
- public FunctionDefinition(ast: Parser.FunctionDefinition): void {
- this._visitFunctionLikeDefinition(ast);
- }
- public ModifierDefinition(ast: Parser.ModifierDefinition): void {
- this._visitFunctionLikeDefinition(ast);
- }
- public ForStatement(ast: Parser.ForStatement): void {
- this._visitStatement(ast);
- }
- public ReturnStatement(ast: Parser.ReturnStatement): void {
- this._visitStatement(ast);
- }
- public BreakStatement(ast: Parser.BreakStatement): void {
- this._visitStatement(ast);
- }
- public ContinueStatement(ast: Parser.ContinueStatement): void {
- this._visitStatement(ast);
- }
- public EmitStatement(ast: any /* TODO: Parser.EmitStatement */): void {
- this._visitStatement(ast);
- }
- public VariableDeclarationStatement(ast: Parser.VariableDeclarationStatement): void {
- this._visitStatement(ast);
- }
- public Statement(ast: Parser.Statement): void {
- this._visitStatement(ast);
- }
- public WhileStatement(ast: Parser.WhileStatement): void {
- this._visitStatement(ast);
- }
- public SimpleStatement(ast: Parser.SimpleStatement): void {
- this._visitStatement(ast);
- }
- public ThrowStatement(ast: Parser.ThrowStatement): void {
- this._visitStatement(ast);
- }
- public DoWhileStatement(ast: Parser.DoWhileStatement): void {
- this._visitStatement(ast);
- }
- public ExpressionStatement(ast: Parser.ExpressionStatement): void {
- this._visitStatement(ast.expression);
- }
- public InlineAssemblyStatement(ast: Parser.InlineAssemblyStatement): void {
- this._visitStatement(ast);
- }
- public ModifierInvocation(ast: Parser.ModifierInvocation): void {
- const BUILTIN_MODIFIERS = ['public', 'view', 'payable', 'external', 'internal', 'pure', 'constant'];
- if (!_.includes(BUILTIN_MODIFIERS, ast.name)) {
- this._visitStatement(ast);
- }
- }
- private _visitStatement(ast: Parser.ASTNode): void {
- this._astInfos.push({
- type: ast.type,
- node: ast,
- name: null,
- range: ast.loc,
- });
- }
- private _visitFunctionLikeDefinition(ast: Parser.ModifierDefinition | Parser.FunctionDefinition): void {
- this._astInfos.push({
- type: ast.type,
- node: ast,
- name: ast.name,
- range: ast.loc,
- });
- }
- private _visitContractDefinition(ast: Parser.ContractDefinition): void {
- this._astInfos.push({
- type: ast.type,
- node: ast,
- name: ast.name,
- range: ast.loc,
- });
- }
- private _getASTInfoForRange(sourceRange: SourceRange, offset: SingleFileSourceRange): ASTInfo | null {
- const offsetSourceRange = {
- ...sourceRange,
- location: {
- start: {
- line: sourceRange.location.start.line + offset.start.line,
- column: sourceRange.location.start.column + offset.start.column,
- },
- end: {
- line: sourceRange.location.end.line + offset.end.line,
- column: sourceRange.location.end.column + offset.end.column,
- },
- },
- };
- for (const astInfo of this._astInfos) {
- const astInfoRange = astInfo.range as SingleFileSourceRange;
- if (
- astInfoRange.start.column === offsetSourceRange.location.start.column &&
- astInfoRange.start.line === offsetSourceRange.location.start.line &&
- astInfoRange.end.column === offsetSourceRange.location.end.column &&
- astInfoRange.end.line === offsetSourceRange.location.end.line
- ) {
- return astInfo;
- }
- }
- return null;
- }
-}
diff --git a/packages/sol-tracing-utils/src/index.ts b/packages/sol-tracing-utils/src/index.ts
index 413e5305e..fdf024ae0 100644
--- a/packages/sol-tracing-utils/src/index.ts
+++ b/packages/sol-tracing-utils/src/index.ts
@@ -22,11 +22,13 @@ export {
BranchMap,
EvmCallStackEntry,
FnMap,
- LocationByOffset,
+ OffsetToLocation,
StatementMap,
TraceInfoBase,
TraceInfoExistingContract,
TraceInfoNewContract,
+ Sources,
+ SourceCodes,
} from './types';
export { collectCoverageEntries } from './collect_coverage_entries';
export { TraceCollector, SingleFileSubtraceHandler } from './trace_collector';
diff --git a/packages/sol-tracing-utils/src/source_maps.ts b/packages/sol-tracing-utils/src/source_maps.ts
index af0fb4035..8c17652d9 100644
--- a/packages/sol-tracing-utils/src/source_maps.ts
+++ b/packages/sol-tracing-utils/src/source_maps.ts
@@ -1,7 +1,7 @@
import * as _ from 'lodash';
import { getPcToInstructionIndexMapping } from './instructions';
-import { LocationByOffset, SourceRange } from './types';
+import { OffsetToLocation, SourceCodes, SourceRange, Sources } from './types';
const RADIX = 10;
@@ -15,38 +15,41 @@ export interface SourceLocation {
* Receives a string with newlines and returns a map of byte offset to LineColumn
* @param str A string to process
*/
-export function getLocationByOffset(str: string): LocationByOffset {
- const locationByOffset: LocationByOffset = { 0: { line: 1, column: 0 } };
+export function getOffsetToLocation(str: string): OffsetToLocation {
+ const offsetToLocation: OffsetToLocation = { 0: { line: 1, column: 0 } };
let currentOffset = 0;
for (const char of str.split('')) {
- const location = locationByOffset[currentOffset];
+ const location = offsetToLocation[currentOffset];
const isNewline = char === '\n';
- locationByOffset[currentOffset + 1] = {
+ offsetToLocation[currentOffset + 1] = {
line: location.line + (isNewline ? 1 : 0),
column: isNewline ? 0 : location.column + 1,
};
currentOffset++;
}
- return locationByOffset;
+ return offsetToLocation;
}
/**
* Parses a sourcemap string.
* The solidity sourcemap format is documented here: https://github.com/ethereum/solidity/blob/develop/docs/miscellaneous.rst#source-mappings
- * @param sourceCodes sources contents
+ * @param indexToSourceCode index to source code
* @param srcMap source map string
* @param bytecodeHex contract bytecode
- * @param sources sources file names
+ * @param indexToSource index to source file path
*/
export function parseSourceMap(
- sourceCodes: string[],
+ sourceCodes: SourceCodes,
srcMap: string,
bytecodeHex: string,
- sources: string[],
+ sources: Sources,
): { [programCounter: number]: SourceRange } {
const bytecode = Uint8Array.from(Buffer.from(bytecodeHex, 'hex'));
const pcToInstructionIndex: { [programCounter: number]: number } = getPcToInstructionIndexMapping(bytecode);
- const locationByOffsetByFileIndex = _.map(sourceCodes, s => (_.isUndefined(s) ? {} : getLocationByOffset(s)));
+ const fileIndexToOffsetToLocation: { [fileIndex: number]: OffsetToLocation } = {};
+ _.map(sourceCodes, (sourceCode: string, fileIndex: number) => {
+ fileIndexToOffsetToLocation[fileIndex] = _.isUndefined(sourceCode) ? {} : getOffsetToLocation(sourceCode);
+ });
const entries = srcMap.split(';');
let lastParsedEntry: SourceLocation = {} as any;
const instructionIndexToSourceRange: { [instructionIndex: number]: SourceRange } = {};
@@ -66,14 +69,18 @@ export function parseSourceMap(
length,
fileIndex,
};
- if (parsedEntry.fileIndex !== -1 && !_.isUndefined(locationByOffsetByFileIndex[parsedEntry.fileIndex])) {
+ if (parsedEntry.fileIndex !== -1 && !_.isUndefined(fileIndexToOffsetToLocation[parsedEntry.fileIndex])) {
+ const offsetToLocation = fileIndexToOffsetToLocation[parsedEntry.fileIndex];
const sourceRange = {
location: {
- start: locationByOffsetByFileIndex[parsedEntry.fileIndex][parsedEntry.offset],
- end: locationByOffsetByFileIndex[parsedEntry.fileIndex][parsedEntry.offset + parsedEntry.length],
+ start: offsetToLocation[parsedEntry.offset],
+ end: offsetToLocation[parsedEntry.offset + parsedEntry.length],
},
fileName: sources[parsedEntry.fileIndex],
};
+ if (sourceRange.location.start === undefined || sourceRange.location.end === undefined) {
+ throw new Error(`Error while processing sourcemap: location out of range in ${sourceRange.fileName}`);
+ }
instructionIndexToSourceRange[i] = sourceRange;
} else {
// Some assembly code generated by Solidity can't be mapped back to a line of source code.
diff --git a/packages/sol-tracing-utils/src/trace.ts b/packages/sol-tracing-utils/src/trace.ts
index 770080af3..973452b24 100644
--- a/packages/sol-tracing-utils/src/trace.ts
+++ b/packages/sol-tracing-utils/src/trace.ts
@@ -4,21 +4,21 @@ import * as _ from 'lodash';
import { utils } from './utils';
-export interface TraceByContractAddress {
+export interface ContractAddressToTraces {
[contractAddress: string]: StructLog[];
}
/**
- * Converts linear stack trace to `TraceByContractAddress`.
+ * Converts linear stack trace to `ContractAddressToTraces`.
* @param structLogs stack trace
* @param startAddress initial context address
*/
-export function getTracesByContractAddress(structLogs: StructLog[], startAddress: string): TraceByContractAddress {
- const traceByContractAddress: TraceByContractAddress = {};
+export function getContractAddressToTraces(structLogs: StructLog[], startAddress: string): ContractAddressToTraces {
+ const contractAddressToTraces: ContractAddressToTraces = {};
let currentTraceSegment = [];
const addressStack = [startAddress];
if (_.isEmpty(structLogs)) {
- return traceByContractAddress;
+ return contractAddressToTraces;
}
const normalizedStructLogs = utils.normalizeStructLogs(structLogs);
// tslint:disable-next-line:prefer-for-of
@@ -45,14 +45,14 @@ export function getTracesByContractAddress(structLogs: StructLog[], startAddress
const nextStructLog = normalizedStructLogs[i + 1];
if (nextStructLog.depth !== structLog.depth) {
addressStack.push(newAddress);
- traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat(
+ contractAddressToTraces[currentAddress] = (contractAddressToTraces[currentAddress] || []).concat(
currentTraceSegment,
);
currentTraceSegment = [];
}
} else if (utils.isEndOpcode(structLog.op)) {
const currentAddress = addressStack.pop() as string;
- traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat(
+ contractAddressToTraces[currentAddress] = (contractAddressToTraces[currentAddress] || []).concat(
currentTraceSegment,
);
currentTraceSegment = [];
@@ -71,7 +71,7 @@ export function getTracesByContractAddress(structLogs: StructLog[], startAddress
logUtils.warn(
"Detected a contract created from within another contract. We currently do not support that scenario. We'll just skip that trace",
);
- return traceByContractAddress;
+ return contractAddressToTraces;
} else {
if (structLog !== _.last(normalizedStructLogs)) {
const nextStructLog = normalizedStructLogs[i + 1];
@@ -79,7 +79,7 @@ export function getTracesByContractAddress(structLogs: StructLog[], startAddress
continue;
} else if (nextStructLog.depth === structLog.depth - 1) {
const currentAddress = addressStack.pop() as string;
- traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat(
+ contractAddressToTraces[currentAddress] = (contractAddressToTraces[currentAddress] || []).concat(
currentTraceSegment,
);
currentTraceSegment = [];
@@ -94,11 +94,11 @@ export function getTracesByContractAddress(structLogs: StructLog[], startAddress
}
if (currentTraceSegment.length !== 0) {
const currentAddress = addressStack.pop() as string;
- traceByContractAddress[currentAddress] = (traceByContractAddress[currentAddress] || []).concat(
+ contractAddressToTraces[currentAddress] = (contractAddressToTraces[currentAddress] || []).concat(
currentTraceSegment,
);
currentTraceSegment = [];
logUtils.warn('Malformed trace. Current trace segment non empty at the end');
}
- return traceByContractAddress;
+ return contractAddressToTraces;
}
diff --git a/packages/sol-tracing-utils/src/trace_collection_subprovider.ts b/packages/sol-tracing-utils/src/trace_collection_subprovider.ts
index 25e38768d..5118921fa 100644
--- a/packages/sol-tracing-utils/src/trace_collection_subprovider.ts
+++ b/packages/sol-tracing-utils/src/trace_collection_subprovider.ts
@@ -1,5 +1,6 @@
import { BlockchainLifecycle } from '@0x/dev-utils';
import { Callback, ErrorCallback, NextCallback, Subprovider } from '@0x/subproviders';
+import { logUtils } from '@0x/utils';
import { CallDataRPC, marshaller, Web3Wrapper } from '@0x/web3-wrapper';
import { JSONRPCRequestPayload, Provider, TxData } from 'ethereum-types';
import * as _ from 'lodash';
@@ -20,6 +21,23 @@ export interface TraceCollectionSubproviderConfig {
shouldCollectGasEstimateTraces: boolean;
}
+type AsyncFunc = (...args: any[]) => Promise<void>;
+
+// HACK: This wrapper outputs errors to console even if the promise gets ignored
+// we need this because web3-provider-engine does not handle promises in
+// the after function of next(after).
+function logAsyncErrors(fn: AsyncFunc): AsyncFunc {
+ async function wrappedAsync(...args: any[]): Promise<void> {
+ try {
+ await fn(...args);
+ } catch (err) {
+ logUtils.log(err);
+ throw err;
+ }
+ }
+ return wrappedAsync;
+}
+
// Because there is no notion of a call trace in the Ethereum rpc - we collect them in a rather non-obvious/hacky way.
// On each call - we create a snapshot, execute the call as a transaction, get the trace, revert the snapshot.
// That allows us to avoid influencing test behaviour.
@@ -74,7 +92,7 @@ export abstract class TraceCollectionSubprovider extends Subprovider {
next();
} else {
const txData = payload.params[0];
- next(this._onTransactionSentAsync.bind(this, txData));
+ next(logAsyncErrors(this._onTransactionSentAsync.bind(this, txData)));
}
return;
@@ -83,7 +101,7 @@ export abstract class TraceCollectionSubprovider extends Subprovider {
next();
} else {
const callData = payload.params[0];
- next(this._onCallOrGasEstimateExecutedAsync.bind(this, callData));
+ next(logAsyncErrors(this._onCallOrGasEstimateExecutedAsync.bind(this, callData)));
}
return;
@@ -92,7 +110,7 @@ export abstract class TraceCollectionSubprovider extends Subprovider {
next();
} else {
const estimateGasData = payload.params[0];
- next(this._onCallOrGasEstimateExecutedAsync.bind(this, estimateGasData));
+ next(logAsyncErrors(this._onCallOrGasEstimateExecutedAsync.bind(this, estimateGasData)));
}
return;
@@ -126,7 +144,7 @@ export abstract class TraceCollectionSubprovider extends Subprovider {
txHash: string | undefined,
cb: Callback,
): Promise<void> {
- if (!txData.isFakeTransaction) {
+ if (!(txData.isFakeTransaction || txData.from === txData.to)) {
// This transaction is a usual transaction. Not a call executed as one.
// And we don't want it to be executed within a snapshotting period
await this._lock.acquire();
diff --git a/packages/sol-tracing-utils/src/trace_collector.ts b/packages/sol-tracing-utils/src/trace_collector.ts
index 943e208cf..f5dde8762 100644
--- a/packages/sol-tracing-utils/src/trace_collector.ts
+++ b/packages/sol-tracing-utils/src/trace_collector.ts
@@ -56,7 +56,7 @@ export class TraceCollector {
this._singleFileSubtraceHandler = singleFileSubtraceHandler;
}
public async writeOutputAsync(): Promise<void> {
- const finalCoverage = this._collector.getFinalCoverage();
+ const finalCoverage: Coverage = this._collector.getFinalCoverage();
const stringifiedCoverage = JSON.stringify(finalCoverage, null, '\t');
await mkdirpAsync('coverage');
fs.writeFileSync('coverage/coverage.json', stringifiedCoverage);
@@ -80,14 +80,14 @@ export class TraceCollector {
const bytecodeHex = stripHexPrefix(bytecode);
const sourceMap = isContractCreation ? contractData.sourceMap : contractData.sourceMapRuntime;
const pcToSourceRange = parseSourceMap(contractData.sourceCodes, sourceMap, bytecodeHex, contractData.sources);
- for (let fileIndex = 0; fileIndex < contractData.sources.length; fileIndex++) {
+ _.map(contractData.sources, (_sourcePath: string, fileIndex: string) => {
const singleFileCoverageForTrace = this._singleFileSubtraceHandler(
contractData,
traceInfo.subtrace,
pcToSourceRange,
- fileIndex,
+ _.parseInt(fileIndex),
);
this._collector.add(singleFileCoverageForTrace);
- }
+ });
}
}
diff --git a/packages/sol-tracing-utils/src/trace_info_subprovider.ts b/packages/sol-tracing-utils/src/trace_info_subprovider.ts
index 635a68f58..de42e1862 100644
--- a/packages/sol-tracing-utils/src/trace_info_subprovider.ts
+++ b/packages/sol-tracing-utils/src/trace_info_subprovider.ts
@@ -1,7 +1,8 @@
+import { NodeType } from '@0x/web3-wrapper';
import * as _ from 'lodash';
import { constants } from './constants';
-import { getTracesByContractAddress } from './trace';
+import { getContractAddressToTraces } from './trace';
import { TraceCollectionSubprovider } from './trace_collection_subprovider';
import { TraceInfo, TraceInfoExistingContract, TraceInfoNewContract } from './types';
@@ -12,18 +13,50 @@ export abstract class TraceInfoSubprovider extends TraceCollectionSubprovider {
protected abstract _handleTraceInfoAsync(traceInfo: TraceInfo): Promise<void>;
protected async _recordTxTraceAsync(address: string, data: string | undefined, txHash: string): Promise<void> {
await this._web3Wrapper.awaitTransactionMinedAsync(txHash, 0);
- const trace = await this._web3Wrapper.getTransactionTraceAsync(txHash, {
- disableMemory: true,
- disableStack: false,
- disableStorage: true,
- });
- const tracesByContractAddress = getTracesByContractAddress(trace.structLogs, address);
- const subcallAddresses = _.keys(tracesByContractAddress);
+ const nodeType = await this._web3Wrapper.getNodeTypeAsync();
+ let trace;
+ if (nodeType === NodeType.Geth) {
+ // For very large traces we use a custom tracer that outputs a format compatible with a
+ // regular trace. We only need the 2nd item on the stack when the instruction is a call.
+ // By not including other stack values, we drastically limit the amount of data to be collected.
+ // There are no good docs about how to write those tracers, but you can find some example ones here:
+ // https://github.com/ethereum/go-ethereum/tree/master/eth/tracers/internal/tracers
+ const tracer = `
+ {
+ data: [],
+ step: function(log) {
+ const op = log.op.toString();
+ const opn = 0 | log.op.toNumber();
+ const pc = 0 | log.getPC();
+ const depth = 0 | log.getDepth();
+ const gasCost = 0 | log.getCost();
+ const gas = 0 | log.getGas();
+ const isCall = opn == 0xf1 || opn == 0xf2 || opn == 0xf4 || opn == 0xf5 || opn == 0xfa;
+ const stack = isCall ? ['0x'+log.stack.peek(1).toString(16), null] : null;
+ this.data.push({ pc, gasCost, depth, op, stack, gas });
+ },
+ fault: function() { },
+ result: function() { return {structLogs: this.data}; }
+ }
+ `;
+ trace = await this._web3Wrapper.getTransactionTraceAsync(txHash, { tracer, timeout: '600s' });
+ } else {
+ /**
+ * Ganache doesn't support custom tracers yet.
+ */
+ trace = await this._web3Wrapper.getTransactionTraceAsync(txHash, {
+ disableMemory: true,
+ disableStack: false,
+ disableStorage: true,
+ });
+ }
+ const contractAddressToTraces = getContractAddressToTraces(trace.structLogs, address);
+ const subcallAddresses = _.keys(contractAddressToTraces);
if (address === constants.NEW_CONTRACT) {
for (const subcallAddress of subcallAddresses) {
let traceInfo: TraceInfoNewContract | TraceInfoExistingContract;
if (subcallAddress === 'NEW_CONTRACT') {
- const traceForThatSubcall = tracesByContractAddress[subcallAddress];
+ const traceForThatSubcall = contractAddressToTraces[subcallAddress];
traceInfo = {
subtrace: traceForThatSubcall,
txHash,
@@ -32,7 +65,7 @@ export abstract class TraceInfoSubprovider extends TraceCollectionSubprovider {
};
} else {
const runtimeBytecode = await this._web3Wrapper.getContractCodeAsync(subcallAddress);
- const traceForThatSubcall = tracesByContractAddress[subcallAddress];
+ const traceForThatSubcall = contractAddressToTraces[subcallAddress];
traceInfo = {
subtrace: traceForThatSubcall,
txHash,
@@ -45,7 +78,7 @@ export abstract class TraceInfoSubprovider extends TraceCollectionSubprovider {
} else {
for (const subcallAddress of subcallAddresses) {
const runtimeBytecode = await this._web3Wrapper.getContractCodeAsync(subcallAddress);
- const traceForThatSubcall = tracesByContractAddress[subcallAddress];
+ const traceForThatSubcall = contractAddressToTraces[subcallAddress];
const traceInfo: TraceInfoExistingContract = {
subtrace: traceForThatSubcall,
txHash,
diff --git a/packages/sol-tracing-utils/src/types.ts b/packages/sol-tracing-utils/src/types.ts
index 54ade0400..97b5e6b37 100644
--- a/packages/sol-tracing-utils/src/types.ts
+++ b/packages/sol-tracing-utils/src/types.ts
@@ -1,5 +1,4 @@
import { StructLog } from 'ethereum-types';
-import * as Parser from 'solidity-parser-antlr';
export interface LineColumn {
line: number;
@@ -16,7 +15,7 @@ export interface SingleFileSourceRange {
end: LineColumn;
}
-export interface LocationByOffset {
+export interface OffsetToLocation {
[offset: number]: LineColumn;
}
@@ -76,13 +75,20 @@ export interface Coverage {
};
}
+export interface SourceCodes {
+ [sourceId: number]: string;
+}
+export interface Sources {
+ [sourceId: number]: string;
+}
+
export interface ContractData {
bytecode: string;
sourceMap: string;
runtimeBytecode: string;
sourceMapRuntime: string;
- sourceCodes: string[];
- sources: string[];
+ sourceCodes: SourceCodes;
+ sources: Sources;
}
// Part of the trace executed within the same context
@@ -119,8 +125,5 @@ export type EvmCallStack = EvmCallStackEntry[];
export interface SourceSnippet {
source: string;
fileName: string;
- type: string;
- node: Parser.ASTNode;
- name: string | null;
range: SingleFileSourceRange;
}
diff --git a/packages/sol-tracing-utils/src/utils.ts b/packages/sol-tracing-utils/src/utils.ts
index d8bc65e73..7dc1844a5 100644
--- a/packages/sol-tracing-utils/src/utils.ts
+++ b/packages/sol-tracing-utils/src/utils.ts
@@ -1,13 +1,13 @@
-import { addressUtils, BigNumber } from '@0x/utils';
+import { addressUtils, BigNumber, logUtils } from '@0x/utils';
import { OpCode, StructLog } from 'ethereum-types';
import { addHexPrefix } from 'ethereumjs-util';
import * as _ from 'lodash';
import { ContractData, LineColumn, SingleFileSourceRange } from './types';
-// This is the minimum length of valid contract bytecode. The Solidity compiler
-// metadata is 86 bytes. If you add the '0x' prefix, we get 88.
-const MIN_CONTRACT_BYTECODE_LENGTH = 88;
+const STATICCALL_GAS_COST = 40;
+
+const bytecodeToContractDataIfExists: { [bytecode: string]: ContractData | undefined } = {};
export const utils = {
compareLineColumn(lhs: LineColumn, rhs: LineColumn): number {
@@ -23,6 +23,12 @@ export const utils = {
utils.compareLineColumn(childRange.end, parentRange.end) <= 0
);
},
+ isRangeEqual(childRange: SingleFileSourceRange, parentRange: SingleFileSourceRange): boolean {
+ return (
+ utils.compareLineColumn(parentRange.start, childRange.start) === 0 &&
+ utils.compareLineColumn(childRange.end, parentRange.end) === 0
+ );
+ },
bytecodeToBytecodeRegex(bytecode: string): string {
const bytecodeRegex = bytecode
// Library linking placeholder: __ConvertLib____________________________
@@ -40,22 +46,29 @@ export const utils = {
if (!bytecode.startsWith('0x')) {
throw new Error(`0x hex prefix missing: ${bytecode}`);
}
- const contractData = _.find(contractsData, contractDataCandidate => {
+ // HACK(leo): We want to cache the values that are possibly undefined.
+ // That's why we can't check for undefined as we usually do, but need to use `hasOwnProperty`.
+ if (bytecodeToContractDataIfExists.hasOwnProperty(bytecode)) {
+ return bytecodeToContractDataIfExists[bytecode];
+ }
+ const contractDataCandidates = _.filter(contractsData, contractDataCandidate => {
const bytecodeRegex = utils.bytecodeToBytecodeRegex(contractDataCandidate.bytecode);
- // If the bytecode is less than the minimum length, we are probably
- // dealing with an interface. This isn't what we're looking for.
- if (bytecodeRegex.length < MIN_CONTRACT_BYTECODE_LENGTH) {
- return false;
- }
const runtimeBytecodeRegex = utils.bytecodeToBytecodeRegex(contractDataCandidate.runtimeBytecode);
- if (runtimeBytecodeRegex.length < MIN_CONTRACT_BYTECODE_LENGTH) {
- return false;
- }
// We use that function to find by bytecode or runtimeBytecode. Those are quasi-random strings so
// collisions are practically impossible and it allows us to reuse that code
return !_.isNull(bytecode.match(bytecodeRegex)) || !_.isNull(bytecode.match(runtimeBytecodeRegex));
});
- return contractData;
+ if (contractDataCandidates.length > 1) {
+ const candidates = contractDataCandidates.map(
+ contractDataCandidate => _.values(contractDataCandidate.sources)[0],
+ );
+ const errMsg =
+ "We've found more than one artifact that contains the exact same bytecode and therefore are unable to detect which contract was executed. " +
+ "We'll be assigning all traces to the first one.";
+ logUtils.warn(errMsg);
+ logUtils.warn(candidates);
+ }
+ return (bytecodeToContractDataIfExists[bytecode] = contractDataCandidates[0]);
},
isCallLike(op: OpCode): boolean {
return _.includes([OpCode.CallCode, OpCode.StaticCall, OpCode.Call, OpCode.DelegateCall], op);
@@ -70,10 +83,17 @@ export const utils = {
normalizeStructLogs(structLogs: StructLog[]): StructLog[] {
if (structLogs[0].depth === 1) {
// Geth uses 1-indexed depth counter whilst ganache starts from 0
- const newStructLogs = _.map(structLogs, structLog => ({
- ...structLog,
- depth: structLog.depth - 1,
- }));
+ const newStructLogs = _.map(structLogs, structLog => {
+ const newStructLog = {
+ ...structLog,
+ depth: structLog.depth - 1,
+ };
+ if (newStructLog.op === 'STATICCALL') {
+ // HACK(leo): Geth traces sometimes returns those gas costs incorrectly as very big numbers so we manually fix them.
+ newStructLog.gasCost = STATICCALL_GAS_COST;
+ }
+ return newStructLog;
+ });
return newStructLogs;
}
return structLogs;
diff --git a/packages/sol-tracing-utils/test/collect_coverage_entries_test.ts b/packages/sol-tracing-utils/test/collect_coverage_entries_test.ts
index 7832ec316..d3ca8930c 100644
--- a/packages/sol-tracing-utils/test/collect_coverage_entries_test.ts
+++ b/packages/sol-tracing-utils/test/collect_coverage_entries_test.ts
@@ -130,7 +130,8 @@ describe('Collect coverage entries', () => {
solcovIgnoreContractBaseName,
);
const solcovIgnoreContract = fs.readFileSync(solcovIgnoreContractFileName).toString();
- const coverageEntries = collectCoverageEntries(solcovIgnoreContract);
+ const IGNORE_REGEXP = /\/\*\s*solcov\s+ignore\s+next\s*\*\/\s*/gm;
+ const coverageEntries = collectCoverageEntries(solcovIgnoreContract, IGNORE_REGEXP);
const fnIds = _.keys(coverageEntries.fnMap);
expect(fnIds.length).to.be.equal(1);
diff --git a/packages/sol-tracing-utils/test/source_maps_test.ts b/packages/sol-tracing-utils/test/source_maps_test.ts
index 5820bedd7..330a6a3e1 100644
--- a/packages/sol-tracing-utils/test/source_maps_test.ts
+++ b/packages/sol-tracing-utils/test/source_maps_test.ts
@@ -4,7 +4,7 @@ import * as _ from 'lodash';
import 'mocha';
import * as path from 'path';
-import { getLocationByOffset, parseSourceMap } from '../src/source_maps';
+import { getOffsetToLocation, parseSourceMap } from '../src/source_maps';
const expect = chai.expect;
@@ -15,7 +15,7 @@ const simplestContract = fs.readFileSync(simplestContractFileName).toString();
describe('source maps', () => {
describe('#getLocationByOffset', () => {
it('correctly computes location by offset', () => {
- const locationByOffset = getLocationByOffset(simplestContract);
+ const offsetToLocation = getOffsetToLocation(simplestContract);
const expectedLocationByOffset = {
'0': { line: 1, column: 0 },
'1': { line: 1, column: 1 },
@@ -41,7 +41,7 @@ describe('source maps', () => {
'21': { line: 2, column: 1 },
'22': { line: 3, column: 0 },
};
- expect(locationByOffset).to.be.deep.equal(expectedLocationByOffset);
+ expect(offsetToLocation).to.be.deep.equal(expectedLocationByOffset);
});
});
describe('#parseSourceMap', () => {
diff --git a/packages/sol-tracing-utils/test/trace_test.ts b/packages/sol-tracing-utils/test/trace_test.ts
index 7a034362c..c9ed93e63 100644
--- a/packages/sol-tracing-utils/test/trace_test.ts
+++ b/packages/sol-tracing-utils/test/trace_test.ts
@@ -3,7 +3,7 @@ import { OpCode, StructLog } from 'ethereum-types';
import * as _ from 'lodash';
import 'mocha';
-import { getTracesByContractAddress } from '../src/trace';
+import { getContractAddressToTraces } from '../src/trace';
const expect = chai.expect;
@@ -44,7 +44,7 @@ describe('Trace', () => {
];
const fullTrace = _.map(trace, compactStructLog => addDefaultStructLogFields(compactStructLog));
const startAddress = '0x0000000000000000000000000000000000000001';
- const traceByContractAddress = getTracesByContractAddress(fullTrace, startAddress);
+ const traceByContractAddress = getContractAddressToTraces(fullTrace, startAddress);
const expectedTraceByContractAddress = {
[startAddress]: [fullTrace[0], fullTrace[2]],
[delegateCallAddress]: [fullTrace[1]],
diff --git a/packages/sra-spec/CHANGELOG.json b/packages/sra-spec/CHANGELOG.json
index fe52a8111..e22a3b0e4 100644
--- a/packages/sra-spec/CHANGELOG.json
+++ b/packages/sra-spec/CHANGELOG.json
@@ -1,5 +1,32 @@
[
{
+ "version": "2.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "1.0.16",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "1.0.15",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"timestamp": 1547040760,
"version": "1.0.14",
"changes": [
@@ -130,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/sra-spec/CHANGELOG.md b/packages/sra-spec/CHANGELOG.md
index 36b6b1fb0..5fe40ccb4 100644
--- a/packages/sra-spec/CHANGELOG.md
+++ b/packages/sra-spec/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v1.0.16 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v1.0.15 - _January 11, 2019_
+
+ * Dependencies updated
+
## v1.0.14 - _January 9, 2019_
* Dependencies updated
diff --git a/packages/sra-spec/package.json b/packages/sra-spec/package.json
index a0caea0f4..9c4c0a24f 100644
--- a/packages/sra-spec/package.json
+++ b/packages/sra-spec/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/sra-spec",
- "version": "1.0.14",
+ "version": "1.0.16",
"engines": {
"node": ">=6.12"
},
@@ -35,11 +35,11 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/sra-spec/README.md",
"dependencies": {
- "@0x/json-schemas": "^2.1.5",
+ "@0x/json-schemas": "^2.1.7",
"@loopback/openapi-v3-types": "^0.8.2"
},
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.2",
"@types/mocha": "^2.2.42",
"@types/node": "^10.5.3",
"chai": "^4.0.1",
diff --git a/packages/sra-spec/src/md/introduction.md b/packages/sra-spec/src/md/introduction.md
index ce61abff6..3f7431c51 100644
--- a/packages/sra-spec/src/md/introduction.md
+++ b/packages/sra-spec/src/md/introduction.md
@@ -204,7 +204,7 @@ A good example of such a field is `remainingTakerAssetAmount`, which is a conven
# Misc.
-* All requests and responses should be of **application/json** content type
-* All token amounts are sent in amounts of the smallest level of precision (base units). (e.g if a token has 18 decimal places, selling 1 token would show up as selling `'1000000000000000000'` units by this API).
-* All addresses are sent as lower-case (non-checksummed) Ethereum addresses with the `0x` prefix.
-* All parameters are to be written in `lowerCamelCase`.
+- All requests and responses should be of **application/json** content type
+- All token amounts are sent in amounts of the smallest level of precision (base units). (e.g if a token has 18 decimal places, selling 1 token would show up as selling `'1000000000000000000'` units by this API).
+- All addresses are sent as lower-case (non-checksummed) Ethereum addresses with the `0x` prefix.
+- All parameters are to be written in `lowerCamelCase`.
diff --git a/packages/subproviders/CHANGELOG.json b/packages/subproviders/CHANGELOG.json
index cc0e0414a..ffb9740cd 100644
--- a/packages/subproviders/CHANGELOG.json
+++ b/packages/subproviders/CHANGELOG.json
@@ -1,5 +1,36 @@
[
{
+ "version": "3.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ },
+ {
+ "note": "Update ganache-core to v2.3.3",
+ "pr": 1518
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "2.1.11",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "2.1.10",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"timestamp": 1547040760,
"version": "2.1.9",
"changes": [
@@ -165,8 +196,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
}
],
@@ -295,8 +325,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
},
{
@@ -312,8 +341,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
},
{
@@ -371,8 +399,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
}
],
@@ -420,8 +447,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/subproviders/CHANGELOG.md b/packages/subproviders/CHANGELOG.md
index 076cce935..16457ee2b 100644
--- a/packages/subproviders/CHANGELOG.md
+++ b/packages/subproviders/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v2.1.11 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v2.1.10 - _January 11, 2019_
+
+ * Dependencies updated
+
## v2.1.9 - _January 9, 2019_
* Dependencies updated
diff --git a/packages/subproviders/README.md b/packages/subproviders/README.md
index 6f97d760e..b0d77284b 100644
--- a/packages/subproviders/README.md
+++ b/packages/subproviders/README.md
@@ -78,12 +78,12 @@ yarn run test:unit
In order to run the integration tests, make sure you have a Ledger Nano S available.
-* Setup your Ledger with the development mnemonic seed: `concert load couple harbor equip island argue ramp clarify fence smart topic`
-* Plug it into your computer
-* Unlock the device
-* Open the on-device Ethereum app
-* Make sure "browser support" and "contract data" are disabled
-* Start [TestRPC](https://github.com/trufflesuite/ganache-cli) locally at port `8545`
+- Setup your Ledger with the development mnemonic seed: `concert load couple harbor equip island argue ramp clarify fence smart topic`
+- Plug it into your computer
+- Unlock the device
+- Open the on-device Ethereum app
+- Make sure "browser support" and "contract data" are disabled
+- Start [TestRPC](https://github.com/trufflesuite/ganache-cli) locally at port `8545`
Then run:
diff --git a/packages/subproviders/package.json b/packages/subproviders/package.json
index 178e7a99c..b54cc11db 100644
--- a/packages/subproviders/package.json
+++ b/packages/subproviders/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/subproviders",
- "version": "2.1.9",
+ "version": "2.1.11",
"engines": {
"node": ">=6.12"
},
@@ -29,24 +29,24 @@
}
},
"dependencies": {
- "@0x/assert": "^1.0.21",
- "@0x/types": "^1.5.0",
- "@0x/typescript-typings": "^3.0.6",
- "@0x/utils": "^2.1.1",
- "@0x/web3-wrapper": "^3.2.2",
+ "@0x/assert": "^1.0.23",
+ "@0x/types": "^1.5.2",
+ "@0x/typescript-typings": "^3.0.8",
+ "@0x/utils": "^3.0.1",
+ "@0x/web3-wrapper": "^3.2.4",
"@ledgerhq/hw-app-eth": "^4.3.0",
"@ledgerhq/hw-transport-u2f": "4.24.0",
"@types/eth-lightwallet": "^3.0.0",
- "@types/ganache-core": "^2.1.0",
+ "@types/ganache-core": "^2.1.2",
"@types/hdkey": "^0.7.0",
"@types/web3-provider-engine": "^14.0.0",
"bip39": "^2.5.0",
"bn.js": "^4.11.8",
"eth-lightwallet": "^3.0.1",
- "ethereum-types": "^1.1.4",
+ "ethereum-types": "^1.1.6",
"ethereumjs-tx": "^1.3.5",
"ethereumjs-util": "^5.1.1",
- "ganache-core": "^2.2.1",
+ "ganache-core": "^2.3.3",
"hdkey": "^0.7.1",
"json-rpc-error": "2.0.0",
"lodash": "^4.17.5",
@@ -54,7 +54,7 @@
"web3-provider-engine": "14.0.6"
},
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.2",
"@types/bip39": "^2.4.0",
"@types/bn.js": "^4.11.0",
"@types/ethereumjs-tx": "^1.0.0",
diff --git a/packages/testnet-faucets/package.json b/packages/testnet-faucets/package.json
index b01ef4b8e..da7477be4 100644
--- a/packages/testnet-faucets/package.json
+++ b/packages/testnet-faucets/package.json
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@0x/testnet-faucets",
- "version": "1.0.61",
+ "version": "1.0.64",
"engines": {
"node": ">=6.12"
},
@@ -18,13 +18,13 @@
"author": "Fabio Berger",
"license": "Apache-2.0",
"dependencies": {
- "0x.js": "^3.0.0",
- "@0x/subproviders": "^2.1.9",
- "@0x/typescript-typings": "^3.0.6",
- "@0x/utils": "^2.1.1",
- "@0x/web3-wrapper": "^3.2.2",
+ "0x.js": "^3.0.3",
+ "@0x/subproviders": "^2.1.11",
+ "@0x/typescript-typings": "^3.0.8",
+ "@0x/utils": "^3.0.1",
+ "@0x/web3-wrapper": "^3.2.4",
"body-parser": "^1.17.1",
- "ethereum-types": "^1.1.4",
+ "ethereum-types": "^1.1.6",
"ethereumjs-tx": "^1.3.5",
"ethereumjs-util": "^5.1.1",
"express": "^4.15.2",
@@ -32,7 +32,7 @@
"rollbar": "^0.6.5"
},
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.2",
"@types/body-parser": "^1.16.1",
"@types/express": "^4.0.35",
"@types/lodash": "4.14.104",
diff --git a/packages/testnet-faucets/src/ts/dispense_asset_tasks.ts b/packages/testnet-faucets/src/ts/dispense_asset_tasks.ts
index 32f5cb623..58caeeeaa 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 2dfa3c3af..533e1f8b3 100644
--- a/packages/testnet-faucets/src/ts/handler.ts
+++ b/packages/testnet-faucets/src/ts/handler.ts
@@ -36,9 +36,9 @@ interface ItemByNetworkId<T> {
}
enum RequestedAssetType {
- ETH = 'ETH',
- WETH = 'WETH',
- ZRX = 'ZRX',
+ ETH = 'ETH', // tslint:disable-line:enum-naming
+ WETH = 'WETH', // tslint:disable-line:enum-naming
+ ZRX = 'ZRX', // tslint:disable-line:enum-naming
}
const FIVE_DAYS_IN_MS = 4.32e8; // TODO: make this configurable
@@ -178,8 +178,10 @@ 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).div(1000).floor(),
+ expirationTimeSeconds: new BigNumber(Date.now() + FIVE_DAYS_IN_MS)
+ // tslint:disable-next-line:custom-no-magic-numbers
+ .div(1000)
+ .integerValue(BigNumber.ROUND_FLOOR),
};
const orderHash = orderHashUtils.getOrderHashHex(order);
const signature = await signatureUtils.ecSignHashAsync(
diff --git a/packages/tslint-config/CHANGELOG.json b/packages/tslint-config/CHANGELOG.json
index 0070a5b81..34ea6aa6b 100644
--- a/packages/tslint-config/CHANGELOG.json
+++ b/packages/tslint-config/CHANGELOG.json
@@ -1,5 +1,32 @@
[
{
+ "version": "3.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "2.0.2",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "2.0.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "2.0.0",
"changes": [
{
@@ -213,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
}
],
@@ -224,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/tslint-config/CHANGELOG.md b/packages/tslint-config/CHANGELOG.md
index 3cebb1e95..37d287c10 100644
--- a/packages/tslint-config/CHANGELOG.md
+++ b/packages/tslint-config/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v2.0.2 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v2.0.1 - _January 11, 2019_
+
+ * Dependencies updated
+
## v2.0.0 - _December 13, 2018_
* Improve async-suffix rule to check functions too, not just methods (#1425)
diff --git a/packages/tslint-config/package.json b/packages/tslint-config/package.json
index 64ec1e967..f90321edb 100644
--- a/packages/tslint-config/package.json
+++ b/packages/tslint-config/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/tslint-config",
- "version": "2.0.0",
+ "version": "2.0.2",
"engines": {
"node": ">=6.12"
},
@@ -9,6 +9,7 @@
"scripts": {
"build": "tsc -b",
"build:ci": "yarn build",
+ "test": "mocha ./lib/test/*.spec.js",
"clean": "shx rm -rf lib",
"lint": "tslint --format stylish --project ."
},
diff --git a/packages/tslint-config/rules/enumNamingRule.ts b/packages/tslint-config/rules/enumNamingRule.ts
new file mode 100644
index 000000000..56499618f
--- /dev/null
+++ b/packages/tslint-config/rules/enumNamingRule.ts
@@ -0,0 +1,60 @@
+import * as Lint from 'tslint';
+import * as ts from 'typescript';
+
+export class Rule extends Lint.Rules.AbstractRule {
+ public static FAILURE_STRING = `Enum member names should be PascalCase`;
+
+ public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
+ return this.applyWithFunction(sourceFile, walk);
+ }
+}
+
+function walk(ctx: Lint.WalkContext<void>): void {
+ // Recursively walk the AST starting with root node, `ctx.sourceFile`.
+ // Call the function `cb` (defined below) for each child.
+ return ts.forEachChild(ctx.sourceFile, cb);
+
+ function cb(node: ts.Node): void {
+ if (node.kind === ts.SyntaxKind.EnumMember) {
+ const keyNode = node.getFirstToken(ctx.sourceFile);
+ if (keyNode !== undefined) {
+ const keyText = keyNode.getText(ctx.sourceFile);
+ if (!isPascalCase(keyText)) {
+ return ctx.addFailureAtNode(node, Rule.FAILURE_STRING, getFix(keyText, node));
+ }
+ }
+ }
+ // Continue recursion into the AST by calling function `cb` for every child of the current node.
+ return ts.forEachChild(node, cb);
+ }
+
+ function getFix(text: string, node: ts.Node): Lint.Replacement {
+ let fix = toPascalCase(text);
+ // check for `member = value`
+ if (node.getChildCount(ctx.sourceFile) === 3) {
+ const value = node.getLastToken(ctx.sourceFile);
+ if (value !== undefined) {
+ fix += ` = ${value.getText(ctx.sourceFile)}`;
+ }
+ }
+ return new Lint.Replacement(node.getStart(ctx.sourceFile), node.getWidth(ctx.sourceFile), fix);
+ }
+}
+
+// Modified from: https://github.com/jonschlinkert/pascalcase/
+function toPascalCase(str: string): string {
+ let result = str.replace(/([a-z0-9\W])([A-Z])/g, '$1 $2');
+ if (result.length === 1) {
+ return result.toUpperCase();
+ }
+ result = result.replace(/^[\W_\.]+|[\W_\.]+$/g, '').toLowerCase();
+ result = result.charAt(0).toUpperCase() + result.slice(1);
+ return result.replace(/[\W_\.]+(\w|$)/g, (_, ch) => {
+ return ch.toUpperCase();
+ });
+}
+function isPascalCase(s: string): boolean {
+ const regex = /^([A-Z0-9]+[a-z0-9]+)+$/g;
+ const key = s.split('=')[0].trim();
+ return regex.test(key);
+}
diff --git a/packages/tslint-config/test/enumNamingSpec.spec.ts b/packages/tslint-config/test/enumNamingSpec.spec.ts
new file mode 100644
index 000000000..d5b864eba
--- /dev/null
+++ b/packages/tslint-config/test/enumNamingSpec.spec.ts
@@ -0,0 +1,88 @@
+import * as assert from 'assert';
+
+import { Rule } from '../rules/enumNamingRule';
+
+import { getFixedResult, helper } from './lintrunner';
+const rule = 'enum-naming';
+
+describe('enumNamingRule', () => {
+ it(`should not fail PascalCase`, () => {
+ const src = `enum test { MemberOne, MemberTwo }`;
+ const result = helper(src, rule);
+ assert.equal(result.errorCount, 0);
+ });
+ it(`should not fail PascalCase keys with uncased values`, () => {
+ const src = `enum test { MemberOne = 'member_one', MemberTwo = 'member two' }`;
+ const result = helper(src, rule);
+ assert.equal(result.errorCount, 0);
+ });
+ it(`should not fail PascalCase keys with numbers`, () => {
+ const src = `enum test { Member1 = 'member_one', MemberTwo = 'member two' }`;
+ const result = helper(src, rule);
+ assert.equal(result.errorCount, 0);
+ });
+ it(`should fail with camelCase`, () => {
+ const src = `enum test { memberOne, memberTwo }`;
+ const result = helper(src, rule);
+ assert.equal(result.errorCount, 2);
+ });
+ it(`should fail with snake case`, () => {
+ const src = `enum test { member_one, member_two }`;
+ const result = helper(src, rule);
+ assert.equal(result.errorCount, 2);
+ });
+ it(`should fail with all caps`, () => {
+ const src = `enum test { MEMBERONE, MEMBER_TWO }`;
+ const result = helper(src, rule);
+ assert.equal(result.errorCount, 2);
+ });
+ it(`should fail with mixed case`, () => {
+ const src = `enum test { member_one, MemberTwo }`;
+ const result = helper(src, rule);
+ assert.equal(result.errorCount, 1);
+ });
+
+ it(`should fail with the right position`, () => {
+ const src = `enum test { MemberOne, member_two }`;
+ const startPosition = src.indexOf('member_two');
+ const endPosition = startPosition + 'member_two'.length;
+ const failure = helper(src, rule).failures[0];
+
+ assert.equal(failure.getStartPosition().getPosition(), startPosition);
+ assert.equal(failure.getEndPosition().getPosition(), endPosition);
+ assert.equal(failure.getFailure(), Rule.FAILURE_STRING);
+ });
+
+ it(`should fail with the right message`, () => {
+ const src = `enum test { memberOne, memberTwo }`;
+ const failure = helper(src, rule).failures[0];
+
+ assert.equal(failure.getFailure(), Rule.FAILURE_STRING);
+ });
+});
+describe('enumNaming fixer', () => {
+ it('should fix keys', () => {
+ const src = `enum test { MemberOne, memberTwo, member_three, MEMBER_FOUR, MEMBERFIVE }`;
+ const expected = `enum test { MemberOne, MemberTwo, MemberThree, MemberFour, Memberfive }`;
+ const actual = getFixedResult(src, rule);
+ const result = helper(src, rule);
+ assert.equal(result.errorCount, 4); // tslint:disable-line:custom-no-magic-numbers
+ assert.equal(actual, expected);
+ });
+ it('should not fix values', () => {
+ const src = `enum test { MemberOne = 'MemberOne', memberTwo = 'memberTwo', member_three = 'member_three', MEMBER_FOUR = 'MEMBER_FOUR' }`;
+ const expected = `enum test { MemberOne = 'MemberOne', MemberTwo = 'memberTwo', MemberThree = 'member_three', MemberFour = 'MEMBER_FOUR' }`;
+ const actual = getFixedResult(src, rule);
+ const result = helper(src, rule);
+ assert.equal(result.errorCount, 3); // tslint:disable-line:custom-no-magic-numbers
+ assert.equal(actual, expected);
+ });
+ it('should preserve values with equals sign', () => {
+ const src = `enum Operators { assign = '=', EQUALS = '==', Triple_Equals = '===' }`;
+ const expected = `enum Operators { Assign = '=', Equals = '==', TripleEquals = '===' }`;
+ const actual = getFixedResult(src, rule);
+ const result = helper(src, rule);
+ assert.equal(result.errorCount, 3); // tslint:disable-line:custom-no-magic-numbers
+ assert.equal(actual, expected);
+ });
+});
diff --git a/packages/tslint-config/test/lintrunner.ts b/packages/tslint-config/test/lintrunner.ts
new file mode 100644
index 000000000..fcd1b6844
--- /dev/null
+++ b/packages/tslint-config/test/lintrunner.ts
@@ -0,0 +1,23 @@
+import * as path from 'path';
+import { Configuration, Linter, Replacement } from 'tslint';
+
+export const helper = (src: string, rule: string) => {
+ const linter = new Linter({ fix: false });
+ linter.lint(
+ '',
+ src,
+ Configuration.parseConfigFile({
+ rules: {
+ [rule]: true,
+ },
+ rulesDirectory: path.join(__dirname, '../rules'),
+ }),
+ );
+ return linter.getResult();
+};
+
+export const getFixedResult = (src: string, rule: string) => {
+ const result = helper(src, rule);
+ const fixes = [].concat.apply(result.failures.map(x => x.getFix()));
+ return Replacement.applyFixes(src, fixes);
+};
diff --git a/packages/tslint-config/tsconfig.json b/packages/tslint-config/tsconfig.json
index 44845cf1f..b9a4dd03e 100644
--- a/packages/tslint-config/tsconfig.json
+++ b/packages/tslint-config/tsconfig.json
@@ -2,7 +2,7 @@
"extends": "../../tsconfig",
"compilerOptions": {
"outDir": "lib",
- "rootDir": "rules"
+ "rootDir": "."
},
- "include": ["./rules/**/*"]
+ "include": ["./rules/**/*", "test/**/*"]
}
diff --git a/packages/tslint-config/tslint.json b/packages/tslint-config/tslint.json
index e8de6221e..a5fa6962c 100644
--- a/packages/tslint-config/tslint.json
+++ b/packages/tslint-config/tslint.json
@@ -25,6 +25,7 @@
"curly": true,
"custom-no-magic-numbers": [true, 0, 1, 2, 3, -1],
"encoding": true,
+ "enum-naming": true,
"eofline": true,
"import-spacing": true,
"indent": [true, "spaces", 4],
@@ -125,5 +126,5 @@
"check-preblock"
]
},
- "rulesDirectory": "lib"
+ "rulesDirectory": "lib/rules"
}
diff --git a/packages/types/CHANGELOG.json b/packages/types/CHANGELOG.json
index 754cd29dc..7a6d205ee 100644
--- a/packages/types/CHANGELOG.json
+++ b/packages/types/CHANGELOG.json
@@ -1,5 +1,32 @@
[
{
+ "version": "2.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "1.5.2",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "1.5.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "1.5.0",
"changes": [
{
@@ -40,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
}
],
@@ -268,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/types/CHANGELOG.md b/packages/types/CHANGELOG.md
index a1745cf94..ac27d9096 100644
--- a/packages/types/CHANGELOG.md
+++ b/packages/types/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v1.5.2 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v1.5.1 - _January 11, 2019_
+
+ * Dependencies updated
+
## v1.5.0 - _January 9, 2019_
* Added types for Dutch Auction contract (#1465)
diff --git a/packages/types/package.json b/packages/types/package.json
index 75c3b7c63..440f05423 100644
--- a/packages/types/package.json
+++ b/packages/types/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/types",
- "version": "1.5.0",
+ "version": "1.5.2",
"engines": {
"node": ">=6.12"
},
@@ -23,7 +23,7 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/types/README.md",
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.2",
"make-promises-safe": "^1.1.0",
"shx": "^0.2.2",
"tslint": "5.11.0",
@@ -31,8 +31,8 @@
},
"dependencies": {
"@types/node": "*",
- "bignumber.js": "~4.1.0",
- "ethereum-types": "^1.1.4"
+ "bignumber.js": "~8.0.2",
+ "ethereum-types": "^1.1.6"
},
"publishConfig": {
"access": "public"
diff --git a/packages/typescript-typings/CHANGELOG.json b/packages/typescript-typings/CHANGELOG.json
index fadf5ad14..e3ae60231 100644
--- a/packages/typescript-typings/CHANGELOG.json
+++ b/packages/typescript-typings/CHANGELOG.json
@@ -1,5 +1,32 @@
[
{
+ "version": "4.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "3.0.8",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "3.0.7",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "3.0.6",
"changes": [
{
@@ -188,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/typescript-typings/CHANGELOG.md b/packages/typescript-typings/CHANGELOG.md
index 1663d40af..8f23cce14 100644
--- a/packages/typescript-typings/CHANGELOG.md
+++ b/packages/typescript-typings/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v3.0.8 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v3.0.7 - _January 11, 2019_
+
+ * Dependencies updated
+
## v3.0.6 - _December 13, 2018_
* Dependencies updated
diff --git a/packages/typescript-typings/package.json b/packages/typescript-typings/package.json
index c67b660c8..01cab8c63 100644
--- a/packages/typescript-typings/package.json
+++ b/packages/typescript-typings/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/typescript-typings",
- "version": "3.0.6",
+ "version": "3.0.8",
"engines": {
"node": ">=6.12"
},
@@ -26,8 +26,8 @@
"dependencies": {
"@types/bn.js": "^4.11.0",
"@types/react": "*",
- "bignumber.js": "~4.1.0",
- "ethereum-types": "^1.1.4",
+ "bignumber.js": "~8.0.2",
+ "ethereum-types": "^1.1.6",
"popper.js": "1.14.3"
},
"devDependencies": {
diff --git a/packages/typescript-typings/types/chai-as-promised/index.d.ts b/packages/typescript-typings/types/chai-as-promised/index.d.ts
index ba6dabdcc..6d5345755 100644
--- a/packages/typescript-typings/types/chai-as-promised/index.d.ts
+++ b/packages/typescript-typings/types/chai-as-promised/index.d.ts
@@ -5,9 +5,7 @@
declare module 'chai-as-promised' {
function chaiAsPromised(chai: any, utils: any): void;
- namespace chaiAsPromised {
-
- }
+ namespace chaiAsPromised {}
export = chaiAsPromised;
}
diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json
index d84e32dd2..0fb199e58 100644
--- a/packages/utils/CHANGELOG.json
+++ b/packages/utils/CHANGELOG.json
@@ -1,12 +1,31 @@
[
{
+ "version": "4.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "3.0.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "3.0.0",
"changes": [
{
"note": "Make `promisify` resolve when the callback error is undefined.",
"pr": 1501
}
- ]
+ ],
+ "timestamp": 1547225310
},
{
"version": "2.1.1",
@@ -40,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
@@ -172,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
}
],
@@ -340,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
@@ -384,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/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md
index 15d78e321..ed3f00158 100644
--- a/packages/utils/CHANGELOG.md
+++ b/packages/utils/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v3.0.1 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v3.0.0 - _January 11, 2019_
+
+ * Make `promisify` resolve when the callback error is undefined. (#1501)
+
## v2.1.1 - _January 9, 2019_
* Add `should` prefix to names of properties in EncodingRules and DecodingRules (#1363)
diff --git a/packages/utils/package.json b/packages/utils/package.json
index 49d6e3013..b6be39210 100644
--- a/packages/utils/package.json
+++ b/packages/utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/utils",
- "version": "2.1.1",
+ "version": "3.0.1",
"engines": {
"node": ">=6.12"
},
@@ -28,13 +28,13 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/utils/README.md",
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
+ "@0x/tslint-config": "^2.0.2",
"@types/detect-node": "2.0.0",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
- "chai-bignumber": "^2.0.1",
+ "chai-bignumber": "^3.0.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",
@@ -44,14 +44,14 @@
"typescript": "3.0.1"
},
"dependencies": {
- "@0x/types": "^1.5.0",
- "@0x/typescript-typings": "^3.0.6",
+ "@0x/types": "^1.5.2",
+ "@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.4",
+ "ethereum-types": "^1.1.6",
"ethereumjs-util": "^5.1.1",
"ethers": "~4.0.4",
"isomorphic-fetch": "^2.2.1",
diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts
index 2da46db35..28b6418d8 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) {
diff --git a/packages/utils/src/abi_encoder/abstract_data_types/data_type.ts b/packages/utils/src/abi_encoder/abstract_data_types/data_type.ts
index 13cc87e2a..f23324721 100644
--- a/packages/utils/src/abi_encoder/abstract_data_types/data_type.ts
+++ b/packages/utils/src/abi_encoder/abstract_data_types/data_type.ts
@@ -51,8 +51,26 @@ export abstract class DataType {
return value;
}
+ public decodeAsArray(returndata: string, rules?: DecodingRules): any[] {
+ const value = this.decode(returndata, rules);
+ const valuesAsArray = _.isObject(value) ? _.values(value) : [value];
+ return valuesAsArray;
+ }
+
+ public getSignature(isDetailed?: boolean): string {
+ if (_.isEmpty(this._dataItem.name) || !isDetailed) {
+ return this.getSignatureType();
+ }
+ const name = this.getDataItem().name;
+ const lastIndexOfScopeDelimiter = name.lastIndexOf('.');
+ const isScopedName = !_.isUndefined(lastIndexOfScopeDelimiter) && lastIndexOfScopeDelimiter > 0;
+ const shortName = isScopedName ? name.substr((lastIndexOfScopeDelimiter as number) + 1) : name;
+ const detailedSignature = `${shortName} ${this.getSignatureType()}`;
+ return detailedSignature;
+ }
+
public abstract generateCalldataBlock(value: any, parentBlock?: CalldataBlock): CalldataBlock;
public abstract generateValue(calldata: RawCalldata, rules: DecodingRules): any;
- public abstract getSignature(): string;
+ public abstract getSignatureType(): string;
public abstract isStatic(): boolean;
}
diff --git a/packages/utils/src/abi_encoder/abstract_data_types/types/set.ts b/packages/utils/src/abi_encoder/abstract_data_types/types/set.ts
index 00059a4b6..2c6c4b0f6 100644
--- a/packages/utils/src/abi_encoder/abstract_data_types/types/set.ts
+++ b/packages/utils/src/abi_encoder/abstract_data_types/types/set.ts
@@ -1,3 +1,4 @@
+import { ObjectMap } from '@0x/types';
import { DataItem } from 'ethereum-types';
import * as ethUtil from 'ethereumjs-util';
import * as _ from 'lodash';
@@ -134,31 +135,26 @@ export abstract class AbstractSetDataType extends DataType {
const block = new SetCalldataBlock(this.getDataItem().name, this.getSignature(), parentName);
// Create blocks for members of set.
const memberCalldataBlocks: CalldataBlock[] = [];
- const childMap = _.cloneDeep(this._memberIndexByName);
- _.forOwn(obj, (value: any, key: string) => {
- if (!(key in childMap)) {
+ _.forEach(this._memberIndexByName, (memberIndex: number, memberName: string) => {
+ if (!(memberName in obj)) {
throw new Error(
- `Could not assign tuple to object: unrecognized key '${key}' in object ${this.getDataItem().name}`,
+ `Could not assign tuple to object: missing key '${memberName}' in object ${JSON.stringify(obj)}`,
);
}
- const memberBlock = this._members[this._memberIndexByName[key]].generateCalldataBlock(value, block);
+ const memberValue: any = (obj as ObjectMap<any>)[memberName];
+ const memberBlock = this._members[memberIndex].generateCalldataBlock(memberValue, block);
memberCalldataBlocks.push(memberBlock);
- delete childMap[key];
});
- // Sanity check that all members have been included.
- if (Object.keys(childMap).length !== 0) {
- throw new Error(`Could not assign tuple to object: missing keys ${Object.keys(childMap)}`);
- }
// Associate member blocks with Set block.
block.setMembers(memberCalldataBlocks);
return block;
}
- protected _computeSignatureOfMembers(): string {
+ protected _computeSignatureOfMembers(isDetailed?: boolean): string {
// Compute signature of members
let signature = `(`;
_.each(this._members, (member: DataType, i: number) => {
- signature += member.getSignature();
+ signature += member.getSignature(isDetailed);
if (i < this._members.length - 1) {
signature += ',';
}
@@ -179,17 +175,27 @@ export abstract class AbstractSetDataType extends DataType {
// Create one member for each component of `dataItem`
const members: DataType[] = [];
const memberIndexByName: MemberIndexByName = {};
+ const memberNames: string[] = [];
_.each(dataItem.components, (memberItem: DataItem) => {
+ // If a component with `name` already exists then
+ // rename to `name_nameIdx` to avoid naming conflicts.
+ let memberName = memberItem.name;
+ let nameIdx = 0;
+ while (_.includes(memberNames, memberName) || _.isEmpty(memberName)) {
+ nameIdx++;
+ memberName = `${memberItem.name}_${nameIdx}`;
+ }
+ memberNames.push(memberName);
const childDataItem: DataItem = {
type: memberItem.type,
- name: `${dataItem.name}.${memberItem.name}`,
+ name: `${dataItem.name}.${memberName}`,
};
const components = memberItem.components;
if (!_.isUndefined(components)) {
childDataItem.components = components;
}
const child = this.getFactory().create(childDataItem, this);
- memberIndexByName[memberItem.name] = members.length;
+ memberIndexByName[memberName] = members.length;
members.push(child);
});
return [members, memberIndexByName];
diff --git a/packages/utils/src/abi_encoder/evm_data_type_factory.ts b/packages/utils/src/abi_encoder/evm_data_type_factory.ts
index 4cc124e0a..268649148 100644
--- a/packages/utils/src/abi_encoder/evm_data_type_factory.ts
+++ b/packages/utils/src/abi_encoder/evm_data_type_factory.ts
@@ -2,6 +2,8 @@
import { DataItem, MethodAbi } from 'ethereum-types';
import * as _ from 'lodash';
+import { generateDataItemsFromSignature } from './utils/signature_parser';
+
import { DataType } from './abstract_data_types/data_type';
import { DataTypeFactory } from './abstract_data_types/interfaces';
import { AddressDataType } from './evm_data_types/address';
@@ -129,4 +131,35 @@ export class EvmDataTypeFactory implements DataTypeFactory {
private constructor() {}
}
+
+/**
+ * Convenience function for creating a DataType from different inputs.
+ * @param input A single or set of DataItem or a DataType signature.
+ * A signature in the form of '<type>' is interpreted as a `DataItem`
+ * For example, 'string' is interpreted as {type: 'string'}
+ * A signature in the form '(<type1>, <type2>, ..., <typen>)' is interpreted as `DataItem[]`
+ * For eaxmple, '(string, uint256)' is interpreted as [{type: 'string'}, {type: 'uint256'}]
+ * @return DataType corresponding to input.
+ */
+export function create(input: DataItem | DataItem[] | string): DataType {
+ // Handle different types of input
+ const isSignature = typeof input === 'string';
+ const isTupleSignature = isSignature && (input as string).startsWith('(');
+ const shouldParseAsTuple = isTupleSignature || _.isArray(input);
+ // Create input `dataItem`
+ let dataItem: DataItem;
+ if (shouldParseAsTuple) {
+ const dataItems = isSignature ? generateDataItemsFromSignature(input as string) : (input as DataItem[]);
+ dataItem = {
+ name: '',
+ type: 'tuple',
+ components: dataItems,
+ };
+ } else {
+ dataItem = isSignature ? generateDataItemsFromSignature(input as string)[0] : (input as DataItem);
+ }
+ // Create data type
+ const dataType = EvmDataTypeFactory.getInstance().create(dataItem);
+ return dataType;
+}
/* tslint:enable no-construct */
diff --git a/packages/utils/src/abi_encoder/evm_data_types/address.ts b/packages/utils/src/abi_encoder/evm_data_types/address.ts
index 88846b1fa..2278830eb 100644
--- a/packages/utils/src/abi_encoder/evm_data_types/address.ts
+++ b/packages/utils/src/abi_encoder/evm_data_types/address.ts
@@ -10,8 +10,8 @@ import { constants } from '../utils/constants';
export class AddressDataType extends AbstractBlobDataType {
private static readonly _SIZE_KNOWN_AT_COMPILE_TIME: boolean = true;
private static readonly _ADDRESS_SIZE_IN_BYTES = 20;
- private static readonly _DECODED_ADDRESS_OFFSET_IN_BYTES = constants.EVM_WORD_WIDTH_IN_BYTES -
- AddressDataType._ADDRESS_SIZE_IN_BYTES;
+ private static readonly _DECODED_ADDRESS_OFFSET_IN_BYTES =
+ constants.EVM_WORD_WIDTH_IN_BYTES - AddressDataType._ADDRESS_SIZE_IN_BYTES;
public static matchType(type: string): boolean {
return type === SolidityTypes.Address;
@@ -39,10 +39,11 @@ export class AddressDataType extends AbstractBlobDataType {
const valueBufPadded = calldata.popWord();
const valueBuf = valueBufPadded.slice(AddressDataType._DECODED_ADDRESS_OFFSET_IN_BYTES);
const value = ethUtil.bufferToHex(valueBuf);
- return value;
+ const valueLowercase = _.toLower(value);
+ return valueLowercase;
}
- public getSignature(): string {
+ public getSignatureType(): string {
return SolidityTypes.Address;
}
/* tslint:enable prefer-function-over-method */
diff --git a/packages/utils/src/abi_encoder/evm_data_types/array.ts b/packages/utils/src/abi_encoder/evm_data_types/array.ts
index 7595cb667..d9607f47e 100644
--- a/packages/utils/src/abi_encoder/evm_data_types/array.ts
+++ b/packages/utils/src/abi_encoder/evm_data_types/array.ts
@@ -7,7 +7,6 @@ import { constants } from '../utils/constants';
export class ArrayDataType extends AbstractSetDataType {
private static readonly _MATCHER = RegExp('^(.+)\\[([0-9]*)\\]$');
- private readonly _arraySignature: string;
private readonly _elementType: string;
public static matchType(type: string): boolean {
@@ -35,25 +34,36 @@ export class ArrayDataType extends AbstractSetDataType {
super(dataItem, dataTypeFactory, isArray, arrayLength, arrayElementType);
// Set array properties
this._elementType = arrayElementType;
- this._arraySignature = this._computeSignature();
}
- public getSignature(): string {
- return this._arraySignature;
+ public getSignatureType(): string {
+ return this._computeSignature(false);
}
- private _computeSignature(): string {
+ public getSignature(isDetailed?: boolean): string {
+ if (_.isEmpty(this.getDataItem().name) || !isDetailed) {
+ return this.getSignatureType();
+ }
+ const name = this.getDataItem().name;
+ const lastIndexOfScopeDelimiter = name.lastIndexOf('.');
+ const isScopedName = !_.isUndefined(lastIndexOfScopeDelimiter) && lastIndexOfScopeDelimiter > 0;
+ const shortName = isScopedName ? name.substr((lastIndexOfScopeDelimiter as number) + 1) : name;
+ const detailedSignature = `${shortName} ${this._computeSignature(isDetailed)}`;
+ return detailedSignature;
+ }
+
+ private _computeSignature(isDetailed?: boolean): string {
// Compute signature for a single array element
const elementDataItem: DataItem = {
type: this._elementType,
- name: 'N/A',
+ name: '',
};
const elementComponents = this.getDataItem().components;
if (!_.isUndefined(elementComponents)) {
elementDataItem.components = elementComponents;
}
const elementDataType = this.getFactory().create(elementDataItem);
- const elementSignature = elementDataType.getSignature();
+ const elementSignature = elementDataType.getSignature(isDetailed);
// Construct signature for array of type `element`
if (_.isUndefined(this._arrayLength)) {
return `${elementSignature}[]`;
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 d713d5a94..23298bc88 100644
--- a/packages/utils/src/abi_encoder/evm_data_types/bool.ts
+++ b/packages/utils/src/abi_encoder/evm_data_types/bool.ts
@@ -37,16 +37,16 @@ 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;
}
- public getSignature(): string {
+ public getSignatureType(): string {
return SolidityTypes.Bool;
}
/* tslint:enable prefer-function-over-method */
diff --git a/packages/utils/src/abi_encoder/evm_data_types/dynamic_bytes.ts b/packages/utils/src/abi_encoder/evm_data_types/dynamic_bytes.ts
index 5277efd6c..fa38b63c0 100644
--- a/packages/utils/src/abi_encoder/evm_data_types/dynamic_bytes.ts
+++ b/packages/utils/src/abi_encoder/evm_data_types/dynamic_bytes.ts
@@ -65,7 +65,7 @@ export class DynamicBytesDataType extends AbstractBlobDataType {
return value;
}
- public getSignature(): string {
+ public getSignatureType(): string {
return SolidityTypes.Bytes;
}
/* tslint:enable prefer-function-over-method */
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 f1dcf5ea1..f8be1f778 100644
--- a/packages/utils/src/abi_encoder/evm_data_types/int.ts
+++ b/packages/utils/src/abi_encoder/evm_data_types/int.ts
@@ -10,7 +10,7 @@ import * as EncoderMath from '../utils/math';
export class IntDataType extends AbstractBlobDataType {
private static readonly _MATCHER = RegExp(
- '^int(8|16|24|32|40|48|56|64|72|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256){0,1}$',
+ '^int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256){0,1}$',
);
private static readonly _SIZE_KNOWN_AT_COMPILE_TIME: boolean = true;
private static readonly _MAX_WIDTH: number = 256;
@@ -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 {
@@ -47,13 +47,17 @@ export class IntDataType extends AbstractBlobDataType {
return encodedValue;
}
- public decodeValue(calldata: RawCalldata): BigNumber {
+ public decodeValue(calldata: RawCalldata): BigNumber | number {
const valueBuf = calldata.popWord();
const value = EncoderMath.safeDecodeNumericValue(valueBuf, this._minValue, this._maxValue);
+ const numberOfBytesInUint8 = 8;
+ if (this._width === numberOfBytesInUint8) {
+ return value.toNumber();
+ }
return value;
}
- public getSignature(): string {
+ public getSignatureType(): string {
return `${SolidityTypes.Int}${this._width}`;
}
}
diff --git a/packages/utils/src/abi_encoder/evm_data_types/method.ts b/packages/utils/src/abi_encoder/evm_data_types/method.ts
index b1cd1377f..c852a0fdf 100644
--- a/packages/utils/src/abi_encoder/evm_data_types/method.ts
+++ b/packages/utils/src/abi_encoder/evm_data_types/method.ts
@@ -44,7 +44,20 @@ export class MethodDataType extends AbstractSetDataType {
return returnValues;
}
- public getSignature(): string {
+ public strictDecodeReturnValue<T>(returndata: string, rules?: DecodingRules): T {
+ const returnValues = this._returnDataType.decode(returndata, rules);
+ const returnValuesAsArray: any = _.isObject(returnValues) ? _.values(returnValues) : [returnValues];
+ switch (returnValuesAsArray.length) {
+ case 0:
+ return undefined as any;
+ case 1:
+ return returnValuesAsArray[0];
+ default:
+ return returnValuesAsArray;
+ }
+ }
+
+ public getSignatureType(): string {
return this._methodSignature;
}
diff --git a/packages/utils/src/abi_encoder/evm_data_types/pointer.ts b/packages/utils/src/abi_encoder/evm_data_types/pointer.ts
index 389e75927..250db7c64 100644
--- a/packages/utils/src/abi_encoder/evm_data_types/pointer.ts
+++ b/packages/utils/src/abi_encoder/evm_data_types/pointer.ts
@@ -11,7 +11,11 @@ export class PointerDataType extends AbstractPointerDataType {
super(dataItem, dataTypeFactory, destDataType, parentDataType);
}
- public getSignature(): string {
- return this._destination.getSignature();
+ public getSignatureType(): string {
+ return this._destination.getSignature(false);
+ }
+
+ public getSignature(isDetailed?: boolean): string {
+ return this._destination.getSignature(isDetailed);
}
}
diff --git a/packages/utils/src/abi_encoder/evm_data_types/static_bytes.ts b/packages/utils/src/abi_encoder/evm_data_types/static_bytes.ts
index 2e371c505..cbf1957d7 100644
--- a/packages/utils/src/abi_encoder/evm_data_types/static_bytes.ts
+++ b/packages/utils/src/abi_encoder/evm_data_types/static_bytes.ts
@@ -36,7 +36,7 @@ export class StaticBytesDataType extends AbstractBlobDataType {
this._width = StaticBytesDataType._decodeWidthFromType(dataItem.type);
}
- public getSignature(): string {
+ public getSignatureType(): string {
// Note that `byte` reduces to `bytes1`
return `${SolidityTypes.Bytes}${this._width}`;
}
diff --git a/packages/utils/src/abi_encoder/evm_data_types/string.ts b/packages/utils/src/abi_encoder/evm_data_types/string.ts
index 91a72ad3f..97ac46442 100644
--- a/packages/utils/src/abi_encoder/evm_data_types/string.ts
+++ b/packages/utils/src/abi_encoder/evm_data_types/string.ts
@@ -52,7 +52,7 @@ export class StringDataType extends AbstractBlobDataType {
return value;
}
- public getSignature(): string {
+ public getSignatureType(): string {
return SolidityTypes.String;
}
/* tslint:enable prefer-function-over-method */
diff --git a/packages/utils/src/abi_encoder/evm_data_types/tuple.ts b/packages/utils/src/abi_encoder/evm_data_types/tuple.ts
index 31593c882..5000c85e8 100644
--- a/packages/utils/src/abi_encoder/evm_data_types/tuple.ts
+++ b/packages/utils/src/abi_encoder/evm_data_types/tuple.ts
@@ -1,11 +1,10 @@
import { DataItem, SolidityTypes } from 'ethereum-types';
+import * as _ from 'lodash';
import { DataTypeFactory } from '../abstract_data_types/interfaces';
import { AbstractSetDataType } from '../abstract_data_types/types/set';
export class TupleDataType extends AbstractSetDataType {
- private readonly _signature: string;
-
public static matchType(type: string): boolean {
return type === SolidityTypes.Tuple;
}
@@ -15,10 +14,21 @@ export class TupleDataType extends AbstractSetDataType {
if (!TupleDataType.matchType(dataItem.type)) {
throw new Error(`Tried to instantiate Tuple with bad input: ${dataItem}`);
}
- this._signature = this._computeSignatureOfMembers();
}
- public getSignature(): string {
- return this._signature;
+ public getSignatureType(): string {
+ return this._computeSignatureOfMembers(false);
+ }
+
+ public getSignature(isDetailed?: boolean): string {
+ if (_.isEmpty(this.getDataItem().name) || !isDetailed) {
+ return this.getSignatureType();
+ }
+ const name = this.getDataItem().name;
+ const lastIndexOfScopeDelimiter = name.lastIndexOf('.');
+ const isScopedName = !_.isUndefined(lastIndexOfScopeDelimiter) && lastIndexOfScopeDelimiter > 0;
+ const shortName = isScopedName ? name.substr((lastIndexOfScopeDelimiter as number) + 1) : name;
+ const detailedSignature = `${shortName} ${this._computeSignatureOfMembers(isDetailed)}`;
+ return detailedSignature;
}
}
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 5180f0cf3..a82aa789e 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 {
@@ -46,13 +46,17 @@ export class UIntDataType extends AbstractBlobDataType {
return encodedValue;
}
- public decodeValue(calldata: RawCalldata): BigNumber {
+ public decodeValue(calldata: RawCalldata): BigNumber | number {
const valueBuf = calldata.popWord();
const value = EncoderMath.safeDecodeNumericValue(valueBuf, UIntDataType._MIN_VALUE, this._maxValue);
+ const numberOfBytesInUint8 = 8;
+ if (this._width === numberOfBytesInUint8) {
+ return value.toNumber();
+ }
return value;
}
- public getSignature(): string {
+ public getSignatureType(): string {
return `${SolidityTypes.Uint}${this._width}`;
}
}
diff --git a/packages/utils/src/abi_encoder/index.ts b/packages/utils/src/abi_encoder/index.ts
index baf844ac6..cfacfe075 100644
--- a/packages/utils/src/abi_encoder/index.ts
+++ b/packages/utils/src/abi_encoder/index.ts
@@ -11,4 +11,6 @@ export {
String,
Tuple,
UInt,
+ create,
} from './evm_data_type_factory';
+export { DataType } from './abstract_data_types/data_type';
diff --git a/packages/utils/src/abi_encoder/utils/constants.ts b/packages/utils/src/abi_encoder/utils/constants.ts
index 36de2dd4f..fc586f295 100644
--- a/packages/utils/src/abi_encoder/utils/constants.ts
+++ b/packages/utils/src/abi_encoder/utils/constants.ts
@@ -11,7 +11,7 @@ export const constants = {
HEX_SELECTOR_BYTE_OFFSET_IN_CALLDATA: 0,
// Disable no-object-literal-type-assertion so we can enforce cast
/* tslint:disable no-object-literal-type-assertion */
- DEFAULT_DECODING_RULES: { shouldConvertStructsToObjects: false } as DecodingRules,
+ DEFAULT_DECODING_RULES: { shouldConvertStructsToObjects: true } as DecodingRules,
DEFAULT_ENCODING_RULES: { shouldOptimize: true, shouldAnnotate: false } as EncodingRules,
/* tslint:enable no-object-literal-type-assertion */
};
diff --git a/packages/utils/src/abi_encoder/utils/math.ts b/packages/utils/src/abi_encoder/utils/math.ts
index d84983c5b..a2a79e2a8 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(
@@ -10,10 +10,12 @@ 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}`);
+ } else if (value.isNaN()) {
+ throw new Error(`Tried to assign NaN value`);
}
}
function bigNumberToPaddedBuffer(value: BigNumber): Buffer {
@@ -30,7 +32,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 +76,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/utils/src/abi_encoder/utils/signature_parser.ts b/packages/utils/src/abi_encoder/utils/signature_parser.ts
new file mode 100644
index 000000000..315784cea
--- /dev/null
+++ b/packages/utils/src/abi_encoder/utils/signature_parser.ts
@@ -0,0 +1,101 @@
+import { DataItem } from 'ethereum-types';
+import * as _ from 'lodash';
+
+/**
+ * Returns an array of DataItem's corresponding to the input signature.
+ * A signature can be in two forms: '<DataItem.type>' or '(<DataItem1.type>, <DataItem2.type>, ...)
+ * An example of the first form would be 'address' or 'uint256'
+ * An example of the second form would be '(address, uint256)'
+ * Signatures can also include a name field, for example: 'foo address' or '(foo address, bar uint256)'
+ * @param signature of input DataItems
+ * @return DataItems derived from input signature
+ */
+export function generateDataItemsFromSignature(signature: string): DataItem[] {
+ let trimmedSignature = signature;
+ if (signature.startsWith('(')) {
+ if (!signature.endsWith(')')) {
+ throw new Error(`Failed to generate data item. Must end with ')'`);
+ }
+ trimmedSignature = signature.substr(1, signature.length - 2);
+ }
+ trimmedSignature += ',';
+ let isCurrTokenArray = false;
+ let currTokenArrayModifier = '';
+ let isParsingArrayModifier = false;
+ let currToken = '';
+ let parenCount = 0;
+ let currTokenName = '';
+ const dataItems: DataItem[] = [];
+ for (const char of trimmedSignature) {
+ // Tokenize the type string while keeping track of parentheses.
+ switch (char) {
+ case '(':
+ parenCount += 1;
+ currToken += char;
+ break;
+ case ')':
+ parenCount -= 1;
+ currToken += char;
+ break;
+ case '[':
+ if (parenCount === 0) {
+ isParsingArrayModifier = true;
+ isCurrTokenArray = true;
+ currTokenArrayModifier += '[';
+ } else {
+ currToken += char;
+ }
+ break;
+ case ']':
+ if (parenCount === 0) {
+ isParsingArrayModifier = false;
+ currTokenArrayModifier += ']';
+ } else {
+ currToken += char;
+ }
+ break;
+ case ' ':
+ if (parenCount === 0) {
+ currTokenName = currToken;
+ currToken = '';
+ } else {
+ currToken += char;
+ }
+ break;
+ case ',':
+ if (parenCount === 0) {
+ // Generate new DataItem from token
+ const components = currToken.startsWith('(') ? generateDataItemsFromSignature(currToken) : [];
+ const isTuple = !_.isEmpty(components);
+ const dataItem: DataItem = { name: currTokenName, type: '' };
+ if (isTuple) {
+ dataItem.type = 'tuple';
+ dataItem.components = components;
+ } else {
+ dataItem.type = currToken;
+ }
+ if (isCurrTokenArray) {
+ dataItem.type += currTokenArrayModifier;
+ }
+ dataItems.push(dataItem);
+ // reset token state
+ currTokenName = '';
+ currToken = '';
+ isCurrTokenArray = false;
+ currTokenArrayModifier = '';
+ break;
+ } else {
+ currToken += char;
+ break;
+ }
+ default:
+ if (isParsingArrayModifier) {
+ currTokenArrayModifier += char;
+ } else {
+ currToken += char;
+ }
+ break;
+ }
+ }
+ return dataItems;
+}
diff --git a/packages/utils/src/sign_typed_data_utils.ts b/packages/utils/src/sign_typed_data_utils.ts
index 6963b9084..adb66622d 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/utils/test/abi_encoder/evm_data_types_test.ts b/packages/utils/test/abi_encoder/evm_data_types_test.ts
index 55d582d10..4814ce28b 100644
--- a/packages/utils/test/abi_encoder/evm_data_types_test.ts
+++ b/packages/utils/test/abi_encoder/evm_data_types_test.ts
@@ -26,6 +26,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Dynamic size; Static elements', async () => {
// Create DataType object
@@ -41,6 +45,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Fixed size; Dynamic elements', async () => {
// Create DataType object
@@ -56,6 +64,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Dynamic size; Dynamic elements', async () => {
// Create DataType object
@@ -71,6 +83,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Dynamic Size; Multidimensional; Dynamic Elements', async () => {
// Create DataType object
@@ -89,6 +105,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Dynamic Size; Multidimensional; Static Elements', async () => {
// Create DataType object
@@ -107,6 +127,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Static Size; Multidimensional; Static Elements', async () => {
// Create DataType object
@@ -124,6 +148,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Static Size; Multidimensional; Dynamic Elements', async () => {
// Create DataType object
@@ -141,6 +169,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Static size; Too Few Elements', async () => {
// Create DataType object
@@ -173,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');
});
});
@@ -197,6 +229,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
const decodingRules: AbiEncoder.DecodingRules = { shouldConvertStructsToObjects: true };
const decodedArgs = dataType.decode(encodedArgs, decodingRules);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args, encodingRules);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Dynamic elements only', async () => {
// Create DataType object
@@ -217,6 +253,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
const decodingRules: AbiEncoder.DecodingRules = { shouldConvertStructsToObjects: true };
const decodedArgs = dataType.decode(encodedArgs, decodingRules);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Nested Static Array', async () => {
// Create DataType object
@@ -237,6 +277,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
const decodingRules: AbiEncoder.DecodingRules = { shouldConvertStructsToObjects: true };
const decodedArgs = dataType.decode(encodedArgs, decodingRules);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Nested Dynamic Array', async () => {
// Create DataType object
@@ -257,6 +301,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
const decodingRules: AbiEncoder.DecodingRules = { shouldConvertStructsToObjects: true };
const decodedArgs = dataType.decode(encodedArgs, decodingRules);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Nested Static Multidimensional Array', async () => {
// Create DataType object
@@ -279,6 +327,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
const decodingRules: AbiEncoder.DecodingRules = { shouldConvertStructsToObjects: true };
const decodedArgs = dataType.decode(encodedArgs, decodingRules);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Nested Dynamic Multidimensional Array', async () => {
// Create DataType object
@@ -301,6 +353,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
const decodingRules: AbiEncoder.DecodingRules = { shouldConvertStructsToObjects: true };
const decodedArgs = dataType.decode(encodedArgs, decodingRules);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Static and dynamic elements mixed', async () => {
// Create DataType object
@@ -331,6 +387,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
const decodingRules: AbiEncoder.DecodingRules = { shouldConvertStructsToObjects: true };
const decodedArgs = dataType.decode(encodedArgs, decodingRules);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Missing Key', async () => {
// Create DataType object
@@ -345,22 +405,7 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Encode Args and validate result
expect(() => {
dataType.encode(args, encodingRules);
- }).to.throw('Could not assign tuple to object: missing keys field_2');
- });
- it('Bad Key', async () => {
- // Create DataType object
- const testDataItem = {
- name: 'Tuple',
- type: 'tuple',
- components: [{ name: 'field_1', type: 'int32' }, { name: 'field_2', type: 'bool' }],
- };
- const dataType = new AbiEncoder.Tuple(testDataItem);
- // Construct args to be encoded
- const args = { unknown_field: new BigNumber(-5) };
- // Encode Args and validate result
- expect(() => {
- dataType.encode(args, encodingRules);
- }).to.throw("Could not assign tuple to object: unrecognized key 'unknown_field' in object Tuple");
+ }).to.throw('Could not assign tuple to object: missing key \'field_2\' in object {"field_1":"-5"}');
});
});
@@ -378,6 +423,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Invalid Address - input is not valid hex', async () => {
// Create DataType object
@@ -417,6 +466,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('False', async () => {
// Create DataType object
@@ -431,6 +484,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
});
@@ -455,6 +512,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Int256 - Negative Base Case', async () => {
// Create DataType object
@@ -469,6 +530,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Int256 - Positive Value', async () => {
// Create DataType object
@@ -483,6 +548,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Int256 - Negative Value', async () => {
// Create DataType object
@@ -497,6 +566,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Int256 - Value too large', async () => {
// Create DataType object
@@ -533,6 +606,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Int32 - Negative Base Case', async () => {
// Create DataType object
@@ -547,6 +624,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Int32 - Positive Value', async () => {
// Create DataType object
@@ -561,6 +642,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Int32 - Negative Value', async () => {
// Create DataType object
@@ -575,6 +660,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Int32 - Value too large', async () => {
// Create DataType object
@@ -621,6 +710,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('UInt256 - Positive Value', async () => {
// Create DataType object
@@ -635,6 +728,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('UInt256 - Zero Value', async () => {
// Create DataType object
@@ -649,6 +746,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('UInt256 - Value too large', async () => {
// Create DataType object
@@ -685,6 +786,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('UInt32 - Positive Value', async () => {
// Create DataType object
@@ -699,6 +804,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('UInt32 - Zero Value', async () => {
// Create DataType object
@@ -713,6 +822,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('UInt32 - Value too large', async () => {
// Create DataType object
@@ -752,6 +865,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Single Byte (bytes1)', async () => {
// Create DataType object
@@ -766,6 +883,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('4 Bytes (bytes4)', async () => {
// Create DataType object
@@ -780,6 +901,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('4 Bytes (bytes4); Encoder must pad input', async () => {
// Create DataType object
@@ -796,6 +921,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
const decodedArgs = dataType.decode(encodedArgs);
const paddedArgs = '0x1a180000';
expect(decodedArgs).to.be.deep.equal(paddedArgs);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('32 Bytes (bytes32)', async () => {
// Create DataType object
@@ -810,6 +939,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('32 Bytes (bytes32); Encoder must pad input', async () => {
// Create DataType object
@@ -826,6 +959,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
const decodedArgs = dataType.decode(encodedArgs);
const paddedArgs = '0x1a18bf6100000000000000000000000000000000000000000000000000000000';
expect(decodedArgs).to.be.deep.equal(paddedArgs);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Should throw when pass in too many bytes (bytes4)', async () => {
// Create DataType object
@@ -893,6 +1030,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Spans multiple EVM words', async () => {
// Create DataType object
@@ -910,6 +1051,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Input as Buffer', async () => {
// Create DataType object
@@ -927,6 +1072,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Should throw when pass in bad hex (no 0x prefix)', async () => {
// Create DataType object
@@ -968,6 +1117,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('Spans multiple EVM words', async () => {
// Create DataType object
@@ -985,6 +1138,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
it('String that begins with 0x prefix', async () => {
// Create DataType object
@@ -1002,6 +1159,10 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Decode Encoded Args and validate result
const decodedArgs = dataType.decode(encodedArgs);
expect(decodedArgs).to.be.deep.equal(args);
+ // Validate signature
+ const dataTypeFromSignature = AbiEncoder.create(dataType.getSignature(true));
+ const argsEncodedFromSignature = dataTypeFromSignature.encode(args);
+ expect(argsEncodedFromSignature).to.be.deep.equal(expectedEncodedArgs);
});
});
});
diff --git a/packages/utils/test/abi_encoder/methods_test.ts b/packages/utils/test/abi_encoder/methods_test.ts
index a0525967e..d8045fece 100644
--- a/packages/utils/test/abi_encoder/methods_test.ts
+++ b/packages/utils/test/abi_encoder/methods_test.ts
@@ -21,7 +21,8 @@ describe('ABI Encoder: Method Encoding / Decoding', () => {
'0x09f2b0c30000000000000000000000000000000000000000000000000000000000000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff560000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000000015600000000000000000000000000000000000000000000000000000000000000';
expect(calldata).to.be.equal(expectedCalldata);
// Validate decoding
- const decodedValue = method.decode(calldata);
+ const decodingRules = { shouldConvertStructsToObjects: false };
+ const decodedValue = method.decode(calldata, decodingRules);
expect(decodedValue).to.be.deep.equal(args);
});
it('Array of Static Tuples (Array has defined length)', async () => {
@@ -40,7 +41,8 @@ describe('ABI Encoder: Method Encoding / Decoding', () => {
'0x9eb20969000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000d000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000f0000000000000000000000000000000000000000000000000000000000000010';
expect(calldata).to.be.equal(expectedCalldata);
// Validate decoding
- const decodedValue = method.decode(calldata);
+ const decodingRules = { shouldConvertStructsToObjects: false };
+ const decodedValue = method.decode(calldata, decodingRules);
expect(decodedValue).to.be.deep.equal(args);
});
it('Array of Static Tuples (Array has dynamic length)', async () => {
@@ -59,7 +61,8 @@ describe('ABI Encoder: Method Encoding / Decoding', () => {
'0x63275d6e00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000d000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000f0000000000000000000000000000000000000000000000000000000000000010';
expect(calldata).to.be.equal(expectedCalldata);
// Validate decoding
- const decodedValue = method.decode(calldata);
+ const decodingRules = { shouldConvertStructsToObjects: false };
+ const decodedValue = method.decode(calldata, decodingRules);
expect(decodedValue).to.be.deep.equal(args);
});
it('Array of Dynamic Tuples (Array has defined length)', async () => {
@@ -78,7 +81,8 @@ describe('ABI Encoder: Method Encoding / Decoding', () => {
'0xdeedb00f00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000003800000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000132000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000013400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000138000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000023130000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000023132000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000023134000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000023136000000000000000000000000000000000000000000000000000000000000';
expect(calldata).to.be.equal(expectedCalldata);
// Validate decoding
- const decodedValue = method.decode(calldata);
+ const decodingRules = { shouldConvertStructsToObjects: false };
+ const decodedValue = method.decode(calldata, decodingRules);
expect(decodedValue).to.be.deep.equal(args);
});
it('Array of Dynamic Tuples (Array has dynamic length)', async () => {
@@ -97,7 +101,8 @@ describe('ABI Encoder: Method Encoding / Decoding', () => {
'0x60c847fb000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000003800000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000132000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000013400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000138000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000023130000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000023132000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000023134000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000023136000000000000000000000000000000000000000000000000000000000000';
expect(calldata).to.be.equal(expectedCalldata);
// Validate decoding
- const decodedValue = method.decode(calldata);
+ const decodingRules = { shouldConvertStructsToObjects: false };
+ const decodedValue = method.decode(calldata, decodingRules);
expect(decodedValue).to.be.deep.equal(args);
});
it('Multidimensional Arrays / Static Members', async () => {
@@ -108,19 +113,16 @@ describe('ABI Encoder: Method Encoding / Decoding', () => {
const args = [];
const argsLength = 8;
for (let i = 0; i < argsLength; ++i) {
- args.push([
- [[new BigNumber(++value), new BigNumber(++value)], [new BigNumber(++value), new BigNumber(++value)]],
- [[new BigNumber(++value), new BigNumber(++value)], [new BigNumber(++value), new BigNumber(++value)]],
- ]);
+ args.push([[[++value, ++value], [++value, ++value]], [[++value, ++value], [++value, ++value]]]);
}
const calldata = method.encode(args, encodingRules);
// Validate calldata
const expectedCalldata =
'0xc2f47d6f00000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000009600000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000000d400000000000000000000000000000000000000000000000000000000000000e600000000000000000000000000000000000000000000000000000000000000039000000000000000000000000000000000000000000000000000000000000003a000000000000000000000000000000000000000000000000000000000000003b000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000000000000000000000000000000000000000003d000000000000000000000000000000000000000000000000000000000000003e000000000000000000000000000000000000000000000000000000000000003f00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000d000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000f0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000130000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001700000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000019000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001b000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001d000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000001f000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000210000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000230000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000025000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000027000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000029000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002b000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002d000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000002f0000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003100000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000033000000000000000000000000000000000000000000000000000000000000003400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000035000000000000000000000000000000000000000000000000000000000000003600000000000000000000000000000000000000000000000000000000000000370000000000000000000000000000000000000000000000000000000000000038';
expect(calldata).to.be.equal(expectedCalldata);
- expect(calldata).to.be.equal(expectedCalldata);
// Validate decoding
- const decodedValue = method.decode(calldata);
+ const decodingRules = { shouldConvertStructsToObjects: false };
+ const decodedValue = method.decode(calldata, decodingRules);
expect(decodedValue).to.be.deep.equal(args);
});
it('Multidimensional Arrays / Dynamic Members', async () => {
@@ -148,7 +150,8 @@ describe('ABI Encoder: Method Encoding / Decoding', () => {
'0x81534ebd0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000052000000000000000000000000000000000000000000000000000000000000009a00000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000131000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000013300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000134000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000137000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000139000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002313000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000023131000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000231320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000002313300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000023134000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000231350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002313600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000231370000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002313800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000023139000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000232300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000023231000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000232320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000002323300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000023234000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000232350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002323600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000232370000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002323800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000002323900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000023330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000002333100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000023332000000000000000000000000000000000000000000000000000000000000';
expect(calldata).to.be.equal(expectedCalldata);
// Validate decoding
- const decodedValue = method.decode(calldata);
+ const decodingRules = { shouldConvertStructsToObjects: false };
+ const decodedValue = method.decode(calldata, decodingRules);
expect(decodedValue).to.be.deep.equal(args);
});
it('Fixed Length Array / Dynamic Members', async () => {
@@ -161,7 +164,8 @@ describe('ABI Encoder: Method Encoding / Decoding', () => {
'0x243a6e6e0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000005427261766500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034e657700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005576f726c64000000000000000000000000000000000000000000000000000000';
expect(calldata).to.be.equal(expectedCalldata);
// Validate decoding
- const decodedValue = method.decode(calldata);
+ const decodingRules = { shouldConvertStructsToObjects: false };
+ const decodedValue = method.decode(calldata, decodingRules);
expect(decodedValue).to.be.deep.equal(args);
});
it('Fixed Length Array / Dynamic Members', async () => {
@@ -174,7 +178,8 @@ describe('ABI Encoder: Method Encoding / Decoding', () => {
'0x243a6e6e0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000005427261766500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034e657700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005576f726c64000000000000000000000000000000000000000000000000000000';
expect(calldata).to.be.equal(expectedCalldata);
// Validate decoding
- const decodedValue = method.decode(calldata);
+ const decodingRules = { shouldConvertStructsToObjects: false };
+ const decodedValue = method.decode(calldata, decodingRules);
expect(decodedValue).to.be.deep.equal(args);
});
it('Unfixed Length Array / Dynamic Members ABI', async () => {
@@ -187,33 +192,40 @@ describe('ABI Encoder: Method Encoding / Decoding', () => {
'0x13e751a900000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000005427261766500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034e657700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005576f726c64000000000000000000000000000000000000000000000000000000';
expect(calldata).to.be.equal(expectedCalldata);
// Validate decoding
- const decodedValue = method.decode(calldata);
+ const decodingRules = { shouldConvertStructsToObjects: false };
+ const decodedValue = method.decode(calldata, decodingRules);
expect(decodedValue).to.be.deep.equal(args);
});
it('Unfixed Length Array / Static Members ABI', async () => {
// Generate calldata
const method = new AbiEncoder.Method(AbiSamples.dynamicArrayStaticMembersAbi);
- const args = [[new BigNumber(127), new BigNumber(14), new BigNumber(54)]];
+ // tslint:disable custom-no-magic-numbers
+ const args = [[127, 14, 54]];
+ // tslint:enable custom-no-magic-numbers
const calldata = method.encode(args, encodingRules);
// Validate calldata
const expectedCalldata =
'0x4fc8a83300000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000036';
expect(calldata).to.be.equal(expectedCalldata);
// Validate decoding
- const decodedValue = method.decode(calldata);
+ const decodingRules = { shouldConvertStructsToObjects: false };
+ const decodedValue = method.decode(calldata, decodingRules);
expect(decodedValue).to.be.deep.equal(args);
});
it('Fixed Length Array / Static Members ABI', async () => {
// Generate calldata
const method = new AbiEncoder.Method(AbiSamples.staticArrayAbi);
- const args = [[new BigNumber(127), new BigNumber(14), new BigNumber(54)]];
+ // tslint:disable custom-no-magic-numbers
+ const args = [[127, 14, 54]];
+ // tslint:enable custom-no-magic-numbers
const calldata = method.encode(args, encodingRules);
// Validate calldata
const expectedCalldata =
'0xf68ade72000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000036';
expect(calldata).to.be.equal(expectedCalldata);
// Validate decoding
- const decodedValue = method.decode(calldata);
+ const decodingRules = { shouldConvertStructsToObjects: false };
+ const decodedValue = method.decode(calldata, decodingRules);
expect(decodedValue).to.be.deep.equal(args);
});
it('Array ABI', async () => {
@@ -226,7 +238,8 @@ describe('ABI Encoder: Method Encoding / Decoding', () => {
'0x13e751a900000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000046669766500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000373697800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005736576656e000000000000000000000000000000000000000000000000000000';
expect(calldata).to.be.equal(expectedCalldata);
// Validate decoding
- const decodedValue = method.decode(calldata);
+ const decodingRules = { shouldConvertStructsToObjects: false };
+ const decodedValue = method.decode(calldata, decodingRules);
expect(decodedValue).to.be.deep.equal(args);
});
it('Static Tuple', async () => {
@@ -240,7 +253,8 @@ describe('ABI Encoder: Method Encoding / Decoding', () => {
'0xa9125e150000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000f0000000000000000000000000000000000000000000000000000000000000000';
expect(calldata).to.be.equal(expectedCalldata);
// Validate decoding
- const decodedValue = method.decode(calldata);
+ const decodingRules = { shouldConvertStructsToObjects: false };
+ const decodedValue = method.decode(calldata, decodingRules);
expect(decodedValue).to.be.deep.equal(args);
});
it('Dynamic Tuple (Array input)', async () => {
@@ -254,7 +268,8 @@ describe('ABI Encoder: Method Encoding / Decoding', () => {
'0x5b998f3500000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000046669766500000000000000000000000000000000000000000000000000000000';
expect(calldata).to.be.equal(expectedCalldata);
// Validate decoding
- const decodedValue = method.decode(calldata);
+ const decodingRules = { shouldConvertStructsToObjects: false };
+ const decodedValue = method.decode(calldata, decodingRules);
expect(decodedValue).to.be.deep.equal(args);
});
it('Dynamic Tuple (Object input)', async () => {
@@ -268,7 +283,8 @@ describe('ABI Encoder: Method Encoding / Decoding', () => {
'0x5b998f3500000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000046669766500000000000000000000000000000000000000000000000000000000';
expect(calldata).to.be.equal(expectedCalldata);
// Validate decoding
- const decodedValue = method.decode(calldata);
+ const decodingRules = { shouldConvertStructsToObjects: false };
+ const decodedValue = method.decode(calldata, decodingRules);
expect(decodedValue).to.be.deep.equal(args);
});
it('Large, Flat ABI', async () => {
@@ -291,13 +307,16 @@ describe('ABI Encoder: Method Encoding / Decoding', () => {
'0x312d4d42000000000000000000000000000000000000000000000000000000000f4d9feefffffffffffffffffffffffffffffffffffffffffffffffffffffffff0b26012000000000000000000000000000000000000000000000000000000000006a0444300000000000000000000000000000000000000000000000000000000000000000102030405060708091112131415161718192021222324252627282930313200000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f4980000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000003800010203040506070809111213141516171819202122232425262728293031320809111213141516171819202122232425262728293031320000000000000000000000000000000000000000000000000000000000000000000000000000002c4c6974746c65207065746572207069706572207069706564206120706970696e672070657070657220706f740000000000000000000000000000000000000000';
expect(calldata).to.be.equal(expectedCalldata);
// Validate decoding
- const decodedValue = method.decode(calldata);
+ const decodingRules = { shouldConvertStructsToObjects: false };
+ const decodedValue = method.decode(calldata, decodingRules);
expect(decodedValue).to.be.deep.equal(args);
});
it('Large, Nested ABI', async () => {
// Construct Calldata
const method = new AbiEncoder.Method(AbiSamples.largeNestedAbi);
- const someStaticArray = [new BigNumber(127), new BigNumber(14), new BigNumber(54)];
+ // tslint:disable custom-no-magic-numbers
+ const someStaticArray = [127, 14, 54];
+ // tslint:enable custom-no-magic-numbers
const someStaticArrayWithDynamicMembers = [
'the little piping piper piped a piping pipper papper',
'the kid knows how to write poems, what can I say -- I guess theres a lot I could say to try to fill this line with a lot of text.',
diff --git a/packages/utils/test/abi_encoder/optimizer_test.ts b/packages/utils/test/abi_encoder/optimizer_test.ts
index ee0654ec3..c2881f14c 100644
--- a/packages/utils/test/abi_encoder/optimizer_test.ts
+++ b/packages/utils/test/abi_encoder/optimizer_test.ts
@@ -23,7 +23,7 @@ describe('ABI Encoder: Optimized Method Encoding/Decoding', () => {
'0x7221063300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000096';
expect(optimizedCalldata).to.be.equal(expectedOptimizedCalldata);
// Validate decoding
- const decodedArgs = method.decode(optimizedCalldata);
+ const decodedArgs = method.decode(optimizedCalldata, { shouldConvertStructsToObjects: false });
expect(decodedArgs).to.be.deep.equal(args);
});
it('Duplicate Dynamic Arrays with Dynamic Elements', async () => {
@@ -38,7 +38,7 @@ describe('ABI Encoder: Optimized Method Encoding/Decoding', () => {
'0xbb4f12e300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000548656c6c6f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005576f726c64000000000000000000000000000000000000000000000000000000';
expect(optimizedCalldata).to.be.equal(expectedOptimizedCalldata);
// Validate decoding
- const decodedArgs = method.decode(optimizedCalldata);
+ const decodedArgs = method.decode(optimizedCalldata, { shouldConvertStructsToObjects: false });
expect(decodedArgs).to.be.deep.equal(args);
});
it('Duplicate Static Arrays with Static Elements (should not optimize)', async () => {
@@ -55,7 +55,7 @@ describe('ABI Encoder: Optimized Method Encoding/Decoding', () => {
const unoptimizedCalldata = method.encode(args);
expect(optimizedCalldata).to.be.equal(unoptimizedCalldata);
// Validate decoding
- const decodedArgs = method.decode(optimizedCalldata);
+ const decodedArgs = method.decode(optimizedCalldata, { shouldConvertStructsToObjects: false });
expect(decodedArgs).to.be.deep.equal(args);
});
it('Duplicate Static Arrays with Dynamic Elements', async () => {
@@ -70,7 +70,7 @@ describe('ABI Encoder: Optimized Method Encoding/Decoding', () => {
'0x9fe31f8e0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000548656c6c6f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005576f726c64000000000000000000000000000000000000000000000000000000';
expect(optimizedCalldata).to.be.equal(expectedOptimizedCalldata);
// Validate decoding
- const decodedArgs = method.decode(optimizedCalldata);
+ const decodedArgs = method.decode(optimizedCalldata, { shouldConvertStructsToObjects: false });
expect(decodedArgs).to.be.deep.equal(args);
});
it('Duplicate Array Elements (should optimize)', async () => {
@@ -84,7 +84,7 @@ describe('ABI Encoder: Optimized Method Encoding/Decoding', () => {
'0x13e751a900000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000548656c6c6f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005576f726c64000000000000000000000000000000000000000000000000000000';
expect(optimizedCalldata).to.be.equal(expectedOptimizedCalldata);
// Validate decoding
- const decodedArgs = method.decode(optimizedCalldata);
+ const decodedArgs = method.decode(optimizedCalldata, { shouldConvertStructsToObjects: false });
expect(decodedArgs).to.be.deep.equal(args);
});
it('Duplicate Tuple Fields', async () => {
@@ -98,7 +98,7 @@ describe('ABI Encoder: Optimized Method Encoding/Decoding', () => {
'0x16780a5e000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000548656c6c6f000000000000000000000000000000000000000000000000000000';
expect(optimizedCalldata).to.be.equal(expectedOptimizedCalldata);
// Validate decoding
- const decodedArgs = method.decode(optimizedCalldata);
+ const decodedArgs = method.decode(optimizedCalldata, { shouldConvertStructsToObjects: false });
expect(decodedArgs).to.be.deep.equal(args);
});
it('Duplicate Strings', async () => {
@@ -115,7 +115,7 @@ describe('ABI Encoder: Optimized Method Encoding/Decoding', () => {
'0x07370bfa00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000548656c6c6f000000000000000000000000000000000000000000000000000000';
expect(optimizedCalldata).to.be.equal(expectedOptimizedCalldata);
// Validate decoding
- const decodedArgs = method.decode(optimizedCalldata);
+ const decodedArgs = method.decode(optimizedCalldata, { shouldConvertStructsToObjects: false });
expect(decodedArgs).to.be.deep.equal(args);
});
it('Duplicate Bytes', async () => {
@@ -133,7 +133,7 @@ describe('ABI Encoder: Optimized Method Encoding/Decoding', () => {
'0x6045e42900000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002801020304050607080910111213141516171819202122232425262728293031323334353637383940000000000000000000000000000000000000000000000000';
expect(optimizedCalldata).to.be.equal(expectedOptimizedCalldata);
// Validate decoding
- const decodedArgs = method.decode(optimizedCalldata);
+ const decodedArgs = method.decode(optimizedCalldata, { shouldConvertStructsToObjects: false });
expect(decodedArgs).to.be.deep.equal(args);
});
it('Duplicate Tuples', async () => {
@@ -148,7 +148,7 @@ describe('ABI Encoder: Optimized Method Encoding/Decoding', () => {
'0x564f826d000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000006792a000000000000000000000000000000000000000000000000000000000000000d48656c6c6f2c20576f726c642100000000000000000000000000000000000000';
expect(optimizedCalldata).to.be.equal(expectedOptimizedCalldata);
// Validate decoding
- const decodedArgs = method.decode(optimizedCalldata);
+ const decodedArgs = method.decode(optimizedCalldata, { shouldConvertStructsToObjects: false });
expect(decodedArgs).to.be.deep.equal(args);
});
it('Duplicate Fields Across Two Tuples', async () => {
@@ -164,7 +164,7 @@ describe('ABI Encoder: Optimized Method Encoding/Decoding', () => {
'0x564f826d000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000d48656c6c6f2c20576f726c642100000000000000000000000000000000000000';
expect(optimizedCalldata).to.be.equal(expectedOptimizedCalldata);
// Validate decoding
- const decodedArgs = method.decode(optimizedCalldata);
+ const decodedArgs = method.decode(optimizedCalldata, { shouldConvertStructsToObjects: false });
expect(decodedArgs).to.be.deep.equal(args);
});
it('Duplicate Arrays, Nested in Separate Tuples', async () => {
@@ -180,7 +180,7 @@ describe('ABI Encoder: Optimized Method Encoding/Decoding', () => {
'0x18970a9e000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000009600000000000000000000000000000000000000000000000000000000000000c80000000000000000000000000000000000000000000000000000000000000035657874726120617267756d656e7420746f2070726576656e742065786163746c79206d61746368696e6720746865207475706c65730000000000000000000000';
expect(optimizedCalldata).to.be.equal(expectedOptimizedCalldata);
// Validate decoding
- const decodedArgs = method.decode(optimizedCalldata);
+ const decodedArgs = method.decode(optimizedCalldata, { shouldConvertStructsToObjects: false });
expect(decodedArgs).to.be.deep.equal(args);
});
it('Duplicate Tuples, Nested in Separate Tuples', async () => {
@@ -196,7 +196,7 @@ describe('ABI Encoder: Optimized Method Encoding/Decoding', () => {
'0x0b4d2e6a000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000d48656c6c6f2c20576f726c6421000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035657874726120617267756d656e7420746f2070726576656e742065786163746c79206d61746368696e6720746865207475706c65730000000000000000000000';
expect(optimizedCalldata).to.be.equal(expectedOptimizedCalldata);
// Validate decoding
- const decodedArgs = method.decode(optimizedCalldata);
+ const decodedArgs = method.decode(optimizedCalldata, { shouldConvertStructsToObjects: false });
expect(decodedArgs).to.be.deep.equal(args);
});
it('Duplicate Two-Dimensional Arrays', async () => {
@@ -211,7 +211,7 @@ describe('ABI Encoder: Optimized Method Encoding/Decoding', () => {
'0x0d28c4f9000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000002c0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000548656c6c6f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005576f726c640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000003466f6f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003426172000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035a61610000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000548656c6c6f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005576f726c640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000003466f6f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003426172000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035a61610000000000000000000000000000000000000000000000000000000000';
expect(optimizedCalldata).to.be.equal(expectedOptimizedCalldata);
// Validate decoding
- const decodedArgs = method.decode(optimizedCalldata);
+ const decodedArgs = method.decode(optimizedCalldata, { shouldConvertStructsToObjects: false });
expect(decodedArgs).to.be.deep.equal(args);
});
it('Duplicate Array, Nested within Separate Two-Dimensional Arrays', async () => {
@@ -226,14 +226,21 @@ describe('ABI Encoder: Optimized Method Encoding/Decoding', () => {
'0x0d28c4f900000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003466f6f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000548656c6c6f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005576f726c640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000034261720000000000000000000000000000000000000000000000000000000000';
expect(optimizedCalldata).to.be.equal(expectedOptimizedCalldata);
// Validate decoding
- const decodedArgs = method.decode(optimizedCalldata);
+ const decodedArgs = method.decode(optimizedCalldata, { shouldConvertStructsToObjects: false });
expect(decodedArgs).to.be.deep.equal(args);
});
it('Array Elements Duplicated as Tuple Fields', async () => {
// Generate calldata
const method = new AbiEncoder.Method(OptimizedAbis.arrayElementsDuplicatedAsTupleFields);
- const array = [new BigNumber(100), new BigNumber(150), new BigNumber(200), new BigNumber(225)];
- const tuple = [[array[0]], [array[1]], [array[2]], [array[3]]];
+ // tslint:disable custom-no-magic-numbers
+ const array = [100, 150, 200, 225];
+ // tslint:enable custom-no-magic-numbers
+ const tuple = [
+ [new BigNumber(array[0])],
+ [new BigNumber(array[1])],
+ [new BigNumber(array[2])],
+ [new BigNumber(array[3])],
+ ];
const args = [array, tuple];
// Validata calldata
const optimizedCalldata = method.encode(args, encodingRules);
@@ -241,7 +248,7 @@ describe('ABI Encoder: Optimized Method Encoding/Decoding', () => {
'0x5b5c78fd0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000009600000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000e1';
expect(optimizedCalldata).to.be.equal(expectedOptimizedCalldata);
// Validate decoding
- const decodedArgs = method.decode(optimizedCalldata);
+ const decodedArgs = method.decode(optimizedCalldata, { shouldConvertStructsToObjects: false });
expect(decodedArgs).to.be.deep.equal(args);
});
it('Array Elements Duplicated as Separate Parameter', async () => {
@@ -256,7 +263,7 @@ describe('ABI Encoder: Optimized Method Encoding/Decoding', () => {
'0xe0e0d34900000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000005576f726c64000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000548656c6c6f000000000000000000000000000000000000000000000000000000';
expect(optimizedCalldata).to.be.equal(expectedOptimizedCalldata);
// Validate decoding
- const decodedArgs = method.decode(optimizedCalldata);
+ const decodedArgs = method.decode(optimizedCalldata, { shouldConvertStructsToObjects: false });
expect(decodedArgs).to.be.deep.equal(args);
});
});
diff --git a/packages/utils/test/abi_encoder/return_values_test.ts b/packages/utils/test/abi_encoder/return_values_test.ts
index 104c7f5db..308d11ee5 100644
--- a/packages/utils/test/abi_encoder/return_values_test.ts
+++ b/packages/utils/test/abi_encoder/return_values_test.ts
@@ -15,7 +15,7 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => {
// Decode return value
const method = new AbiEncoder.Method(ReturnValueAbis.noReturnValues);
const returnValue = '0x';
- const decodedReturnValue = method.decodeReturnValues(returnValue);
+ const decodedReturnValue = method.decodeReturnValues(returnValue, { shouldConvertStructsToObjects: false });
const expectedDecodedReturnValue: any[] = [];
expect(decodedReturnValue).to.be.deep.equal(expectedDecodedReturnValue);
});
@@ -24,7 +24,9 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => {
const method = new AbiEncoder.Method(ReturnValueAbis.singleStaticReturnValue);
const returnValue = ['0x01020304'];
const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules);
- const decodedReturnValue = method.decodeReturnValues(encodedReturnValue);
+ const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, {
+ shouldConvertStructsToObjects: false,
+ });
// Validate decoded return value
expect(decodedReturnValue).to.be.deep.equal(returnValue);
});
@@ -33,7 +35,9 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => {
const method = new AbiEncoder.Method(ReturnValueAbis.multipleStaticReturnValues);
const returnValue = ['0x01020304', '0x05060708'];
const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules);
- const decodedReturnValue = method.decodeReturnValues(encodedReturnValue);
+ const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, {
+ shouldConvertStructsToObjects: false,
+ });
// Validate decoded return value
expect(decodedReturnValue).to.be.deep.equal(returnValue);
});
@@ -42,7 +46,9 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => {
const method = new AbiEncoder.Method(ReturnValueAbis.singleDynamicReturnValue);
const returnValue = ['0x01020304'];
const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules);
- const decodedReturnValue = method.decodeReturnValues(encodedReturnValue);
+ const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, {
+ shouldConvertStructsToObjects: false,
+ });
// Validate decoded return value
expect(decodedReturnValue).to.be.deep.equal(returnValue);
});
@@ -51,7 +57,9 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => {
const method = new AbiEncoder.Method(ReturnValueAbis.multipleDynamicReturnValues);
const returnValue = ['0x01020304', '0x05060708'];
const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules);
- const decodedReturnValue = method.decodeReturnValues(encodedReturnValue);
+ const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, {
+ shouldConvertStructsToObjects: false,
+ });
// Validate decoded return value
expect(decodedReturnValue).to.be.deep.equal(returnValue);
});
@@ -60,7 +68,9 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => {
const method = new AbiEncoder.Method(ReturnValueAbis.mixedStaticAndDynamicReturnValues);
const returnValue = ['0x01020304', '0x05060708'];
const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules);
- const decodedReturnValue = method.decodeReturnValues(encodedReturnValue);
+ const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, {
+ shouldConvertStructsToObjects: false,
+ });
// Validate decoded return value
expect(decodedReturnValue).to.be.deep.equal(returnValue);
});
diff --git a/packages/dev-tools-pages/assets/fonts/.gitkeep b/packages/utils/test/abi_encoder/signature_tests.ts
index e69de29bb..e69de29bb 100644
--- a/packages/dev-tools-pages/assets/fonts/.gitkeep
+++ b/packages/utils/test/abi_encoder/signature_tests.ts
diff --git a/packages/web3-wrapper/CHANGELOG.json b/packages/web3-wrapper/CHANGELOG.json
index 65f811028..4a639f662 100644
--- a/packages/web3-wrapper/CHANGELOG.json
+++ b/packages/web3-wrapper/CHANGELOG.json
@@ -1,5 +1,36 @@
[
{
+ "version": "4.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ },
+ {
+ "note": "Update ganache-core to v2.3.3",
+ "pr": 1518
+ }
+ ]
+ },
+ {
+ "timestamp": 1547561734,
+ "version": "3.2.4",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "3.2.3",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"timestamp": 1547040760,
"version": "3.2.2",
"changes": [
@@ -82,8 +113,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
}
],
@@ -97,8 +127,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
}
],
@@ -135,13 +164,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
}
],
@@ -151,8 +178,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
}
],
@@ -180,8 +206,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
},
{
@@ -328,8 +353,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
}
]
@@ -392,8 +416,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
},
{
@@ -417,8 +440,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
},
{
diff --git a/packages/web3-wrapper/CHANGELOG.md b/packages/web3-wrapper/CHANGELOG.md
index 4242fe0cc..5850c5474 100644
--- a/packages/web3-wrapper/CHANGELOG.md
+++ b/packages/web3-wrapper/CHANGELOG.md
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v3.2.4 - _January 15, 2019_
+
+ * Dependencies updated
+
+## v3.2.3 - _January 11, 2019_
+
+ * Dependencies updated
+
## v3.2.2 - _January 9, 2019_
* Dependencies updated
diff --git a/packages/web3-wrapper/package.json b/packages/web3-wrapper/package.json
index b67472a8a..f28cc36ca 100644
--- a/packages/web3-wrapper/package.json
+++ b/packages/web3-wrapper/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/web3-wrapper",
- "version": "3.2.2",
+ "version": "3.2.4",
"engines": {
"node": ">=6.12"
},
@@ -36,14 +36,14 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/web3-wrapper/README.md",
"devDependencies": {
- "@0x/tslint-config": "^2.0.0",
- "@types/ganache-core": "^2.1.0",
+ "@0x/tslint-config": "^2.0.2",
+ "@types/ganache-core": "^2.1.2",
"@types/lodash": "4.14.104",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
- "chai-bignumber": "^2.0.1",
+ "chai-bignumber": "^3.0.0",
"dirty-chai": "^2.0.1",
- "ganache-core": "0xProject/ganache-core#monorepo-dep",
+ "ganache-core": "^2.3.3",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",
"npm-run-all": "^4.1.2",
@@ -54,11 +54,11 @@
"typescript": "3.0.1"
},
"dependencies": {
- "@0x/assert": "^1.0.21",
- "@0x/json-schemas": "^2.1.5",
- "@0x/typescript-typings": "^3.0.6",
- "@0x/utils": "^2.1.1",
- "ethereum-types": "^1.1.4",
+ "@0x/assert": "^1.0.23",
+ "@0x/json-schemas": "^2.1.7",
+ "@0x/typescript-typings": "^3.0.8",
+ "@0x/utils": "^3.0.1",
+ "ethereum-types": "^1.1.6",
"ethereumjs-util": "^5.1.1",
"ethers": "~4.0.4",
"lodash": "^4.17.5"
diff --git a/packages/web3-wrapper/src/utils.ts b/packages/web3-wrapper/src/utils.ts
index c68587632..1aba3c75a 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;
}
@@ -37,7 +33,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/web3-wrapper/test/web3_wrapper_test.ts b/packages/web3-wrapper/test/web3_wrapper_test.ts
index 935c67636..c4ee91d3d 100644
--- a/packages/web3-wrapper/test/web3_wrapper_test.ts
+++ b/packages/web3-wrapper/test/web3_wrapper_test.ts
@@ -1,10 +1,10 @@
+import { BigNumber } from '@0x/utils';
import * as chai from 'chai';
import { BlockParamLiteral, JSONRPCErrorCallback, JSONRPCRequestPayload, TransactionReceipt } from 'ethereum-types';
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';
@@ -35,7 +35,7 @@ describe('Web3Wrapper tests', () => {
describe('#getNodeVersionAsync', () => {
it('gets the node version', async () => {
const nodeVersion = await web3Wrapper.getNodeVersionAsync();
- const NODE_VERSION = 'EthereumJS TestRPC/v2.1.2/ethereum-js';
+ const NODE_VERSION = 'EthereumJS TestRPC/v2.3.3/ethereum-js';
expect(nodeVersion).to.be.equal(NODE_VERSION);
});
});
@@ -118,7 +118,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 +151,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 () => {
diff --git a/packages/website/README.md b/packages/website/README.md
index a9145cb6c..432b7c335 100644
--- a/packages/website/README.md
+++ b/packages/website/README.md
@@ -59,11 +59,11 @@ yarn lint
##### Toolkit
-* [Material Design Icon Font](http://zavoloklom.github.io/material-design-iconic-font/icons.html#directional)
-* [BassCSS toolkit](http://basscss.com/)
-* [Material-UI component library](http://www.material-ui.com/#/)
+- [Material Design Icon Font](http://zavoloklom.github.io/material-design-iconic-font/icons.html#directional)
+- [BassCSS toolkit](http://basscss.com/)
+- [Material-UI component library](http://www.material-ui.com/#/)
##### Recommended Atom packages:
-* [atom-typescript](https://atom.io/packages/atom-typescript)
-* [linter-tslint](https://atom.io/packages/linter-tslint)
+- [atom-typescript](https://atom.io/packages/atom-typescript)
+- [linter-tslint](https://atom.io/packages/linter-tslint)
diff --git a/packages/website/contracts/Mintable.json b/packages/website/contracts/Mintable.json
index dc46dc829..895db73a2 100644
--- a/packages/website/contracts/Mintable.json
+++ b/packages/website/contracts/Mintable.json
@@ -182,8 +182,7 @@
"type": "event"
}
],
- "unlinked_binary":
- "0x6060604052341561000c57fe5b5b6105018061001c6000396000f300606060405236156100675763ffffffff60e060020a600035041663095ea7b3811461006957806318160ddd1461009c57806323b872dd146100be57806370a08231146100f7578063a0712d6814610125578063a9059cbb1461013a578063dd62ed3e1461016d575bfe5b341561007157fe5b610088600160a060020a03600435166024356101a1565b604080519115158252519081900360200190f35b34156100a457fe5b6100ac61020c565b60408051918252519081900360200190f35b34156100c657fe5b610088600160a060020a0360043581169060243516604435610212565b604080519115158252519081900360200190f35b34156100ff57fe5b6100ac600160a060020a0360043516610335565b60408051918252519081900360200190f35b341561012d57fe5b610138600435610354565b005b341561014257fe5b610088600160a060020a03600435166024356103bc565b604080519115158252519081900360200190f35b341561017557fe5b6100ac600160a060020a036004358116906024351661046e565b60408051918252519081900360200190f35b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60025481565b600160a060020a03808416600081815260016020908152604080832033909516835293815283822054928252819052918220548390108015906102555750828110155b801561027b5750600160a060020a03841660009081526020819052604090205483810110155b1561032757600160a060020a03808516600090815260208190526040808220805487019055918716815220805484900390556000198110156102e557600160a060020a03808616600090815260016020908152604080832033909416835292905220805484900390555b83600160a060020a031685600160a060020a03166000805160206104b6833981519152856040518082815260200191505060405180910390a36001915061032c565b600091505b5b509392505050565b600160a060020a0381166000908152602081905260409020545b919050565b68056bc75e2d6310000081111561036b5760006000fd5b600160a060020a03331660009081526020819052604090205461038f90829061049b565b600160a060020a0333166000908152602081905260409020556002546103b5908261049b565b6002555b50565b600160a060020a0333166000908152602081905260408120548290108015906103ff5750600160a060020a03831660009081526020819052604090205482810110155b1561045f57600160a060020a0333811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191936000805160206104b6833981519152929081900390910190a3506001610206565b506000610206565b5b92915050565b600160a060020a038083166000908152600160209081526040808320938516835292905220545b92915050565b6000828201838110156104aa57fe5b8091505b50929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820998c8326b9629e063eb4867166e72c68a8c2e3ebca6a9d35ebc78c041c7aa47b0029",
+ "unlinked_binary": "0x6060604052341561000c57fe5b5b6105018061001c6000396000f300606060405236156100675763ffffffff60e060020a600035041663095ea7b3811461006957806318160ddd1461009c57806323b872dd146100be57806370a08231146100f7578063a0712d6814610125578063a9059cbb1461013a578063dd62ed3e1461016d575bfe5b341561007157fe5b610088600160a060020a03600435166024356101a1565b604080519115158252519081900360200190f35b34156100a457fe5b6100ac61020c565b60408051918252519081900360200190f35b34156100c657fe5b610088600160a060020a0360043581169060243516604435610212565b604080519115158252519081900360200190f35b34156100ff57fe5b6100ac600160a060020a0360043516610335565b60408051918252519081900360200190f35b341561012d57fe5b610138600435610354565b005b341561014257fe5b610088600160a060020a03600435166024356103bc565b604080519115158252519081900360200190f35b341561017557fe5b6100ac600160a060020a036004358116906024351661046e565b60408051918252519081900360200190f35b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60025481565b600160a060020a03808416600081815260016020908152604080832033909516835293815283822054928252819052918220548390108015906102555750828110155b801561027b5750600160a060020a03841660009081526020819052604090205483810110155b1561032757600160a060020a03808516600090815260208190526040808220805487019055918716815220805484900390556000198110156102e557600160a060020a03808616600090815260016020908152604080832033909416835292905220805484900390555b83600160a060020a031685600160a060020a03166000805160206104b6833981519152856040518082815260200191505060405180910390a36001915061032c565b600091505b5b509392505050565b600160a060020a0381166000908152602081905260409020545b919050565b68056bc75e2d6310000081111561036b5760006000fd5b600160a060020a03331660009081526020819052604090205461038f90829061049b565b600160a060020a0333166000908152602081905260409020556002546103b5908261049b565b6002555b50565b600160a060020a0333166000908152602081905260408120548290108015906103ff5750600160a060020a03831660009081526020819052604090205482810110155b1561045f57600160a060020a0333811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191936000805160206104b6833981519152929081900390910190a3506001610206565b506000610206565b5b92915050565b600160a060020a038083166000908152600160209081526040808320938516835292905220545b92915050565b6000828201838110156104aa57fe5b8091505b50929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820998c8326b9629e063eb4867166e72c68a8c2e3ebca6a9d35ebc78c041c7aa47b0029",
"networks": {},
"schema_version": "0.0.5",
"updated_at": 1503413048892
diff --git a/packages/website/md/docs/json_schemas/1/schemas.md b/packages/website/md/docs/json_schemas/1/schemas.md
index fcf5d8df6..11f9df329 100644
--- a/packages/website/md/docs/json_schemas/1/schemas.md
+++ b/packages/website/md/docs/json_schemas/1/schemas.md
@@ -1,28 +1,28 @@
0x Protocol Schemas
-* [Basic types](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/basic_type_schemas.ts) (e.g Ethereum address, number)
-* [ECSignature](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/ec_signature_schema.ts)
-* [Order/SignedOrder](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/order_schemas.ts)
-* [OrderHash](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/order_hash_schema.ts)
+- [Basic types](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/basic_type_schemas.ts) (e.g Ethereum address, number)
+- [ECSignature](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/ec_signature_schema.ts)
+- [Order/SignedOrder](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/order_schemas.ts)
+- [OrderHash](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/order_hash_schema.ts)
0x.js Schemas
-* [BlockRange](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/block_range_schema.ts)
-* [IndexFilter Values](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/index_filter_values_schema.ts)
-* [OrderFillRequests](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/order_fill_requests_schema.ts)
-* [OrderCancellationRequests](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/order_cancel_schema.ts)
-* [OrderFillOrKillRequests](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/order_fill_or_kill_requests_schema.ts)
-* [SignedOrders](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/signed_orders_schema.ts)
-* [Token](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/token_schema.ts)
-* [TxData](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/tx_data_schema.ts)
+- [BlockRange](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/block_range_schema.ts)
+- [IndexFilter Values](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/index_filter_values_schema.ts)
+- [OrderFillRequests](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/order_fill_requests_schema.ts)
+- [OrderCancellationRequests](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/order_cancel_schema.ts)
+- [OrderFillOrKillRequests](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/order_fill_or_kill_requests_schema.ts)
+- [SignedOrders](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/signed_orders_schema.ts)
+- [Token](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/token_schema.ts)
+- [TxData](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/tx_data_schema.ts)
Standard Relayer API Schemas
-* [Error response](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/relayer_api_error_response_schema.ts)
-* [Fees payload](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/relayer_api_fees_payload_schema.ts)
-* [Fees response](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/relayer_api_fees_response_schema.ts)
-* [Orderbook channel subscribe](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/relayer_api_orberbook_channel_subscribe_schema.ts)
-* [Orderbook channel snapshot](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/relayer_api_orderbook_channel_snapshot_schema.ts)
-* [Orderbook channel update](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/relayer_api_orderbook_channel_update_response_schema.ts)
-* [Orderbook response](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/relayer_api_orderbook_response_schema.ts)
-* [Token pairs response](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/relayer_api_token_pairs_response_schema.ts)
+- [Error response](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/relayer_api_error_response_schema.ts)
+- [Fees payload](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/relayer_api_fees_payload_schema.ts)
+- [Fees response](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/relayer_api_fees_response_schema.ts)
+- [Orderbook channel subscribe](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/relayer_api_orberbook_channel_subscribe_schema.ts)
+- [Orderbook channel snapshot](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/relayer_api_orderbook_channel_snapshot_schema.ts)
+- [Orderbook channel update](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/relayer_api_orderbook_channel_update_response_schema.ts)
+- [Orderbook response](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/relayer_api_orderbook_response_schema.ts)
+- [Token pairs response](https://github.com/0xProject/0x-monorepo/blob/d4c1b3b0bd26e730ce6687469cdf7283877543e1/packages/json-schemas/schemas/relayer_api_token_pairs_response_schema.ts)
diff --git a/packages/website/md/docs/json_schemas/2/schemas.md b/packages/website/md/docs/json_schemas/2/schemas.md
index 8ea6c8e85..78e6df372 100644
--- a/packages/website/md/docs/json_schemas/2/schemas.md
+++ b/packages/website/md/docs/json_schemas/2/schemas.md
@@ -1,40 +1,40 @@
Basic Schemas
-* [Address type](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/address_schema.json)
-* [Number type](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/number_schema.json)
-* [Hex type](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/hex_schema.json)
-* [JS number](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/js_number.json)
+- [Address type](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/address_schema.json)
+- [Number type](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/number_schema.json)
+- [Hex type](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/hex_schema.json)
+- [JS number](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/js_number.json)
0x Protocol Schemas
-* [Order](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/order_schema.json)
-* [SignedOrder](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/signed_order_schema.json)
-* [OrderHash](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/order_hash_schema.json)
-* [ECSignature](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/ec_signature_schema.json)
+- [Order](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/order_schema.json)
+- [SignedOrder](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/signed_order_schema.json)
+- [OrderHash](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/order_hash_schema.json)
+- [ECSignature](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/ec_signature_schema.json)
0x.js Schemas
-* [BlockParam](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/block_param_schema.json)
-* [BlockRange](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/block_range_schema.json)
-* [IndexFilter Values](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/index_filter_values_schema.json)
-* [OrderFillRequests](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/order_fill_requests_schema.json)
-* [OrderCancellationRequests](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/order_cancel_schema.json)
-* [OrderFillOrKillRequests](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/order_fill_or_kill_requests_schema.json)
-* [SignedOrders](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/signed_orders_schema.json)
-* [Token](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/token_schema.json)
-* [TxData](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/tx_data_schema.json)
+- [BlockParam](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/block_param_schema.json)
+- [BlockRange](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/block_range_schema.json)
+- [IndexFilter Values](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/index_filter_values_schema.json)
+- [OrderFillRequests](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/order_fill_requests_schema.json)
+- [OrderCancellationRequests](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/order_cancel_schema.json)
+- [OrderFillOrKillRequests](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/order_fill_or_kill_requests_schema.json)
+- [SignedOrders](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/signed_orders_schema.json)
+- [Token](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/token_schema.json)
+- [TxData](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/tx_data_schema.json)
Standard Relayer API Schemas
-* [Paginated collection](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/paginated_collection_schema.json)
-* [Error response](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_error_response_schema.json)
-* [Order config payload](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_order_config_payload_schema.json)
-* [Order config response](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_order_config_response_schema.json)
-* [Orders channel subscribe payload](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_payload_schema.json)
-* [Orders channel subscribe](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_schema.json)
-* [Orders channel update](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_orders_channel_update_response_schema.json)
-* [Orderbook response](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_orderbook_response_schema.json)
-* [Asset pairs](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_asset_data_pairs_schema.json)
-* [Trade info](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_asset_data_trade_info_schema.json)
-* [Asset pairs response](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_asset_data_pairs_response_schema.json)
-* [Fee recipients response](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_fee_recipients_response_schema.json)
+- [Paginated collection](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/paginated_collection_schema.json)
+- [Error response](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_error_response_schema.json)
+- [Order config payload](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_order_config_payload_schema.json)
+- [Order config response](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_order_config_response_schema.json)
+- [Orders channel subscribe payload](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_payload_schema.json)
+- [Orders channel subscribe](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_schema.json)
+- [Orders channel update](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_orders_channel_update_response_schema.json)
+- [Orderbook response](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_orderbook_response_schema.json)
+- [Asset pairs](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_asset_data_pairs_schema.json)
+- [Trade info](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_asset_data_trade_info_schema.json)
+- [Asset pairs response](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_asset_data_pairs_response_schema.json)
+- [Fee recipients response](https://github.com/0xProject/0x-monorepo/blob/5ec4b27200297708298deca97603849a37b2f66a/packages/json-schemas/schemas/relayer_api_fee_recipients_response_schema.json)
diff --git a/packages/website/md/docs/json_schemas/3/schemas.md b/packages/website/md/docs/json_schemas/3/schemas.md
index 99aff7b5a..90fcfdffe 100644
--- a/packages/website/md/docs/json_schemas/3/schemas.md
+++ b/packages/website/md/docs/json_schemas/3/schemas.md
@@ -1,41 +1,41 @@
Basic Schemas
-* [Address type](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/address_schema.json)
-* [Number type](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/number_schema.json)
-* [Whole number type](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/whole_number_schema.json)
-* [Hex type](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/hex_schema.json)
-* [JS number](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/js_number.json)
+- [Address type](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/address_schema.json)
+- [Number type](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/number_schema.json)
+- [Whole number type](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/whole_number_schema.json)
+- [Hex type](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/hex_schema.json)
+- [JS number](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/js_number.json)
0x Protocol Schemas
-* [Order](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/order_schema.json)
-* [SignedOrder](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/signed_order_schema.json)
-* [OrderHash](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/order_hash_schema.json)
-* [ECSignature](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/ec_signature_schema.json)
+- [Order](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/order_schema.json)
+- [SignedOrder](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/signed_order_schema.json)
+- [OrderHash](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/order_hash_schema.json)
+- [ECSignature](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/ec_signature_schema.json)
0x.js Schemas
-* [BlockParam](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/block_param_schema.json)
-* [BlockRange](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/block_range_schema.json)
-* [IndexFilter Values](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/index_filter_values_schema.json)
-* [OrderFillRequests](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/order_fill_requests_schema.json)
-* [OrderCancellationRequests](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/order_cancel_schema.json)
-* [OrderFillOrKillRequests](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/order_fill_or_kill_requests_schema.json)
-* [SignedOrders](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/signed_orders_schema.json)
-* [Token](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/token_schema.json)
-* [TxData](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/tx_data_schema.json)
+- [BlockParam](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/block_param_schema.json)
+- [BlockRange](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/block_range_schema.json)
+- [IndexFilter Values](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/index_filter_values_schema.json)
+- [OrderFillRequests](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/order_fill_requests_schema.json)
+- [OrderCancellationRequests](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/order_cancel_schema.json)
+- [OrderFillOrKillRequests](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/order_fill_or_kill_requests_schema.json)
+- [SignedOrders](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/signed_orders_schema.json)
+- [Token](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/token_schema.json)
+- [TxData](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/tx_data_schema.json)
Standard Relayer API Schemas
-* [Paginated collection](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/paginated_collection_schema.json)
-* [Error response](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_error_response_schema.json)
-* [Order config payload](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_order_config_payload_schema.json)
-* [Order config response](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_order_config_response_schema.json)
-* [Orders channel subscribe payload](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_payload_schema.json)
-* [Orders channel subscribe](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_schema.json)
-* [Orders channel update](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_orders_channel_update_response_schema.json)
-* [Orderbook response](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_orderbook_response_schema.json)
-* [Asset pairs](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_asset_data_pairs_schema.json)
-* [Trade info](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_asset_data_trade_info_schema.json)
-* [Asset pairs response](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_asset_data_pairs_response_schema.json)
-* [Fee recipients response](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_fee_recipients_response_schema.json)
+- [Paginated collection](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/paginated_collection_schema.json)
+- [Error response](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_error_response_schema.json)
+- [Order config payload](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_order_config_payload_schema.json)
+- [Order config response](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_order_config_response_schema.json)
+- [Orders channel subscribe payload](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_payload_schema.json)
+- [Orders channel subscribe](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_schema.json)
+- [Orders channel update](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_orders_channel_update_response_schema.json)
+- [Orderbook response](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_orderbook_response_schema.json)
+- [Asset pairs](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_asset_data_pairs_schema.json)
+- [Trade info](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_asset_data_trade_info_schema.json)
+- [Asset pairs response](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_asset_data_pairs_response_schema.json)
+- [Fee recipients response](https://github.com/0xProject/0x-monorepo/blob/528ae4376e5e605dac9666f2a5917803e942a1f9/packages/json-schemas/schemas/relayer_api_fee_recipients_response_schema.json)
diff --git a/packages/website/md/docs/smart_contracts/2/introduction.md b/packages/website/md/docs/smart_contracts/2/introduction.md
index 4a3a73027..b2c3d8f8d 100644
--- a/packages/website/md/docs/smart_contracts/2/introduction.md
+++ b/packages/website/md/docs/smart_contracts/2/introduction.md
@@ -2,5 +2,5 @@ Welcome to the [0x smart contracts](https://github.com/0xProject/0x-monorepo/tre
### Helpful wiki articles:
-* [Deployed smart contract addresses](https://0x.org/wiki#Deployed-Addresses)
-* [0x Protocol Specification](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md)
+- [Deployed smart contract addresses](https://0x.org/wiki#Deployed-Addresses)
+- [0x Protocol Specification](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md)
diff --git a/packages/website/md/docs/sol-compiler/1/introduction.md b/packages/website/md/docs/sol-compiler/1/introduction.md
index fcd80f47b..3b7332111 100644
--- a/packages/website/md/docs/sol-compiler/1/introduction.md
+++ b/packages/website/md/docs/sol-compiler/1/introduction.md
@@ -1,8 +1,8 @@
Welcome to the [sol-compiler](https://github.com/0xProject/0x-monorepo/tree/development/packages/sol-compiler) documentation! Sol-compiler is a wrapper around [solc-js](https://www.npmjs.com/package/solc) that adds:
-* Smart re-compilation: Only recompiles when smart contracts have changed
-* Ability to compile an entire project instead of only individual `.sol` files
-* Compilation using the Solidity version specified at the top of each individual `.sol` file
-* Proper parsing of Solidity version ranges
-* Support for the standard [input description](https://solidity.readthedocs.io/en/develop/using-the-compiler.html#input-description) for what information you'd like added to the resulting `artifacts` file (i.e 100% configurable artifacts content).
-* Storage of constructor args, source maps and paths to all dependency source files.
+- Smart re-compilation: Only recompiles when smart contracts have changed
+- Ability to compile an entire project instead of only individual `.sol` files
+- Compilation using the Solidity version specified at the top of each individual `.sol` file
+- Proper parsing of Solidity version ranges
+- Support for the standard [input description](https://solidity.readthedocs.io/en/develop/using-the-compiler.html#input-description) for what information you'd like added to the resulting `artifacts` file (i.e 100% configurable artifacts content).
+- Storage of constructor args, source maps and paths to all dependency source files.
diff --git a/packages/website/md/docs/sol_coverage/installation.md b/packages/website/md/docs/sol_coverage/installation.md
index c7aaf07e9..7c9840ab8 100644
--- a/packages/website/md/docs/sol_coverage/installation.md
+++ b/packages/website/md/docs/sol_coverage/installation.md
@@ -1,7 +1,7 @@
**Install**
```bash
-yarn add @0x/sol-coverage
+yarn add -D @0x/sol-coverage
```
**Import**
diff --git a/packages/website/md/docs/sol_coverage/introduction.md b/packages/website/md/docs/sol_coverage/introduction.md
index 3214e93a9..f21f8ecbe 100644
--- a/packages/website/md/docs/sol_coverage/introduction.md
+++ b/packages/website/md/docs/sol_coverage/introduction.md
@@ -1 +1 @@
-Welcome to the [sol-coverage](https://github.com/0xProject/0x-monorepo/tree/development/packages/sol-coverage) documentation! Sol-coverage is a Solidity coverage tool for your smart contract tests.
+Welcome to the [sol-coverage](https://github.com/0xProject/0x-monorepo/tree/development/packages/sol-coverage) documentation! Sol-coverage is a Solidity coverage tool.
diff --git a/packages/website/md/docs/sol_coverage/usage.md b/packages/website/md/docs/sol_coverage/usage.md
index dd3cdf597..d194f8abd 100644
--- a/packages/website/md/docs/sol_coverage/usage.md
+++ b/packages/website/md/docs/sol_coverage/usage.md
@@ -1,4 +1,4 @@
-Sol-coverage uses transaction traces in order to figure out which lines of Solidity source code have been covered by your tests. In order for it to gather these traces, you must add the `CoverageSubprovider` to the [ProviderEngine](https://github.com/MetaMask/provider-engine) instance you use when running your Solidity tests. If you're unfamiliar with ProviderEngine, please read the [Web3 Provider explained](https://0x.org/wiki#Web3-Provider-Explained) wiki article.
+Sol-coverage uses transaction traces in order to figure out which lines of Solidity source code have been covered by your tests. In order for it to gather these traces, you must add the `CoverageSubprovider` to the [ProviderEngine](https://github.com/MetaMask/provider-engine) instance you use when running your Solidity tests. If you're unfamiliar with `ProviderEngine`, please read the [Web3 Provider explained](https://0x.org/wiki#Web3-Provider-Explained) wiki article.
The CoverageSubprovider eavesdrops on the `eth_sendTransaction` and `eth_call` RPC calls and collects traces after each call using `debug_traceTransaction`. `eth_call`'s' don't generate traces - so we take a snapshot, re-submit it as a transaction, get the trace and then revert the snapshot.
@@ -12,9 +12,8 @@ If you are generating your artifacts with [@0x/sol-compiler](https://0x.org/docs
```typescript
import { SolCompilerArtifactsAdapter } from '@0x/sol-coverage';
-const artifactsPath = 'src/artifacts';
-const contractsPath = 'src/contracts';
-const artifactsAdapter = new SolCompilerArtifactsAdapter(artifactsPath, contractsPath);
+// Both artifactsDir and contractsDir are optional and will be fetched from compiler.json if not passed in
+const artifactAdapter = new SolCompilerArtifactAdapter(artifactsDir, contractsDir);
```
### Truffle
@@ -23,8 +22,9 @@ If your project is using [Truffle](https://truffleframework.com/), we've written
```typescript
import { TruffleArtifactAdapter } from '@0x/sol-coverage';
-const contractsPath = 'src/contracts';
-const artifactAdapter = new TruffleArtifactAdapter(contractsDir);
+const projectRoot = '.';
+const solcVersion = '0.5.0';
+const artifactAdapter = new TruffleArtifactAdapter(projectRoot, solcVersion);
```
Because truffle artifacts don't have all the data we need - we actually will recompile your contracts under the hood. That's why you don't need to pass an `artifactsPath`.
@@ -32,7 +32,13 @@ Because truffle artifacts don't have all the data we need - we actually will rec
### Other framework/toolset
You'll need to write your own artifacts adapter. It should extend `AbstractArtifactsAdapter`.
-Look at the code of the two adapters above for examples.
+
+```typescript
+import { AbstractArtifactAdapter } from '@0x/sol-trace';
+
+class YourCustomArtifactsAdapter extends AbstractArtifactAdapter {...};
+const artifactAdapter = new YourCustomArtifactsAdapter(...);
+```
### Usage
@@ -41,16 +47,14 @@ import { CoverageSubprovider } from '@0x/sol-coverage';
import ProviderEngine = require('web3-provider-engine');
const provider = new ProviderEngine();
-
-const artifactsPath = 'src/artifacts';
-const contractsPath = 'src/contracts';
-const networkId = 50;
// Some calls might not have `from` address specified. Nevertheless - transactions need to be submitted from an address with at least some funds. defaultFromAddress is the address that will be used to submit those calls as transactions from.
const defaultFromAddress = '0x5409ed021d9299bf6814279a6a1411a7e866a631';
const isVerbose = true;
const coverageSubprovider = new CoverageSubprovider(artifactsAdapter, defaultFromAddress, isVerbose);
provider.addProvider(coverageSubprovider);
+// Add all your other providers
+provider.start();
```
After your test suite is complete (e.g in the Mocha global `after` hook), you'll need to call:
@@ -60,3 +64,11 @@ await coverageSubprovider.writeCoverageAsync();
```
This will create a `coverage.json` file in a `coverage` directory. This file has an [Istanbul format](https://github.com/gotwarlost/istanbul/blob/master/coverage.json.md) - so you can use it with any of the existing Istanbul reporters.
+
+```bash
+yarn add -D istanbul
+istanbul report html
+open coverage/index.html
+```
+
+Use [Geth](https://github.com/ethereum/go-ethereum) as a backing node. We recommend using our [Devnet Docker container](https://hub.docker.com/r/0xorg/devnet) which sets up a Geth node for testing purposes. Ganache support is a [work in progress](https://github.com/0xProject/0x-monorepo/issues/1520).
diff --git a/packages/website/md/docs/sol_profiler/installation.md b/packages/website/md/docs/sol_profiler/installation.md
index be9a365f5..e29ac5ae7 100644
--- a/packages/website/md/docs/sol_profiler/installation.md
+++ b/packages/website/md/docs/sol_profiler/installation.md
@@ -1,7 +1,7 @@
**Install**
```bash
-yarn add @0x/sol-profiler
+yarn add -D @0x/sol-profiler
```
**Import**
diff --git a/packages/website/md/docs/sol_profiler/usage.md b/packages/website/md/docs/sol_profiler/usage.md
index 35ea140da..0fbc31bc1 100644
--- a/packages/website/md/docs/sol_profiler/usage.md
+++ b/packages/website/md/docs/sol_profiler/usage.md
@@ -1,4 +1,4 @@
-Sol-profiler uses transaction traces in order to figure out which lines of Solidity source code have been covered by your tests. In order for it to gather these traces, you must add the `ProfilerSubprovider` to the [ProviderEngine](https://github.com/MetaMask/provider-engine) instance you use when running your Solidity tests. If you're unfamiliar with ProviderEngine, please read the [Web3 Provider explained](https://0x.org/wiki#Web3-Provider-Explained) wiki article.
+Sol-profiler uses transaction traces in order to figure out which lines of Solidity source code have been covered by your tests. In order for it to gather these traces, you must add the `ProfilerSubprovider` to the [ProviderEngine](https://github.com/MetaMask/provider-engine) instance you use when running your Solidity tests. If you're unfamiliar with `ProviderEngine`, please read the [Web3 Provider explained](https://0x.org/wiki#Web3-Provider-Explained) wiki article.
The ProfilerSubprovider eavesdrops on the `eth_sendTransaction` and `eth_call` RPC calls and collects traces after each call using `debug_traceTransaction`. `eth_call`'s' don't generate traces - so we take a snapshot, re-submit it as a transaction, get the trace and then revert the snapshot.
@@ -12,9 +12,8 @@ If you are generating your artifacts with [@0x/sol-compiler](https://0x.org/docs
```typescript
import { SolCompilerArtifactsAdapter } from '@0x/sol-profiler';
-const artifactsPath = 'src/artifacts';
-const contractsPath = 'src/contracts';
-const artifactsAdapter = new SolCompilerArtifactsAdapter(artifactsPath, contractsPath);
+// Both artifactsDir and contractsDir are optional and will be fetched from compiler.json if not passed in
+const artifactAdapter = new SolCompilerArtifactAdapter(artifactsDir, contractsDir);
```
### Truffle
@@ -23,8 +22,9 @@ If your project is using [Truffle](https://truffleframework.com/), we've written
```typescript
import { TruffleArtifactAdapter } from '@0x/sol-profiler';
-const contractsPath = 'src/contracts';
-const artifactAdapter = new TruffleArtifactAdapter(contractsDir);
+const projectRoot = '.';
+const solcVersion = '0.5.0';
+const artifactAdapter = new TruffleArtifactAdapter(projectRoot, solcVersion);
```
Because truffle artifacts don't have all the data we need - we actually will recompile your contracts under the hood. That's why you don't need to pass an `artifactsPath`.
@@ -32,7 +32,13 @@ Because truffle artifacts don't have all the data we need - we actually will rec
### Other framework/toolset
You'll need to write your own artifacts adapter. It should extend `AbstractArtifactsAdapter`.
-Look at the code of the two adapters above for examples.
+
+```typescript
+import { AbstractArtifactAdapter } from '@0x/sol-trace';
+
+class YourCustomArtifactsAdapter extends AbstractArtifactAdapter {...};
+const artifactAdapter = new YourCustomArtifactsAdapter(...);
+```
### Usage
@@ -41,22 +47,28 @@ import { ProfilerSubprovider } from '@0x/sol-profiler';
import ProviderEngine = require('web3-provider-engine');
const provider = new ProviderEngine();
-
-const artifactsPath = 'src/artifacts';
-const contractsPath = 'src/contracts';
-const networkId = 50;
// Some calls might not have `from` address specified. Nevertheless - transactions need to be submitted from an address with at least some funds. defaultFromAddress is the address that will be used to submit those calls as transactions from.
const defaultFromAddress = '0x5409ed021d9299bf6814279a6a1411a7e866a631';
const isVerbose = true;
const profilerSubprovider = new ProfilerSubprovider(artifactsAdapter, defaultFromAddress, isVerbose);
provider.addProvider(profilerSubprovider);
+// Add all your other providers
+provider.start();
```
After your test suite is complete (e.g in the Mocha global `after` hook), you'll need to call:
```typescript
-await profilerSubprovider.writeProfilerAsync();
+await profilerSubprovider.writeProfilerOutputAsync();
+```
+
+This will create a `coverage.json` file in a `coverage` directory. This file has an [Istanbul format](https://github.com/gotwarlost/istanbul/blob/master/profiler.json.md) - so you can use it with any of the existing Istanbul reporters.
+
+```bash
+yarn add -D istanbul
+istanbul report html
+open coverage/index.html
```
-This will create a `profiler.json` file in a `profiler` directory. This file has an [Istanbul format](https://github.com/gotwarlost/istanbul/blob/master/profiler.json.md) - so you can use it with any of the existing Istanbul reporters.
+Use [Geth](https://github.com/ethereum/go-ethereum) as a backing node. We recommend using our [Devnet Docker container](https://hub.docker.com/r/0xorg/devnet) which sets up a Geth node for testing purposes. Ganache support is a [work in progress](https://github.com/0xProject/0x-monorepo/issues/1520).
diff --git a/packages/website/md/docs/sol_trace/installation.md b/packages/website/md/docs/sol_trace/installation.md
index 2f794b2f8..eb7bf08b8 100644
--- a/packages/website/md/docs/sol_trace/installation.md
+++ b/packages/website/md/docs/sol_trace/installation.md
@@ -1,17 +1,17 @@
**Install**
```bash
-yarn add @0x/sol-trace
+yarn add -D @0x/sol-trace
```
**Import**
```javascript
-import { TraceSubprovider } from '@0x/sol-trace';
+import { RevertTraceSubprovider } from '@0x/sol-trace';
```
or
```javascript
-var TraceSubprovider = require('@0x/sol-trace').TraceSubprovider;
+var RevertTraceSubprovider = require('@0x/sol-trace').RevertTraceSubprovider;
```
diff --git a/packages/website/md/docs/sol_trace/introduction.md b/packages/website/md/docs/sol_trace/introduction.md
index 21fea764e..73f5c2bcd 100644
--- a/packages/website/md/docs/sol_trace/introduction.md
+++ b/packages/website/md/docs/sol_trace/introduction.md
@@ -1 +1 @@
-Welcome to the [sol-trace](https://github.com/0xProject/0x-monorepo/tree/development/packages/sol-trace) documentation! Sol-trace is a Solidity trace tool for your smart contract tests.
+Welcome to the [sol-trace](https://github.com/0xProject/0x-monorepo/tree/development/packages/sol-trace) documentation! Sol-trace gives you a human-readable error stack trace when a revert happens in your Solidity code.
diff --git a/packages/website/md/docs/sol_trace/usage.md b/packages/website/md/docs/sol_trace/usage.md
index f3aa6fc35..d117a0faf 100644
--- a/packages/website/md/docs/sol_trace/usage.md
+++ b/packages/website/md/docs/sol_trace/usage.md
@@ -1,10 +1,10 @@
-Sol-trace uses transaction traces in order to figure out which lines of Solidity source code have been covered by your tests. In order for it to gather these traces, you must add the `TraceSubprovider` to the [ProviderEngine](https://github.com/MetaMask/provider-engine) instance you use when running your Solidity tests. If you're unfamiliar with ProviderEngine, please read the [Web3 Provider explained](https://0x.org/wiki#Web3-Provider-Explained) wiki article.
+Sol-trace uses transaction traces to reconstruct the stack trace when reverts happen in Solidity. In order for it to gather these traces, you must add the `RevertTraceSubprovider` to the [ProviderEngine](https://github.com/MetaMask/provider-engine) instance you use when running your Solidity tests. If you're unfamiliar with `ProviderEngine`, please read the [Web3 Provider explained](https://0x.org/wiki#Web3-Provider-Explained) wiki article.
-The TraceSubprovider eavesdrops on the `eth_sendTransaction` and `eth_call` RPC calls and collects traces after each call using `debug_traceTransaction`. `eth_call`'s' don't generate traces - so we take a snapshot, re-submit it as a transaction, get the trace and then revert the snapshot.
+The `RevertTraceSubprovider` eavesdrops on the `eth_sendTransaction` and `eth_call` RPC calls and collects traces after each call using `debug_traceTransaction`. `eth_call`'s' don't generate traces - so we take a snapshot, re-submit it as a transaction, get the trace and then revert the snapshot.
Trace subprovider needs some info about your contracts (`srcMap`, `bytecode`). It gets that info from your project's artifacts. Some frameworks have their own artifact format. Some artifact formats don't actually contain all the neccessary data.
-In order to use `TraceSubprovider` with your favorite framework you need to pass an `artifactsAdapter` to it.
+In order to use `RevertTraceSubprovider` with your favorite framework you need to pass an `artifactsAdapter` to it.
### Sol-compiler
@@ -12,9 +12,8 @@ If you are generating your artifacts with [@0x/sol-compiler](https://0x.org/docs
```typescript
import { SolCompilerArtifactsAdapter } from '@0x/sol-trace';
-const artifactsPath = 'src/artifacts';
-const contractsPath = 'src/contracts';
-const artifactsAdapter = new SolCompilerArtifactsAdapter(artifactsPath, contractsPath);
+// Both artifactsDir and contractsDir are optional and will be fetched from compiler.json if not passed in
+const artifactAdapter = new SolCompilerArtifactAdapter(artifactsDir, contractsDir);
```
### Truffle
@@ -23,8 +22,9 @@ If your project is using [Truffle](https://truffleframework.com/), we've written
```typescript
import { TruffleArtifactAdapter } from '@0x/sol-trace';
-const contractsPath = 'src/contracts';
-const artifactAdapter = new TruffleArtifactAdapter(contractsDir);
+const projectRoot = '.';
+const solcVersion = '0.5.0';
+const artifactAdapter = new TruffleArtifactAdapter(projectRoot, solcVersion);
```
Because truffle artifacts don't have all the data we need - we actually will recompile your contracts under the hood. That's why you don't need to pass an `artifactsPath`.
@@ -32,31 +32,31 @@ Because truffle artifacts don't have all the data we need - we actually will rec
### Other framework/toolset
You'll need to write your own artifacts adapter. It should extend `AbstractArtifactsAdapter`.
-Look at the code of the two adapters above for examples.
+
+```typescript
+import { AbstractArtifactAdapter } from '@0x/sol-trace';
+
+class YourCustomArtifactsAdapter extends AbstractArtifactAdapter {...};
+const artifactAdapter = new YourCustomArtifactsAdapter(...);
+```
### Usage
```typescript
-import { TraceSubprovider } from '@0x/sol-trace';
+import { RevertTraceSubprovider } from '@0x/sol-trace';
import ProviderEngine = require('web3-provider-engine');
const provider = new ProviderEngine();
-
-const artifactsPath = 'src/artifacts';
-const contractsPath = 'src/contracts';
-const networkId = 50;
// Some calls might not have `from` address specified. Nevertheless - transactions need to be submitted from an address with at least some funds. defaultFromAddress is the address that will be used to submit those calls as transactions from.
const defaultFromAddress = '0x5409ed021d9299bf6814279a6a1411a7e866a631';
const isVerbose = true;
-const traceSubprovider = new TraceSubprovider(artifactsAdapter, defaultFromAddress, isVerbose);
+const revertTraceSubprovider = new RevertTraceSubprovider(artifactsAdapter, defaultFromAddress, isVerbose);
-provider.addProvider(traceSubprovider);
+provider.addProvider(revertTraceSubprovider);
+// Add all your other providers
+provider.start();
```
-After your test suite is complete (e.g in the Mocha global `after` hook), you'll need to call:
-
-```typescript
-await traceSubprovider.writeTraceAsync();
-```
+Now when you run your tests, it should print out stack traces when encountering an error.
-This will create a `trace.json` file in a `trace` directory. This file has an [Istanbul format](https://github.com/gotwarlost/istanbul/blob/master/trace.json.md) - so you can use it with any of the existing Istanbul reporters.
+Use [Geth](https://github.com/ethereum/go-ethereum) as a backing node. We recommend using our [Devnet Docker container](https://hub.docker.com/r/0xorg/devnet) which sets up a Geth node for testing purposes. Ganache support is a [work in progress](https://github.com/0xProject/0x-monorepo/issues/1520).
diff --git a/packages/website/package.json b/packages/website/package.json
index af43fabf9..ce7ed395f 100644
--- a/packages/website/package.json
+++ b/packages/website/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/website",
- "version": "0.0.64",
+ "version": "0.0.67",
"engines": {
"node": ">=6.12"
},
@@ -20,18 +20,18 @@
"author": "Fabio Berger",
"license": "Apache-2.0",
"dependencies": {
- "@0x/asset-buyer": "^3.0.5",
- "@0x/contract-addresses": "^2.1.0",
- "@0x/contract-wrappers": "^4.2.0",
- "@0x/json-schemas": "^2.1.5",
- "@0x/order-utils": "^3.1.0",
- "@0x/react-docs": "^1.0.23",
- "@0x/react-shared": "^1.1.0",
- "@0x/subproviders": "^2.1.9",
- "@0x/types": "^1.5.0",
- "@0x/typescript-typings": "^3.0.4",
- "@0x/utils": "^2.1.1",
- "@0x/web3-wrapper": "^3.2.2",
+ "@0x/asset-buyer": "^4.0.2",
+ "@0x/contract-addresses": "^2.2.0",
+ "@0x/contract-wrappers": "^5.0.1",
+ "@0x/json-schemas": "^2.1.7",
+ "@0x/order-utils": "^3.1.2",
+ "@0x/react-docs": "^1.0.25",
+ "@0x/react-shared": "^1.1.2",
+ "@0x/subproviders": "^2.1.11",
+ "@0x/types": "^1.5.2",
+ "@0x/typescript-typings": "^3.0.8",
+ "@0x/utils": "^3.0.1",
+ "@0x/web3-wrapper": "^3.2.4",
"@reach/dialog": "^0.1.2",
"@types/react-lazyload": "^2.3.1",
"@types/react-loadable": "^5.4.2",
@@ -42,7 +42,7 @@
"blockies": "^0.0.2",
"bowser": "^1.9.3",
"deep-equal": "^1.0.1",
- "ethereum-types": "^1.1.4",
+ "ethereum-types": "^1.1.6",
"ethereumjs-util": "^5.1.1",
"find-versions": "^2.0.0",
"jsonschema": "^1.2.0",
@@ -54,18 +54,20 @@
"polished": "^1.9.2",
"query-string": "^6.0.0",
"rc-slider": "^8.6.3",
- "react": "^16.4.2",
+ "react": "^16.5.2",
"react-copy-to-clipboard": "^5.0.0",
"react-document-title": "^2.0.3",
- "react-dom": "^16.4.2",
+ "react-dom": "^16.5.2",
"react-flickity-component": "^3.1.0",
"react-headroom": "2.2.2",
"react-helmet": "^5.2.0",
"react-lazyload": "^2.3.0",
"react-loadable": "^5.5.0",
+ "react-markdown": "^4.0.6",
"react-popper": "^1.0.0-beta.6",
"react-redux": "^5.0.3",
"react-responsive": "^6.0.1",
+ "react-router-dom": "^4.3.1",
"react-scroll": "0xproject/react-scroll#pr-330-and-replace-state",
"react-scrollable-anchor": "^0.6.1",
"react-syntax-highlighter": "^10.1.1",
diff --git a/packages/website/public/css/basscss.min.css b/packages/website/public/css/basscss.min.css
new file mode 100644
index 000000000..cb6f13198
--- /dev/null
+++ b/packages/website/public/css/basscss.min.css
@@ -0,0 +1 @@
+/*! Basscss | http://basscss.com | MIT License */.h1{font-size:2rem}.h2{font-size:1.5rem}.h3{font-size:1.25rem}.h4{font-size:1rem}.h5{font-size:.875rem}.h6{font-size:.75rem}.font-family-inherit{font-family:inherit}.font-size-inherit{font-size:inherit}.text-decoration-none{text-decoration:none}.bold{font-weight:700}.regular{font-weight:400}.italic{font-style:italic}.caps{text-transform:uppercase;letter-spacing:.2em}.left-align{text-align:left}.center{text-align:center}.right-align{text-align:right}.justify{text-align:justify}.nowrap{white-space:nowrap}.break-word{word-wrap:break-word}.line-height-1{line-height:1}.line-height-2{line-height:1.125}.line-height-3{line-height:1.25}.line-height-4{line-height:1.5}.list-style-none{list-style:none}.underline{text-decoration:underline}.truncate{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.list-reset{list-style:none;padding-left:0}.inline{display:inline}.block{display:block}.inline-block{display:inline-block}.table{display:table}.table-cell{display:table-cell}.overflow-hidden{overflow:hidden}.overflow-scroll{overflow:scroll}.overflow-auto{overflow:auto}.clearfix:after,.clearfix:before{content:" ";display:table}.clearfix:after{clear:both}.left{float:left}.right{float:right}.fit{max-width:100%}.max-width-1{max-width:24rem}.max-width-2{max-width:32rem}.max-width-3{max-width:48rem}.max-width-4{max-width:64rem}.border-box{box-sizing:border-box}.align-baseline{vertical-align:baseline}.align-top{vertical-align:top}.align-middle{vertical-align:middle}.align-bottom{vertical-align:bottom}.m0{margin:0}.mt0{margin-top:0}.mr0{margin-right:0}.mb0{margin-bottom:0}.ml0,.mx0{margin-left:0}.mx0{margin-right:0}.my0{margin-top:0;margin-bottom:0}.m1{margin:.5rem}.mt1{margin-top:.5rem}.mr1{margin-right:.5rem}.mb1{margin-bottom:.5rem}.ml1,.mx1{margin-left:.5rem}.mx1{margin-right:.5rem}.my1{margin-top:.5rem;margin-bottom:.5rem}.m2{margin:1rem}.mt2{margin-top:1rem}.mr2{margin-right:1rem}.mb2{margin-bottom:1rem}.ml2,.mx2{margin-left:1rem}.mx2{margin-right:1rem}.my2{margin-top:1rem;margin-bottom:1rem}.m3{margin:2rem}.mt3{margin-top:2rem}.mr3{margin-right:2rem}.mb3{margin-bottom:2rem}.ml3,.mx3{margin-left:2rem}.mx3{margin-right:2rem}.my3{margin-top:2rem;margin-bottom:2rem}.m4{margin:4rem}.mt4{margin-top:4rem}.mr4{margin-right:4rem}.mb4{margin-bottom:4rem}.ml4,.mx4{margin-left:4rem}.mx4{margin-right:4rem}.my4{margin-top:4rem;margin-bottom:4rem}.mxn1{margin-left:-.5rem;margin-right:-.5rem}.mxn2{margin-left:-1rem;margin-right:-1rem}.mxn3{margin-left:-2rem;margin-right:-2rem}.mxn4{margin-left:-4rem;margin-right:-4rem}.ml-auto{margin-left:auto}.mr-auto,.mx-auto{margin-right:auto}.mx-auto{margin-left:auto}.p0{padding:0}.pt0{padding-top:0}.pr0{padding-right:0}.pb0{padding-bottom:0}.pl0,.px0{padding-left:0}.px0{padding-right:0}.py0{padding-top:0;padding-bottom:0}.p1{padding:.5rem}.pt1{padding-top:.5rem}.pr1{padding-right:.5rem}.pb1{padding-bottom:.5rem}.pl1{padding-left:.5rem}.py1{padding-top:.5rem;padding-bottom:.5rem}.px1{padding-left:.5rem;padding-right:.5rem}.p2{padding:1rem}.pt2{padding-top:1rem}.pr2{padding-right:1rem}.pb2{padding-bottom:1rem}.pl2{padding-left:1rem}.py2{padding-top:1rem;padding-bottom:1rem}.px2{padding-left:1rem;padding-right:1rem}.p3{padding:2rem}.pt3{padding-top:2rem}.pr3{padding-right:2rem}.pb3{padding-bottom:2rem}.pl3{padding-left:2rem}.py3{padding-top:2rem;padding-bottom:2rem}.px3{padding-left:2rem;padding-right:2rem}.p4{padding:4rem}.pt4{padding-top:4rem}.pr4{padding-right:4rem}.pb4{padding-bottom:4rem}.pl4{padding-left:4rem}.py4{padding-top:4rem;padding-bottom:4rem}.px4{padding-left:4rem;padding-right:4rem}.col{float:left}.col,.col-right{box-sizing:border-box}.col-right{float:right}.col-1{width:8.33333%}.col-2{width:16.66667%}.col-3{width:25%}.col-4{width:33.33333%}.col-5{width:41.66667%}.col-6{width:50%}.col-7{width:58.33333%}.col-8{width:66.66667%}.col-9{width:75%}.col-10{width:83.33333%}.col-11{width:91.66667%}.col-12{width:100%}@media (min-width:40em){.sm-col{float:left;box-sizing:border-box}.sm-col-right{float:right;box-sizing:border-box}.sm-col-1{width:8.33333%}.sm-col-2{width:16.66667%}.sm-col-3{width:25%}.sm-col-4{width:33.33333%}.sm-col-5{width:41.66667%}.sm-col-6{width:50%}.sm-col-7{width:58.33333%}.sm-col-8{width:66.66667%}.sm-col-9{width:75%}.sm-col-10{width:83.33333%}.sm-col-11{width:91.66667%}.sm-col-12{width:100%}}@media (min-width:52em){.md-col{float:left;box-sizing:border-box}.md-col-right{float:right;box-sizing:border-box}.md-col-1{width:8.33333%}.md-col-2{width:16.66667%}.md-col-3{width:25%}.md-col-4{width:33.33333%}.md-col-5{width:41.66667%}.md-col-6{width:50%}.md-col-7{width:58.33333%}.md-col-8{width:66.66667%}.md-col-9{width:75%}.md-col-10{width:83.33333%}.md-col-11{width:91.66667%}.md-col-12{width:100%}}@media (min-width:64em){.lg-col{float:left;box-sizing:border-box}.lg-col-right{float:right;box-sizing:border-box}.lg-col-1{width:8.33333%}.lg-col-2{width:16.66667%}.lg-col-3{width:25%}.lg-col-4{width:33.33333%}.lg-col-5{width:41.66667%}.lg-col-6{width:50%}.lg-col-7{width:58.33333%}.lg-col-8{width:66.66667%}.lg-col-9{width:75%}.lg-col-10{width:83.33333%}.lg-col-11{width:91.66667%}.lg-col-12{width:100%}}.flex{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}@media (min-width:40em){.sm-flex{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}}@media (min-width:52em){.md-flex{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}}@media (min-width:64em){.lg-flex{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}}.flex-column{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.flex-wrap{-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.items-start{-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;-ms-grid-row-align:flex-start;align-items:flex-start}.items-end{-webkit-box-align:end;-webkit-align-items:flex-end;-ms-flex-align:end;-ms-grid-row-align:flex-end;align-items:flex-end}.items-center{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;-ms-grid-row-align:center;align-items:center}.items-baseline{-webkit-box-align:baseline;-webkit-align-items:baseline;-ms-flex-align:baseline;-ms-grid-row-align:baseline;align-items:baseline}.items-stretch{-webkit-box-align:stretch;-webkit-align-items:stretch;-ms-flex-align:stretch;-ms-grid-row-align:stretch;align-items:stretch}.self-start{-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start}.self-end{-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end}.self-center{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.self-baseline{-webkit-align-self:baseline;-ms-flex-item-align:baseline;align-self:baseline}.self-stretch{-webkit-align-self:stretch;-ms-flex-item-align:stretch;align-self:stretch}.justify-start{-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start}.justify-end{-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end}.justify-center{-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.justify-between{-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.justify-around{-webkit-justify-content:space-around;-ms-flex-pack:distribute;justify-content:space-around}.content-start{-webkit-align-content:flex-start;-ms-flex-line-pack:start;align-content:flex-start}.content-end{-webkit-align-content:flex-end;-ms-flex-line-pack:end;align-content:flex-end}.content-center{-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center}.content-between{-webkit-align-content:space-between;-ms-flex-line-pack:justify;align-content:space-between}.content-around{-webkit-align-content:space-around;-ms-flex-line-pack:distribute;align-content:space-around}.content-stretch{-webkit-align-content:stretch;-ms-flex-line-pack:stretch;align-content:stretch}.flex-auto{-webkit-box-flex:1;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;min-width:0;min-height:0}.flex-none{-webkit-box-flex:0;-webkit-flex:none;-ms-flex:none;flex:none}.order-0{-webkit-box-ordinal-group:1;-webkit-order:0;-ms-flex-order:0;order:0}.order-1{-webkit-box-ordinal-group:2;-webkit-order:1;-ms-flex-order:1;order:1}.order-2{-webkit-box-ordinal-group:3;-webkit-order:2;-ms-flex-order:2;order:2}.order-3{-webkit-box-ordinal-group:4;-webkit-order:3;-ms-flex-order:3;order:3}.order-last{-webkit-box-ordinal-group:100000;-webkit-order:99999;-ms-flex-order:99999;order:99999}.relative{position:relative}.absolute{position:absolute}.fixed{position:fixed}.top-0{top:0}.right-0{right:0}.bottom-0{bottom:0}.left-0{left:0}.z1{z-index:1}.z2{z-index:2}.z3{z-index:3}.z4{z-index:4}.border{border-style:solid;border-width:1px}.border-top{border-top-style:solid;border-top-width:1px}.border-right{border-right-style:solid;border-right-width:1px}.border-bottom{border-bottom-style:solid;border-bottom-width:1px}.border-left{border-left-style:solid;border-left-width:1px}.border-none{border:0}.rounded{border-radius:3px}.circle{border-radius:50%}.rounded-top{border-radius:3px 3px 0 0}.rounded-right{border-radius:0 3px 3px 0}.rounded-bottom{border-radius:0 0 3px 3px}.rounded-left{border-radius:3px 0 0 3px}.not-rounded{border-radius:0}.hide{position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px)}@media (max-width:40em){.xs-hide{display:none!important}}@media (min-width:40em) and (max-width:52em){.sm-hide{display:none!important}}@media (min-width:52em) and (max-width:64em){.md-hide{display:none!important}}@media (min-width:64em){.lg-hide{display:none!important}}.display-none{display:none!important} \ No newline at end of file
diff --git a/packages/website/public/images/team/marcs.jpg b/packages/website/public/images/team/marcs.jpg
new file mode 100644
index 000000000..fefc24156
--- /dev/null
+++ b/packages/website/public/images/team/marcs.jpg
Binary files differ
diff --git a/packages/website/public/images/team/oshirob.png b/packages/website/public/images/team/oshirob.png
new file mode 100644
index 000000000..094bab79b
--- /dev/null
+++ b/packages/website/public/images/team/oshirob.png
Binary files differ
diff --git a/packages/website/public/index.html b/packages/website/public/index.html
index 26ebcdec8..738b675e7 100644
--- a/packages/website/public/index.html
+++ b/packages/website/public/index.html
@@ -18,6 +18,7 @@
<link rel="stylesheet" href="/css/roboto.css" />
<link rel="stylesheet" href="/css/roboto_mono.css" />
<link rel="stylesheet" href="/css/formular.css" />
+ <link rel="stylesheet" href="/css/basscss.min.css" />
<link rel="stylesheet" href="/css/basscss_responsive_custom.css" />
<link rel="stylesheet" href="/css/basscss_responsive_padding.css" />
<link rel="stylesheet" href="/css/basscss_responsive_margin.css" />
diff --git a/packages/website/translations/chinese.json b/packages/website/translations/chinese.json
index 88193a181..1af89ebfe 100644
--- a/packages/website/translations/chinese.json
+++ b/packages/website/translations/chinese.json
@@ -7,48 +7,37 @@
"FULL_LIST_PROMPT": "查看",
"FULL_LIST_LINK": "完整列表",
"TOKENIZED_SECTION_HEADER": "世界正走向代币化时代",
- "TOKENIZED_SECTION_DESCRIPTION":
- "以太坊区块链是一种开源的金融服务系统,全网无边界,统一使用加密代币充当各类资产。在未来,大多数数字资产和商品都将实现代币化。",
+ "TOKENIZED_SECTION_DESCRIPTION": "以太坊区块链是一种开源的金融服务系统,全网无边界,统一使用加密代币充当各类资产。在未来,大多数数字资产和商品都将实现代币化。",
"CURRENCY": "货币",
"TRADITIONAL_ASSETS": "传统资产",
"DIGITAL_GOODS": "数字商品",
"OFFCHAIN_ORDER_RELAY": "链下订单中继",
"ONCHAIN_SETTLEMENT": "链上最终结算",
- "OFFCHAIN_ONCHAIN_DESCRIPTION":
- "在 0x 协议中,所有订单都通过链下传输,大幅削减了损耗成本,能够有效避免区块链膨胀。任何人都可以构建中继方,由中继方广播订单,每促成一笔交易,就可以收取一笔交易费。",
+ "OFFCHAIN_ONCHAIN_DESCRIPTION": "在 0x 协议中,所有订单都通过链下传输,大幅削减了损耗成本,能够有效避免区块链膨胀。任何人都可以构建中继方,由中继方广播订单,每促成一笔交易,就可以收取一笔交易费。",
"RELAYERS_HEADER": "基于 0X 协议构建的中继方",
"BENEFITS_HEADER": "0x 的好處",
"BENEFIT_ONE_TITLE": "去信任化的交易机制",
- "BENEFIT_ONE_DESCRIPTION":
- "基于以太坊的分布式网络构建,去除中心体系单点故障,保证无间断运营,每笔交易都自动操作进行结算,完全解除交易对手风险。",
+ "BENEFIT_ONE_DESCRIPTION": "基于以太坊的分布式网络构建,去除中心体系单点故障,保证无间断运营,每笔交易都自动操作进行结算,完全解除交易对手风险。",
"BENEFIT_TWO_TITLE": "共享流动性",
- "BENEFIT_TWO_DESCRIPTION":
- "通过共享标准 API,让中继方轻松聚集流动池,随着越来越多的中继方纷纷上线,将形成充裕的流动性,创造网络效应。",
+ "BENEFIT_TWO_DESCRIPTION": "通过共享标准 API,让中继方轻松聚集流动池,随着越来越多的中继方纷纷上线,将形成充裕的流动性,创造网络效应。",
"BENEFIT_THREE_TITLE": "开源优势",
- "BENEFIT_THREE_DESCRIPTION":
- "0x 是一种开源协议,全网无边界,可供免费使用。用户可以直接联系已知的交易对象进行免费交易,还可以支付一定数额的 ZRX 代币,以访问中继方的流动池。",
+ "BENEFIT_THREE_DESCRIPTION": "0x 是一种开源协议,全网无边界,可供免费使用。用户可以直接联系已知的交易对象进行免费交易,还可以支付一定数额的 ZRX 代币,以访问中继方的流动池。",
"BUILDING_BLOCK_SECTION_HEADER": "去中心化应用的构建块",
- "BUILDING_BLOCK_SECTION_DESCRIPTION":
- "0x 协议是需要交易功能的去中心化应用的可插构建块。如今许多开发人员都在使用 0x 协议构建 Web 应用程序和智能合约,赶快加入这一行列吧!",
+ "BUILDING_BLOCK_SECTION_DESCRIPTION": "0x 协议是需要交易功能的去中心化应用的可插构建块。如今许多开发人员都在使用 0x 协议构建 Web 应用程序和智能合约,赶快加入这一行列吧!",
"DEV_TOOLS_PROMPT": "了解具体的构建方法,请参见",
"SMART_CONTRACT": "智能合约 的文档",
"DOCS": "",
"AND": "和",
"DECENTRALIZED_GOVERNANCE": "去中心化的治理",
- "DECENTRALIZED_GOVERNANCE_DESCRIPTION":
- "去中心化组织使用代币代表所有权,指引其治理逻辑。去中心化组织利用 0x 协议,可以无缝安全地进行启动资金所有权的交易。",
+ "DECENTRALIZED_GOVERNANCE_DESCRIPTION": "去中心化组织使用代币代表所有权,指引其治理逻辑。去中心化组织利用 0x 协议,可以无缝安全地进行启动资金所有权的交易。",
"PREDICTION_MARKETS": "预测市场",
- "PREDICTION_MARKETS_DESCRIPTION":
- "去中心化预测市场平台会根据现实世界中发生的事件,按照其中包含的金融风险生成代币集合。使用 0x 协议,允许这些代币即刻交易。",
+ "PREDICTION_MARKETS_DESCRIPTION": "去中心化预测市场平台会根据现实世界中发生的事件,按照其中包含的金融风险生成代币集合。使用 0x 协议,允许这些代币即刻交易。",
"STABLE_TOKENS": "稳定代币",
- "STABLE_TOKENS_DESCRIPTION":
- "StableCoins 等新型经济结构的成功建设有赖于高效的流动性市场的支持。0x 协议能有效促进底层经济机制,利于代币保持稳定。",
+ "STABLE_TOKENS_DESCRIPTION": "StableCoins 等新型经济结构的成功建设有赖于高效的流动性市场的支持。0x 协议能有效促进底层经济机制,利于代币保持稳定。",
"DECENTRALIZED_LOANS": "去中心化的借贷模式",
- "DECENTRALIZED_LOANS_DESCRIPTION":
- "高效借贷需要流动性市场的支持,为投资者提供方便购买、转卖借贷商品的平台。使用 0x 协议能够为借款方搭建一个自组织的生态系统,高效地针对所有未偿贷款确定市场价格。",
+ "DECENTRALIZED_LOANS_DESCRIPTION": "高效借贷需要流动性市场的支持,为投资者提供方便购买、转卖借贷商品的平台。使用 0x 协议能够为借款方搭建一个自组织的生态系统,高效地针对所有未偿贷款确定市场价格。",
"FUND_MANAGEMENT": "基金管理",
- "FUND_MANAGEMENT_DESCRIPTION":
- "去中心化基金管理通过划分需事先商定的资产类别,有效限制基金经理的投资行为。向基金管理智能合约中嵌入 0x 协议,可确保其遵守安全约束。",
+ "FUND_MANAGEMENT_DESCRIPTION": "去中心化基金管理通过划分需事先商定的资产类别,有效限制基金经理的投资行为。向基金管理智能合约中嵌入 0x 协议,可确保其遵守安全约束。",
"FINAL_CALL_TO_ACTION": "开始构建去中心化的未来",
"DOCUMENTATION": "文档",
"COMMUNITY": "社区",
@@ -93,8 +82,7 @@
"GITHUB": "github",
"LIVE_CHAT": "live chat",
"LIBRARIES_AND_TOOLS": "Libraries & Tools",
- "LIBRARIES_AND_TOOLS_DESCRIPTION":
- "A list of available tools maintained by the 0x core developers and wider community for building on top of 0x Protocol and Ethereum",
+ "LIBRARIES_AND_TOOLS_DESCRIPTION": "A list of available tools maintained by the 0x core developers and wider community for building on top of 0x Protocol and Ethereum",
"MORE": "more",
"LAUNCH_KIT": "0x launch kit",
"LAUNCH_KIT_PITCH": "launch a relayer in under a minute.",
@@ -110,6 +98,5 @@
"PERFECT_FOR_DEVELOPERS": "Perfect for developers who need a simple drop-in marketplace",
"LEARN_MORE": "learn more",
"START_BUILDING_ON_0X": "Start building on 0x",
- "START_BUILDING_ON_0X_DESCRIPTION":
- "Follow one of our \"Getting started\" guides to learn more about building ontop of 0x."
+ "START_BUILDING_ON_0X_DESCRIPTION": "Follow one of our \"Getting started\" guides to learn more about building ontop of 0x."
}
diff --git a/packages/website/translations/english.json b/packages/website/translations/english.json
index a1d8ecc43..000cbefdf 100644
--- a/packages/website/translations/english.json
+++ b/packages/website/translations/english.json
@@ -1,56 +1,44 @@
{
"TOP_HEADER": "powering decentralized exchange",
- "TOP_TAGLINE":
- "0x is an open, permissionless protocol allowing for ERC20 tokens to be traded on the Ethereum blockchain.",
+ "TOP_TAGLINE": "0x is an open, permissionless protocol allowing for ERC20 tokens to be traded on the Ethereum blockchain.",
"BUILD_CALL_TO_ACTION": "build on 0x",
"COMMUNITY_CALL_TO_ACTION": "join the community",
"PROJECTS_HEADER": "projects building on 0x",
"FULL_LIST_PROMPT": "view the",
"FULL_LIST_LINK": "full list",
"TOKENIZED_SECTION_HEADER": "the world's value is becoming tokenized",
- "TOKENIZED_SECTION_DESCRIPTION":
- "0x is the critical infrastructure layer in the emerging financial stack built on a foundation of Ethereum token standards. Developers needing exchange functionality for ERC 20 tokens, ERC 721 tokens, or any new asset type can easily integrate the 0x protocol into their application.",
+ "TOKENIZED_SECTION_DESCRIPTION": "0x is the critical infrastructure layer in the emerging financial stack built on a foundation of Ethereum token standards. Developers needing exchange functionality for ERC 20 tokens, ERC 721 tokens, or any new asset type can easily integrate the 0x protocol into their application.",
"CURRENCY": "currency",
"TRADITIONAL_ASSETS": "traditional assets",
"DIGITAL_GOODS": "digital goods",
"OFFCHAIN_ORDER_RELAY": "off-chain order relay",
"ONCHAIN_SETTLEMENT": "on-chain settlement",
- "OFFCHAIN_ONCHAIN_DESCRIPTION":
- "in 0x protocol, orders are transported off-chain, massively reducing gas costs and eliminating blockchain bloat. Relayers help broadcast orders and collect a fee each time they facilitate a trade. Anyone can build a relayer.",
+ "OFFCHAIN_ONCHAIN_DESCRIPTION": "in 0x protocol, orders are transported off-chain, massively reducing gas costs and eliminating blockchain bloat. Relayers help broadcast orders and collect a fee each time they facilitate a trade. Anyone can build a relayer.",
"RELAYERS_HEADER": "relayers building on 0x",
"BENEFITS_HEADER": "benefits of 0x",
"USE_CASES_HEADER": "use cases of 0x",
"BENEFIT_ONE_TITLE": "any asset",
- "BENEFIT_ONE_DESCRIPTION":
- "the 0x protocol facilitates the exchange of a growing number of Ethereum-based tokens including currencies, game items, and many more digital assets.",
+ "BENEFIT_ONE_DESCRIPTION": "the 0x protocol facilitates the exchange of a growing number of Ethereum-based tokens including currencies, game items, and many more digital assets.",
"BENEFIT_TWO_TITLE": "networked liquidity",
- "BENEFIT_TWO_DESCRIPTION":
- "by sharing a standard API, relayers can easily aggregate liquidity pools, creating network effects around liquidity that compound as more relayers come online.",
+ "BENEFIT_TWO_DESCRIPTION": "by sharing a standard API, relayers can easily aggregate liquidity pools, creating network effects around liquidity that compound as more relayers come online.",
"BENEFIT_THREE_TITLE": "exchange everywhere",
- "BENEFIT_THREE_DESCRIPTION":
- "0x allows trade functionality to fade into the background, enabling developers to focus on building while 0x handles the exchange.",
+ "BENEFIT_THREE_DESCRIPTION": "0x allows trade functionality to fade into the background, enabling developers to focus on building while 0x handles the exchange.",
"BUILDING_BLOCK_SECTION_HEADER": "a building block for dApps",
- "BUILDING_BLOCK_SECTION_DESCRIPTION":
- "0x protocol is a pluggable building block for dApps that require exchange functionality. Join the many developers that are already using 0x in their web applications and smart contracts.",
+ "BUILDING_BLOCK_SECTION_DESCRIPTION": "0x protocol is a pluggable building block for dApps that require exchange functionality. Join the many developers that are already using 0x in their web applications and smart contracts.",
"DEV_TOOLS_PROMPT": "learn how in our",
"SMART_CONTRACT": "smart contract",
"DOCS": "docs",
"AND": "and",
"DECENTRALIZED_GOVERNANCE": "decentralized governance",
- "DECENTRALIZED_GOVERNANCE_DESCRIPTION":
- "Decentralized organizations use tokens to represent ownership and guide their governance logic. 0x allows decentralized organizations to seamlessly and safely trade ownership for startup capital.",
+ "DECENTRALIZED_GOVERNANCE_DESCRIPTION": "Decentralized organizations use tokens to represent ownership and guide their governance logic. 0x allows decentralized organizations to seamlessly and safely trade ownership for startup capital.",
"PREDICTION_MARKETS": "prediction markets",
- "PREDICTION_MARKETS_DESCRIPTION":
- "decentralized prediction market platforms generate sets of tokens that represent a financial stake in the outcomes of real-world events. 0x allows these tokens to be instantly tradable.",
+ "PREDICTION_MARKETS_DESCRIPTION": "decentralized prediction market platforms generate sets of tokens that represent a financial stake in the outcomes of real-world events. 0x allows these tokens to be instantly tradable.",
"STABLE_TOKENS": "stable tokens",
- "STABLE_TOKENS_DESCRIPTION":
- "novel economic constructs such as stable coins require efficient, liquid markets to succeed. 0x will facilitate the underlying economic mechanisms that allow these tokens to remain stable.",
+ "STABLE_TOKENS_DESCRIPTION": "novel economic constructs such as stable coins require efficient, liquid markets to succeed. 0x will facilitate the underlying economic mechanisms that allow these tokens to remain stable.",
"DECENTRALIZED_LOANS": "decentralized loans",
- "DECENTRALIZED_LOANS_DESCRIPTION":
- "efficient lending requires liquid markets where investors can buy and re-sell loans. 0x enables an ecosystem of lenders to self-organize and efficiently determine market prices for all outstanding loans.",
+ "DECENTRALIZED_LOANS_DESCRIPTION": "efficient lending requires liquid markets where investors can buy and re-sell loans. 0x enables an ecosystem of lenders to self-organize and efficiently determine market prices for all outstanding loans.",
"FUND_MANAGEMENT": "fund management",
- "FUND_MANAGEMENT_DESCRIPTION":
- "Decentralized fund management limits fund managers to investing in pre-agreed upon asset classes. Embedding 0x into fund management smart contracts enables them to enforce these security constraints.",
+ "FUND_MANAGEMENT_DESCRIPTION": "Decentralized fund management limits fund managers to investing in pre-agreed upon asset classes. Embedding 0x into fund management smart contracts enables them to enforce these security constraints.",
"FINAL_CALL_TO_ACTION": "get started on building the decentralized future",
"DOCUMENTATION": "documentation",
"COMMUNITY": "community",
@@ -93,15 +81,13 @@
"USE_NETWORKED_LIQUIDITY": "use networked liquidity",
"USE_NETWORKED_LIQUIDITY_DESCRIPTION": "Learn how to tap into networked liquidity using the Standard Relayer API",
"INTEGRATE_0X_INSTANT": "add seamless purchasing of crypto assets to your website or app",
- "INTEGRATE_0X_INSTANT_DESCRIPTION":
- "learn how to use 0x Instant or AssetBuyer to give your users the power of purchasing crypto assets using 0x",
+ "INTEGRATE_0X_INSTANT_DESCRIPTION": "learn how to use 0x Instant or AssetBuyer to give your users the power of purchasing crypto assets using 0x",
"VIEW_ALL_DOCUMENTATION": "view all documentation",
"SANDBOX": "0x.js sandbox",
"GITHUB": "github",
"LIVE_CHAT": "live chat",
"LIBRARIES_AND_TOOLS": "Libraries & Tools",
- "LIBRARIES_AND_TOOLS_DESCRIPTION":
- "A list of available tools maintained by the 0x core developers and wider community for building on top of 0x Protocol and Ethereum",
+ "LIBRARIES_AND_TOOLS_DESCRIPTION": "A list of available tools maintained by the 0x core developers and wider community for building on top of 0x Protocol and Ethereum",
"MORE": "more",
"LAUNCH_KIT": "0x launch kit",
"LAUNCH_KIT_PITCH": "launch a relayer in under a minute.",
@@ -118,12 +104,9 @@
"LEARN_MORE": "learn more",
"OUR_MISSION_AND_VALUES": "our mission & values",
"GAMING_AND_COLLECTABLES": "gaming & collectables",
- "GAMING_AND_COLLECTABLES_DESCRIPTION":
- "artists and game makers are tokenizing digital art and in-game items known as non-fungible tokens (NFTs). 0x enables these creators to add exchange functionality to give access and the ability to build marketplaces for NFT trading.",
+ "GAMING_AND_COLLECTABLES_DESCRIPTION": "artists and game makers are tokenizing digital art and in-game items known as non-fungible tokens (NFTs). 0x enables these creators to add exchange functionality to give access and the ability to build marketplaces for NFT trading.",
"ORDER_BOOKS": "order books",
- "ORDER_BOOKS_DESCRIPTION":
- "there are thousands of decentralized apps that have native utility tokens. 0x provides market makers and professional exchanges an ability to host order books to facilitate the exchange of these assets.",
+ "ORDER_BOOKS_DESCRIPTION": "there are thousands of decentralized apps that have native utility tokens. 0x provides market makers and professional exchanges an ability to host order books to facilitate the exchange of these assets.",
"START_BUILDING_ON_0X": "Start building on 0x",
- "START_BUILDING_ON_0X_DESCRIPTION":
- "Follow one of our \"Getting started\" guides to learn more about building ontop of 0x."
+ "START_BUILDING_ON_0X_DESCRIPTION": "Follow one of our \"Getting started\" guides to learn more about building ontop of 0x."
}
diff --git a/packages/website/translations/korean.json b/packages/website/translations/korean.json
index 539b81470..82f88a0c3 100644
--- a/packages/website/translations/korean.json
+++ b/packages/website/translations/korean.json
@@ -7,48 +7,37 @@
"FULL_LIST_PROMPT": "보기",
"FULL_LIST_LINK": "전체 목록",
"TOKENIZED_SECTION_HEADER": "전 세계의 가치가 토큰으로 변환되고 있음",
- "TOKENIZED_SECTION_DESCRIPTION":
- "이더리움 블록체인은 국경이 없는 개방형 결제 시스템으로, 다양한 자산을 암호화 토큰으로 나타내 줍니다. 앞으로는 디지털 자산과 상품 대부분이 토큰으로 바뀔 것입니다.",
+ "TOKENIZED_SECTION_DESCRIPTION": "이더리움 블록체인은 국경이 없는 개방형 결제 시스템으로, 다양한 자산을 암호화 토큰으로 나타내 줍니다. 앞으로는 디지털 자산과 상품 대부분이 토큰으로 바뀔 것입니다.",
"CURRENCY": "통화",
"TRADITIONAL_ASSETS": "전통적 자산",
"DIGITAL_GOODS": "디지털 상품",
"OFFCHAIN_ORDER_RELAY": "오프체인 주문 릴레이",
"ONCHAIN_SETTLEMENT": "온체인 정산",
- "OFFCHAIN_ONCHAIN_DESCRIPTION":
- "0x 프로토콜에서 주문은 오프체인으로 전달되므로, 가스 비용이 대폭 줄고 블록체인이 불필요하게 커지지 않습니다. Relayer는 주문을 브로드캐스팅할 수 있게 해 주고, 주문에서 거래가 진행될 때마다 수수료를 받을 수 있습니다. 누구든지 Relayer를 생성할 수 있습니다.",
+ "OFFCHAIN_ONCHAIN_DESCRIPTION": "0x 프로토콜에서 주문은 오프체인으로 전달되므로, 가스 비용이 대폭 줄고 블록체인이 불필요하게 커지지 않습니다. Relayer는 주문을 브로드캐스팅할 수 있게 해 주고, 주문에서 거래가 진행될 때마다 수수료를 받을 수 있습니다. 누구든지 Relayer를 생성할 수 있습니다.",
"RELAYERS_HEADER": "0x 기반 Relayer",
"BENEFITS_HEADER": "모두 보기",
"BENEFIT_ONE_TITLE": "신뢰할 수 없는 거래소",
- "BENEFIT_ONE_DESCRIPTION":
- "중앙화된 오류 지점과 중단 시간이 없는 이더리움의 분산 네트워크를 바탕으로 구축되므로, 각 거래가 개별 단위로 정산되며 거래 상대방으로 인한 위험도 없습니다.",
+ "BENEFIT_ONE_DESCRIPTION": "중앙화된 오류 지점과 중단 시간이 없는 이더리움의 분산 네트워크를 바탕으로 구축되므로, 각 거래가 개별 단위로 정산되며 거래 상대방으로 인한 위험도 없습니다.",
"BENEFIT_TWO_TITLE": "공유 유동 자금",
- "BENEFIT_TWO_DESCRIPTION":
- "표준 API를 공유하므로 Relayer는 유동 자금 풀을 쉽게 취합할 수 있습니다. 따라서 더 많은 Relayer가 온라인 상태가 되면 유동 자금을 바탕으로 한 복합적인 네트워크 효과를 만들 수 있습니다.",
+ "BENEFIT_TWO_DESCRIPTION": "표준 API를 공유하므로 Relayer는 유동 자금 풀을 쉽게 취합할 수 있습니다. 따라서 더 많은 Relayer가 온라인 상태가 되면 유동 자금을 바탕으로 한 복합적인 네트워크 효과를 만들 수 있습니다.",
"BENEFIT_THREE_TITLE": "오픈 소스",
- "BENEFIT_THREE_DESCRIPTION":
- "0x는 무허가형 오프 소스이며, 무료로 사용할 수 있습니다. 이미 알고 있는 상대방과 직접 무료로 거래하거나, Relayer에 약간의 ZRX 토큰을 지불하여 해당 유동 자금 풀에 액세스할 수 있습니다.",
+ "BENEFIT_THREE_DESCRIPTION": "0x는 무허가형 오프 소스이며, 무료로 사용할 수 있습니다. 이미 알고 있는 상대방과 직접 무료로 거래하거나, Relayer에 약간의 ZRX 토큰을 지불하여 해당 유동 자금 풀에 액세스할 수 있습니다.",
"BUILDING_BLOCK_SECTION_HEADER": "dApp을 위한 기본 구성 요소",
- "BUILDING_BLOCK_SECTION_DESCRIPTION":
- "0x 프로토콜은 거래소 기능이 필요한 dApp을 위한 연결 가능한 기본 구성 요소입니다. 웹 애플리케이션과 스마트 계약에서 이미 0x를 사용하고 있는 여러 개발자 대열에 동참해 보세요.",
+ "BUILDING_BLOCK_SECTION_DESCRIPTION": "0x 프로토콜은 거래소 기능이 필요한 dApp을 위한 연결 가능한 기본 구성 요소입니다. 웹 애플리케이션과 스마트 계약에서 이미 0x를 사용하고 있는 여러 개발자 대열에 동참해 보세요.",
"DEV_TOOLS_PROMPT": "수행하는 방법 알아보기",
"SMART_CONTRACT": "스마트 계약 문서에 ",
"DOCS": "",
"AND": "및",
"DECENTRALIZED_GOVERNANCE": "탈중앙화된 거버넌스",
- "DECENTRALIZED_GOVERNANCE_DESCRIPTION":
- "탈중앙화된 조직은 토큰을 사용하여 소유권을 나타내며 거버넌스 로직의 방향을 정합니다. 0x를 사용하면 탈중앙화된 조직이 안전하고 원활하게 스타트업 자금의 소유권을 주고받을 수 있습니다.",
+ "DECENTRALIZED_GOVERNANCE_DESCRIPTION": "탈중앙화된 조직은 토큰을 사용하여 소유권을 나타내며 거버넌스 로직의 방향을 정합니다. 0x를 사용하면 탈중앙화된 조직이 안전하고 원활하게 스타트업 자금의 소유권을 주고받을 수 있습니다.",
"PREDICTION_MARKETS": "예측 시장",
- "PREDICTION_MARKETS_DESCRIPTION":
- "탈중앙화된 예측 시장 플랫폼은 실제 이벤트 결과에서의 금전적인 지분을 나타내는 토큰 세트를 생성합니다. 0x를 사용하면 이러한 토큰을 즉시 거래할 수 있습니다.",
+ "PREDICTION_MARKETS_DESCRIPTION": "탈중앙화된 예측 시장 플랫폼은 실제 이벤트 결과에서의 금전적인 지분을 나타내는 토큰 세트를 생성합니다. 0x를 사용하면 이러한 토큰을 즉시 거래할 수 있습니다.",
"STABLE_TOKENS": "안정적인 토큰",
- "STABLE_TOKENS_DESCRIPTION":
- "안정적인 코인과 같은 새롭게 등장한 경제 개념은 효율성이 높은 유동 시장에 적용해야 성공할 수 있습니다. 0x는 이러한 토큰이 안정적인 상태를 유지할 수 있게 하는 기반 경제 메커니즘을 가능하게 합니다.",
+ "STABLE_TOKENS_DESCRIPTION": "안정적인 코인과 같은 새롭게 등장한 경제 개념은 효율성이 높은 유동 시장에 적용해야 성공할 수 있습니다. 0x는 이러한 토큰이 안정적인 상태를 유지할 수 있게 하는 기반 경제 메커니즘을 가능하게 합니다.",
"DECENTRALIZED_LOANS": "탈중앙화된 대출",
- "DECENTRALIZED_LOANS_DESCRIPTION":
- "대출이 효율적으로 이루어지려면 투자자가 대출 상품을 사고 다시 파는 유동 시장이 있어야 합니다. 0x를 통해 전체 미상환 대출이 자체 구성되고 이러한 대출의 시장 가격을 효율적으로 결정할 수 있는 대출 기관 생태계가 가능해집니다.",
+ "DECENTRALIZED_LOANS_DESCRIPTION": "대출이 효율적으로 이루어지려면 투자자가 대출 상품을 사고 다시 파는 유동 시장이 있어야 합니다. 0x를 통해 전체 미상환 대출이 자체 구성되고 이러한 대출의 시장 가격을 효율적으로 결정할 수 있는 대출 기관 생태계가 가능해집니다.",
"FUND_MANAGEMENT": "자금 관리",
- "FUND_MANAGEMENT_DESCRIPTION":
- "탈중앙화된 자금 관리로 자금 운용 관리자가 사전 합의된 자산 등급에 투자하는 것이 제한됩니다. 자금 관리 스마트 계약에 0x를 포함시키면 자금 운용 담당자가 보안 관련 제한 사항을 강화할 수 있습니다.",
+ "FUND_MANAGEMENT_DESCRIPTION": "탈중앙화된 자금 관리로 자금 운용 관리자가 사전 합의된 자산 등급에 투자하는 것이 제한됩니다. 자금 관리 스마트 계약에 0x를 포함시키면 자금 운용 담당자가 보안 관련 제한 사항을 강화할 수 있습니다.",
"FINAL_CALL_TO_ACTION": "탈중앙화된 미래 구축하기",
"DOCUMENTATION": "문서",
"COMMUNITY": "커뮤니티",
@@ -93,8 +82,7 @@
"GITHUB": "github",
"LIVE_CHAT": "live chat",
"LIBRARIES_AND_TOOLS": "Libraries & Tools",
- "LIBRARIES_AND_TOOLS_DESCRIPTION":
- "A list of available tools maintained by the 0x core developers and wider community for building on top of 0x Protocol and Ethereum",
+ "LIBRARIES_AND_TOOLS_DESCRIPTION": "A list of available tools maintained by the 0x core developers and wider community for building on top of 0x Protocol and Ethereum",
"MORE": "more",
"LAUNCH_KIT": "0x launch kit",
"LAUNCH_KIT_PITCH": "launch a relayer in under a minute.",
@@ -110,6 +98,5 @@
"PERFECT_FOR_DEVELOPERS": "Perfect for developers who need a simple drop-in marketplace",
"LEARN_MORE": "learn more",
"START_BUILDING_ON_0X": "Start building on 0x",
- "START_BUILDING_ON_0X_DESCRIPTION":
- "Follow one of our \"Getting started\" guides to learn more about building ontop of 0x."
+ "START_BUILDING_ON_0X_DESCRIPTION": "Follow one of our \"Getting started\" guides to learn more about building ontop of 0x."
}
diff --git a/packages/website/translations/russian.json b/packages/website/translations/russian.json
index feb5df02e..acf78b507 100644
--- a/packages/website/translations/russian.json
+++ b/packages/website/translations/russian.json
@@ -7,48 +7,37 @@
"FULL_LIST_PROMPT": "Просмотреть",
"FULL_LIST_LINK": "полный список",
"TOKENIZED_SECTION_HEADER": "Сегодняшний мир движется к токенизации ценности",
- "TOKENIZED_SECTION_DESCRIPTION":
- "Блокчейн Ethereum — это открытая, безграничная финансовая система, большое количество активов которой представлено в виде криптографических токенов. В будущем большая часть цифровых активов и товаров будет токенизирована.",
+ "TOKENIZED_SECTION_DESCRIPTION": "Блокчейн Ethereum — это открытая, безграничная финансовая система, большое количество активов которой представлено в виде криптографических токенов. В будущем большая часть цифровых активов и товаров будет токенизирована.",
"CURRENCY": "Валюта",
"TRADITIONAL_ASSETS": "Традиционные активы",
"DIGITAL_GOODS": "Цифровые товары",
"OFFCHAIN_ORDER_RELAY": "Офчейн-ордер",
"ONCHAIN_SETTLEMENT": "Ончейн-транзакция",
- "OFFCHAIN_ONCHAIN_DESCRIPTION":
- "При использовании протокола 0x ордера проводятся вне блокчейна, что сокращает расходы на газ (топливо) и предотвращает раздувание блокчейна. Релейеры помогают провести ордера и берут комиссию каждый раз, когда способствуют торгам. Любой может создать релейера.",
+ "OFFCHAIN_ONCHAIN_DESCRIPTION": "При использовании протокола 0x ордера проводятся вне блокчейна, что сокращает расходы на газ (топливо) и предотвращает раздувание блокчейна. Релейеры помогают провести ордера и берут комиссию каждый раз, когда способствуют торгам. Любой может создать релейера.",
"RELAYERS_HEADER": "РЕЛЕЙЕРЫ, РАЗРАБОТАННЫЕ НА 0X",
"BENEFITS_HEADER": "Просмотреть все",
"BENEFIT_ONE_TITLE": "Обмен, не требующий доверия",
- "BENEFIT_ONE_DESCRIPTION":
- "Каждая сделка, основанная на распределенной сети Ethereum без единой точки отказа и с нулевым временем простоя, является атомарной операцией и проводится без риска для контрагента.",
+ "BENEFIT_ONE_DESCRIPTION": "Каждая сделка, основанная на распределенной сети Ethereum без единой точки отказа и с нулевым временем простоя, является атомарной операцией и проводится без риска для контрагента.",
"BENEFIT_TWO_TITLE": "Общая ликвидность",
- "BENEFIT_TWO_DESCRIPTION":
- "При обмене стандартным API релейеры могут легко объединять пулы ликвидности, создавая сетевые эффекты вокруг ликвидности, которые усложняются с появлением новых релейеров в сети.",
+ "BENEFIT_TWO_DESCRIPTION": "При обмене стандартным API релейеры могут легко объединять пулы ликвидности, создавая сетевые эффекты вокруг ликвидности, которые усложняются с появлением новых релейеров в сети.",
"BENEFIT_THREE_TITLE": "Открытый исходный код",
- "BENEFIT_THREE_DESCRIPTION":
- "0x — это бесплатный и доступный протокол с открытым кодом. Торгуйте напрямую с известными контрагентами бесплатно или заплатите релейеру несколько ZRX-токенов, чтобы получить доступ к его пулу ликвидности.",
+ "BENEFIT_THREE_DESCRIPTION": "0x — это бесплатный и доступный протокол с открытым кодом. Торгуйте напрямую с известными контрагентами бесплатно или заплатите релейеру несколько ZRX-токенов, чтобы получить доступ к его пулу ликвидности.",
"BUILDING_BLOCK_SECTION_HEADER": "Строительный блок для dApp",
- "BUILDING_BLOCK_SECTION_DESCRIPTION":
- "Протокол 0x — это подключаемый строительный блок для dApp, нуждающихся в функционале обмена. Присоединяйтесь к разработчикам, которые уже используют 0x в своих веб-приложениях и смарт-контрактах.",
+ "BUILDING_BLOCK_SECTION_DESCRIPTION": "Протокол 0x — это подключаемый строительный блок для dApp, нуждающихся в функционале обмена. Присоединяйтесь к разработчикам, которые уже используют 0x в своих веб-приложениях и смарт-контрактах.",
"DEV_TOOLS_PROMPT": "Узнайте как это сделать в документации к",
"SMART_CONTRACT": "смарт-контрактам",
"DOCS": "",
"AND": "и",
"DECENTRALIZED_GOVERNANCE": "Децентрализированное управление",
- "DECENTRALIZED_GOVERNANCE_DESCRIPTION":
- "Децентрализованные организации используют токены для представления собственности и внедрения своей логики управления. Протокол 0x позволяет децентрализованным организациям беспрепятственно и безопасно торговать собственностью для стартового капитала.",
+ "DECENTRALIZED_GOVERNANCE_DESCRIPTION": "Децентрализованные организации используют токены для представления собственности и внедрения своей логики управления. Протокол 0x позволяет децентрализованным организациям беспрепятственно и безопасно торговать собственностью для стартового капитала.",
"PREDICTION_MARKETS": "Рынки предсказаний",
- "PREDICTION_MARKETS_DESCRIPTION":
- "Платформы для децентрализованных рынков предсказаний генерируют множество токенов, которые представляют собой финансовую долю в результате реальных событий. Протокол 0x позволяет мгновенно торговать эти токены.",
+ "PREDICTION_MARKETS_DESCRIPTION": "Платформы для децентрализованных рынков предсказаний генерируют множество токенов, которые представляют собой финансовую долю в результате реальных событий. Протокол 0x позволяет мгновенно торговать эти токены.",
"STABLE_TOKENS": "Стабильные токены",
- "STABLE_TOKENS_DESCRIPTION":
- "Новые экономические конструкции, например стабильные токены, требуют наличия успешных и эффективных ликвидных рынков. Протокол 0x призван облегчить основные экономические механизмы, которые позволят этим токенам оставаться стабильными.",
+ "STABLE_TOKENS_DESCRIPTION": "Новые экономические конструкции, например стабильные токены, требуют наличия успешных и эффективных ликвидных рынков. Протокол 0x призван облегчить основные экономические механизмы, которые позволят этим токенам оставаться стабильными.",
"DECENTRALIZED_LOANS": "Децентрализированные займы",
- "DECENTRALIZED_LOANS_DESCRIPTION":
- "Эффективное кредитование требует наличия ликвидных рынков, где инвесторы могут купить и перепродать займы. Протокол 0x позволяет экосистеме кредиторов самоорганизовываться и эффективно определять рыночные цены для всех невыплаченных займов.",
+ "DECENTRALIZED_LOANS_DESCRIPTION": "Эффективное кредитование требует наличия ликвидных рынков, где инвесторы могут купить и перепродать займы. Протокол 0x позволяет экосистеме кредиторов самоорганизовываться и эффективно определять рыночные цены для всех невыплаченных займов.",
"FUND_MANAGEMENT": "Управление средствами",
- "FUND_MANAGEMENT_DESCRIPTION":
- "Децентрализованное управление средствами ограничивает управляющих средствами путем определения предварительно согласованных классов активов для инвестиций. Встраивание протокола 0x в смарт-контракты для управления средствами позволяет им обеспечить исполнение этих ограничений безопасности.",
+ "FUND_MANAGEMENT_DESCRIPTION": "Децентрализованное управление средствами ограничивает управляющих средствами путем определения предварительно согласованных классов активов для инвестиций. Встраивание протокола 0x в смарт-контракты для управления средствами позволяет им обеспечить исполнение этих ограничений безопасности.",
"FINAL_CALL_TO_ACTION": "Начните создавать децентрализованное будущее",
"DOCUMENTATION": "Документация",
"COMMUNITY": "Сообщество",
@@ -93,8 +82,7 @@
"GITHUB": "github",
"LIVE_CHAT": "live chat",
"LIBRARIES_AND_TOOLS": "Libraries & Tools",
- "LIBRARIES_AND_TOOLS_DESCRIPTION":
- "A list of available tools maintained by the 0x core developers and wider community for building on top of 0x Protocol and Ethereum",
+ "LIBRARIES_AND_TOOLS_DESCRIPTION": "A list of available tools maintained by the 0x core developers and wider community for building on top of 0x Protocol and Ethereum",
"MORE": "more",
"LAUNCH_KIT": "0x launch kit",
"LAUNCH_KIT_PITCH": "launch a relayer in under a minute.",
@@ -110,6 +98,5 @@
"PERFECT_FOR_DEVELOPERS": "Perfect for developers who need a simple drop-in marketplace",
"LEARN_MORE": "learn more",
"START_BUILDING_ON_0X": "Start building on 0x",
- "START_BUILDING_ON_0X_DESCRIPTION":
- "Follow one of our \"Getting started\" guides to learn more about building ontop of 0x."
+ "START_BUILDING_ON_0X_DESCRIPTION": "Follow one of our \"Getting started\" guides to learn more about building ontop of 0x."
}
diff --git a/packages/website/translations/spanish.json b/packages/website/translations/spanish.json
index f4762a67e..152b3ef22 100644
--- a/packages/website/translations/spanish.json
+++ b/packages/website/translations/spanish.json
@@ -1,55 +1,43 @@
{
"TOP_HEADER": "potenciar el intercambio descentralizado",
- "TOP_TAGLINE":
- "0x es un protocolo abierto y sin restricciones que permite el intercambio de tokens ERC20 en la cadena de bloques Ethereum.",
+ "TOP_TAGLINE": "0x es un protocolo abierto y sin restricciones que permite el intercambio de tokens ERC20 en la cadena de bloques Ethereum.",
"BUILD_CALL_TO_ACTION": "crear en 0x",
"COMMUNITY_CALL_TO_ACTION": "unirse a la comunidad",
"PROJECTS_HEADER": "proyectos creados en 0x",
"FULL_LIST_PROMPT": "ver la",
"FULL_LIST_LINK": "lista completa",
"TOKENIZED_SECTION_HEADER": "el valor del mundo se está tokenizando",
- "TOKENIZED_SECTION_DESCRIPTION":
- "la cadena de bloques Ethereum es un sistema financiero abierto y sin fronteras que representa una amplia variedad de activos como tokens criptográficos. En el futuro, la mayoría de los activos y bienes digitales estarán tokenizados.",
+ "TOKENIZED_SECTION_DESCRIPTION": "la cadena de bloques Ethereum es un sistema financiero abierto y sin fronteras que representa una amplia variedad de activos como tokens criptográficos. En el futuro, la mayoría de los activos y bienes digitales estarán tokenizados.",
"CURRENCY": "moneda",
"TRADITIONAL_ASSETS": "activos tradicionales",
"DIGITAL_GOODS": "bienes digitales",
"OFFCHAIN_ORDER_RELAY": "orden retransmisión fuera de cadena",
"ONCHAIN_SETTLEMENT": "liquidación en cadena",
- "OFFCHAIN_ONCHAIN_DESCRIPTION":
- "en el protocolo 0x, las órdenes se transportan fuera de la cadena, lo que reduce enormemente los costos de combustible y elimina el sobredimensionamiento de la cadena de bloques. Los transmisores ayudan a emitir órdenes y a cobrar un cargo cada vez que facilitan un intercambio. Cualquier persona puede crear un transmisor.",
+ "OFFCHAIN_ONCHAIN_DESCRIPTION": "en el protocolo 0x, las órdenes se transportan fuera de la cadena, lo que reduce enormemente los costos de combustible y elimina el sobredimensionamiento de la cadena de bloques. Los transmisores ayudan a emitir órdenes y a cobrar un cargo cada vez que facilitan un intercambio. Cualquier persona puede crear un transmisor.",
"RELAYERS_HEADER": "transmisores creados en 0x",
"BENEFITS_HEADER": "beneficios de 0x",
"BENEFIT_ONE_TITLE": "intercambio confiable",
- "BENEFIT_ONE_DESCRIPTION":
- "creado en la red distribuida de Ethereum sin ningún punto de error centralizado y sin tiempo de inactividad; cada intercambio se concreta atómicamente y sin riesgos para la contraparte.",
+ "BENEFIT_ONE_DESCRIPTION": "creado en la red distribuida de Ethereum sin ningún punto de error centralizado y sin tiempo de inactividad; cada intercambio se concreta atómicamente y sin riesgos para la contraparte.",
"BENEFIT_TWO_TITLE": "liquidez compartida",
- "BENEFIT_TWO_DESCRIPTION":
- "al compartir un API estándar, los transmisores pueden acumular fácilmente fondos de liquidez, lo que crea efectos de red en torno a la liquidez que se forma a medida que más transmisores se conectan.",
+ "BENEFIT_TWO_DESCRIPTION": "al compartir un API estándar, los transmisores pueden acumular fácilmente fondos de liquidez, lo que crea efectos de red en torno a la liquidez que se forma a medida que más transmisores se conectan.",
"BENEFIT_THREE_TITLE": "código abierto",
- "BENEFIT_THREE_DESCRIPTION":
- "0x es código abierto, su uso es gratuito. Negocie directamente con una contraparte conocida sin costo o páguele a un transmisor con algunos para acceder a su fondo de liquidez.",
+ "BENEFIT_THREE_DESCRIPTION": "0x es código abierto, su uso es gratuito. Negocie directamente con una contraparte conocida sin costo o páguele a un transmisor con algunos para acceder a su fondo de liquidez.",
"BUILDING_BLOCK_SECTION_HEADER": "un bloque de creación para dApps",
- "BUILDING_BLOCK_SECTION_DESCRIPTION":
- "el protocolo 0x es un bloque de creación acoplable para dApps que requiere una funcionalidad de intercambio. Únase a los numerosos desarrolladores que ya utilizan 0x en sus aplicaciones web y contratos inteligentes.",
+ "BUILDING_BLOCK_SECTION_DESCRIPTION": "el protocolo 0x es un bloque de creación acoplable para dApps que requiere una funcionalidad de intercambio. Únase a los numerosos desarrolladores que ya utilizan 0x en sus aplicaciones web y contratos inteligentes.",
"DEV_TOOLS_PROMPT": "aprenda cómo hacerlo en nuestros documentos de",
"SMART_CONTRACT": "contratos inteligentes",
"DOCS": "",
"AND": "y",
"DECENTRALIZED_GOVERNANCE": "gobierno descentralizado",
- "DECENTRALIZED_GOVERNANCE_DESCRIPTION":
- "las organizaciones descentralizadas utilizan tokens para representar la titularidad y guiar su lógica de gobierno. 0x les permite a las organizaciones descentralizadas intercambiar titularidad por capital inicial sin problemas y de forma segura.",
+ "DECENTRALIZED_GOVERNANCE_DESCRIPTION": "las organizaciones descentralizadas utilizan tokens para representar la titularidad y guiar su lógica de gobierno. 0x les permite a las organizaciones descentralizadas intercambiar titularidad por capital inicial sin problemas y de forma segura.",
"PREDICTION_MARKETS": "mercados de predicción",
- "PREDICTION_MARKETS_DESCRIPTION":
- "las plataformas del mercado de predicción descentralizado generan conjuntos de tokens que representan un interés financiero en los resultados de los sucesos del mundo real. 0x permite que estos tokens se negocien de manera instantánea.",
+ "PREDICTION_MARKETS_DESCRIPTION": "las plataformas del mercado de predicción descentralizado generan conjuntos de tokens que representan un interés financiero en los resultados de los sucesos del mundo real. 0x permite que estos tokens se negocien de manera instantánea.",
"STABLE_TOKENS": "tokens estables",
- "STABLE_TOKENS_DESCRIPTION":
- "las construcciones económicas novedosas, como las monedas estables, requieren mercados eficientes y con liquidez para tener éxito. 0x facilitará los mecanismos económicos subyacentes que permiten que estos tokens continúen siendo estables.",
+ "STABLE_TOKENS_DESCRIPTION": "las construcciones económicas novedosas, como las monedas estables, requieren mercados eficientes y con liquidez para tener éxito. 0x facilitará los mecanismos económicos subyacentes que permiten que estos tokens continúen siendo estables.",
"DECENTRALIZED_LOANS": "préstamos descentralizados",
- "DECENTRALIZED_LOANS_DESCRIPTION":
- "los préstamos eficientes requieren mercados con liquidez donde los inversores pueden comprar y revender préstamos. 0x facilita un ecosistema de prestamistas que se organizan ellos mismos y determinan, de forma eficaz, los precios del mercado para todos los préstamos pendientes.",
+ "DECENTRALIZED_LOANS_DESCRIPTION": "los préstamos eficientes requieren mercados con liquidez donde los inversores pueden comprar y revender préstamos. 0x facilita un ecosistema de prestamistas que se organizan ellos mismos y determinan, de forma eficaz, los precios del mercado para todos los préstamos pendientes.",
"FUND_MANAGEMENT": "administración de fondos",
- "FUND_MANAGEMENT_DESCRIPTION":
- "la administración descentralizada de fondos limita a los administradores de fondos a invertir en clases de activos preacordadas. Integrar 0x a los contratos inteligentes de la administración de fondos les permite imponer esas restricciones de seguridad.",
+ "FUND_MANAGEMENT_DESCRIPTION": "la administración descentralizada de fondos limita a los administradores de fondos a invertir en clases de activos preacordadas. Integrar 0x a los contratos inteligentes de la administración de fondos les permite imponer esas restricciones de seguridad.",
"FINAL_CALL_TO_ACTION": "comience a crear el futuro descentralizado",
"DOCUMENTATION": "documentación",
"COMMUNITY": "comunidad",
@@ -94,8 +82,7 @@
"GITHUB": "github",
"LIVE_CHAT": "live chat",
"LIBRARIES_AND_TOOLS": "Libraries & Tools",
- "LIBRARIES_AND_TOOLS_DESCRIPTION":
- "A list of available tools maintained by the 0x core developers and wider community for building on top of 0x Protocol and Ethereum",
+ "LIBRARIES_AND_TOOLS_DESCRIPTION": "A list of available tools maintained by the 0x core developers and wider community for building on top of 0x Protocol and Ethereum",
"MORE": "more",
"LAUNCH_KIT": "0x launch kit",
"LAUNCH_KIT_PITCH": "launch a relayer in under a minute.",
@@ -111,6 +98,5 @@
"PERFECT_FOR_DEVELOPERS": "Perfect for developers who need a simple drop-in marketplace",
"LEARN_MORE": "learn more",
"START_BUILDING_ON_0X": "Start building on 0x",
- "START_BUILDING_ON_0X_DESCRIPTION":
- "Follow one of our \"Getting started\" guides to learn more about building ontop of 0x."
+ "START_BUILDING_ON_0X_DESCRIPTION": "Follow one of our \"Getting started\" guides to learn more about building ontop of 0x."
}
diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts
index 37f746f7c..ea5a59340 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/aboutPageLayout.tsx b/packages/website/ts/components/aboutPageLayout.tsx
index a2fd9dd72..51c1a661e 100644
--- a/packages/website/ts/components/aboutPageLayout.tsx
+++ b/packages/website/ts/components/aboutPageLayout.tsx
@@ -38,18 +38,17 @@ export const AboutPageLayout = (props: Props) => (
{props.description}
</AnimatedParagraph>
- {props.linkLabel &&
- (props.href || props.to) && (
- <AnimatedLink
- to={props.to}
- href={props.href}
- target={!_.isUndefined(props.href) ? '_blank' : undefined}
- isWithArrow={true}
- isAccentColor={true}
- >
- {props.linkLabel}
- </AnimatedLink>
- )}
+ {props.linkLabel && (props.href || props.to) && (
+ <AnimatedLink
+ to={props.to}
+ href={props.href}
+ target={!_.isUndefined(props.href) ? '_blank' : undefined}
+ isWithArrow={true}
+ isAccentColor={true}
+ >
+ {props.linkLabel}
+ </AnimatedLink>
+ )}
</Column>
</Column>
</Section>
diff --git a/packages/website/ts/components/animatedChatIcon.tsx b/packages/website/ts/components/animatedChatIcon.tsx
index 9a86e244c..770536259 100644
--- a/packages/website/ts/components/animatedChatIcon.tsx
+++ b/packages/website/ts/components/animatedChatIcon.tsx
@@ -98,9 +98,6 @@ const Rays = styled.g`
transform-origin: 50% 50%;
`;
-const Dot =
- styled.circle <
- { delay: number } >
- `
+const Dot = styled.circle<{ delay: number }>`
animation: ${fadeInOut} 4s ${props => `${props.delay}s`} infinite;
`;
diff --git a/packages/website/ts/components/banner.tsx b/packages/website/ts/components/banner.tsx
index 76fc1d09e..ce3fd499a 100644
--- a/packages/website/ts/components/banner.tsx
+++ b/packages/website/ts/components/banner.tsx
@@ -123,10 +123,7 @@ const ButtonWrap = styled.div`
// Note let's refactor this
// is it absolutely necessary to have a stateless component
// to pass props down into the styled icon?
-const Border =
- styled.div <
- BorderProps >
- `
+const Border = styled.div<BorderProps>`
position: absolute;
background-image: ${props =>
props.isBottom ? 'url(/images/banner/bottomofcta.png);' : 'url(/images/banner/topofcta.png);'};
diff --git a/packages/website/ts/components/button.tsx b/packages/website/ts/components/button.tsx
index 569038ae0..31a74e599 100644
--- a/packages/website/ts/components/button.tsx
+++ b/packages/website/ts/components/button.tsx
@@ -58,10 +58,7 @@ Button.defaultProps = {
borderColor: 'rgba(255, 255, 255, .4)',
};
-const ButtonBase =
- styled.button <
- ButtonInterface >
- `
+const ButtonBase = styled.button<ButtonInterface>`
appearance: none;
border: 1px solid transparent;
display: inline-block;
diff --git a/packages/website/ts/components/definition.tsx b/packages/website/ts/components/definition.tsx
index 92fe54f38..bd7a40425 100644
--- a/packages/website/ts/components/definition.tsx
+++ b/packages/website/ts/components/definition.tsx
@@ -69,10 +69,7 @@ export const Definition = (props: Props) => (
</Wrap>
);
-const Wrap =
- styled.div <
- Props >
- `
+const Wrap = styled.div<Props>`
max-width: ${props => props.isInline && '354px'};
& + & {
@@ -97,10 +94,7 @@ const Wrap =
}
`;
-const TextWrap =
- styled.div <
- Props >
- `
+const TextWrap = styled.div<Props>`
width: 100%;
max-width: 560px;
diff --git a/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx b/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx
index a0114d898..1c47903db 100644
--- a/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx
+++ b/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx
@@ -148,15 +148,17 @@ export class BlockchainErrDialog extends React.Component<BlockchainErrDialogProp
If you are using{' '}
<a href={constants.URL_METAMASK_CHROME_STORE} target="_blank">
Metamask
- </a>, you can switch networks in the top left corner of the extension popover.
+ </a>
+ , you can switch networks in the top left corner of the extension popover.
</div>
<h4>Parity Signer</h4>
<div>
If using the{' '}
<a href={constants.URL_PARITY_CHROME_STORE} target="_blank">
Parity Signer Chrome extension
- </a>, make sure to start your local Parity node with `parity ui` or `parity --chain Kovan ui` in
- order to connect to mainnet \ or Kovan respectively.
+ </a>
+ , make sure to start your local Parity node with `parity ui` or `parity --chain Kovan ui` in order
+ to connect to mainnet \ or Kovan respectively.
</div>
</div>
);
diff --git a/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx b/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx
index 9b9421f1a..5ca272b1a 100644
--- a/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx
+++ b/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx
@@ -111,20 +111,19 @@ export class EthWethConversionDialog extends React.Component<
)}
<div className="pt1" style={{ fontSize: 12 }}>
<div className="left">1 ETH = 1 WETH</div>
- {this.props.direction === Side.Receive &&
- this.state.isEthTokenBalanceLoaded && (
- <div
- className="right"
- onClick={this._onMaxClick.bind(this)}
- style={{
- color: colors.darkBlue,
- textDecoration: 'underline',
- cursor: 'pointer',
- }}
- >
- Max
- </div>
- )}
+ {this.props.direction === Side.Receive && this.state.isEthTokenBalanceLoaded && (
+ <div
+ className="right"
+ onClick={this._onMaxClick.bind(this)}
+ style={{
+ color: colors.darkBlue,
+ textDecoration: 'underline',
+ cursor: 'pointer',
+ }}
+ >
+ Max
+ </div>
+ )}
</div>
</div>
</div>
diff --git a/packages/website/ts/components/dialogs/ledger_config_dialog.tsx b/packages/website/ts/components/dialogs/ledger_config_dialog.tsx
index e15a2dd94..527353aa0 100644
--- a/packages/website/ts/components/dialogs/ledger_config_dialog.tsx
+++ b/packages/website/ts/components/dialogs/ledger_config_dialog.tsx
@@ -20,8 +20,8 @@ import { utils } from 'ts/utils/utils';
const VALID_ETHEREUM_DERIVATION_PATH_PREFIX = `44'/60'`;
enum LedgerSteps {
- CONNECT,
- SELECT_ADDRESS,
+ Connect,
+ SelectAddress,
}
interface LedgerConfigDialogProps {
@@ -52,7 +52,7 @@ export class LedgerConfigDialog extends React.Component<LedgerConfigDialogProps,
const derivationPathIfExists = props.blockchain.getLedgerDerivationPathIfExists();
this.state = {
connectionErrMsg: '',
- stepIndex: LedgerSteps.CONNECT,
+ stepIndex: LedgerSteps.Connect,
userAddresses: [],
addressBalances: [],
derivationPath: _.isUndefined(derivationPathIfExists)
@@ -67,7 +67,7 @@ export class LedgerConfigDialog extends React.Component<LedgerConfigDialogProps,
<FlatButton key="ledgerConnectCancel" label="Cancel" onClick={this._onClose.bind(this)} />,
];
const dialogTitle =
- this.state.stepIndex === LedgerSteps.CONNECT ? 'Connect to your Ledger' : 'Select desired address';
+ this.state.stepIndex === LedgerSteps.Connect ? 'Connect to your Ledger' : 'Select desired address';
return (
<Dialog
title={dialogTitle}
@@ -79,8 +79,8 @@ export class LedgerConfigDialog extends React.Component<LedgerConfigDialogProps,
bodyStyle={{ paddingBottom: 0 }}
>
<div style={{ color: colors.grey700, paddingTop: 1 }}>
- {this.state.stepIndex === LedgerSteps.CONNECT && this._renderConnectStep()}
- {this.state.stepIndex === LedgerSteps.SELECT_ADDRESS && this._renderSelectAddressStep()}
+ {this.state.stepIndex === LedgerSteps.Connect && this._renderConnectStep()}
+ {this.state.stepIndex === LedgerSteps.SelectAddress && this._renderSelectAddressStep()}
</div>
</Dialog>
);
@@ -195,7 +195,7 @@ export class LedgerConfigDialog extends React.Component<LedgerConfigDialogProps,
private _onClose(): void {
this.setState({
connectionErrMsg: '',
- stepIndex: LedgerSteps.CONNECT,
+ stepIndex: LedgerSteps.Connect,
});
const isOpen = false;
this.props.toggleDialogFn(isOpen);
@@ -210,7 +210,7 @@ export class LedgerConfigDialog extends React.Component<LedgerConfigDialogProps,
this.props.blockchain.fetchTokenInformationAsync();
this.props.dispatcher.updateUserWeiBalance(selectAddressBalance);
this.setState({
- stepIndex: LedgerSteps.CONNECT,
+ stepIndex: LedgerSteps.Connect,
});
const isOpen = false;
this.props.toggleDialogFn(isOpen);
@@ -284,7 +284,7 @@ export class LedgerConfigDialog extends React.Component<LedgerConfigDialogProps,
const didSucceed = await this._fetchAddressesAndBalancesAsync();
if (didSucceed) {
this.setState({
- stepIndex: LedgerSteps.SELECT_ADDRESS,
+ stepIndex: LedgerSteps.SelectAddress,
connectionErrMsg: '',
});
}
diff --git a/packages/website/ts/components/fill_order.tsx b/packages/website/ts/components/fill_order.tsx
index 3d0203573..95a3671c4 100644
--- a/packages/website/ts/components/fill_order.tsx
+++ b/packages/website/ts/components/fill_order.tsx
@@ -173,17 +173,16 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> {
private _renderOrderJsonNotices(): React.ReactNode {
return (
<div>
- {!_.isUndefined(this.props.initialOrder) &&
- !this.state.didOrderValidationRun && (
- <div className="pt2">
- <span className="pr1">
- <i className="zmdi zmdi-spinner zmdi-hc-spin" />
- </span>
- <span>Validating order...</span>
- </div>
- )}
+ {!_.isUndefined(this.props.initialOrder) && !this.state.didOrderValidationRun && (
+ <div className="pt2">
+ <span className="pr1">
+ <i className="zmdi zmdi-spinner zmdi-hc-spin" />
+ </span>
+ <span>Validating order...</span>
+ </div>
+ )}
{!_.isEmpty(this.state.orderJSONErrMsg) && (
- <Alert type={AlertTypes.ERROR} message={this.state.orderJSONErrMsg} />
+ <Alert type={AlertTypes.Error} message={this.state.orderJSONErrMsg} />
)}
</div>
);
@@ -206,7 +205,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> {
amount: orderMakerAmount
.times(takerAssetToken.amount)
.div(orderTakerAmount)
- .floor(),
+ .integerValue(BigNumber.ROUND_FLOOR),
symbol: makerToken.symbol,
};
const fillAssetToken = {
@@ -220,7 +219,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> {
const orderReceiveAmountBigNumber = orderMakerAmount
.times(this.props.orderFillAmount)
.dividedBy(orderTakerAmount)
- .floor();
+ .integerValue(BigNumber.ROUND_FLOOR);
orderReceiveAmount = this._formatCurrencyAmount(orderReceiveAmountBigNumber, makerToken.decimals);
}
const isUserMaker =
@@ -299,7 +298,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> {
onClick={this._onCancelOrderClickFireAndForgetAsync.bind(this)}
/>
{this.state.didCancelOrderSucceed && (
- <Alert type={AlertTypes.SUCCESS} message={this._renderCancelSuccessMsg()} />
+ <Alert type={AlertTypes.Success} message={this._renderCancelSuccessMsg()} />
)}
</div>
) : (
@@ -311,10 +310,10 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> {
onClick={this._onFillOrderClick.bind(this)}
/>
{!_.isEmpty(this.state.globalErrMsg) && (
- <Alert type={AlertTypes.ERROR} message={this.state.globalErrMsg} />
+ <Alert type={AlertTypes.Error} message={this.state.globalErrMsg} />
)}
{this.state.didFillOrderSucceed && (
- <Alert type={AlertTypes.SUCCESS} message={this._renderFillSuccessMsg()} />
+ <Alert type={AlertTypes.Success} message={this._renderFillSuccessMsg()} />
)}
</div>
)}
diff --git a/packages/website/ts/components/fill_warning_dialog.tsx b/packages/website/ts/components/fill_warning_dialog.tsx
index feb72c2ee..5be09e6c2 100644
--- a/packages/website/ts/components/fill_warning_dialog.tsx
+++ b/packages/website/ts/components/fill_warning_dialog.tsx
@@ -37,7 +37,8 @@ export const FillWarningDialog = (props: FillWarningDialogProps) => {
be counterfeit. It is your responsibility to verify the token addresses on Etherscan (
<a href="https://0x.org/wiki#Verifying-Custom-Tokens" target="_blank">
See this how-to guide
- </a>) before filling an order. <b>This action may result in the loss of funds</b>.
+ </a>
+ ) before filling an order. <b>This action may result in the loss of funds</b>.
</div>
</div>
</Dialog>
diff --git a/packages/website/ts/components/generate_order/asset_picker.tsx b/packages/website/ts/components/generate_order/asset_picker.tsx
index e6ecd2ec8..d3f11f962 100644
--- a/packages/website/ts/components/generate_order/asset_picker.tsx
+++ b/packages/website/ts/components/generate_order/asset_picker.tsx
@@ -18,9 +18,9 @@ import { utils } from 'ts/utils/utils';
const TOKEN_ICON_DIMENSION = 100;
const TILE_DIMENSION = 146;
enum AssetViews {
- ASSET_PICKER = 'ASSET_PICKER',
- NEW_TOKEN_FORM = 'NEW_TOKEN_FORM',
- CONFIRM_TRACK_TOKEN = 'CONFIRM_TRACK_TOKEN',
+ AssetPicker = 'ASSET_PICKER',
+ NewTokenForm = 'NEW_TOKEN_FORM',
+ ConfirmTrackToken = 'CONFIRM_TRACK_TOKEN',
}
interface AssetPickerProps {
@@ -44,29 +44,29 @@ interface AssetPickerState {
export class AssetPicker extends React.Component<AssetPickerProps, AssetPickerState> {
public static defaultProps: Partial<AssetPickerProps> = {
- tokenVisibility: TokenVisibility.ALL,
+ tokenVisibility: TokenVisibility.All,
};
private readonly _dialogConfigsByAssetView: { [assetView: string]: DialogConfigs };
constructor(props: AssetPickerProps) {
super(props);
this.state = {
- assetView: AssetViews.ASSET_PICKER,
+ assetView: AssetViews.AssetPicker,
hoveredAddress: undefined,
chosenTrackTokenAddress: undefined,
isAddingTokenToTracked: false,
};
this._dialogConfigsByAssetView = {
- [AssetViews.ASSET_PICKER]: {
+ [AssetViews.AssetPicker]: {
title: 'Select token',
isModal: false,
actions: [],
},
- [AssetViews.NEW_TOKEN_FORM]: {
+ [AssetViews.NewTokenForm]: {
title: 'Add an ERC20 token',
isModal: false,
actions: [],
},
- [AssetViews.CONFIRM_TRACK_TOKEN]: {
+ [AssetViews.ConfirmTrackToken]: {
title: 'Tracking confirmation',
isModal: true,
actions: [
@@ -95,15 +95,15 @@ export class AssetPicker extends React.Component<AssetPickerProps, AssetPickerSt
autoScrollBodyContent={true}
onRequestClose={this._onCloseDialog.bind(this)}
>
- {this.state.assetView === AssetViews.ASSET_PICKER && this._renderAssetPicker()}
- {this.state.assetView === AssetViews.NEW_TOKEN_FORM && (
+ {this.state.assetView === AssetViews.AssetPicker && this._renderAssetPicker()}
+ {this.state.assetView === AssetViews.NewTokenForm && (
<NewTokenForm
blockchain={this.props.blockchain}
onNewTokenSubmitted={this._onNewTokenSubmitted.bind(this)}
tokenByAddress={this.props.tokenByAddress}
/>
)}
- {this.state.assetView === AssetViews.CONFIRM_TRACK_TOKEN && this._renderConfirmTrackToken()}
+ {this.state.assetView === AssetViews.ConfirmTrackToken && this._renderConfirmTrackToken()}
</Dialog>
);
}
@@ -138,19 +138,19 @@ export class AssetPicker extends React.Component<AssetPickerProps, AssetPickerSt
const allTokens = _.values(this.props.tokenByAddress);
// filter tokens based on visibility specified in props, do not show ZRX or ETHER as tracked or untracked
const filteredTokens =
- this.props.tokenVisibility === TokenVisibility.ALL
+ this.props.tokenVisibility === TokenVisibility.All
? allTokens
: _.filter(allTokens, token => {
return (
token.symbol !== constants.ZRX_TOKEN_SYMBOL &&
token.symbol !== constants.ETHER_TOKEN_SYMBOL &&
- ((this.props.tokenVisibility === TokenVisibility.TRACKED && utils.isTokenTracked(token)) ||
- (this.props.tokenVisibility === TokenVisibility.UNTRACKED &&
+ ((this.props.tokenVisibility === TokenVisibility.Tracked && utils.isTokenTracked(token)) ||
+ (this.props.tokenVisibility === TokenVisibility.Untracked &&
!utils.isTokenTracked(token)))
);
});
// if we are showing tracked tokens, sort by date added, otherwise sort by symbol
- const sortKey = this.props.tokenVisibility === TokenVisibility.TRACKED ? 'trackedTimestamp' : 'symbol';
+ const sortKey = this.props.tokenVisibility === TokenVisibility.Tracked ? 'trackedTimestamp' : 'symbol';
const sortedTokens = filteredTokens.sort(firstBy(sortKey));
if (_.isEmpty(sortedTokens)) {
return <div className="mx-auto p4 h2">No tokens to remove.</div>;
@@ -188,7 +188,7 @@ export class AssetPicker extends React.Component<AssetPickerProps, AssetPickerSt
cursor: 'pointer',
opacity: isHovered ? 0.6 : 1,
};
- if (this.props.tokenVisibility !== TokenVisibility.TRACKED) {
+ if (this.props.tokenVisibility !== TokenVisibility.Tracked) {
gridTiles.push(
<div
key={otherTokenKey}
@@ -222,7 +222,7 @@ export class AssetPicker extends React.Component<AssetPickerProps, AssetPickerSt
}
private _onCloseDialog(): void {
this.setState({
- assetView: AssetViews.ASSET_PICKER,
+ assetView: AssetViews.AssetPicker,
});
this.props.onTokenChosen(this.props.currentTokenAddress);
}
@@ -232,21 +232,21 @@ export class AssetPicker extends React.Component<AssetPickerProps, AssetPickerSt
this.props.onTokenChosen(tokenAddress);
} else {
this.setState({
- assetView: AssetViews.CONFIRM_TRACK_TOKEN,
+ assetView: AssetViews.ConfirmTrackToken,
chosenTrackTokenAddress: tokenAddress,
});
}
}
private _onCustomAssetChosen(): void {
this.setState({
- assetView: AssetViews.NEW_TOKEN_FORM,
+ assetView: AssetViews.NewTokenForm,
});
}
private _onNewTokenSubmitted(newToken: Token): void {
trackedTokenStorage.addTrackedTokenToUser(this.props.userAddress, this.props.networkId, newToken);
this.props.dispatcher.addTokenToTokenByAddress(newToken);
this.setState({
- assetView: AssetViews.ASSET_PICKER,
+ assetView: AssetViews.AssetPicker,
});
this.props.onTokenChosen(newToken.address);
}
@@ -254,7 +254,7 @@ export class AssetPicker extends React.Component<AssetPickerProps, AssetPickerSt
const resetState: AssetPickerState = {
...this.state,
isAddingTokenToTracked: false,
- assetView: AssetViews.ASSET_PICKER,
+ assetView: AssetViews.AssetPicker,
chosenTrackTokenAddress: undefined,
};
if (!didUserAcceptTracking) {
diff --git a/packages/website/ts/components/generate_order/generate_order_form.tsx b/packages/website/ts/components/generate_order/generate_order_form.tsx
index 8afbee977..0f70aa18f 100644
--- a/packages/website/ts/components/generate_order/generate_order_form.tsx
+++ b/packages/website/ts/components/generate_order/generate_order_form.tsx
@@ -36,9 +36,9 @@ import { errorReporter } from 'ts/utils/error_reporter';
import { utils } from 'ts/utils/utils';
enum SigningState {
- UNSIGNED,
- SIGNING,
- SIGNED,
+ Unsigned,
+ Signing,
+ Signed,
}
interface GenerateOrderFormProps {
@@ -76,7 +76,7 @@ export class GenerateOrderForm extends React.Component<GenerateOrderFormProps, G
this.state = {
globalErrMsg: '',
shouldShowIncompleteErrs: false,
- signingState: SigningState.UNSIGNED,
+ signingState: SigningState.Unsigned,
};
}
public componentDidMount(): void {
@@ -207,7 +207,7 @@ export class GenerateOrderForm extends React.Component<GenerateOrderFormProps, G
/>
</div>
{this.state.globalErrMsg !== '' && (
- <Alert type={AlertTypes.ERROR} message={this.state.globalErrMsg} />
+ <Alert type={AlertTypes.Error} message={this.state.globalErrMsg} />
)}
</div>
</div>
@@ -215,7 +215,7 @@ export class GenerateOrderForm extends React.Component<GenerateOrderFormProps, G
title="Order JSON"
titleStyle={{ fontWeight: 100 }}
modal={false}
- open={this.state.signingState === SigningState.SIGNED}
+ open={this.state.signingState === SigningState.Signed}
onRequestClose={this._onCloseOrderJSONDialog.bind(this)}
>
<OrderJSON
@@ -247,7 +247,7 @@ export class GenerateOrderForm extends React.Component<GenerateOrderFormProps, G
// orderHash will not collide with the previously generated orderHash.
this.props.dispatcher.updateOrderSalt(generatePseudoRandomSalt());
this.setState({
- signingState: SigningState.UNSIGNED,
+ signingState: SigningState.Unsigned,
});
}
private async _onSignClickedAsync(): Promise<boolean> {
@@ -305,13 +305,13 @@ export class GenerateOrderForm extends React.Component<GenerateOrderFormProps, G
}
private async _signTransactionAsync(): Promise<PortalOrder | undefined> {
this.setState({
- signingState: SigningState.SIGNING,
+ signingState: SigningState.Signing,
});
const exchangeAddress = this.props.blockchain.getExchangeContractAddressIfExists();
if (_.isUndefined(exchangeAddress)) {
this.props.dispatcher.updateShouldBlockchainErrDialogBeOpen(true);
this.setState({
- signingState: SigningState.UNSIGNED,
+ signingState: SigningState.Unsigned,
});
return undefined;
}
@@ -371,7 +371,7 @@ export class GenerateOrderForm extends React.Component<GenerateOrderFormProps, G
}
}
this.setState({
- signingState: globalErrMsg === '' ? SigningState.SIGNED : SigningState.UNSIGNED,
+ signingState: globalErrMsg === '' ? SigningState.Signed : SigningState.Unsigned,
globalErrMsg,
});
return order;
diff --git a/packages/website/ts/components/generate_order/new_token_form.tsx b/packages/website/ts/components/generate_order/new_token_form.tsx
index b8cd88b18..ce684d177 100644
--- a/packages/website/ts/components/generate_order/new_token_form.tsx
+++ b/packages/website/ts/components/generate_order/new_token_form.tsx
@@ -93,7 +93,7 @@ export class NewTokenForm extends React.Component<NewTokenFormProps, NewTokenFor
onClickAsyncFn={this._onAddNewTokenClickAsync.bind(this)}
/>
</div>
- {this.state.globalErrMsg !== '' && <Alert type={AlertTypes.ERROR} message={this.state.globalErrMsg} />}
+ {this.state.globalErrMsg !== '' && <Alert type={AlertTypes.Error} message={this.state.globalErrMsg} />}
</div>
);
}
diff --git a/packages/website/ts/components/hamburger.tsx b/packages/website/ts/components/hamburger.tsx
index 435d206cd..34d4ccc46 100644
--- a/packages/website/ts/components/hamburger.tsx
+++ b/packages/website/ts/components/hamburger.tsx
@@ -16,10 +16,7 @@ export const Hamburger: React.FunctionComponent<Props> = (props: Props) => {
);
};
-const StyledHamburger =
- styled.button <
- Props >
- `
+const StyledHamburger = styled.button<Props>`
background: none;
border: 0;
width: 22px;
@@ -41,9 +38,8 @@ const StyledHamburger =
height: 2px;
margin-bottom: 5px;
transform-origin: 4px 0px;
- transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
- background-color 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
- opacity 0.55s ease;
+ transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1),
+ background-color 0.5s cubic-bezier(0.77, 0.2, 0.05, 1), opacity 0.55s ease;
&:first-child {
//transform-origin: 0% 0%;
diff --git a/packages/website/ts/components/header.tsx b/packages/website/ts/components/header.tsx
index 90e097070..088f41048 100644
--- a/packages/website/ts/components/header.tsx
+++ b/packages/website/ts/components/header.tsx
@@ -87,7 +87,9 @@ class HeaderBase extends React.Component<HeaderProps> {
</Link>
<NavLinks>
- {_.map(navItems, (link, index) => <NavItem key={`navlink-${index}`} link={link} />)}
+ {_.map(navItems, (link, index) => (
+ <NavItem key={`navlink-${index}`} link={link} />
+ ))}
</NavLinks>
<MediaQuery minWidth={990}>
@@ -130,10 +132,7 @@ const NavItem = (props: { link: NavItemProps; key: string }) => {
);
};
-const StyledHeader =
- styled.header <
- HeaderProps >
- `
+const StyledHeader = styled.header<HeaderProps>`
padding: 30px;
background-color: ${props => props.theme.bgColor};
`;
@@ -200,10 +199,7 @@ const NavLinks = styled.ul`
}
`;
-const DropdownWrap =
- styled.div <
- DropdownWrapInterface >
- `
+const DropdownWrap = styled.div<DropdownWrapInterface>`
width: ${props => props.width || 280}px;
padding: 15px 0;
border: 1px solid transparent;
@@ -219,27 +215,28 @@ const DropdownWrap =
transition: opacity 0.35s, transform 0.35s, visibility 0s 0.35s;
z-index: 20;
- &:after, &:before {
- bottom: 100%;
- left: 50%;
- border: solid transparent;
- content: " ";
- height: 0;
- width: 0;
- position: absolute;
- pointer-events: none;
+ &:after,
+ &:before {
+ bottom: 100%;
+ left: 50%;
+ border: solid transparent;
+ content: ' ';
+ height: 0;
+ width: 0;
+ position: absolute;
+ pointer-events: none;
}
&:after {
- border-color: rgba(255, 255, 255, 0);
- border-bottom-color: ${props => props.theme.dropdownBg};
- border-width: 10px;
- margin-left: -10px;
+ border-color: rgba(255, 255, 255, 0);
+ border-bottom-color: ${props => props.theme.dropdownBg};
+ border-width: 10px;
+ margin-left: -10px;
}
&:before {
- border-color: rgba(255, 0, 0, 0);
- border-bottom-color: ${props => props.theme.dropdownBorderColor};
- border-width: 11px;
- margin-left: -11px;
+ border-color: rgba(255, 0, 0, 0);
+ border-bottom-color: ${props => props.theme.dropdownBorderColor};
+ border-width: 11px;
+ margin-left: -11px;
}
@media (max-width: 768px) {
diff --git a/packages/website/ts/components/hero.tsx b/packages/website/ts/components/hero.tsx
index a662ee3a5..c326e0292 100644
--- a/packages/website/ts/components/hero.tsx
+++ b/packages/website/ts/components/hero.tsx
@@ -28,10 +28,7 @@ interface WrapProps {
isFullWidth?: boolean;
isCenteredMobile?: boolean;
}
-const Wrap =
- styled.div <
- WrapProps >
- `
+const Wrap = styled.div<WrapProps>`
width: calc(100% - 60px);
margin: 0 auto;
@@ -53,10 +50,7 @@ interface TitleProps {
isLarge?: any;
maxWidth?: string;
}
-const Title =
- styled.h1 <
- TitleProps >
- `
+const Title = styled.h1<TitleProps>`
font-size: ${props => (props.isLarge ? '80px' : '50px')};
font-weight: 300;
line-height: 1.1;
@@ -87,10 +81,7 @@ const Description = styled.p`
}
`;
-const Content =
- styled.div <
- { width: string } >
- `
+const Content = styled.div<{ width: string }>`
width: 100%;
@media (min-width: 768px) {
diff --git a/packages/website/ts/components/icon.tsx b/packages/website/ts/components/icon.tsx
index 165e999b9..60e4d04ee 100644
--- a/packages/website/ts/components/icon.tsx
+++ b/packages/website/ts/components/icon.tsx
@@ -32,10 +32,7 @@ export const Icon: React.FunctionComponent<IconProps> = (props: IconProps) => {
return null;
};
-export const InlineIconWrap =
- styled.div <
- PaddingInterface >
- `
+export const InlineIconWrap = styled.div<PaddingInterface>`
margin: ${props => getCSSPadding(props.margin)};
display: flex;
align-items: center;
@@ -54,10 +51,7 @@ const _getSize = (size: string | number = 'small'): string => {
return `${size}px`;
};
-const StyledIcon =
- styled.figure <
- IconProps >
- `
+const StyledIcon = styled.figure<IconProps>`
width: ${props => _getSize(props.size)};
height: ${props => _getSize(props.size)};
margin: ${props => getCSSPadding(props.margin)};
diff --git a/packages/website/ts/components/image.tsx b/packages/website/ts/components/image.tsx
index 65b2a9705..0137cfc97 100644
--- a/packages/website/ts/components/image.tsx
+++ b/packages/website/ts/components/image.tsx
@@ -12,9 +12,6 @@ const ImageClass: React.FunctionComponent<Props> = (props: Props) => {
return <img {...props} />;
};
-export const Image =
- styled(ImageClass) <
- Props >
- `
+export const Image = styled(ImageClass)<Props>`
margin: ${props => props.isCentered && `0 auto`};
`;
diff --git a/packages/website/ts/components/inputs/allowance_state_toggle.tsx b/packages/website/ts/components/inputs/allowance_state_toggle.tsx
index 5396295d2..3a78d32f3 100644
--- a/packages/website/ts/components/inputs/allowance_state_toggle.tsx
+++ b/packages/website/ts/components/inputs/allowance_state_toggle.tsx
@@ -150,7 +150,7 @@ export class AllowanceStateToggle extends React.Component<AllowanceStateTogglePr
}
logUtils.log(`Unexpected error encountered: ${err}`);
logUtils.log(err.stack);
- this.props.onErrorOccurred(BalanceErrs.allowanceSettingFailed);
+ this.props.onErrorOccurred(BalanceErrs.AllowanceSettingFailed);
errorReporter.report(err);
}
}
diff --git a/packages/website/ts/components/link.tsx b/packages/website/ts/components/link.tsx
index 080a0abcc..a66985acc 100644
--- a/packages/website/ts/components/link.tsx
+++ b/packages/website/ts/components/link.tsx
@@ -44,10 +44,7 @@ export const LinkWrap = styled.div`
}
`;
-const StyledLink =
- styled(SmartLink) <
- LinkInterface >
- `
+const StyledLink = styled(SmartLink)<LinkInterface>`
display: ${props => !props.isBlock && 'inline-flex'};
color: ${props => props.color || props.theme.linkColor};
text-align: center;
diff --git a/packages/website/ts/components/logo.tsx b/packages/website/ts/components/logo.tsx
index 19aeb901e..f89be0711 100644
--- a/packages/website/ts/components/logo.tsx
+++ b/packages/website/ts/components/logo.tsx
@@ -23,10 +23,7 @@ const StyledLogo = styled.div`
}
`;
-const Icon =
- styled(LogoIcon) <
- LogoInterface >
- `
+const Icon = styled(LogoIcon)<LogoInterface>`
flex-shrink: 0;
path {
diff --git a/packages/website/ts/components/mobileNav.tsx b/packages/website/ts/components/mobileNav.tsx
index 573d21596..d43bbe50e 100644
--- a/packages/website/ts/components/mobileNav.tsx
+++ b/packages/website/ts/components/mobileNav.tsx
@@ -55,10 +55,7 @@ export class MobileNav extends React.PureComponent<Props> {
}
}
-const Wrap =
- styled.nav <
- { isToggled: boolean } >
- `
+const Wrap = styled.nav<{ isToggled: boolean }>`
width: 100%;
height: 357px;
background-color: ${props => props.theme.mobileNavBgUpper};
@@ -99,19 +96,13 @@ const Overlay = styled.div`
interface SectionProps {
isDark?: boolean;
}
-const Section =
- styled.div <
- SectionProps >
- `
+const Section = styled.div<SectionProps>`
width: 100%;
padding: 15px 30px;
background-color: ${props => (props.isDark ? props.theme.mobileNavBgLower : 'transparent')};
`;
-const Grid =
- styled(WrapGrid) <
- WrapProps >
- `
+const Grid = styled(WrapGrid)<WrapProps>`
justify-content: flex-start;
li {
diff --git a/packages/website/ts/components/modals/input.tsx b/packages/website/ts/components/modals/input.tsx
index 8cfcc9763..c72e53aa0 100644
--- a/packages/website/ts/components/modals/input.tsx
+++ b/packages/website/ts/components/modals/input.tsx
@@ -60,10 +60,7 @@ const StyledInput = styled.input`
}
`;
-const InputWrapper =
- styled.div <
- InputProps >
- `
+const InputWrapper = styled.div<InputProps>`
position: relative;
flex-grow: ${props => props.width === InputWidth.Full && 1};
width: ${props => props.width === InputWidth.Half && `calc(50% - 15px)`};
diff --git a/packages/website/ts/components/modals/modal_contact.tsx b/packages/website/ts/components/modals/modal_contact.tsx
index 7414df7d9..62c1062a3 100644
--- a/packages/website/ts/components/modals/modal_contact.tsx
+++ b/packages/website/ts/components/modals/modal_contact.tsx
@@ -361,28 +361,22 @@ const StyledDialogContent = styled(DialogContent)`
}
`;
-const Form =
- styled.form <
- FormProps >
- `
+const Form = styled.form<FormProps>`
position: relative;
- transition: opacity 0.30s ease-in-out, visibility 0.30s ease-in-out;
+ transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
opacity: ${props => props.isSuccessful && `0`};
visibility: ${props => props.isSuccessful && `hidden`};
`;
-const Confirmation =
- styled.div <
- FormProps >
- `
+const Confirmation = styled.div<FormProps>`
position: absolute;
top: 50%;
text-align: center;
width: 100%;
left: 0;
- transition: opacity 0.30s ease-in-out, visibility 0.30s ease-in-out;
- transition-delay: 0.40s;
+ transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
+ transition-delay: 0.4s;
padding: 60px 60px;
transform: translateY(-50%);
opacity: ${props => (props.isSuccessful ? `1` : `0`)};
diff --git a/packages/website/ts/components/nested_sidebar_menu.tsx b/packages/website/ts/components/nested_sidebar_menu.tsx
index 4d4bc4617..56df880f3 100644
--- a/packages/website/ts/components/nested_sidebar_menu.tsx
+++ b/packages/website/ts/components/nested_sidebar_menu.tsx
@@ -77,8 +77,8 @@ export class MenuItem extends React.Component<MenuItemProps, MenuItemState> {
isActive
? colors.lightLinkBlue
: this.props.screenWidth === ScreenWidths.Sm
- ? 'white'
- : colors.grey100
+ ? 'white'
+ : colors.grey100
}
fontSize="14px"
textAlign="left"
diff --git a/packages/website/ts/components/newLayout.tsx b/packages/website/ts/components/newLayout.tsx
index 28e7653c5..07691a02a 100644
--- a/packages/website/ts/components/newLayout.tsx
+++ b/packages/website/ts/components/newLayout.tsx
@@ -54,10 +54,7 @@ export const Section: React.FunctionComponent<SectionProps> = (props: SectionPro
);
};
-export const Column =
- styled.div <
- ColumnProps >
- `
+export const Column = styled.div<ColumnProps>`
width: ${props => props.width};
max-width: ${props => props.maxWidth};
padding: ${props => props.padding};
@@ -71,10 +68,7 @@ export const Column =
}
`;
-export const FlexWrap =
- styled.div <
- FlexProps >
- `
+export const FlexWrap = styled.div<FlexProps>`
max-width: 1500px;
margin: 0 auto;
padding: ${props => props.padding};
@@ -85,18 +79,12 @@ export const FlexWrap =
}
`;
-export const WrapSticky =
- styled.div <
- WrapProps >
- `
+export const WrapSticky = styled.div<WrapProps>`
position: sticky;
top: ${props => props.offsetTop || '60px'};
`;
-const SectionBase =
- styled.section <
- SectionProps >
- `
+const SectionBase = styled.section<SectionProps>`
width: ${props => !props.isFullWidth && 'calc(100% - 60px)'};
max-width: 1500px;
margin: 0 auto;
@@ -110,10 +98,7 @@ const SectionBase =
}
`;
-const Wrap =
- styled(FlexWrap) <
- WrapProps >
- `
+const Wrap = styled(FlexWrap)<WrapProps>`
width: ${props => props.wrapWidth || 'calc(100% - 60px)'};
width: ${props => props.bgColor && 'calc(100% - 60px)'};
max-width: ${props => !props.isFullWidth && (props.maxWidth || '895px')};
@@ -121,10 +106,7 @@ const Wrap =
margin: 0 auto;
`;
-export const WrapGrid =
- styled(Wrap) <
- WrapProps >
- `
+export const WrapGrid = styled(Wrap)<WrapProps>`
display: flex;
flex-wrap: ${props => props.isWrapped && `wrap`};
justify-content: ${props => (props.isCentered ? `center` : 'space-between')};
diff --git a/packages/website/ts/components/newsletter_form.tsx b/packages/website/ts/components/newsletter_form.tsx
index bd61e3f4d..e5fd95646 100644
--- a/packages/website/ts/components/newsletter_form.tsx
+++ b/packages/website/ts/components/newsletter_form.tsx
@@ -117,10 +117,7 @@ const StyledForm = styled.form`
margin-top: 27px;
`;
-const StyledInput =
- styled.input <
- InputProps >
- `
+const StyledInput = styled.input<InputProps>`
appearance: none;
background-color: transparent;
border: 0;
@@ -132,7 +129,7 @@ const StyledInput =
width: 100%;
&::placeholder {
- color: #B1B1B1; // #9D9D9D on light theme
+ color: #b1b1b1; // #9D9D9D on light theme
}
`;
@@ -140,14 +137,11 @@ const InputWrapper = styled.div`
position: relative;
`;
-const InnerInputWrapper =
- styled.div <
- ArrowProps >
- `
+const InnerInputWrapper = styled.div<ArrowProps>`
opacity: ${props => props.isSubmitted && 0};
visibility: ${props => props.isSubmitted && 'hidden'};
transition: opacity 0.25s ease-in-out, visibility 0.25s ease-in-out;
- transition-delay: 0.30s;
+ transition-delay: 0.3s;
`;
const SubmitButton = styled.button`
@@ -174,11 +168,8 @@ const Text = styled.p`
margin-top: 15px;
`;
-const SuccessText =
- styled.p <
- ArrowProps >
- `
- color: #B1B1B1;
+const SuccessText = styled.p<ArrowProps>`
+ color: #b1b1b1;
font-size: 1rem;
font-weight: 300;
line-height: 1.2em;
@@ -194,10 +185,7 @@ const SuccessText =
transition-delay: 0.55s;
`;
-const Arrow =
- styled.svg <
- ArrowProps >
- `
+const Arrow = styled.svg<ArrowProps>`
transform: ${props => props.isSubmitted && `translateX(44px)`};
transition: transform 0.25s ease-in-out;
`;
diff --git a/packages/website/ts/components/portal/portal.tsx b/packages/website/ts/components/portal/portal.tsx
index 94ab63ac6..59cf2db71 100644
--- a/packages/website/ts/components/portal/portal.tsx
+++ b/packages/website/ts/components/portal/portal.tsx
@@ -229,8 +229,8 @@ export class Portal extends React.Component<PortalProps, PortalState> {
const isAssetPickerDialogOpen = this.state.tokenManagementState !== TokenManagementState.None;
const tokenVisibility =
this.state.tokenManagementState === TokenManagementState.Add
- ? TokenVisibility.UNTRACKED
- : TokenVisibility.TRACKED;
+ ? TokenVisibility.Untracked
+ : TokenVisibility.Tracked;
return (
<Container>
<MetaTags title={DOCUMENT_TITLE} description={DOCUMENT_DESCRIPTION} />
@@ -447,7 +447,8 @@ export class Portal extends React.Component<PortalProps, PortalState> {
render={this._renderAccountManagementItem.bind(this, item)}
/>
);
- })}}
+ })}
+ }
<Route render={this._renderNotFoundMessage.bind(this)} />
</Switch>
<PortalDisclaimerDialog
diff --git a/packages/website/ts/components/sections/landing/clients.tsx b/packages/website/ts/components/sections/landing/clients.tsx
index 9a68fbf4c..4d83a1d2f 100644
--- a/packages/website/ts/components/sections/landing/clients.tsx
+++ b/packages/website/ts/components/sections/landing/clients.tsx
@@ -86,10 +86,7 @@ export const SectionLandingClients = () => (
</Section>
);
-const StyledProject =
- styled.div <
- StyledProjectInterface >
- `
+const StyledProject = styled.div<StyledProjectInterface>`
flex-shrink: 0;
img {
@@ -99,7 +96,7 @@ const StyledProject =
}
@media (min-width: 768px) {
- width: auto;
+ width: auto;
height: 50px;
margin: 30px;
}
diff --git a/packages/website/ts/components/siteWrap.tsx b/packages/website/ts/components/siteWrap.tsx
index 316896dbb..1f0902105 100644
--- a/packages/website/ts/components/siteWrap.tsx
+++ b/packages/website/ts/components/siteWrap.tsx
@@ -140,10 +140,7 @@ export class SiteWrap extends React.Component<Props, State> {
}
}
-const Main =
- styled.main <
- MainProps >
- `
+const Main = styled.main<MainProps>`
transition: transform 0.5s, opacity 0.5s;
opacity: ${props => props.isNavToggled && '0.5'};
`;
diff --git a/packages/website/ts/components/text.tsx b/packages/website/ts/components/text.tsx
index 10f272e73..a47e61ef3 100644
--- a/packages/website/ts/components/text.tsx
+++ b/packages/website/ts/components/text.tsx
@@ -27,10 +27,7 @@ interface ParagraphProps extends BaseTextInterface {
fontWeight?: string | number;
}
-const StyledHeading =
- styled.h1 <
- HeadingProps >
- `
+const StyledHeading = styled.h1<HeadingProps>`
max-width: ${props => props.maxWidth};
color: ${props => props.color || props.theme.textColor};
display: ${props => props.isFlex && `inline-flex`};
@@ -64,10 +61,7 @@ Heading.defaultProps = {
// Note: this would be useful to be implemented the same way was "Heading"
// and be more generic. e.g. <Text /> with a props asElement so we can use it
// for literally anything =
-export const Paragraph =
- styled.p <
- ParagraphProps >
- `
+export const Paragraph = styled.p<ParagraphProps>`
font-size: ${props => `var(--${props.size || 'default'}Paragraph)`};
font-weight: ${props => props.fontWeight || 300};
margin-bottom: ${props => !props.isNoMargin && (props.marginBottom || '30px')};
diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx
index 92aecf046..e8f2a6461 100644
--- a/packages/website/ts/components/token_balances.tsx
+++ b/packages/website/ts/components/token_balances.tsx
@@ -303,7 +303,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
currentTokenAddress={''}
onTokenChosen={this._onAssetTokenPicked.bind(this)}
tokenByAddress={this.props.tokenByAddress}
- tokenVisibility={this.state.isAddingToken ? TokenVisibility.UNTRACKED : TokenVisibility.TRACKED}
+ tokenVisibility={this.state.isAddingToken ? TokenVisibility.Untracked : TokenVisibility.Tracked}
/>
</div>
);
@@ -354,12 +354,11 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
{tokenState.isLoaded ? (
<span>
{this._renderAmount(tokenState.balance, token.decimals)} {token.symbol}
- {this.state.isZRXSpinnerVisible &&
- token.symbol === ZRX_TOKEN_SYMBOL && (
- <span className="pl1">
- <i className="zmdi zmdi-spinner zmdi-hc-spin" />
- </span>
- )}
+ {this.state.isZRXSpinnerVisible && token.symbol === ZRX_TOKEN_SYMBOL && (
+ <span className="pl1">
+ <i className="zmdi zmdi-spinner zmdi-hc-spin" />
+ </span>
+ )}
</span>
) : (
<i className="zmdi zmdi-spinner zmdi-hc-spin" />
@@ -440,7 +439,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
}
private _onSendFailed(): void {
this.setState({
- errorType: BalanceErrs.sendFailed,
+ errorType: BalanceErrs.SendFailed,
});
}
private _renderAmount(amount: BigNumber, decimals: number): React.ReactNode {
@@ -461,7 +460,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
}
private _renderErrorDialogBody(): React.ReactNode {
switch (this.state.errorType) {
- case BalanceErrs.incorrectNetworkForFaucet:
+ case BalanceErrs.IncorrectNetworkForFaucet:
return (
<div>
Our faucet can only send test Ether to addresses on testnets. Please make sure you are connected
@@ -469,7 +468,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
</div>
);
- case BalanceErrs.faucetRequestFailed:
+ case BalanceErrs.FaucetRequestFailed:
return (
<div>
An unexpected error occurred while trying to request test Ether from our faucet. Please refresh
@@ -477,13 +476,13 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
</div>
);
- case BalanceErrs.faucetQueueIsFull:
+ case BalanceErrs.FaucetQueueIsFull:
return <div>Our test Ether faucet queue is full. Please try requesting test Ether again later.</div>;
- case BalanceErrs.mintingFailed:
+ case BalanceErrs.MintingFailed:
return <div>Minting your test tokens failed unexpectedly. Please refresh the page and try again.</div>;
- case BalanceErrs.allowanceSettingFailed:
+ case BalanceErrs.AllowanceSettingFailed:
return (
<div>
An unexpected error occurred while trying to set your test token allowance. Please refresh the
@@ -522,7 +521,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
logUtils.log(`Unexpected error encountered: ${err}`);
logUtils.log(err.stack);
this.setState({
- errorType: BalanceErrs.mintingFailed,
+ errorType: BalanceErrs.MintingFailed,
});
errorReporter.report(err);
return false;
@@ -538,7 +537,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
// from, we must show user an error message
if (!utils.isTestNetwork(this.props.blockchain.networkId)) {
this.setState({
- errorType: BalanceErrs.incorrectNetworkForFaucet,
+ errorType: BalanceErrs.IncorrectNetworkForFaucet,
});
return false;
}
@@ -554,8 +553,8 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
logUtils.log(`Unexpected status code: ${response.status} -> ${responseBody}`);
const errorType =
response.status === constants.UNAVAILABLE_STATUS
- ? BalanceErrs.faucetQueueIsFull
- : BalanceErrs.faucetRequestFailed;
+ ? BalanceErrs.FaucetQueueIsFull
+ : BalanceErrs.FaucetRequestFailed;
this.setState({
errorType,
});
diff --git a/packages/website/ts/components/ui/alert.tsx b/packages/website/ts/components/ui/alert.tsx
index 32e0f1be8..c7a5b9030 100644
--- a/packages/website/ts/components/ui/alert.tsx
+++ b/packages/website/ts/components/ui/alert.tsx
@@ -8,7 +8,7 @@ interface AlertProps {
}
export const Alert = (props: AlertProps) => {
- const isAlert = props.type === AlertTypes.ERROR;
+ const isAlert = props.type === AlertTypes.Error;
const errMsgStyles = {
background: isAlert ? colors.red200 : colors.lightestGreen,
color: colors.white,
diff --git a/packages/website/ts/components/ui/lifecycle_raised_button.tsx b/packages/website/ts/components/ui/lifecycle_raised_button.tsx
index a8daf4102..f004dd47f 100644
--- a/packages/website/ts/components/ui/lifecycle_raised_button.tsx
+++ b/packages/website/ts/components/ui/lifecycle_raised_button.tsx
@@ -6,9 +6,9 @@ import * as React from 'react';
const COMPLETE_STATE_SHOW_LENGTH_MS = 2000;
enum ButtonState {
- READY,
- LOADING,
- COMPLETE,
+ Ready,
+ Loading,
+ Complete,
}
interface LifeCycleRaisedButtonProps {
@@ -38,7 +38,7 @@ export class LifeCycleRaisedButton extends React.Component<LifeCycleRaisedButton
constructor(props: LifeCycleRaisedButtonProps) {
super(props);
this.state = {
- buttonState: ButtonState.READY,
+ buttonState: ButtonState.Ready,
};
}
public componentWillUnmount(): void {
@@ -52,13 +52,13 @@ export class LifeCycleRaisedButton extends React.Component<LifeCycleRaisedButton
let label;
switch (this.state.buttonState) {
- case ButtonState.READY:
+ case ButtonState.Ready:
label = this.props.labelReady;
break;
- case ButtonState.LOADING:
+ case ButtonState.Loading:
label = this.props.labelLoading;
break;
- case ButtonState.COMPLETE:
+ case ButtonState.Complete:
label = this.props.labelComplete;
break;
default:
@@ -72,13 +72,13 @@ export class LifeCycleRaisedButton extends React.Component<LifeCycleRaisedButton
backgroundColor={this.props.backgroundColor}
labelColor={this.props.labelColor}
onClick={this.onClickAsync.bind(this)}
- disabled={this.props.isDisabled || this.state.buttonState !== ButtonState.READY}
+ disabled={this.props.isDisabled || this.state.buttonState !== ButtonState.Ready}
/>
);
}
public async onClickAsync(): Promise<void> {
this.setState({
- buttonState: ButtonState.LOADING,
+ buttonState: ButtonState.Loading,
});
const didSucceed = await this.props.onClickAsyncFn();
if (this._didUnmount) {
@@ -86,16 +86,16 @@ export class LifeCycleRaisedButton extends React.Component<LifeCycleRaisedButton
}
if (didSucceed) {
this.setState({
- buttonState: ButtonState.COMPLETE,
+ buttonState: ButtonState.Complete,
});
this._buttonTimeoutId = window.setTimeout(() => {
this.setState({
- buttonState: ButtonState.READY,
+ buttonState: ButtonState.Ready,
});
}, COMPLETE_STATE_SHOW_LENGTH_MS);
} else {
this.setState({
- buttonState: ButtonState.READY,
+ buttonState: ButtonState.Ready,
});
}
}
diff --git a/packages/website/ts/components/ui/party.tsx b/packages/website/ts/components/ui/party.tsx
index f9e0967d4..a14b94d8a 100644
--- a/packages/website/ts/components/ui/party.tsx
+++ b/packages/website/ts/components/ui/party.tsx
@@ -94,14 +94,17 @@ export class Party extends React.Component<PartyProps, PartyState> {
<ReactTooltip id={registeredTooltipId}>
{isRegistered ? (
<div>
- This token address was found in the token registry<br />
+ This token address was found in the token registry
+ <br />
smart contract and is therefore believed to be a<br />
legitimate token.
</div>
) : (
<div>
- This token is not included in the token registry<br />
- smart contract. We cannot guarantee the legitimacy<br />
+ This token is not included in the token registry
+ <br />
+ smart contract. We cannot guarantee the legitimacy
+ <br />
of this token. Make sure to verify its address on Etherscan.
</div>
)}
@@ -109,27 +112,28 @@ export class Party extends React.Component<PartyProps, PartyState> {
</div>
</div>
)}
- {!_.isUndefined(this.props.hasUniqueNameAndSymbol) &&
- !this.props.hasUniqueNameAndSymbol && (
- <div>
- <div
- data-tip={true}
- data-for={uniqueNameAndSymbolTooltipId}
- className="mx-auto"
- style={{ fontSize: 13, width: 127 }}
- >
- <span style={{ color: colors.red500 }}>
- <i className="zmdi zmdi-alert-octagon" />
- </span>{' '}
- <span>Suspicious token</span>
- <ReactTooltip id={uniqueNameAndSymbolTooltipId}>
- This token shares it's name, symbol or both with<br />
- a token in the 0x Token Registry but it has a different<br />
- smart contract address. This is most likely a scam token!
- </ReactTooltip>
- </div>
+ {!_.isUndefined(this.props.hasUniqueNameAndSymbol) && !this.props.hasUniqueNameAndSymbol && (
+ <div>
+ <div
+ data-tip={true}
+ data-for={uniqueNameAndSymbolTooltipId}
+ className="mx-auto"
+ style={{ fontSize: 13, width: 127 }}
+ >
+ <span style={{ color: colors.red500 }}>
+ <i className="zmdi zmdi-alert-octagon" />
+ </span>{' '}
+ <span>Suspicious token</span>
+ <ReactTooltip id={uniqueNameAndSymbolTooltipId}>
+ This token shares it's name, symbol or both with
+ <br />
+ a token in the 0x Token Registry but it has a different
+ <br />
+ smart contract address. This is most likely a scam token!
+ </ReactTooltip>
</div>
- )}
+ </div>
+ )}
</div>
</div>
);
diff --git a/packages/website/ts/constants/globalStyle.tsx b/packages/website/ts/constants/globalStyle.tsx
index 5abb758c5..ef7ec9426 100644
--- a/packages/website/ts/constants/globalStyle.tsx
+++ b/packages/website/ts/constants/globalStyle.tsx
@@ -11,9 +11,7 @@ export interface GlobalStyle {
}
const GlobalStyles = withTheme(
- createGlobalStyle <
- GlobalStyle >
- `
+ createGlobalStyle<GlobalStyle>`
${cssReset};
html {
diff --git a/packages/website/ts/containers/asset_buyer_documentation.ts b/packages/website/ts/containers/asset_buyer_documentation.ts
index 815176e47..a75c6d861 100644
--- a/packages/website/ts/containers/asset_buyer_documentation.ts
+++ b/packages/website/ts/containers/asset_buyer_documentation.ts
@@ -40,6 +40,7 @@ const docsInfoConfig: DocsInfoConfig = {
};
const mapStateToProps = getMapStateToProps(docsInfoConfig);
-export const Documentation: React.ComponentClass<DocPageProps> = connect(mapStateToProps, mapDispatchToProps)(
- DocPageComponent,
-);
+export const Documentation: React.ComponentClass<DocPageProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(DocPageComponent);
diff --git a/packages/website/ts/containers/connect_documentation.ts b/packages/website/ts/containers/connect_documentation.ts
index 19fd0ee56..1cfc0702e 100644
--- a/packages/website/ts/containers/connect_documentation.ts
+++ b/packages/website/ts/containers/connect_documentation.ts
@@ -45,6 +45,7 @@ const docsInfoConfig: DocsInfoConfig = {
};
const mapStateToProps = getMapStateToProps(docsInfoConfig);
-export const Documentation: React.ComponentClass<DocPageProps> = connect(mapStateToProps, mapDispatchToProps)(
- DocPageComponent,
-);
+export const Documentation: React.ComponentClass<DocPageProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(DocPageComponent);
diff --git a/packages/website/ts/containers/contract_wrappers_documentation.ts b/packages/website/ts/containers/contract_wrappers_documentation.ts
index dec95ae62..bbabce7a7 100644
--- a/packages/website/ts/containers/contract_wrappers_documentation.ts
+++ b/packages/website/ts/containers/contract_wrappers_documentation.ts
@@ -40,6 +40,7 @@ const docsInfoConfig: DocsInfoConfig = {
};
const mapStateToProps = getMapStateToProps(docsInfoConfig);
-export const Documentation: React.ComponentClass<DocPageProps> = connect(mapStateToProps, mapDispatchToProps)(
- DocPageComponent,
-);
+export const Documentation: React.ComponentClass<DocPageProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(DocPageComponent);
diff --git a/packages/website/ts/containers/docs_home.ts b/packages/website/ts/containers/docs_home.ts
index e0ca439a6..2a6dac0e2 100644
--- a/packages/website/ts/containers/docs_home.ts
+++ b/packages/website/ts/containers/docs_home.ts
@@ -26,6 +26,7 @@ const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
dispatcher: new Dispatcher(dispatch),
});
-export const DocsHome: React.ComponentClass<DocsHomeProps> = connect(mapStateToProps, mapDispatchToProps)(
- DocsHomeComponent,
-);
+export const DocsHome: React.ComponentClass<DocsHomeProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(DocsHomeComponent);
diff --git a/packages/website/ts/containers/ethereum_types_documentation.ts b/packages/website/ts/containers/ethereum_types_documentation.ts
index 9b668d515..e6e4d4067 100644
--- a/packages/website/ts/containers/ethereum_types_documentation.ts
+++ b/packages/website/ts/containers/ethereum_types_documentation.ts
@@ -36,6 +36,7 @@ const docsInfoConfig: DocsInfoConfig = {
};
const mapStateToProps = getMapStateToProps(docsInfoConfig);
-export const Documentation: React.ComponentClass<DocPageProps> = connect(mapStateToProps, mapDispatchToProps)(
- DocPageComponent,
-);
+export const Documentation: React.ComponentClass<DocPageProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(DocPageComponent);
diff --git a/packages/website/ts/containers/faq.ts b/packages/website/ts/containers/faq.ts
index a2b5735f6..da5b71bdd 100644
--- a/packages/website/ts/containers/faq.ts
+++ b/packages/website/ts/containers/faq.ts
@@ -22,4 +22,7 @@ const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
dispatcher: new Dispatcher(dispatch),
});
-export const FAQ: React.ComponentClass<FAQProps> = connect(mapStateToProps, mapDispatchToProps)(FAQComponent);
+export const FAQ: React.ComponentClass<FAQProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(FAQComponent);
diff --git a/packages/website/ts/containers/json_schemas_documentation.ts b/packages/website/ts/containers/json_schemas_documentation.ts
index 3862ba878..1090265e7 100644
--- a/packages/website/ts/containers/json_schemas_documentation.ts
+++ b/packages/website/ts/containers/json_schemas_documentation.ts
@@ -65,6 +65,7 @@ const docsInfoConfig: DocsInfoConfig = {
};
const mapStateToProps = getMapStateToProps(docsInfoConfig);
-export const Documentation: React.ComponentClass<DocPageProps> = connect(mapStateToProps, mapDispatchToProps)(
- DocPageComponent,
-);
+export const Documentation: React.ComponentClass<DocPageProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(DocPageComponent);
diff --git a/packages/website/ts/containers/migrations_documentation.ts b/packages/website/ts/containers/migrations_documentation.ts
index dd5db3ac6..bae84dfea 100644
--- a/packages/website/ts/containers/migrations_documentation.ts
+++ b/packages/website/ts/containers/migrations_documentation.ts
@@ -61,6 +61,7 @@ const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
dispatcher: new Dispatcher(dispatch),
});
-export const Documentation: React.ComponentClass<DocPageProps> = connect(mapStateToProps, mapDispatchToProps)(
- DocPageComponent,
-);
+export const Documentation: React.ComponentClass<DocPageProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(DocPageComponent);
diff --git a/packages/website/ts/containers/not_found.ts b/packages/website/ts/containers/not_found.ts
index f384dab89..825c021ec 100644
--- a/packages/website/ts/containers/not_found.ts
+++ b/packages/website/ts/containers/not_found.ts
@@ -22,6 +22,7 @@ const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
dispatcher: new Dispatcher(dispatch),
});
-export const NotFound: React.ComponentClass<NotFoundProps> = connect(mapStateToProps, mapDispatchToProps)(
- NotFoundComponent,
-);
+export const NotFound: React.ComponentClass<NotFoundProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(NotFoundComponent);
diff --git a/packages/website/ts/containers/order_utils_documentation.ts b/packages/website/ts/containers/order_utils_documentation.ts
index 4996c329a..8d83357ca 100644
--- a/packages/website/ts/containers/order_utils_documentation.ts
+++ b/packages/website/ts/containers/order_utils_documentation.ts
@@ -41,6 +41,7 @@ const docsInfoConfig: DocsInfoConfig = {
};
const mapStateToProps = getMapStateToProps(docsInfoConfig);
-export const Documentation: React.ComponentClass<DocPageProps> = connect(mapStateToProps, mapDispatchToProps)(
- DocPageComponent,
-);
+export const Documentation: React.ComponentClass<DocPageProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(DocPageComponent);
diff --git a/packages/website/ts/containers/order_watcher_documentation.ts b/packages/website/ts/containers/order_watcher_documentation.ts
index f3d3bada8..149ffdd2a 100644
--- a/packages/website/ts/containers/order_watcher_documentation.ts
+++ b/packages/website/ts/containers/order_watcher_documentation.ts
@@ -41,6 +41,7 @@ const docsInfoConfig: DocsInfoConfig = {
};
const mapStateToProps = getMapStateToProps(docsInfoConfig);
-export const Documentation: React.ComponentClass<DocPageProps> = connect(mapStateToProps, mapDispatchToProps)(
- DocPageComponent,
-);
+export const Documentation: React.ComponentClass<DocPageProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(DocPageComponent);
diff --git a/packages/website/ts/containers/portal.ts b/packages/website/ts/containers/portal.ts
index 5661e0a97..db41a3ec3 100644
--- a/packages/website/ts/containers/portal.ts
+++ b/packages/website/ts/containers/portal.ts
@@ -87,6 +87,7 @@ const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
dispatcher: new Dispatcher(dispatch),
});
-export const Portal: React.ComponentClass<PortalComponentProps> = connect(mapStateToProps, mapDispatchToProps)(
- PortalComponent,
-);
+export const Portal: React.ComponentClass<PortalComponentProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(PortalComponent);
diff --git a/packages/website/ts/containers/smart_contracts_documentation.ts b/packages/website/ts/containers/smart_contracts_documentation.ts
index 7c0de5515..d94e285a7 100644
--- a/packages/website/ts/containers/smart_contracts_documentation.ts
+++ b/packages/website/ts/containers/smart_contracts_documentation.ts
@@ -91,6 +91,7 @@ const docsInfoConfig: DocsInfoConfig = {
};
const mapStateToProps = getMapStateToProps(docsInfoConfig);
-export const Documentation: React.ComponentClass<DocPageProps> = connect(mapStateToProps, mapDispatchToProps)(
- DocPageComponent,
-);
+export const Documentation: React.ComponentClass<DocPageProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(DocPageComponent);
diff --git a/packages/website/ts/containers/sol_compiler_documentation.ts b/packages/website/ts/containers/sol_compiler_documentation.ts
index e899e9627..31117372b 100644
--- a/packages/website/ts/containers/sol_compiler_documentation.ts
+++ b/packages/website/ts/containers/sol_compiler_documentation.ts
@@ -45,6 +45,7 @@ const docsInfoConfig: DocsInfoConfig = {
};
const mapStateToProps = getMapStateToProps(docsInfoConfig);
-export const Documentation: React.ComponentClass<DocPageProps> = connect(mapStateToProps, mapDispatchToProps)(
- DocPageComponent,
-);
+export const Documentation: React.ComponentClass<DocPageProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(DocPageComponent);
diff --git a/packages/website/ts/containers/sol_coverage_documentation.ts b/packages/website/ts/containers/sol_coverage_documentation.ts
index 25d67e2d0..a9073b720 100644
--- a/packages/website/ts/containers/sol_coverage_documentation.ts
+++ b/packages/website/ts/containers/sol_coverage_documentation.ts
@@ -38,6 +38,7 @@ const docsInfoConfig: DocsInfoConfig = {
};
const mapStateToProps = getMapStateToProps(docsInfoConfig);
-export const Documentation: React.ComponentClass<DocPageProps> = connect(mapStateToProps, mapDispatchToProps)(
- DocPageComponent,
-);
+export const Documentation: React.ComponentClass<DocPageProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(DocPageComponent);
diff --git a/packages/website/ts/containers/sol_profiler_documentation.ts b/packages/website/ts/containers/sol_profiler_documentation.ts
index 14839831e..2f3936cae 100644
--- a/packages/website/ts/containers/sol_profiler_documentation.ts
+++ b/packages/website/ts/containers/sol_profiler_documentation.ts
@@ -38,6 +38,7 @@ const docsInfoConfig: DocsInfoConfig = {
};
const mapStateToProps = getMapStateToProps(docsInfoConfig);
-export const Documentation: React.ComponentClass<DocPageProps> = connect(mapStateToProps, mapDispatchToProps)(
- DocPageComponent,
-);
+export const Documentation: React.ComponentClass<DocPageProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(DocPageComponent);
diff --git a/packages/website/ts/containers/sol_trace_documentation.ts b/packages/website/ts/containers/sol_trace_documentation.ts
index c5286f1ff..9c2552438 100644
--- a/packages/website/ts/containers/sol_trace_documentation.ts
+++ b/packages/website/ts/containers/sol_trace_documentation.ts
@@ -38,6 +38,7 @@ const docsInfoConfig: DocsInfoConfig = {
};
const mapStateToProps = getMapStateToProps(docsInfoConfig);
-export const Documentation: React.ComponentClass<DocPageProps> = connect(mapStateToProps, mapDispatchToProps)(
- DocPageComponent,
-);
+export const Documentation: React.ComponentClass<DocPageProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(DocPageComponent);
diff --git a/packages/website/ts/containers/subproviders_documentation.ts b/packages/website/ts/containers/subproviders_documentation.ts
index c7fb807a6..2ac0360ab 100644
--- a/packages/website/ts/containers/subproviders_documentation.ts
+++ b/packages/website/ts/containers/subproviders_documentation.ts
@@ -44,6 +44,7 @@ const docsInfoConfig: DocsInfoConfig = {
};
const mapStateToProps = getMapStateToProps(docsInfoConfig);
-export const Documentation: React.ComponentClass<DocPageProps> = connect(mapStateToProps, mapDispatchToProps)(
- DocPageComponent,
-);
+export const Documentation: React.ComponentClass<DocPageProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(DocPageComponent);
diff --git a/packages/website/ts/containers/web3_wrapper_documentation.ts b/packages/website/ts/containers/web3_wrapper_documentation.ts
index ad286da1a..73fea90ed 100644
--- a/packages/website/ts/containers/web3_wrapper_documentation.ts
+++ b/packages/website/ts/containers/web3_wrapper_documentation.ts
@@ -40,6 +40,7 @@ const docsInfoConfig: DocsInfoConfig = {
};
const mapStateToProps = getMapStateToProps(docsInfoConfig);
-export const Documentation: React.ComponentClass<DocPageProps> = connect(mapStateToProps, mapDispatchToProps)(
- DocPageComponent,
-);
+export const Documentation: React.ComponentClass<DocPageProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(DocPageComponent);
diff --git a/packages/website/ts/containers/wiki.ts b/packages/website/ts/containers/wiki.ts
index 069b0ae54..f4f2f6ec6 100644
--- a/packages/website/ts/containers/wiki.ts
+++ b/packages/website/ts/containers/wiki.ts
@@ -25,4 +25,7 @@ const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
dispatcher: new Dispatcher(dispatch),
});
-export const Wiki: React.ComponentClass<WikiProps> = connect(mapStateToProps, mapDispatchToProps)(WikiComponent);
+export const Wiki: React.ComponentClass<WikiProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(WikiComponent);
diff --git a/packages/website/ts/containers/zero_ex_js_documentation.ts b/packages/website/ts/containers/zero_ex_js_documentation.ts
index 5da8d5e52..0e4765656 100644
--- a/packages/website/ts/containers/zero_ex_js_documentation.ts
+++ b/packages/website/ts/containers/zero_ex_js_documentation.ts
@@ -72,6 +72,7 @@ const docsInfoConfig: DocsInfoConfig = {
};
const mapStateToProps = getMapStateToProps(docsInfoConfig);
-export const Documentation: React.ComponentClass<DocPageProps> = connect(mapStateToProps, mapDispatchToProps)(
- DocPageComponent,
-);
+export const Documentation: React.ComponentClass<DocPageProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(DocPageComponent);
diff --git a/packages/website/ts/index.tsx b/packages/website/ts/index.tsx
index 4ed66c572..7bb018d17 100644
--- a/packages/website/ts/index.tsx
+++ b/packages/website/ts/index.tsx
@@ -31,7 +31,6 @@ import { NextWhy } from 'ts/pages/why';
tradeHistoryStorage.clearIfRequired();
trackedTokenStorage.clearIfRequired();
-import 'basscss/css/basscss.css';
import 'less/all.less';
// We pass modulePromise returning lambda instead of module promise,
diff --git a/packages/website/ts/pages/about/jobs.tsx b/packages/website/ts/pages/about/jobs.tsx
index ee1aa6cef..85c25a75f 100644
--- a/packages/website/ts/pages/about/jobs.tsx
+++ b/packages/website/ts/pages/about/jobs.tsx
@@ -151,7 +151,9 @@ export class NextAboutJobs extends React.Component<NextAboutJobsProps, NextAbout
<Section id={OPEN_POSITIONS_HASH} isFlex={true} maxWidth="1170px" wrapWidth="100%">
<Column>
<Heading size="medium">
- Current<br />Openings
+ Current
+ <br />
+ Openings
</Heading>
</Column>
diff --git a/packages/website/ts/pages/about/team.tsx b/packages/website/ts/pages/about/team.tsx
index 41d6c2cf8..808fea049 100644
--- a/packages/website/ts/pages/about/team.tsx
+++ b/packages/website/ts/pages/about/team.tsx
@@ -30,7 +30,7 @@ const team: TeamMember[] = [
{
imageUrl: '/images/team/fabiob.jpg',
name: 'Fabio Berger',
- title: 'senior engineer',
+ title: 'engineering manager',
},
{
imageUrl: '/images/team/alexv.jpg',
@@ -55,7 +55,7 @@ const team: TeamMember[] = [
{
imageUrl: '/images/team/toms.jpg',
name: 'Tom Schmidt',
- title: 'product manager',
+ title: 'product lead',
},
{
imageUrl: '/images/team/jacobe.jpg',
@@ -147,6 +147,16 @@ const team: TeamMember[] = [
name: 'Xianny Ng',
title: 'engineer',
},
+ {
+ imageUrl: '/images/team/oshirob.png',
+ name: 'Brent Oshiro',
+ title: 'community engagement lead',
+ },
+ {
+ imageUrl: '/images/team/marcs.jpg',
+ name: 'Marc Savino',
+ title: 'technical sourcer',
+ },
];
const advisors: TeamMember[] = [
diff --git a/packages/website/ts/pages/documentation/developers_page.tsx b/packages/website/ts/pages/documentation/developers_page.tsx
index 78376a0f2..0b725c514 100644
--- a/packages/website/ts/pages/documentation/developers_page.tsx
+++ b/packages/website/ts/pages/documentation/developers_page.tsx
@@ -68,10 +68,7 @@ interface SidebarContainerProps {
className?: string;
}
-const SidebarContainer =
- styled.div <
- SidebarContainerProps >
- `
+const SidebarContainer = styled.div<SidebarContainerProps>`
${scrollableContainerStyles}
padding-top: 27px;
padding-left: ${SIDEBAR_PADDING}px;
@@ -87,10 +84,7 @@ interface MainContentContainerProps {
className?: string;
}
-const MainContentContainer =
- styled.div <
- MainContentContainerProps >
- `
+const MainContentContainer = styled.div<MainContentContainerProps>`
${scrollableContainerStyles}
padding-top: 0px;
padding-left: 50px;
diff --git a/packages/website/ts/pages/documentation/docs_home.tsx b/packages/website/ts/pages/documentation/docs_home.tsx
index d11cf02fb..5849a2a03 100644
--- a/packages/website/ts/pages/documentation/docs_home.tsx
+++ b/packages/website/ts/pages/documentation/docs_home.tsx
@@ -55,7 +55,7 @@ const TUTORIALS: TutorialInfo[] = [
];
const CATEGORY_TO_PACKAGES: ObjectMap<Package[]> = {
- [Categories.ZeroExProtocol]: [
+ [Categories.ZeroExProtocolTypescript]: [
{
description:
'A library for interacting with the 0x protocol. It is a high level package which combines a number of smaller specific-purpose packages such as [order-utils](https://0x.org/docs/order-utils) and [contract-wrappers](https://0x.org/docs/contract-wrappers).',
@@ -92,23 +92,6 @@ const CATEGORY_TO_PACKAGES: ObjectMap<Package[]> = {
},
{
description:
- "A Python library for interacting with 0x orders. Generate an orderHash, sign an order, validate it's signature and more.",
- link: {
- title: '0x-order-utils.py',
- to: 'http://0x-order-utils-py.s3-website-us-east-1.amazonaws.com/',
- shouldOpenInNewTab: true,
- },
- },
- {
- description: 'A Python Standard Relayer API client',
- link: {
- title: '0x-sra-client.py',
- to: 'https://pypi.org/project/0x-sra-client/',
- shouldOpenInNewTab: true,
- },
- },
- {
- description:
'An http & websocket client for interacting with relayers that have implemented the [Standard Relayer API](https://github.com/0xProject/standard-relayer-api)',
link: {
title: '@0x/connect',
@@ -190,6 +173,57 @@ const CATEGORY_TO_PACKAGES: ObjectMap<Package[]> = {
},
},
],
+ [Categories.ZeroExProtocolPython]: [
+ {
+ description:
+ "A library for interacting with 0x orders. Generate an orderHash, sign an order, validate it's signature and more.",
+ link: {
+ title: '0x-order-utils',
+ to: 'https://pypi.org/project/0x-order-utils/',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description: 'A Standard Relayer API client',
+ link: {
+ title: '0x-sra-client',
+ to: 'https://pypi.org/project/0x-sra-client/',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description: 'Package containing the addresses at which the 0x smart contracts have been deployed',
+ link: {
+ title: '0x-contract-addresses',
+ to: 'https://pypi.org/project/0x-contract-addresses/',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description: 'Package containing the 0x smart contract compilation artifacts',
+ link: {
+ title: '0x-contract-artifacts',
+ to: 'https://pypi.org/project/0x-contract-artifacts/',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description: '0x JSON schemas for those developing on top of 0x protocol',
+ link: {
+ title: '0x-json-schemas',
+ to: 'https://pypi.org/project/0x-json-schemas/',
+ shouldOpenInNewTab: true,
+ },
+ },
+ {
+ description: 'Demo project showing how to interact with the 0x smart contracts using Python',
+ link: {
+ title: '0x-contract-demo',
+ to: 'https://github.com/0xProject/0x-monorepo/blob/development/python-packages/contract_demo/README.md',
+ shouldOpenInNewTab: true,
+ },
+ },
+ ],
[Categories.Ethereum]: [
{
description:
@@ -409,7 +443,10 @@ export class DocsHome extends React.Component<DocsHomeProps, DocsHomeState> {
title: this.props.translate.get(tutorialInfo.link.title as Key, Deco.Cap),
};
}),
- [Categories.ZeroExProtocol]: _.map(CATEGORY_TO_PACKAGES[Categories.ZeroExProtocol], pkg => pkg.link),
+ [Categories.ZeroExProtocolTypescript]: _.map(
+ CATEGORY_TO_PACKAGES[Categories.ZeroExProtocolTypescript],
+ pkg => pkg.link,
+ ),
[Categories.Ethereum]: _.map(CATEGORY_TO_PACKAGES[Categories.Ethereum], pkg => pkg.link),
[Categories.CommunityMaintained]: _.map(
CATEGORY_TO_PACKAGES[Categories.CommunityMaintained],
@@ -466,4 +503,4 @@ export class DocsHome extends React.Component<DocsHomeProps, DocsHomeState> {
});
return menuItems;
}
-}
+} // tslint:disable:max-file-line-count
diff --git a/packages/website/ts/pages/faq/faq.tsx b/packages/website/ts/pages/faq/faq.tsx
index 8cde7224e..548db1d1d 100644
--- a/packages/website/ts/pages/faq/faq.tsx
+++ b/packages/website/ts/pages/faq/faq.tsx
@@ -36,17 +36,16 @@ const sections: FAQSection[] = [
<div>
At its core, 0x is an open and non-rent seeking protocol that facilitates trustless, low
friction exchange of Ethereum-based assets. Developers can use 0x as a platform to build
- exchange applications on top of (<a
- href={`${configs.BASE_URL}${WebsitePaths.ZeroExJs}#introduction`}
- target="blank"
- >
+ exchange applications on top of (
+ <a href={`${configs.BASE_URL}${WebsitePaths.ZeroExJs}#introduction`} target="blank">
0x.js
</a>{' '}
is a Javascript library for interacting with the 0x protocol). For end users, 0x will be the
infrastructure of a wide variety of user-facing applications i.e.{' '}
<a href={`${configs.BASE_URL}${WebsitePaths.Portal}`} target="blank">
0x Portal
- </a>, a decentralized application that facilitates trustless trading of Ethereum-based tokens
+ </a>
+ , a decentralized application that facilitates trustless trading of Ethereum-based tokens
between known counterparties.
</div>
),
@@ -253,7 +252,8 @@ const sections: FAQSection[] = [
target="_blank"
>
development roadmap
- </a>.
+ </a>
+ .
</div>
),
},
@@ -360,7 +360,8 @@ const sections: FAQSection[] = [
target="_blank"
>
here
- </a>.
+ </a>
+ .
</div>
),
},
@@ -380,8 +381,9 @@ const sections: FAQSection[] = [
Join our{' '}
<a href={constants.URL_ZEROEX_CHAT} target="_blank">
Discord
- </a>! As an open source project, 0x will rely on a worldwide community of passionate developers
- to contribute proposals, ideas and code.
+ </a>
+ ! As an open source project, 0x will rely on a worldwide community of passionate developers to
+ contribute proposals, ideas and code.
</div>
),
},
diff --git a/packages/website/ts/pages/instant.tsx b/packages/website/ts/pages/instant.tsx
index b97bb35a4..586665d5b 100644
--- a/packages/website/ts/pages/instant.tsx
+++ b/packages/website/ts/pages/instant.tsx
@@ -100,7 +100,7 @@ export class Next0xInstant extends React.Component<Props> {
<div>
{[...Array(18)].map((item, index) => (
<Card key={`card-${index}`} index={index}>
- <img src={`/images/0x-instant/widget-${index % 6 + 1}.png`} />
+ <img src={`/images/0x-instant/widget-${(index % 6) + 1}.png`} />
</Card>
))}
</div>
@@ -189,13 +189,10 @@ const fadeUp = keyframes`
}
`;
-const ConfiguratorSection =
- styled(Section) <
- SectionProps >
- `
- @media (max-width: ${CONFIGURATOR_MIN_WIDTH_PX}px) {
- display: none;
- }
+const ConfiguratorSection = styled(Section)<SectionProps>`
+ @media (max-width: ${CONFIGURATOR_MIN_WIDTH_PX}px) {
+ display: none;
+ }
`;
// width = 370 * 12
@@ -233,29 +230,26 @@ const MarqueeWrap = styled.div`
}
`;
-const Card =
- styled.div <
- { index: number } >
- `
- opacity: 0;
- flex-shrink: 0;
- transform: translateY(10px);
- will-change: opacity, transform;
- animation: ${fadeUp} 0.75s ${props => `${props.index * 0.05}s`} forwards;
-
- img {
- height: auto;
- }
+const Card = styled.div<{ index: number }>`
+ opacity: 0;
+ flex-shrink: 0;
+ transform: translateY(10px);
+ will-change: opacity, transform;
+ animation: ${fadeUp} 0.75s ${props => `${props.index * 0.05}s`} forwards;
- @media (min-width: 768px) {
img {
- width: 370px;
+ height: auto;
}
- }
- @media (max-width: 768px) {
- img {
- width: 300px;
+ @media (min-width: 768px) {
+ img {
+ width: 370px;
+ }
+ }
+
+ @media (max-width: 768px) {
+ img {
+ width: 300px;
+ }
}
- }
`;
diff --git a/packages/website/ts/pages/instant/config_generator.tsx b/packages/website/ts/pages/instant/config_generator.tsx
index e43d47119..29fce85db 100644
--- a/packages/website/ts/pages/instant/config_generator.tsx
+++ b/packages/website/ts/pages/instant/config_generator.tsx
@@ -318,13 +318,10 @@ interface CheckboxTextProps {
isSelected?: boolean;
}
-const CheckboxText =
- styled.span <
- CheckboxTextProps >
- `
+const CheckboxText = styled.span<CheckboxTextProps>`
font-size: 14px;
line-height: 18px;
- color: ${props => (props.isSelected ? colors.brandDark : '#666666')}
+ color: ${props => (props.isSelected ? colors.brandDark : '#666666')};
`;
const OptionalAction = styled(OptionalText)`
diff --git a/packages/website/ts/pages/why.tsx b/packages/website/ts/pages/why.tsx
index 197ce5fc9..a0ed5f95a 100644
--- a/packages/website/ts/pages/why.tsx
+++ b/packages/website/ts/pages/why.tsx
@@ -229,10 +229,7 @@ interface SectionProps {
isNotRelative?: boolean;
}
-const SectionWrap =
- styled.div <
- SectionProps >
- `
+const SectionWrap = styled.div<SectionProps>`
position: ${props => !props.isNotRelative && 'relative'};
& + & {
@@ -258,10 +255,7 @@ const SectionWrap =
interface SectionTitleProps {
isNoBorder?: boolean;
}
-const SectionTitle =
- styled(Heading) <
- SectionTitleProps >
- `
+const SectionTitle = styled(Heading)<SectionTitleProps>`
position: relative;
${props =>
@@ -278,7 +272,6 @@ const SectionTitle =
}
`}
-
@media (max-width: 768px) {
&:before {
width: calc(100vw - 60px);
diff --git a/packages/website/ts/types.ts b/packages/website/ts/types.ts
index 50114e2d6..081c6d014 100644
--- a/packages/website/ts/types.ts
+++ b/packages/website/ts/types.ts
@@ -83,12 +83,12 @@ export interface Fill {
}
export enum BalanceErrs {
- incorrectNetworkForFaucet,
- faucetRequestFailed,
- faucetQueueIsFull,
- mintingFailed,
- sendFailed,
- allowanceSettingFailed,
+ IncorrectNetworkForFaucet,
+ FaucetRequestFailed,
+ FaucetQueueIsFull,
+ MintingFailed,
+ SendFailed,
+ AllowanceSettingFailed,
}
export enum ActionTypes {
@@ -209,8 +209,8 @@ export enum ScreenWidths {
}
export enum AlertTypes {
- ERROR,
- SUCCESS,
+ Error,
+ Success,
}
export enum BlockchainErrs {
@@ -228,11 +228,11 @@ export enum BlockchainCallErrs {
}
export enum Environments {
- DEVELOPMENT = 'DEVELOPMENT',
- DOGFOOD = 'DOGFOOD',
- STAGING = 'STAGING',
- PRODUCTION = 'PRODUCTION',
- UNKNOWN = 'UNKNOWN',
+ Development = 'DEVELOPMENT',
+ Dogfood = 'DOGFOOD',
+ Staging = 'STAGING',
+ Production = 'PRODUCTION',
+ Unknown = 'UNKNOWN',
}
export type ContractInstance = any; // TODO: add type definition for Contract
@@ -323,9 +323,9 @@ export interface DialogConfigs {
}
export enum TokenVisibility {
- ALL = 'ALL',
- UNTRACKED = 'UNTRACKED',
- TRACKED = 'TRACKED',
+ All = 'ALL',
+ Untracked = 'UNTRACKED',
+ Tracked = 'TRACKED',
}
export interface VersionToFilePath {
@@ -350,7 +350,7 @@ export enum WebsitePaths {
Docs = '/docs',
ZeroExJs = '/docs/0x.js',
Home = '/',
- FAQ = '/faq',
+ FAQ = '/faq', // tslint:disable-line:enum-naming
About = '/about',
AboutMission = '/about/mission',
AboutTeam = '/about/team',
@@ -629,7 +629,7 @@ export enum BrowserType {
export enum OperatingSystemType {
Android = 'Android',
- iOS = 'iOS',
+ iOS = 'iOS', // tslint:disable-line:enum-naming
Mac = 'Mac',
Windows = 'Windows',
WindowsPhone = 'WindowsPhone',
@@ -655,8 +655,9 @@ export interface TutorialInfo {
}
export enum Categories {
- ZeroExProtocol = '0x Protocol',
- Ethereum = 'Ethereum',
+ ZeroExProtocolTypescript = '0x Protocol (Typescript/Javascript)',
+ ZeroExProtocolPython = '0x Protocol (Python)',
+ Ethereum = 'Ethereum (Typescript/Javascript)',
CommunityMaintained = 'Community Maintained',
}
diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts
index 8cc0061de..e84f9d0cc 100644
--- a/packages/website/ts/utils/utils.ts
+++ b/packages/website/ts/utils/utils.ts
@@ -342,18 +342,18 @@ export const utils = {
},
getEnvironment(): Environments {
if (utils.isDogfood()) {
- return Environments.DOGFOOD;
+ return Environments.Dogfood;
}
if (utils.isDevelopment()) {
- return Environments.DEVELOPMENT;
+ return Environments.Development;
}
if (utils.isStaging()) {
- return Environments.STAGING;
+ return Environments.Staging;
}
if (utils.isProduction()) {
- return Environments.PRODUCTION;
+ return Environments.Production;
}
- return Environments.UNKNOWN;
+ return Environments.Unknown;
},
getEthToken(tokenByAddress: TokenByAddress): Token {
return utils.getTokenBySymbol(constants.ETHER_TOKEN_SYMBOL, tokenByAddress);
@@ -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 {